/*
 * Salesforce-mirror index surfaces. Scoped under .sfm- so it never collides with
 * the AM/cpv1 control-panel chrome. Tokens + values from the design handoff
 * (export-sf-mirror/mockups/contacts-index.html). Grows as Phase 2 lands more
 * of the mockup (filter builder, cap/refine landmark, etc.).
 */

/* Entity switcher (subnav) */
.sfm-subnav { display: flex; gap: 6px; padding: 4px 0 14px; flex-wrap: wrap; }
.sfm-pill {
  padding: 5px 11px; background: #fff; border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 12.5px; color: #475569; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; line-height: 1.3;
}
.sfm-pill:hover { color: #0f172a; }
.sfm-pill-meta { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #94a3b8; }
.sfm-pill--active { background: #0f172a; color: #fff; border-color: #0f172a; }
.sfm-pill--active:hover { color: #fff; }
.sfm-pill--active .sfm-pill-meta { color: rgba(255, 255, 255, 0.6); }

/* Read-only mirror tag + synced-ago note (page head) */
.sfm-ro-tag {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8;
  border: 1px solid #e2e8f0; border-radius: 3px; padding: 1px 6px; margin-left: 8px;
  vertical-align: 2px;
}
.sfm-sync-note {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11px; color: #475569;
}

/* ============================================================
 * Two-pane filter builder (.fb) — values from
 * export-sf-mirror/mockups/filter-builder-B.html.
 * Rendered inside the control-panel popover (.cp-pop--builder).
 * ============================================================ */

/* Host popover: drop the narrow-dropdown padding/width so .fb sizes itself.
 * The base .cp-pop is left:0-anchored to the "+ filter" chip-wrap. That wrap sits
 * mid-toolbar and the builder is wide (620px), so it can overflow the viewport's
 * right edge (clipped operators + value list, esp. ≥1440). Neither left:0 nor right:0
 * fits at every width (right:0 clips the LEFT on narrow viewports), so the
 * control-panel controller clamps it horizontally on open (see #clampBuilder). The
 * `--cp-builder-shift` var it sets nudges this popover left to stay on-screen. */
.cp-pop--builder { padding: 0 !important; width: auto !important; max-width: none !important; overflow: hidden;
  transform: translateX(var(--cp-builder-shift, 0px)); }

.fb { display: flex; height: 360px; width: 620px; max-width: 86vw; font-size: 14px; color: #0f172a; }

/* Left rail — field families */
.fb-rail { width: 206px; border-right: 1px solid #e2e8f0; background: #f8fafc; overflow-y: auto; padding: 6px 0; flex-shrink: 0; }
.fb-railhead { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; color: #94a3b8; font-weight: 700; padding: 8px 13px 5px; }
.fb-cat { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 8px 13px; font-size: 12.5px; color: #475569; cursor: pointer; border: none; background: transparent; border-left: 2px solid transparent; }
.fb-cat:hover { background: #fff; color: #0f172a; }
.fb-cat.on { background: #fff; color: #0f172a; font-weight: 600; border-left-color: #0f172a; }
.fb-cat-label { flex: 1; }
.fb-ct { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #94a3b8; }
.fb-acctflag, .fb-rel { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 8.5px; color: #1d4ed8; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 2px; padding: 0 3px; text-transform: uppercase; }
.fb-rel { margin-right: 5px; }

/* Right pane shell */
.fb-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Field-list view (step 1) */
.fb-fieldview { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.fb-search { padding: 8px; border-bottom: 1px solid #e2e8f0; }
.fb-search input, .fb-vsearch-input { width: 100%; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 7px 10px; font: inherit; font-size: 13px; }
.fb-search input:focus, .fb-vsearch-input:focus { outline: none; border-color: #2563eb; }
.fb-fields { flex: 1; overflow-y: auto; padding: 4px 0; }
.fb-prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: none; background: transparent; text-align: left; padding: 7px 13px; font: inherit; font-size: 13px; color: #0f172a; cursor: pointer; }
.fb-prow:hover { background: #f1f5f9; }
.fb-prow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-pfield { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11px; color: #94a3b8; margin-left: 4px; }
.fb-ptype { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 9.5px; color: #94a3b8; text-transform: uppercase; flex-shrink: 0; }
.fb-noresults { padding: 16px 13px; font-size: 12.5px; color: #94a3b8; }

/* Value-editor view (step 2) */
.fb-valueview { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.fb-vhead { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.fb-vback { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 16px; line-height: 1; color: #94a3b8; cursor: pointer; border: none; background: transparent; padding: 0 4px; }
.fb-vback:hover { color: #0f172a; }
.fb-vfield { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-vbody { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.fb-op { display: flex; gap: 6px; padding: 9px 13px 4px; flex-wrap: wrap; }
.fb-op-chip { font: inherit; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; color: #475569; border: 1px solid #cbd5e1; background: #fff; border-radius: 4px; padding: 3px 9px; cursor: pointer; }
.fb-op-chip.on { background: #0f172a; color: #fff; border-color: #0f172a; }
/* First-class negation ops are red (canon: is none of / does not contain / contains none). */
.fb-op-chip--neg { color: #991b1b; border-color: #fecaca; }
.fb-op-chip--neg.on { background: #991b1b; color: #fff; border-color: #991b1b; }
.fb-vregion { padding: 8px 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-vregion.fb-vbools { gap: 6px; }
.fb-vinput, .fb-vselect { font: inherit; font-size: 13px; border: 1px solid #cbd5e1; border-radius: 4px; padding: 6px 9px; color: #0f172a; background: #fff; }
.fb-vinput { flex: 1; min-width: 120px; }
.fb-vinput--num, .fb-vinput--date { flex: 0 1 140px; }
.fb-vinput:focus, .fb-vselect:focus { outline: none; border-color: #2563eb; }
.fb-vrange-arrow { color: #94a3b8; }
.fb-bool-pill { font: inherit; font-size: 12.5px; border: 1px solid #cbd5e1; background: #fff; color: #475569; border-radius: 4px; padding: 6px 14px; cursor: pointer; }
.fb-bool-pill.on { background: #0f172a; color: #fff; border-color: #0f172a; }
.fb-vnullnote, .fb-vloading { padding: 4px 0; font-size: 12.5px; color: #94a3b8; }

/* Searchable value list (enum/picker/array) */
.fb-vregion:has(.fb-vlist) { display: block; }
.fb-vlist { max-height: 168px; overflow-y: auto; margin-top: 8px; border: 1px solid #e2e8f0; border-radius: 4px; }
.fb-vrow { display: flex; align-items: center; gap: 9px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.fb-vrow:hover { background: #f1f5f9; }
.fb-vrow:focus-visible { outline: 2px solid #0f172a; outline-offset: -2px; background: #f1f5f9; }
.fb-vbox { width: 14px; height: 14px; border: 1px solid #cbd5e1; border-radius: 3px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; }
.fb-vbox.ck { background: #0f172a; border-color: #0f172a; }
.fb-vval { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-vct { margin-left: auto; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; color: #94a3b8; }

/* Multi-field search ("Any text field") — field checklist under the query input */
.fb-vregion:has(.fb-vlist--mt) { display: block; }
.fb-mt-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11.5px; color: #64748b; }
.fb-mt-toggle { font: inherit; font-size: 11.5px; color: #0f172a; background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fb-vlist--mt { max-height: 148px; }

/* Footer — live match estimate + Add */
.fb-vfoot { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.fb-vnote { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #94a3b8; }
.fb-vadd { margin-left: auto; font: inherit; font-size: 12.5px; font-weight: 600; color: #fff; background: #0f172a; border: 1px solid #0f172a; border-radius: 4px; padding: 7px 14px; cursor: pointer; }
.fb-vadd:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
 * Column resize (.rz) — design-system components/column-resize.
 * Opt-in via .cpv1-tbl--resizable (table-layout: fixed + <colgroup>).
 * ============================================================ */
.cpv1-tbl--resizable { table-layout: fixed; }
.cpv1-tbl--resizable thead th { position: relative; }
.rz { position: absolute; top: 0; right: 0; width: 15px; height: 100%; cursor: col-resize; display: flex; align-items: center; justify-content: center; z-index: 3; }
.rz::after { content: ""; width: 2px; height: 11px; border-radius: 2px; background: #cbd5e1; opacity: 0.55; transition: background 0.12s, height 0.12s, width 0.12s, opacity 0.12s; }
.rz:hover::after, th.rz-active .rz::after { background: #2563eb; opacity: 1; height: 62%; width: 3px; }
.rz:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
body.rz-dragging, body.rz-dragging * { cursor: col-resize !important; user-select: none; }

/* ============================================================
 * View export (CSV) — design-system components/view-export.
 * The button reuses .cpv1-util-btn (peer to Columns); the scope popover below.
 * ============================================================ */
.ve-wrap { position: relative; display: inline-flex; }
.export-pop { position: absolute; top: 38px; right: 0; width: 288px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 8px 28px rgba(15,23,42,.14); border-radius: 4px; z-index: 25; overflow: hidden; }
.export-pop[hidden] { display: none; }
.ep-h { padding: 11px 14px; border-bottom: 1px solid #e2e8f0; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: #475569; font-weight: 700; }
.ep-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.ep-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.ep-row .epl { color: #475569; }
.ep-row .epv { color: #0f172a; font-weight: 500; text-align: right; white-space: nowrap; }
.ep-row .epv.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; }
.ep-note { font-size: 11.5px; color: #94a3b8; line-height: 1.45; border-top: 1px solid #eef2f6; padding-top: 9px; }
.ep-foot { padding: 11px 14px; border-top: 1px solid #e2e8f0; background: #f8fafc; display: flex; justify-content: flex-end; }
.ep-go { font: inherit; font-size: 12.5px; font-weight: 600; color: #fff; background: #0f172a; border: 1px solid #0f172a; border-radius: 4px; padding: 7px 14px; cursor: pointer; text-decoration: none; }
.ep-go:hover { background: #1e293b; }

/* ============================================================
 * Aggregate-first grouped view (bands of distinct values + true counts).
 * Reuses .cpv1-group-band chrome; the chevron is glyph-driven (▸/▾) here, so
 * neutralize any base rotation. Status/more rows are quiet utility rows.
 * ============================================================ */
[data-controller="grouped-aggregate"] .cpv1-group-band-chev { transform: none !important; }
.cpv1-bands-status { padding: 10px 14px; font-size: 13px; color: #94a3b8; }
.cpv1-band-status-row td, .cpv1-band-more-row td { padding: 4px 14px; background: #fff; }
.cpv1-band-more-row .cpv1-landmark-link { font-size: 12.5px; }

/* ============================================================
 * Mirror detail — full-record read-only page.
 * Spec: export-sf-mirror/archetypes/mirror-detail/reference.html.
 * Field-level classes scoped under .sfm-detail to avoid collisions.
 * ============================================================ */
.sfm-detail-crumb { padding: 4px 0 10px; font-size: 12.5px; }
.sfm-detail-crumb a { color: #475569; text-decoration: none; }
.sfm-detail-crumb a:hover { color: #0f172a; }

/* Record head */
.sfm-rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 4px 0 16px; border-bottom: 1px solid #e2e8f0; margin-bottom: 16px; }
.sfm-rh-eyebrow { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.sfm-rh-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 8px; }
.sfm-rh-keys { display: flex; flex-wrap: wrap; gap: 18px; }
.sfm-k { display: inline-flex; flex-direction: column; gap: 1px; }
.sfm-kl { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; }
.sfm-kv { font-size: 13px; color: #0f172a; }
.sfm-rh-r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.sfm-sf-link { font-size: 12.5px; font-weight: 600; color: #fff; background: #0f172a; border: 1px solid #0f172a; border-radius: 4px; padding: 7px 13px; text-decoration: none; white-space: nowrap; }
.sfm-sf-link:hover { background: #1e293b; }
.sfm-meta-line { display: inline-flex; align-items: center; gap: 8px; }

/* Detail layout: nav rail + fields column */
.sfm-detail { display: flex; gap: 24px; align-items: flex-start; }
.sfm-navrail { width: 208px; flex-shrink: 0; position: sticky; top: 16px; }
.sfm-nav-find input { width: 100%; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 7px 10px; font: inherit; font-size: 12.5px; margin-bottom: 8px; }
.sfm-nav-find input:focus { outline: none; border-color: #2563eb; }
.sfm-nav-list { display: flex; flex-direction: column; }
.sfm-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 9px; font-size: 12.5px; color: #475569; text-decoration: none; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; }
.sfm-nav-item:hover { background: #f8fafc; color: #0f172a; }
.sfm-nav-item.on { color: #0f172a; font-weight: 600; border-left-color: #0f172a; background: #f8fafc; }
.sfm-nc { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #94a3b8; }
.sfm-nav-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sfm-nav-toggle { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12px; color: #475569; background: none; border: 0; cursor: pointer; padding: 0; }
.sfm-tg { width: 26px; height: 15px; border-radius: 8px; background: #cbd5e1; position: relative; transition: background 0.12s; flex-shrink: 0; }
.sfm-tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: left 0.12s; }
.sfm-nav-toggle.on .sfm-tg { background: #0f172a; }
.sfm-nav-toggle.on .sfm-tg::after { left: 13px; }
.sfm-nav-link { font: inherit; font-size: 12px; color: #2563eb; background: none; border: 0; cursor: pointer; padding: 0; }

/* Field sections */
.sfm-fields-col { flex: 1; min-width: 0; }
.sfm-section { border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 14px; overflow: hidden; }
.sfm-section-head { display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #eef2f6; cursor: pointer; }
.sfm-section.is-collapsed .sfm-section-head { border-bottom: 0; }
.sfm-section-chev { font-size: 11px; color: #94a3b8; width: 12px; }
.sfm-section-title { font-size: 13px; font-weight: 600; }
.sfm-section-count { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; color: #94a3b8; }
.sfm-section-empty-note { margin-left: auto; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #cbd5e1; }
.sfm-section-body { padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }

/* Field rows (scoped) */
.sfm-detail .field { display: grid; grid-template-columns: 150px 1fr; align-items: baseline; gap: 12px; padding: 5px 0; min-width: 0; }
.sfm-detail .field.full { grid-column: 1 / -1; }
.sfm-detail .field-label { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; font-weight: 600; padding-top: 2px; }
.sfm-detail .field-value { font-size: 13px; color: #0f172a; min-width: 0; overflow-wrap: anywhere; }
.sfm-detail .field-value.mono, .sfm-detail .field-value.num { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 12px; }
.sfm-detail .field-value.empty { color: #cbd5e1; }
.sfm-detail .field-value.longtext { line-height: 1.5; color: #334155; }
.sfm-detail .field-value.link a { color: #1d4ed8; text-decoration: none; }
.sfm-detail .field-value.link a:hover { text-decoration: underline; }
.sfm-detail .ext { color: #94a3b8; font-size: 10px; }
.sfm-detail .fk-link { color: #1d4ed8; font-weight: 500; text-decoration: none; }
.sfm-detail a.fk-link:hover { text-decoration: underline; }
.sfm-detail .fk-link--nolink { color: #0f172a; font-weight: 400; } /* resolved name, no page (e.g. SF user) */
.sfm-detail .fk-link .arr { color: #94a3b8; }
/* Rolled-up campaign list (detail "Campaigns" section): wrap the name links across
   lines with comfortable spacing instead of one cramped run. */
.sfm-detail .sfm-campaign-list { line-height: 1.9; }
.sfm-detail .sfm-campaign-list .fk-link { margin-right: 2px; }

/* Related-records strip (prominent, under the record head) */
.sfm-related { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; }
.sfm-related-label { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: #94a3b8; font-weight: 700; }
.sfm-related-link { font-size: 13px; font-weight: 500; color: #1d4ed8; text-decoration: none; }
.sfm-related-link:hover { text-decoration: underline; }
.sfm-detail .json { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; color: #475569; }
.sfm-detail .json .jk { color: #94a3b8; }
.sfm-detail .chip { display: inline-block; font-size: 11.5px; border: 1px solid #cbd5e1; border-radius: 3px; padding: 1px 7px; margin: 0 3px 3px 0; background: #fff; }

/* --- Field-provenance marks (locked design) -----------------------------------
   ƒ prefix = computed (muted); ↗ⁿ suffix = looked-up + hop count (violet accent).
   Native fields carry no mark. Glyph + digit carry the meaning; colour reinforces
   (grayscale-test safe). Tooltip (title attr) carries the full route. */
.sfm-pv-wrap { white-space: nowrap; }
.sfm-pv { font-family: ui-monospace, "IBM Plex Mono", SFMono-Regular, Menlo, monospace; text-transform: none; }
.sfm-pv-fn  { color: #475569; font-weight: 600; margin-right: 5px; font-size: 11px; }
.sfm-pv-loc { color: #6d28d9; font-weight: 600; margin-left: 5px; font-size: 11px; }
.sfm-pv-loc .sfm-pv-h { font-size: 8px; vertical-align: super; font-weight: 700; }

/* Object-resolving cell value → blue link (reuses the mirror FK blue). */
.cpv1-tbl td a.cell-link, .cpv1-tbl .cell-link { color: #1d4ed8; text-decoration: none; }
.cpv1-tbl td a.cell-link:hover { text-decoration: underline; }

/* Detail-page provenance chips + edit-target line. */
.sfm-pv-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-family: ui-monospace, "IBM Plex Mono", SFMono-Regular, Menlo, monospace;
  text-transform: none; font-size: 9.5px; font-weight: 600; color: #6d28d9;
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 3px; padding: 1px 6px; letter-spacing: .02em; }
.sfm-pv-chip .sfm-pv-h { font-size: 8px; vertical-align: super; }
.sfm-pv-chip--fn { color: #475569; background: #f1f5f9; border-color: #e2e8f0; margin-left: 0; margin-right: 7px; }
.sfm-field-edit { display: block; font-size: 11.5px; color: #94a3b8; margin-top: 5px; }
.sfm-field-edit a { color: #1d4ed8; text-decoration: none; }

/* Provenance tooltip pill (styled, shown on hover by provenance-tip controller;
   native title stays for keyboard/SR). position:fixed escapes table overflow. */
.sfm-pv-tip { position: fixed; z-index: 9999; max-width: 360px; pointer-events: none;
  background: #0f172a; color: #fff; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px; line-height: 1.45; padding: 8px 11px; border-radius: 4px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .18); }
.sfm-pv-tip[hidden] { display: none; }

/* ============================================================
 * Manage-columns drawer (.sfm-mc) — right-docked, two-pane.
 * Left: all columns grouped + search. Right: shown-in-order.
 * ============================================================ */
.sfm-mc-wrap { display: inline-flex; }
.sfm-mc-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 1200; }
.sfm-mc { position: fixed; top: 0; right: 0; bottom: 0; width: 760px; max-width: 94vw; z-index: 1201;
  background: #fff; box-shadow: -10px 0 32px rgba(15,23,42,.18); display: flex; flex-direction: column;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #0f172a; }

.sfm-mc-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.sfm-mc-title { font-size: 15px; font-weight: 600; }
.sfm-mc-sub { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11px; color: #94a3b8; }
.sfm-mc-spacer { flex: 1; }
.sfm-mc-link { background: none; border: none; font: inherit; font-size: 12.5px; color: #1d4ed8; cursor: pointer; padding: 0; }
.sfm-mc-link:hover { text-decoration: underline; }
.sfm-mc-x { background: none; border: none; font-size: 20px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 0 2px; }
.sfm-mc-x:hover { color: #0f172a; }

.sfm-mc-body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.sfm-mc-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sfm-mc-left { border-right: 1px solid #e2e8f0; }
.sfm-mc-right { background: #fcfcfd; }
.sfm-mc-paneh { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px 8px; }
.sfm-mc-pt { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #475569; font-weight: 700; }
.sfm-mc-pc { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; color: #94a3b8; }
.sfm-mc-search { padding: 0 16px 10px; }
.sfm-mc-search input { width: 100%; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 8px 11px; font: inherit; font-size: 13px; color: #0f172a; }
.sfm-mc-search input:focus { outline: none; border-color: #2563eb; }
.sfm-mc-scroll { flex: 1; overflow-y: auto; padding-bottom: 8px; }

/* left grouped list */
.sfm-mc-grph { display: flex; align-items: center; gap: 9px; padding: 7px 16px; cursor: pointer;
  position: sticky; top: 0; background: #f1f5f9; border-top: 1px solid #eef2f6; border-bottom: 1px solid #eef2f6; }
.sfm-mc-chev { font-size: 9px; color: #94a3b8; width: 9px; transition: transform .12s; }
.sfm-mc-grph.collapsed .sfm-mc-chev { transform: rotate(-90deg); }
.sfm-mc-gname { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #475569; font-weight: 700; }
.sfm-mc-acct { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; color: #6d28d9; border: 1px solid #ddd6fe; background: #f5f3ff; border-radius: 2px; padding: 0 4px; }
.sfm-mc-gcount { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #94a3b8; }
.sfm-mc-gall { margin-left: auto; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; color: #1d4ed8; opacity: 0; }
.sfm-mc-grph:hover .sfm-mc-gall { opacity: 1; }
.sfm-mc-row { display: flex; align-items: center; gap: 9px; padding: 6px 16px 6px 32px; cursor: pointer; }
.sfm-mc-row:hover { background: #f1f5f9; }
.sfm-mc-chk { width: 15px; height: 15px; border: 1.5px solid #cbd5e1; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; flex-shrink: 0; }
.sfm-mc-chk.on { background: #2563eb; border-color: #2563eb; }
.sfm-mc-lab { font-size: 13px; color: #0f172a; }
.sfm-mc-type { margin-left: auto; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 9px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }

/* right ordered list */
.sfm-mc-ord { display: flex; align-items: center; gap: 8px; padding: 7px 16px; background: #fff; border-bottom: 1px solid #eef2f6; }
.sfm-mc-ord:hover { background: #eff6ff; }
.sfm-mc-grip { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; color: #94a3b8; font-size: 13px; letter-spacing: -2px; cursor: grab; width: 10px; flex-shrink: 0; }
.sfm-mc-grip:hover { color: #0f172a; }
.sfm-mc-ord .sfm-mc-lab { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfm-mc-rmv { flex-shrink: 0; color: #94a3b8; cursor: pointer; font-size: 14px; padding: 0 4px; }
.sfm-mc-rmv:hover { color: #991b1b; }
.sfm-mc-ord.carrying { opacity: .35; }
.sfm-mc-ord.drop-before { box-shadow: inset 0 2px 0 0 #2563eb; }
.sfm-mc-ord.drop-after { box-shadow: inset 0 -2px 0 0 #2563eb; }
.sfm-mc-ghost { position: fixed; z-index: 1300; pointer-events: none; background: #fff; border: 1px solid #2563eb;
  border-radius: 4px; box-shadow: 0 6px 18px rgba(15,23,42,.18); padding: 6px 12px; font-size: 13px; color: #0f172a; }
body.sfm-mc-carrying, body.sfm-mc-carrying .sfm-mc-ord, body.sfm-mc-carrying .sfm-mc-grip { cursor: grabbing; }
.sfm-mc-hint { margin: 8px 16px; padding: 7px 10px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 4px; font-size: 11.5px; color: #1e40af; line-height: 1.45; }
.sfm-mc-hint kbd { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10px; background: #fff; border: 1px solid #bfdbfe; border-radius: 3px; padding: 0 4px; }
.sfm-mc-empty { padding: 24px 16px; text-align: center; color: #94a3b8; font-style: italic; font-size: 13px; }

.sfm-mc-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid #e2e8f0; }
.sfm-mc-fcount { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 11px; color: #94a3b8; }
.sfm-mc-done { padding: 7px 16px; border-radius: 4px; font: inherit; font-size: 12.5px; cursor: pointer; background: #0f172a; border: 1px solid #0f172a; color: #fff; font-weight: 500; }
.sfm-mc-done:hover { background: #475569; }
