/* ── Design tokens — one source of truth for spacing, sizing, colour, type ──
   Change a value here and it propagates everywhere. Toolbar, panels, modals,
   and the table all read from this scale so the UI stays one coherent system. */
:root {
  --bar: 56px;
  /* spacing scale (4px rhythm) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  /* control sizing — every interactive control is one height */
  --ctl-h: 34px;
  --r: 8px; --r-sm: 6px; --r-pill: 999px;
  /* typography */
  --fs: 13px; --fs-sm: 12px; --fs-lg: 15px;
  /* surfaces (dark) */
  --bar-bg: #1b2431; --panel: rgba(17,24,39,.92); --sunken: #111a27;
  --ctl: #2b3648; --ctl-hover: #3a475c; --ctl-brd: rgba(148,163,184,.28);
  /* text */
  --text: #e8edf3; --text-dim: #9fb0c3; --text-mut: #6b7a8d;
  /* brand / semantic accents */
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: rgba(37,99,235,.15);
  --active: #f59e0b; --active-fg: #111827;
  --ok: #059669; --danger: #b91c1c; --danger-hover: #dc2626;
  --divider: rgba(148,163,184,.18);
  --shadow: 0 6px 20px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
}
/* Nice thin scrollbars everywhere (replaces the ugly default webkit thumb). */
* { scrollbar-width: thin; scrollbar-color: #475569 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #475569; border-radius: 6px;
  border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #64748b; background-clip: content-box; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, "Segoe UI", sans-serif; }
body { display: flex; flex-direction: column; }

/* ── Toolbar ──────────────────────────────────────────────────────────── */
.topbar {
  height: var(--bar); flex: 0 0 auto; display: flex; align-items: center;
  gap: var(--s2); padding: 0 var(--s4); background: var(--bar-bg); color: var(--text);
  border-bottom: 1px solid #0b1220; overflow-x: auto; overflow-y: hidden;
}
.topbar .brand { font-size: 18px; flex: 0 0 auto; white-space: nowrap; line-height: 1; }

/* clusters + hairline dividers give the bar its rhythm */
.tb-group { display: inline-flex; align-items: center; gap: var(--s2); flex: 0 0 auto; }
.tb-div { width: 1px; height: 22px; background: var(--divider); flex: 0 0 auto; margin: 0 var(--s1); }
.spacer { flex: 1 1 auto; }

/* one height for every control on the bar */
.topbar button, .topbar .tb-select, .topbar .chk {
  height: var(--ctl-h); box-sizing: border-box; font-size: var(--fs);
  border-radius: var(--r); flex: 0 0 auto; white-space: nowrap;
}

/* buttons */
.topbar button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  padding: 0 var(--s2); border: 0; background: var(--ctl); color: var(--text);
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
/* Icon-only: square, no label. Every one carries a title= — the tooltip IS the
   label now, so never add an .ico button without one. */
.topbar button.ico, .topbar .chk.ico {
  width: var(--ctl-h); padding: 0; justify-content: center; font-size: 15px; gap: 0;
}
.topbar button:hover { background: var(--ctl-hover); }
.topbar button.active { background: var(--active); color: var(--active-fg); }
.topbar button.accent { background: var(--accent); color: #fff; }
.topbar button.accent:hover { background: var(--accent-hover); }
.topbar button.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--ctl-brd); }
.topbar button.ghost:hover { background: var(--ctl); }
.topbar button:disabled { opacity: .4; cursor: default; }
.topbar button:disabled:hover { background: var(--ctl); }
.topbar button.accent:disabled, .topbar button.accent:disabled:hover { background: var(--accent); }

/* project select — button surface + height, custom chevron */
.topbar .tb-select {
  padding: 0 30px 0 var(--s3); border: 0; background-color: var(--ctl); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--ctl-brd); cursor: pointer; max-width: 190px;
  appearance: none; -webkit-appearance: none; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239fb0c3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.topbar .tb-select:hover { background-color: var(--ctl-hover); }

/* view toggles as pills — light up when on */
.topbar .chk {
  display: inline-flex; align-items: center; gap: var(--s2); padding: 0 var(--s3);
  color: var(--text-dim); cursor: pointer; user-select: none;
  box-shadow: inset 0 0 0 1px var(--ctl-brd);
  transition: background .15s, color .15s, box-shadow .15s;
}
.topbar .chk input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* Icon toggle: the checkbox still drives :has(input:checked), it just isn't drawn —
   the lit pill is the state. Keep the input in the DOM for ng-model. */
.topbar .chk.ico input { position: absolute; opacity: 0; pointer-events: none; }
.topbar .chk:hover { background: var(--ctl); }
.topbar .chk:has(input:checked) { color: var(--text); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.55); }

/* segmented groups — joined buttons in one rounded shell */
.btn-group { display: inline-flex; align-items: center; flex: 0 0 auto;
  border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 1px var(--ctl-brd); }
.btn-group button { border-radius: 0; }
.btn-group button + button { border-left: 1px solid rgba(0,0,0,.28); }

#map.selecting { cursor: crosshair; }
#map.adding { cursor: cell; }
.status { display: none; }   /* replaced by floating toasts */

/* Floating toast notifications (top-centre, below the toolbar). */
#toast-wrap { position: fixed; top: calc(var(--bar) + 14px); left: 50%;
  transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column;
  gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; max-width: 60vw;
  background: rgba(17,24,39,.96); color: #f9fafb; padding: 10px 16px;
  border-radius: 10px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.4);
  border-left: 4px solid #2563eb; opacity: 0; transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease; }
.toast.in { opacity: 1; transform: translateY(0); }
.toast-ok { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-busy { border-left-color: #f59e0b; }
.toast-ico { font-size: 15px; line-height: 1; }

#map { flex: 1 1 auto; background: #0b3b45; }

/* Multi-region extraction panel (bottom-left). */
.regions-panel { position: absolute; left: var(--s4); bottom: var(--s4); z-index: 7;
  background: var(--panel); color: var(--text); border-radius: var(--r);
  box-shadow: var(--shadow); padding: var(--s3); width: 214px; font-size: var(--fs-sm); }
.rp-head { font-weight: 600; margin-bottom: var(--s2); }
.rp-list { list-style: none; margin: 0 0 var(--s2); padding: 0; max-height: 38vh; overflow: auto; }
.rp-list li { display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px; color: var(--text-dim); }
.rp-list .rm { width: 22px; height: 22px; border: 0; border-radius: var(--r-sm);
  background: var(--ctl); color: #fca5a5; cursor: pointer; font-size: 11px; }
.rp-list .rm:hover { background: var(--danger); color: #fff; }
.rp-actions { display: flex; gap: var(--s2); }
.rp-actions button { flex: 1; height: 30px; border: 0; border-radius: var(--r-sm);
  background: var(--ctl); color: var(--text); cursor: pointer; font-size: var(--fs-sm);
  white-space: nowrap; }
.rp-actions button:hover { background: var(--ctl-hover); }
.rp-actions button.accent { background: var(--accent); color: #fff; }
.rp-actions button.accent:hover { background: var(--accent-hover); }
.info {
  position: absolute; left: 14px; bottom: 14px; z-index: 5;
  background: rgba(17,24,39,.9); color: #f9fafb; padding: 6px 12px;
  border-radius: 8px; font-size: 13px; pointer-events: none; min-height: 0;
}
.info:empty { display: none; }

/* Two independent boxes: the compass is fixed (never scrolls); the calibration
   box scrolls on its own when tall. The wrapper itself does NOT scroll. */
#right-panels {
  position: absolute; right: 14px; top: calc(var(--bar) + 14px); z-index: 6;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
  max-height: calc(100vh - var(--bar) - 28px); pointer-events: none;
}
#right-panels > * { pointer-events: auto; }
.compass-panel {
  flex: 0 0 auto;                     /* fixed — never scrolls with the panel */
  background: rgba(17,24,39,.92); color: #f9fafb; padding: 12px; text-align: center;
  border-radius: 12px; width: 210px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.compass-title { font-size: 12px; margin-bottom: 6px; color: #cbd5e1; }
#compass { touch-action: none; cursor: grab; display: block; margin: 0 auto; }
#compass:active { cursor: grabbing; }
.c-ring { fill: rgba(255,255,255,.06); stroke: #64748b; stroke-width: 1.5; }
.c-axis { stroke: #475569; stroke-width: 1; }
.c-north { fill: #ef4444; }
.c-south { fill: #cbd5e1; }
.c-lbl { fill: #e5e7eb; font-size: 13px; font-weight: bold; text-anchor: middle;
  dominant-baseline: middle; }
.c-lbl-n { fill: #ef4444; }
.compass-row { display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 8px 0 6px; }
.compass-row button { width: 26px; height: 26px; border: 0; border-radius: 6px;
  background: #374151; color: #fff; font-size: 16px; cursor: pointer; }
.compass-row button:hover { background: #4b5563; }
#north-val { font-size: 15px; font-weight: bold; min-width: 46px; }
.north-save { width: 100%; padding: 7px; border: 0; border-radius: 6px;
  background: #2563eb; color: #fff; font-size: 12px; cursor: pointer; }
.north-save:hover { background: #1d4ed8; }
.compass-hint { font-size: 10.5px; color: #94a3b8; margin-top: 6px; line-height: 1.3; }

/* Legend panel (colour → loại) — under the compass, right side. */
.legend-panel {
  flex: 0 1 auto; min-height: 0; overflow-y: auto;   /* scrolls on its own */
  background: rgba(17,24,39,.92); color: #f9fafb; padding: 12px;
  border-radius: 12px; width: 210px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.legend-title { font-size: 12px; margin-bottom: 8px; color: #cbd5e1; font-weight: bold; }
.calib-row { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 12px; color: #cbd5e1; margin-bottom: 7px; }
.calib-row select { font-size: 12px; padding: 5px 6px; border: 0; border-radius: 6px;
  background: #f9fafb; color: #111; flex: 0 0 auto; width: 118px; }
.calib-row input { font-size: 12px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: #f9fafb; color: #111; width: 110px; flex: 0 0 auto; }
.calib-btn { width: 100%; padding: 7px; border: 0; border-radius: 6px; margin: 2px 0 8px;
  background: #2563eb; color: #fff; font-size: 12px; cursor: pointer; }
.calib-btn:hover { background: #1d4ed8; }
.calib-btn.active { background: #f59e0b; color: #111827; }
.zones-box { margin-bottom: 8px; }
.calib-sub { font-size: 11.5px; color: #cbd5e1; margin: 2px 0 6px; }
/* Zone-shape lock — sits under the OpenLayers zoom buttons at the map's
   top-left. Locked is the resting state so it stays quiet; unlocked goes amber
   because a stray drag in that state rewrites a phân khu/dãy polygon. */
/* Reads as one stack with the OL zoom buttons: same left (.5em = 8px) and same
   24px width, sitting 6px under them (measured: .ol-zoom ends 55px below the
   map top, which starts at --bar). */
.map-lock { position: absolute; left: 8px; top: calc(var(--bar) + 61px); z-index: 7;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(17, 24, 39, .82); color: #e2e8f0; cursor: pointer;
  font-size: 12px; line-height: 24px; text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.map-lock:hover { background: rgba(17, 24, 39, .95); }
.map-lock.open { background: var(--active); color: var(--active-fg);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .35), 0 1px 4px rgba(0, 0, 0, .45); }
/* Only offer the reshape cursor while shapes are actually editable. */
#map.zones-unlocked { cursor: crosshair; }
/* Label review sits directly under the lock, same 24px rail. */
.map-review { top: calc(var(--bar) + 91px); }
.review-panel { position: absolute; left: 40px; top: calc(var(--bar) + 61px); z-index: 8;
  background: var(--panel); color: var(--text); border-radius: var(--r);
  box-shadow: var(--shadow); padding: var(--s3); width: 178px; font-size: var(--fs-sm); }
.review-panel b { font-size: var(--fs); }
.review-panel small { color: var(--text-dim); display: block; margin-top: var(--s2);
  line-height: 1.35; }
.rv-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.rv-dot { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.rv-p { background: #f59e0b; } .rv-v { background: #10b981; } .rv-r { background: #64748b; }
.rv-cur { margin: var(--s2) 0 0; padding: 6px 8px; border-radius: 5px;
  background: var(--sunken); line-height: 1.3; }
.rv-cur small { display: block; color: var(--text-dim); margin: 0; }
.rv-acts { display: flex; gap: 5px; margin-top: var(--s2); }
.rv-acts button { flex: 1 1 auto; height: 30px; border: 0; border-radius: 5px;
  cursor: pointer; font-size: var(--fs-sm); color: #fff; }
.rv-ok { background: #10b981; } .rv-ok:hover { background: #0d9a70; }
.rv-no { background: #64748b; } .rv-no:hover { background: #526074; }
.rv-skip { flex: 0 0 34px !important; background: var(--ctl); color: #cbd5e1; }
.rv-skip:hover { background: var(--ctl-hover); }
.zone-tag { flex: 0 0 auto; font-size: 10px; font-weight: bold; padding: 1px 5px;
  border-radius: 4px; color: #fff; }
.zone-tag.phan_khu { background: #2563eb; }
.zone-tag.day { background: #059669; }
.legend-list .ten.rename { cursor: pointer; }
.legend-list .ten.rename:hover { text-decoration: underline; }
/* Zone row: name line + parent-phân-khu line (dãy hierarchy). */
.legend-list .zbody { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  gap: 1px; cursor: pointer; }
.legend-list .zbody.rename:hover .zname { text-decoration: underline; }
.legend-list .zname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-list .zname .zma { color: var(--text-dim); font-size: 11px; }
.legend-list .zparent { color: #93c5fd; font-size: 10.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.legend-list .zparent.orphan { color: var(--active); }
.legend-list .zhuong { color: #86efac; }
.legend-list li.day .zone-tag { align-self: flex-start; margin-top: 1px; }
/* Zone rows: click to pick for extraction — selected row gets an amber outline. */
.zones-box .legend-list li { cursor: pointer; padding: 4px 5px; border-radius: 6px;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .12s, background .12s; }
.zones-box .legend-list li:hover { background: #273449; }
.zones-box .legend-list li.sel { background: rgba(245,158,11,.12);
  box-shadow: inset 0 0 0 2px var(--active); }
.zones-box .legend-list li.empty { cursor: default; box-shadow: none; }
.zones-box .legend-list li.empty:hover { background: none; }
.legend-list .zi { width: 22px; height: 20px; padding: 0; border: 0; border-radius: 4px;
  background: var(--ctl); color: #cbd5e1; cursor: pointer; font-size: 11px; flex: 0 0 auto; }
.legend-list .zi:hover { background: var(--ctl-hover); color: #fff; }
.zsel-bar { display: flex; gap: 6px; align-items: stretch; margin: 2px 0 8px; }
.zsel-go { flex: 1 1 auto; margin: 0 !important; }
.zsel-x { width: 34px; border: 0; border-radius: 6px; background: var(--ctl); color: #cbd5e1;
  cursor: pointer; font-size: 12px; flex: 0 0 auto; }
.zsel-x:hover { background: var(--danger); color: #fff; }
/* Destructive scoped deletes — outlined at rest, solid red only on hover, so
   they never compete with the extract button sitting right above them. */
.zsel-del, .rp-del { width: 100%; margin: 0 0 8px !important; border: 0; border-radius: 6px;
  background: transparent; box-shadow: inset 0 0 0 1px var(--danger); color: #fca5a5;
  cursor: pointer; font-size: var(--fs-sm); height: var(--ctl-h); }
.zsel-del:hover, .rp-del:hover { background: var(--danger); color: #fff; }
.rp-del { margin-top: var(--s2) !important; }
.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 12px; }
.legend-list li.empty { color: #94a3b8; font-size: 11px; line-height: 1.3; }
.legend-list .sw { width: 15px; height: 15px; border-radius: 3px; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.4); }
.legend-list .ten { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-list button.rm { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px;
  background: #374151; color: #fca5a5; cursor: pointer; font-size: 11px; }
.legend-list button.rm:hover { background: #7f1d1d; color: #fff; }
.legend-hint { font-size: 10.5px; color: #94a3b8; margin-top: 6px; line-height: 1.3; }

/* Edit record modal. */
.edit-modal { position: absolute; inset: 0; z-index: 20; display: none;
  align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.edit-modal.show { display: flex; }
.edit-card { background: #1f2937; color: #f3f4f6; padding: 18px 20px; border-radius: 12px;
  width: 300px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.edit-head { font-size: 15px; font-weight: bold; margin-bottom: 12px; }
.edit-card label { display: flex; flex-direction: column; gap: 3px; font-size: 12px;
  color: #cbd5e1; margin-bottom: 10px; }
.edit-card input { font-size: 13px; padding: 6px 8px; border: 0; border-radius: 6px;
  background: #f9fafb; color: #111; }
.edit-card select { font-size: 13px; padding: 6px 8px; border: 0; border-radius: 6px;
  background: #f9fafb; color: #111; width: 100%; box-sizing: border-box; }
.edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.edit-spacer { flex: 1 1 auto; }
.edit-actions button { font-size: 13px; padding: 7px 14px; border: 0; border-radius: 6px;
  background: #374151; color: #fff; cursor: pointer; }
.edit-actions button.primary { background: #2563eb; }
.edit-actions button.primary:hover { background: #1d4ed8; }
.edit-actions button.danger { background: #7f1d1d; }
.edit-actions button.danger:hover { background: #991b1b; }
/* Config rows inside the ⚙️ Cài đặt modal: label above a full-width select
   (override the side-panel .calib-row which centres label + select in a row). */
.edit-card .calib-row { flex-direction: column; align-items: stretch;
  justify-content: flex-start; gap: 4px; margin-bottom: 12px; }
.edit-card .calib-row select { width: 100%; box-sizing: border-box;
  font-size: 13px; padding: 7px 8px; }

/* Tabbed zone popup. */
.zone-tabs { display: flex; margin-bottom: 14px; border-radius: 8px; overflow: hidden;
  box-shadow: inset 0 0 0 1px #374151; }
.zone-tabs button { flex: 1; padding: 9px 0; border: 0; background: #1f2937; color: #cbd5e1;
  font-size: 13px; cursor: pointer; transition: background .15s; }
.zone-tabs button.on { background: #2563eb; color: #fff; font-weight: bold; }
.zone-tabs button:not(.on):hover { background: #374151; }
.legend-list .ten .zma { color: #93c5fd; font-size: 11px; }

/* Summary table (below the edit modal so editing floats on top). */
.table-modal { position: absolute; inset: 0; z-index: 15; display: none;
  align-items: center; justify-content: center; background: rgba(0,0,0,.5); }
.table-modal.show { display: flex; }
.table-card { background: #1f2937; color: #f3f4f6; border-radius: 12px;
  width: min(920px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); overflow: hidden; }
.table-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid #374151; font-size: 15px; }
.table-head .tcount { font-size: 12px; color: #94a3b8; font-weight: normal; }
.table-head .tcount.warn { color: #fbbf24; }
.table-spacer { flex: 1 1 auto; }
.tchk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #cbd5e1; cursor: pointer; }
.tclose { background: #374151; color: #fff; border: 0; border-radius: 6px;
  width: 28px; height: 28px; font-size: 14px; cursor: pointer; }
.tclose:hover { background: #4b5563; }
.table-scroll { overflow: auto; }
.rec-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rec-table thead th { position: sticky; top: 0; background: #111827; color: #cbd5e1;
  text-align: left; padding: 8px 10px; font-weight: 600; white-space: nowrap; z-index: 1; }
.rec-table td { padding: 7px 10px; border-top: 1px solid #263243; }
.rec-table tbody tr { cursor: pointer; }
.rec-table tbody tr:hover { background: #273449; }
.rec-table tbody tr.flag { background: rgba(251,191,36,.06); }
.rec-table tbody tr.flag:hover { background: rgba(251,191,36,.13); }
.rec-table td.miss { background: rgba(239,68,68,.18); color: #fca5a5; }
.rec-table td.opt { color: #64748b; }
.rec-table .c-idx { color: #64748b; width: 38px; }
.rec-table .c-act { width: 40px; text-align: center; }
.rec-table .lc { color: #fbbf24; margin-left: 3px; }
.tloc { background: #374151; color: #fff; border: 0; border-radius: 6px;
  width: 26px; height: 26px; font-size: 13px; cursor: pointer; }
.tloc:hover { background: #2563eb; }
.tempty { text-align: center; color: #94a3b8; padding: 22px; }

/* Project manager popup. */
.edit-card.wide { width: min(560px, 92vw); }
.pm-add { background: #111827; border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.pm-sub { font-size: 12px; color: #93c5fd; margin-bottom: 8px; font-weight: 600; }
.pm-add input { width: 100%; box-sizing: border-box; font-size: 13px; padding: 7px 8px;
  border: 0; border-radius: 6px; background: #f9fafb; color: #111; margin-bottom: 8px; }
.pm-add-row { display: flex; gap: 8px; }
.pm-add-row select { flex: 1; font-size: 13px; padding: 6px 8px; border: 0; border-radius: 6px; }
.pm-add-row button { font-size: 13px; padding: 7px 16px; border: 0; border-radius: 6px;
  background: #2563eb; color: #fff; cursor: pointer; }
.pm-add-row button:disabled { opacity: .5; cursor: default; }
.pm-list { list-style: none; margin: 0; padding: 0; max-height: 42vh; overflow: auto; }
.pm-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; }
.pm-list li:hover { background: #273449; }
.pm-list li.on { background: rgba(37,99,235,.16); }
.pm-open { flex: 1 1 auto; display: flex; flex-direction: column; cursor: pointer; min-width: 0; }
.pm-open b { font-size: 13px; color: #f3f4f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-open small { font-size: 11px; color: #94a3b8; }
.pm-cur { font-size: 11px; color: #60a5fa; white-space: nowrap; }
.pm-list .rm { background: #7f1d1d; color: #fff; border: 0; border-radius: 6px;
  width: 26px; height: 26px; font-size: 13px; cursor: pointer; flex: 0 0 auto; }
.pm-list .rm:hover { background: #991b1b; }
.pm-lock { font-size: 13px; opacity: .5; width: 26px; text-align: center; flex: 0 0 auto; }
.pm-list li.empty { color: #94a3b8; justify-content: center; padding: 18px; }
.pm-list li.empty:hover { background: none; }
