/*
 * TRAX3ION design system (matched to the Radzen/Material Blazor suite):
 *  - Header/rail: dark teal #06343c with a 3px cyan #07bee3 accent stripe
 *  - Typeface: Roboto; body 16px on #f5f5f5; text #424242
 *  - Material buttons: uppercase, 12.5px/500, 4px radius, elevation shadows
 *  - Material palette: success #4caf50, danger #f44336, warning #ff9800
 */
:root {
  --brand: #06343c;
  --brand-2: #0a4a55;
  /* Brand as TEXT (headings, card labels) - overridden per theme so it always
     contrasts with the surfaces; --brand itself stays the dark rail/header. */
  --brand-ink: #06343c;
  --accent: #07bee3;
  --accent-ink: #04768f;
  --accent-soft: #e1f7fc;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e0e0e0;
  --border-strong: #bdbdbd;
  --text: #424242;
  --muted: #757575;
  --faint: #9e9e9e;
  --success: #4caf50;
  --success-ink: #2e7d32;
  --success-soft: #e8f5e9;
  --danger: #f44336;
  --danger-ink: #c62828;
  --danger-soft: #fdecea;
  --warn: #ff9800;
  --warn-ink: #a86403;
  --warn-soft: #fff3e0;
  /* Filled danger buttons (2026-11-02): one deep red in every theme - white text reads on it (5.6 : 1). */
  --danger-strong: #c62828;
  /* Filled buttons, chips and badges with white text (2026-11-02, option B): white on the bright
     cyan / green was 2.2 / 2.8 : 1. Deep teal 4.9 : 1, deep green 5.1 : 1, in every theme.
     Bars, toggles and dots without text keep --accent / --success. */
  --accent-strong: #0a7c93;
  --accent-strong-hover: #075f70;
  --success-strong: #2e7d32;
  --success-strong-hover: #1b5e20;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-1: 0 2px 1px -1px rgba(0,0,0,.12), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
  --shadow-2: 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12), 0 2px 4px 0 rgba(0,0,0,.14);
  --shadow-btn: 0 1px 1px 0 rgba(0,0,0,.14), 0 2px 1px 0 rgba(0,0,0,.12), 0 1px 3px 0 rgba(0,0,0,.14);
  --font: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 70px;
  --rail-w: 57px;
}

/* ---------- Themes (Settings → Theme) ----------
   The default (light) palette lives on :root; the other themes override only
   the palette variables, so every component follows automatically. */
:root[data-theme="dark"] {
  --brand-ink: #bfe3ec;
  --bg: #0f181b;
  --surface: #16252a;
  --surface-2: #1c2e34;
  --border: #2d454d;
  --border-strong: #46626b;
  --text: #dde5e7;
  --muted: #9db0b5;
  --faint: #74878c;
  --accent-ink: #4fd0ee;
  --accent-soft: #0c3944;
  --success-ink: #81c995;
  --success-soft: #143321;
  --danger-ink: #f28b82;
  --danger-soft: #3b1a16;
  --warn-ink: #fdc169;
  --warn-soft: #38290e;
  --shadow-1: 0 2px 1px -1px rgba(0,0,0,.4), 0 1px 1px 0 rgba(0,0,0,.42), 0 1px 3px 0 rgba(0,0,0,.4);
  --shadow-2: 0 4px 5px 0 rgba(0,0,0,.42), 0 1px 10px 0 rgba(0,0,0,.4), 0 2px 4px 0 rgba(0,0,0,.42);
  --shadow-btn: 0 1px 1px 0 rgba(0,0,0,.42), 0 2px 1px 0 rgba(0,0,0,.4), 0 1px 3px 0 rgba(0,0,0,.42);
}
/* Warm mid tone - not light, not dark; the easy-on-the-eyes option. */
:root[data-theme="comfort"] {
  --bg: #e9e3d5;
  --surface: #f5f1e6;
  --surface-2: #eee8da;
  --border: #d7cfbc;
  --border-strong: #b3a98f;
  --text: #3e3a30;
  --muted: #6e675a;
  --faint: #918a7a;
  --accent-soft: #d9ebea;
  --success-soft: #e2eedd;
  --danger-soft: #f5e3dd;
  --warn-soft: #f4ead4;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
/* Always reserve the scrollbar gutter: without it the fixed wizard action
   bar (and its buttons) shift ~15px sideways between short and tall steps. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  /* Long tokens without spaces (a SOAP fault with a path, a code, a function name) break
     inside their box instead of pushing the page sideways (overflow audit 2026-10-30: 36
     message/title containers overflowed with a 300-char token). Ellipsis cells and
     nowrap tables keep their own rules. */
  overflow-wrap: anywhere;
}
/* Buttons, table headings and pills hold labels, never long tokens: they keep their words whole
   (2026-11-04 - "NE/XT" in the tour, "CATE/GORY" in the Review). */
button, .btn, th, .pill { overflow-wrap: normal; }

/* ---------- App header (TRAX3ION bar) ---------- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--brand);
  border-bottom: 3px solid var(--accent);
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px 0 calc(var(--rail-w) + 20px);
  z-index: 40;
}
.app-header .logo-img { height: 30px; width: auto; display: block; }
.app-header .app-divider {
  width: 1px; height: 30px; background: rgba(255, 255, 255, 0.25); flex: 0 0 auto;
}
.app-header .app-name {
  color: #fff; font-size: 15px; font-weight: 500; letter-spacing: 0.4px; white-space: nowrap;
}
.app-header .app-name small {
  display: block; font-size: 11px; font-weight: 400; color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.3px;
}
.app-header .spacer { flex: 1; }

/* ---------- Left rail ---------- */
/* Rail - the A+D treatment (2026-09-03): near-white icons on rounded hover
 * pads, cyan tinted pad for the active page, instant styled tooltips instead
 * of the slow native title, navigation on top / admin tools at the bottom
 * behind a separator, and a red badge slot for the Setup checklist. */
.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  background: var(--brand);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 0;
  gap: 4px;
}
.rail a,
.rail button {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  transition: color .15s, background .15s;
  border: none; background: transparent; cursor: pointer; padding: 0;
}
.rail a svg, .rail button svg { width: 24px; height: 24px; }
.rail a:hover, .rail button:hover,
.rail a:focus-visible, .rail button:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.14); outline: none; }
.rail a.active {
  color: var(--accent);
  background: rgba(7, 190, 227, 0.18);
  box-shadow: inset 0 0 0 1px rgba(7, 190, 227, 0.35);
}
.rail .rail-top { margin-bottom: 10px; }
.rail .rail-spacer { flex: 1; }
.rail .rail-sep { width: 30px; height: 1px; background: rgba(255, 255, 255, 0.22); margin: 8px 0; flex: none; }
/* Instant tooltip, to the right of the icon. */
.rail .rtip {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--brand-2, #0a4a55); color: #fff;
  font-size: 11.5px; font-weight: 500; letter-spacing: .3px; white-space: nowrap;
  padding: 4px 10px; border-radius: var(--radius); box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none; transition: opacity .1s;
}
.rail a:hover .rtip, .rail button:hover .rtip,
.rail a:focus-visible .rtip, .rail button:focus-visible .rtip { opacity: 1; }
/* Expanded rail (2026-10-19, option A): <html class="rail-x"> widens the rail to show
 * each item's name and what it does; --rail-w moves the header, page and action bar with it.
 * Collapsed (no class) is the icon rail above. Phones keep the bottom bar (media query below). */
.rail .rlab { display: none; flex-direction: column; line-height: 1.2; min-width: 0; text-align: left; }
.rail .rlab b { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* a long company / client name ends in … like the subtitle (overflow audit 2026-10-30) */
.rail .rlab small { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail a.active .rlab small { color: rgba(7, 190, 227, 0.8); }
.rail a { text-decoration: none; }
.rail .rail-toggle { margin-top: 6px; }
.rail, .app-header, .app { transition: width .18s, padding .18s, margin .18s; }
@media (min-width: 721px) {
  html.rail-x { --rail-w: 232px; }
  html.rail-x .rail { align-items: stretch; padding: 13px 10px; }
  html.rail-x .rail a, html.rail-x .rail button { width: auto; height: 46px; display: flex; align-items: center; justify-content: flex-start; gap: 13px; padding: 0 10px; }
  html.rail-x .rail a svg, html.rail-x .rail button svg { flex: none; }
  html.rail-x .rail .rlab { display: flex; }
  html.rail-x .rail .rtip { display: none; }
  html.rail-x .rail .rail-sep { width: auto; margin: 8px 4px; }
  html.rail-x .rail .rail-badge { left: 26px; right: auto; }
  html.rail-x .rail .rail-toggle { height: 38px; color: rgba(255, 255, 255, 0.75); }
  /* The centered page must clear the wide rail on every width. */
  html.rail-x .app { padding-left: 24px; margin-left: max(var(--rail-w), calc((100vw - 1040px) / 2)); margin-right: auto; }
  /* The fixed wizard action bar too (its wide-screen rule ignores the 57 px rail). */
  html.rail-x #panel-1 .nav, html.rail-x #panel-2 .nav, html.rail-x #panel-3 .nav, html.rail-x #panel-4 .nav, html.rail-x #panel-setup .nav {
    padding-left: max(calc(var(--rail-w) + 24px), calc((100vw - 1040px) / 2));
  }
}

/* Red badge (Administration: the Setup checklist has items to fix). */
.rail .rail-badge {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger, #f44336);
  border: 1.5px solid var(--brand);
}

/* ---------- Connection pill (in the dark header) ---------- */
.conn {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px; padding: 7px 14px 7px 12px;
  font-size: 12.5px; color: rgba(255, 255, 255, 0.85);
  cursor: pointer; user-select: none; transition: background .15s, transform .1s;
}
.conn:hover { background: rgba(255, 255, 255, 0.14); }
.conn:active { transform: translateY(1px); }
.conn .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.45); flex: 0 0 auto; }
.conn.checking .dot { animation: conn-pulse 1s ease-in-out infinite; }
@keyframes conn-pulse { 50% { opacity: 0.25; } }
.conn.ok .dot { background: #6fdc8c; box-shadow: 0 0 0 4px rgba(111, 220, 140, 0.22); }
.conn.bad .dot { background: #ff7961; box-shadow: 0 0 0 4px rgba(255, 121, 97, 0.22); }
/* Reverse debits and credits (2026-11-04, option B): the note, the heading tag, the reversed cells. */
.rev-note { margin: 10px 0 4px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 6px; font-size: 13px; color: var(--text); }
.rev-note.hidden { display: none; }
.rev-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: #fff; background: var(--accent-strong); vertical-align: middle; white-space: nowrap; }
#previewTable td.cell-reversed { color: var(--accent-ink); font-weight: 600; }
#previewTable td.cell-reversed small { font-weight: 400; color: var(--muted); margin-left: 4px; white-space: nowrap; }
/* Connected, but some parts did not answer (2026-11-04). */
.conn.warn .dot { background: #f5b942; box-shadow: 0 0 0 4px rgba(245, 185, 66, 0.24); }
.conn b { color: #fff; font-weight: 500; }
.conn-chev { font-size: 11px; opacity: .8; margin-left: -2px; }

/* ---------- Sage switcher (multi-Sage 1c, 2026-10-27, option A) ---------- */
.sage-menu {
  position: absolute; right: 16px; top: calc(100% + 6px); z-index: 60;
  width: 300px; max-height: 70vh; overflow: auto; padding: 6px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
}
.sage-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: var(--radius); background: none;
  color: inherit; font: inherit; font-size: 13px; cursor: pointer;
}
.sage-item:hover:not(:disabled), .sage-item:focus-visible { background: var(--surface-2); outline: none; }
.sage-item:disabled { cursor: not-allowed; opacity: .55; }
.sage-item .sage-check { width: 14px; color: var(--success-ink); font-weight: 600; }
.sage-item .sage-text { flex: 1; min-width: 0; }
.sage-item b { display: block; font-weight: 500; }
.sage-item small { display: block; color: var(--muted); font-size: 12px; }
.sage-item .sage-tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.sage-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.sage-grp { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px 2px; }
.sage-note { font-size: 12px; color: var(--warn-ink); background: var(--warn-soft); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 6px; }

/* ---------- Layout ---------- */
.app {
  max-width: 1040px;
  margin: 0 auto;
  /* Bottom padding clears the fixed wizard action bar. */
  padding: calc(var(--header-h) + 24px) 24px 120px;
  padding-left: calc(var(--rail-w) + 24px);
}
@media (min-width: 1240px) {
  .app { padding-left: 24px; } /* centered; rail clears on its own */
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
  box-shadow: var(--shadow-1);
}
.step { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.step .num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 500; color: var(--faint);
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  transition: all .2s;
}
.step .label { font-size: 13.5px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.step.active .num { color: #fff; background: var(--accent-strong); border-color: var(--accent-strong); }
.step.active .label { color: var(--brand-ink); font-weight: 500; }
.step.done .num { color: #fff; background: var(--success-strong); border-color: var(--success-strong); }
.step.done .label { color: var(--text); }
.step-line { flex: 1 1 auto; height: 2px; background: var(--border); border-radius: 2px; min-width: 12px; }
.step-line.done { background: var(--success); }

/* ---------- Panel / cards ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  padding: 26px; animation: rise .25s ease both;
}
/* Opacity-only on purpose: animating transform turns .panel into the
   containing block for position:fixed children (the wizard action bar),
   pinning the bar to the panel instead of the window. */
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
.panel h2 { margin: 0 0 4px; font-size: 18px; font-weight: 500; color: var(--brand-ink); }
.panel .sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }
/* Step-1 instruction as a cyan chip (user's pick "variant A", 2026-09-03):
 * the Create·Update pill's sentence-sized sister - contrast from color, not
 * size, so the panel keeps its height. Scoped to the picker panel only. */
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
#panel-1 .panel-head > .sub {
  display: inline-block; font-size: 13px; font-weight: 500; color: var(--brand-ink);
  background: var(--accent-soft); border: 1px solid #bfe7f2; border-radius: 999px;
  padding: 3px 14px; margin: 0 0 0 auto;
}
.hidden { display: none !important; }

/* ---------- Object picker ---------- */
.obj-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.obj-card {
  display: flex; align-items: center; gap: 13px; text-align: left;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px 16px; cursor: pointer; font: inherit;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.obj-card:hover { border-color: var(--accent); }
.obj-card:active { transform: translateY(1px); }
.obj-card.selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(7, 190, 227, 0.15);
}
.obj-card .oc-icon {
  width: 40px; height: 40px; border-radius: var(--radius); flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted);
}
.obj-card.selected .oc-icon { background: var(--brand); border-color: var(--brand-ink); color: var(--accent); }
.obj-card .oc-icon svg { width: 22px; height: 22px; }
.obj-card .oc-label { font-weight: 500; font-size: 14.5px; color: var(--brand-ink); }
.obj-card .oc-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ---------- 3B.1 picker: sidebar + carded functions (2026-09-03) ---------- */
.pk-split { display: grid; grid-template-columns: 225px 1fr; margin-top: 4px; }
.pk-side { border-right: 1px solid var(--border); padding: 4px 12px 4px 0; }
.pk-kick {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent-ink, #058cab); margin: 14px 0 6px;
}
.pk-kick:first-child { margin-top: 2px; }
.pk-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  font: inherit; font-size: 13px; color: var(--text); background: none; border: none;
  border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
  padding: 7px 10px; cursor: pointer;
}
.pk-item svg { width: 16px; height: 16px; flex: none; }
.pk-item .pk-n { margin-left: auto; font-size: 11px; color: var(--muted); }
.pk-item:hover { background: var(--surface-2); }
.pk-item.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--brand-ink); font-weight: 500; }
.pk-main { padding: 4px 0 4px 20px; min-width: 0; }
.pk-title { margin: 0 0 2px; font-size: 16.5px; font-weight: 500; color: var(--brand-ink); }
.pk-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.pk-searchrow { margin-bottom: 12px; }
.pk-search {
  width: 100%; max-width: 330px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong, #bdbdbd);
  border-radius: var(--radius); padding: 8px 12px;
}
.pk-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
/* Cards: keep the .obj-card idiom but stack head/description vertically. */
.pk-cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pk-cards .obj-card { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 13px; }
.pk-cards .oc-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pk-cards .oc-icon { width: 30px; height: 30px; }
.pk-cards .oc-icon svg { width: 18px; height: 18px; }
.pk-cards .oc-label { font-size: 13px; line-height: 1.25; }
.pk-cards .oc-desc { font-size: 11.5px; line-height: 1.45; }
/* Quiet capability pills - same chip family, only the ink differs. */
.pk-pill {
  margin-left: auto; flex: none; font-size: 9.5px; font-weight: 500; letter-spacing: .5px;
  text-transform: uppercase; border-radius: 999px; padding: 2px 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.pk-pill.cu { background: var(--success-soft); border-color: color-mix(in srgb, var(--success-ink) 30%, var(--border)); color: var(--success-ink); }
/* Template-defined function (2026-09-14): a clear "Custom" mark, shown first in its area. */
.pk-pill.custom { margin-left: 8px; background: var(--accent-soft, #e1f7fc); border-color: var(--accent); color: var(--accent-ink, #058cab); }
.obj-card.custom { border-color: var(--accent); }
/* Filtered export panel (2026-09-14). */
.export-panel { margin: 10px 0 12px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); scroll-margin-bottom: 96px; scroll-margin-top: 90px; }
.export-panel .ep-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.export-panel .ep-head b { font-size: 13px; }
.export-panel .ep-head .muted { font-size: 12px; }
.export-panel .ep-row { display: grid; grid-template-columns: minmax(160px, 1.4fr) 130px minmax(140px, 1fr) minmax(140px, 1fr) 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.export-panel .ep-row select, .export-panel .ep-row input { font: inherit; font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); min-width: 0; }
.export-panel .ep-row .ep-x { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; height: 28px; cursor: pointer; }
.export-panel .ep-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.export-panel .ep-actions > * { min-width: 0; }
.export-panel .ep-actions .spacer { flex: 1; }
.export-panel #exportMsg.err { color: var(--danger-ink, #c62828); }
.export-panel .ep-len { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.export-panel .ep-len.over { color: var(--danger-ink, #c62828); font-weight: 600; }
.pk-empty { font-size: 12.5px; color: var(--muted); }
/* The open function's name: the strongest thing on the panel (user's call 2026-09-26, option B4). */
.pk-where { font-size: 24px; font-weight: 600; color: var(--brand-ink); line-height: 1.2; }
/* Compact work view: one header row, hints on one line (16-inch fit). The row is its own
   band above the field-set card and the drop zone (a thin rule underneath). */
.wv-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.wv-top .spacer { flex: 1; }
.wv-top .pk-pill { margin-left: 0; }
.wv-back { display: inline-flex; align-items: center; gap: 6px; }
.wv-back svg { width: 15px; height: 15px; }
.wv-meta { font-size: 12.5px; }
.dropzone .dz-grp { font-size: 12.5px; color: var(--muted); margin: 6px auto 0; max-width: 92ch; }
.dropzone .dz-grp b { color: var(--text); font-weight: 500; }
.wv-hints { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.wv-hints .template-hint { margin-top: 0; }
.wv-hints .spacer { flex: 1; }
@media (max-width: 720px) {
  .pk-split { grid-template-columns: 1fr; }
  .pk-side { border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 10px; }
  .pk-main { padding-left: 0; }
}

/* ---------- Template setup ---------- */
.btn-sm { font-size: 11px; padding: 7px 14px; }
.setup-bar { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.setup-bar #templateSummary { flex: 1; font-size: 12.5px; }
/* Panel headers carry the Back button as the FIRST element, top-left
   (user-approved rule, 2026-09-04) - the work-view/Activity pattern. */
.setup-head { margin-bottom: 6px; display: flex; align-items: flex-start; gap: 12px; }
.panel-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; flex: none; }
.panel-back svg { width: 14px; height: 14px; }
.setup-toolbar { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.setup-meta { font-size: 12.5px; color: var(--muted); }
.setup-section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--brand-ink); font-weight: 700; margin: 24px 0 2px; }
.setup-section-p { font-size: 12.5px; margin: 0 0 12px; }
.setup-additional-head { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.setup-additional-head .setup-section-h { margin: 0; flex: 0 0 auto; }
.field-search { max-width: 260px; margin-left: auto; }
.field-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-height: 340px; overflow-y: auto; }
.field-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: var(--surface); }
.field-row:hover { background: var(--surface-2); }
.field-row .fr-main { flex: 1; min-width: 0; }
.field-row .fr-label { font-size: 13.5px; font-weight: 500; }
.field-row .fr-meta { font-size: 11.5px; color: var(--muted); }
.field-row .fr-x3 { font-family: var(--mono); font-size: 10.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: var(--radius); }
.field-row .fr-max { color: var(--faint); font-size: 11px; white-space: nowrap; }
/* List fields (2026-09-14): a chip opens the allowed values. */
.field-row .fr-pop { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.field-row .fr-list { font: inherit; font-size: 10.5px; color: var(--accent-ink, #058cab); background: var(--surface); border: 1px solid var(--accent); border-radius: 999px; padding: 0 8px; line-height: 16px; cursor: pointer; }
.field-row .fr-menu { position: absolute; top: 20px; left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: 6px; min-width: 260px; max-height: 320px; overflow: auto; text-align: left; }
.field-row .fr-menu .h { font-size: 10.5px; color: var(--muted); padding: 4px 8px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; white-space: normal; }
.field-row .fr-menu .it { display: flex; gap: 10px; align-items: center; padding: 5px 8px; font-size: 12.5px; color: var(--text); border-radius: 6px; white-space: nowrap; }
.field-row .fr-menu .it b { font-family: var(--mono); font-weight: 500; color: var(--text); min-width: 18px; text-align: right; }
.field-row .fr-menu .it .or { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; }
.field-row .fr-menu .it.def { background: var(--surface-2); }
.field-row .fr-menu .it.def::after { content: "default"; margin-left: auto; font-size: 10px; color: var(--accent-ink, #058cab); padding-left: 12px; }
.field-row.locked { opacity: .7; }
/* Drag & drop reordering of the standard grid - the WHOLE row drags
   (mousedown anywhere except the toggle / help button), grip is the cue. */
#standardList .field-row { cursor: grab; user-select: none; }
#standardList .field-row:active { cursor: grabbing; }
.field-row .drag-grip {
  cursor: grab; color: var(--faint); font-size: 13px; line-height: 1;
  padding: 4px 2px; margin-left: -4px; user-select: none; flex: 0 0 auto;
}
.field-row .drag-grip:hover { color: var(--muted); }
.field-row.dragging { opacity: .45; }
.field-row.drop-above { box-shadow: inset 0 2px 0 0 var(--accent-ink); }
.field-row.drop-below { box-shadow: inset 0 -2px 0 0 var(--accent-ink); }
.field-row .lock-note { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .3px; }
.field-empty { padding: 18px 14px; font-size: 13px; color: var(--muted); background: var(--surface); text-align: center; }
/* compact toggle used in field rows */
.tgl { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .18s; flex: 0 0 auto; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .18s; }
.tgl:checked { background: var(--accent); }
.tgl:checked::after { transform: translateX(16px); }
/* Disabled toggles: green only when locked ON (required fields). Locked OFF
   (field not added / will be removed) shows the neutral grey - green there
   read as "active" and misled. */
.tgl:disabled { cursor: not-allowed; background: var(--success); }
.tgl:disabled:not(:checked) { background: var(--border-strong); }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 26px 24px 20px; text-align: center; cursor: pointer;
  transition: all .18s; background: var(--surface-2); margin-top: 16px;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }
.dropzone .dz-icon {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--brand); display: grid; place-items: center; color: var(--accent);
  box-shadow: var(--shadow-1);
}
.dropzone .dz-icon svg { width: 24px; height: 24px; }
.dropzone .dz-title { font-weight: 500; font-size: 15px; color: var(--brand-ink); }
.dropzone .dz-hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dropzone .browse { color: var(--accent-ink); font-weight: 500; text-decoration: underline; }

.filecard {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; background: var(--surface-2);
}
.filecard .fc-icon { width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: 0 0 auto; }
.filecard .fc-meta { flex: 1; min-width: 0; }
.filecard .fc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .fc-stats { color: var(--muted); font-size: 12.5px; }
/* "Imported before" (2026-09-14): amber chip on the file name, list on demand. */
.chip-seen { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; vertical-align: middle; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .2px; border: none; border-radius: 999px; padding: 2px 10px; background: var(--warn-soft); color: var(--warn-ink); cursor: pointer; }
.chip-seen:hover { filter: brightness(1.08); }
/* Returned failed-rows file (2026-09-29): where the rows came from + "Use <set>". */
.returned-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 12px; background: var(--accent-soft); }
.returned-notice.warn { background: var(--warn-soft); color: var(--warn-ink); }
.seen-list { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius); border-left: 4px solid var(--warn); background: var(--warn-soft); color: var(--warn-ink); }
.seen-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.seen-table th { text-align: left; font-weight: 600; font-size: 11.5px; padding: 4px 8px; border-bottom: 1px solid rgba(0,0,0,.12); }
.seen-table td { padding: 5px 8px; border-bottom: 1px solid rgba(0,0,0,.08); }
.seen-table .btn-link { color: inherit; text-decoration: underline; }
.seen-list p.muted { margin: 8px 0 0; font-size: 12px; color: inherit; opacity: .85; }
.filecard select { max-width: 200px; }
.filecard .fc-remove { flex: 0 0 auto; width: 30px; height: 30px; border: none; border-radius: var(--radius); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.filecard .fc-remove svg { width: 16px; height: 16px; }
.filecard .fc-remove:hover { background: var(--accent-soft); color: var(--accent-ink); }

input#exampleNum { padding: 6px 32px 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 13px; width: 220px; }
#exampleBtn { vertical-align: middle; }
.template-hint .notice { margin-top: 8px; }
/* Document search in the work view's TOP row: the magnifier's dropdown opens
 * DOWNWARD over the dropzone (the reason it moved up), anchored to the right
 * edge so it never overflows the panel. */
.wv-doc { display: inline-flex; align-items: center; gap: 8px; }
.wv-doc .recent-list { left: auto; right: 0; }

/* Document search: magnifier inside the field + recent-documents dropdown. */
.doc-search { position: relative; display: inline-block; margin: 0 4px; vertical-align: middle; }
.doc-search-btn {
  position: absolute; top: 1px; right: 1px; bottom: 1px;
  width: 30px; border: none; border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.doc-search-btn svg { width: 15px; height: 15px; }
.doc-search-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.recent-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 100%; width: max-content; max-width: 480px; max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(6, 52, 60, 0.14);
}
.recent-list .rl-info { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }
.recent-item { display: block; width: 100%; padding: 8px 12px; border: none; background: none; font: inherit; text-align: left; cursor: pointer; }
.recent-item + .recent-item { border-top: 1px solid var(--border); }
.recent-item:hover { background: var(--accent-soft); }
.recent-item .ri-num { font-weight: 600; font-size: 13px; color: var(--text); }
.recent-item .ri-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }

.template-hint { margin-top: 16px; font-size: 13px; color: var(--muted); }
.template-hint a { color: var(--accent-ink); font-weight: 500; cursor: pointer; text-decoration: none; }
.template-hint a:hover { text-decoration: underline; }

/* ---------- Mapping ---------- */
.map-section-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--faint); font-weight: 500; margin: 18px 0 8px;
}
.map-section-title:first-child { margin-top: 0; }
.map-grid { display: flex; flex-direction: column; gap: 8px; }
.map-row {
  display: grid; grid-template-columns: 1fr 22px 1.1fr; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.map-row.missing { border-color: var(--danger); background: var(--danger-soft); }
.map-row .target { min-width: 0; }
.map-row .t-label { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.map-row .t-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.map-row .arrow { color: var(--faint); text-align: center; }
.map-row .source { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.map-row .sample { font-size: 11.5px; color: var(--faint); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-req {
  font-size: 10px; font-weight: 500; color: #fff; background: var(--danger);
  padding: 2px 6px; border-radius: 9px; letter-spacing: .32px; text-transform: uppercase;
}
/* Mandatory only for the countries whose X3 country record says so (POSOBL …) -
   deliberately softer than .badge-req: it is advice, not a gate. */
.badge-cond {
  font-size: 10px; font-weight: 500; color: var(--muted); background: var(--surface-2);
  border: 1px dashed var(--border); padding: 1px 6px; border-radius: 9px;
  letter-spacing: .32px; text-transform: uppercase; cursor: help;
}
.badge-x3 { font-size: 10.5px; font-family: var(--mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: var(--radius); }
.help {
  color: var(--faint); cursor: pointer; background: none; border: none;
  font-size: 13px; line-height: 1; padding: 0 2px; font-family: inherit;
}
.help:hover, .help:focus-visible { color: var(--accent-ink); }
.fr-label .help { margin-left: 5px; }

/* ---------- Field help popover ---------- */
.help-pop {
  position: fixed; z-index: 300; width: 330px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
  padding: 12px 14px; font-size: 13px; text-align: left;
}
.help-pop-title { font-weight: 600; font-size: 13.5px; color: var(--brand-ink); margin-bottom: 4px; }
.help-pop-text { margin: 0 0 9px; color: var(--text); font-weight: 400; line-height: 1.5; }
.help-pop-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-items: baseline; }
.help-fact-k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.help-fact-v { color: var(--text); font-size: 12.5px; font-weight: 400; }

/* ---------- Form controls ---------- */
select, input[type="text"] {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 8px 11px; transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
select:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(7, 190, 227, 0.18); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px;
  background: var(--surface-2); border-bottom: 2px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(7, 190, 227, 0.04); }
tbody tr.row-error { background: var(--danger-soft); }
tbody tr.row-warn { background: var(--warn-soft); }
/* Review (2026-09-14): a row held back by a sibling's error - amber, the red stays on the culprit row. */
tbody tr.row-held { background: var(--warn-soft); }
td.held-note { color: var(--warn-ink); }
td.cell-error { color: var(--danger-ink); font-weight: 500; }
/* Transcoded value (2026-10-21): the file's code was swapped by a transcoding table - the tooltip says from what. */
td.cell-transcoded { color: var(--accent-ink); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.rownum { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- Pills & stats ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 500;
  padding: 2px 9px; border-radius: 9px; text-transform: uppercase; letter-spacing: .32px; color: #fff;
}
.pill.ok { background: var(--success-strong); }
.pill.upd { background: var(--accent-strong); }
.pill.val { background: var(--muted); }
.progress .seg.s-ok.s-val { background: var(--muted); }
.pill.skip { background: var(--warn); }
.pill.fail { background: var(--danger); }
.pill.pending { background: var(--faint); }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  flex: 1 1 120px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: var(--radius); padding: 12px 16px; background: var(--surface);
}
.stat .n { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.stat .k { font-size: 12px; color: var(--muted); }
.stat.ok { border-left-color: var(--success); }
.stat.ok .n { color: var(--success-ink); }
.stat.skip { border-left-color: var(--warn); }
.stat.skip .n { color: var(--warn-ink); }
.stat.fail { border-left-color: var(--danger); }
.stat.fail .n { color: var(--danger-ink); }
.stat.upd { border-left-color: var(--accent); }
.stat.upd .n { color: var(--accent-ink); }

/* ---------- Options row ---------- */
.options { display: flex; gap: 20px; flex-wrap: wrap; margin: 16px 0 4px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input { appearance: none; width: 38px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .18s; flex: 0 0 auto; }
.check input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .18s; }
.check input:checked { background: var(--accent); }
.check input:checked::after { transform: translateX(18px); }

/* ---------- Progress ---------- */
.progress { position: relative; height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 6px 0 18px; }
.progress .bar { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .25s ease; }
.progress.done .bar { background: var(--success); }
/* Working: a sliding glint over the (possibly still empty) bar, so a slow
   first SOAP response never reads as a frozen screen. */
.progress.working::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 45% 100%; background-repeat: no-repeat; opacity: 0.45;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide { from { background-position: -45% 0; } to { background-position: 145% 0; } }

.run-status { display: flex; align-items: center; gap: 10px; margin: -8px 0 16px; color: var(--muted); font-size: 13.5px; }
.run-status > * { min-width: 0; }
.spinner {
  width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 500; border-left: 4px solid transparent; }
.result-banner.ok { background: var(--success-soft); color: var(--success-ink); border-left-color: var(--success); }
.result-banner.warn { background: var(--warn-soft); color: var(--warn-ink); border-left-color: var(--warn); }
/* "What next" tip under the result line (e.g. products → product-sites). */
.result-banner .rb-hint { flex-basis: 100%; margin-top: 6px; font-size: 12.5px; opacity: 0.85; }
.result-banner .rb-icon { width: 30px; height: 30px; display: grid; place-items: center; }

/* ---------- Buttons / footer nav ---------- */
.nav { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.nav .spacer { flex: 1; }
/* Wizard steps + template setup: the nav is a bar fixed to the bottom of the
   WINDOW, so the primary button is always in the same spot - a repeat import
   (and Save template under a 150-field list) is click, click, click without
   scrolling. The Settings panel keeps the in-flow nav. The horizontal padding
   centres the row on the same 1040px column as .app (and clears the left rail
   when narrow). */
#panel-1 .nav, #panel-2 .nav, #panel-3 .nav, #panel-4 .nav, #panel-setup .nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
  padding: 12px max(24px, calc((100vw - 1040px) / 2));
  padding-left: max(calc(var(--rail-w) + 24px), calc((100vw - 1040px) / 2));
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
}
@media (min-width: 1240px) {
  #panel-1 .nav, #panel-2 .nav, #panel-3 .nav, #panel-4 .nav, #panel-setup .nav {
    padding-left: max(24px, calc((100vw - 1040px) / 2));
  }
}
.btn {
  font: inherit; font-size: 12.5px; font-weight: 500; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: 0.75px;
  padding: 10px 20px; cursor: pointer; border: 1px solid transparent; transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--accent-strong); box-shadow: var(--shadow-btn); }
.btn-primary:not(:disabled):hover { background: var(--accent-strong-hover); }
/* Dark theme: the deep teal sits close to the page, a cyan outline keeps the button's edge visible. */
:root[data-theme="dark"] .btn-primary { border-color: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:not(:disabled):hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-danger-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--danger-ink); }
/* The final create action matches the suite's green material Save button -
   the same green wherever an import is started (the one-click import after a
   dry run included, user decision 2026-09-14). */
#startImport, #importNow.btn-primary { background: var(--success-strong); }
#startImport:not(:disabled):hover, #importNow.btn-primary:not(:disabled):hover { background: var(--success-strong-hover); }
:root[data-theme="dark"] #startImport, :root[data-theme="dark"] #importNow.btn-primary { border-color: var(--success-ink); }

.notice { padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px; margin-top: 14px; border-left: 4px solid transparent; }
.notice.err { background: var(--danger-soft); color: var(--danger-ink); border-left-color: var(--danger); }
.notice.info { background: var(--accent-soft); color: var(--brand-ink); border-left-color: var(--accent); }
.notice.ok { background: var(--success-soft); color: var(--success-ink); border-left-color: var(--success); }
/* Amber = read before you act (a field will be removed, the template changed
   in X3); red stays for refusals. The card shape: title, one line per change,
   the next step as a quieter footer. */
.notice.warn { background: var(--warn-soft); color: var(--warn-ink); border-left-color: var(--warn); }
.notice .nt-title { font-weight: 600; margin-bottom: 4px; }
.notice ul.nt-list { margin: 4px 0 0; padding-left: 18px; }
.notice ul.nt-list li { margin: 2px 0; }
.notice .nt-foot { margin-top: 8px; font-size: 12.5px; opacity: .85; }

.log-wrap { max-height: 340px; overflow-y: auto; }
.muted { color: var(--muted); }
/* Settings panel - administrator section (2026-09-14). */
/* Settings → Your sign-in (2026-10-28). */
.signin-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.signin-label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.signin-area { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.signin-area input { font: inherit; font-size: 13px; min-width: 200px; }
.signin-qr { width: 150px; height: 150px; background: #fff; border-radius: 6px; flex: none; }
.signin-qr svg { width: 100%; height: 100%; }
.signin-tag { font-size: 11px; font-weight: 400; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.signin-tag.on { background: var(--success-soft); color: var(--success-ink); }
.signin-warn { margin: 8px 0 0; padding: 7px 10px; border-radius: 6px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12.5px; }
.signin-msg { margin: 8px 0 0; font-size: 12.5px; } .signin-msg.ok { color: var(--success-ink); } .signin-msg.err { color: var(--danger-ink); }
.signin-codes pre { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 8px 12px; border-radius: 6px; display: inline-block; }
@media (max-width: 700px) { .signin-row { grid-template-columns: 1fr; } }
.settings-admin { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--border); }
.settings-admin h3 { margin: 0 0 2px; font-size: 15px; font-weight: 500; color: var(--brand-ink); }
.settings-admin > .sub { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.codecell { white-space: nowrap; }
.codecell b { letter-spacing: 0.02em; }
/* "Open in Sage X3" (2026-09-14): a created/updated document number links to its record. */
.codecell a.codelink { color: var(--accent-ink); text-decoration: none; border-bottom: 1px dotted currentColor; }
.codecell a.codelink:hover { border-bottom-style: solid; }

/* Sign-in screen - the app's own design language: a standard panel card
   centered on the app background, accent-teal primary action. */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.login-card {
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-btn);
  padding: 32px 36px 36px;
  color: var(--text);
}
.login-title { font-size: 20px; font-weight: 700; color: var(--brand-ink); text-align: center; }
.login-app { margin: 6px 0 14px; color: var(--muted); font-size: 13px; text-align: center; }
/* Who runs this site (2026-11-02): owner line above the title, invitation line under the form, page footer. */
.login-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.login-brand i { width: 18px; height: 18px; border-radius: 5px; background: var(--brand-ink); position: relative; flex: none; }
.login-brand i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--accent); }
.login-invite { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 20px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); background: var(--surface-2); }
.login-foot b { color: var(--text); font-weight: 500; }
.login-foot a { color: var(--accent-ink); text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }
@media (max-height: 640px) { .login-foot { position: static; margin-top: 16px; } .login-overlay { flex-direction: column; overflow: auto; padding: 16px 0 0; } }
/* Public plain pages (privacy.html, 2026-11-02): one readable column, no app chrome. */
body.plain-page { margin: 0; background: var(--bg); color: var(--text); }
.plain-card { max-width: 720px; margin: 32px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 36px 32px; font-size: 14px; line-height: 1.6; }
.plain-card h1 { font-size: 20px; font-weight: 700; color: var(--brand-ink); margin: 0 0 12px; text-align: center; }
.plain-card h2 { font-size: 14px; font-weight: 600; color: var(--brand-ink); margin: 20px 0 6px; }
.plain-card p, .plain-card ul { margin: 0 0 10px; }
.plain-card a { color: var(--accent-ink); }
@media (max-width: 720px) { .plain-card { margin: 0; border-radius: 0; padding: 20px 16px 24px; } }
/* App version under the sign-in card (2026-10-07) - empty until /api/version answers. */
.login-version { margin-top: 16px; color: var(--muted); font-size: 11px; text-align: center; min-height: 14px; }
.login-label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(7, 190, 227, 0.18);
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.login-btn {
  width: 100%;
  margin-top: 24px;
  padding: 12px 20px;
  background: var(--accent-strong);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
}
.login-btn:not(:disabled):hover { background: var(--accent-strong-hover); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
/* Sign in with Microsoft (2026-09-25): a secondary button under an "or" rule. */
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.75px;
}
.login-or::before,
.login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
a.login-btn.login-btn-ms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  margin-top: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
}
a.login-btn.login-btn-ms:hover { background: var(--surface-2, #f4f6f8); color: var(--text); }
.login-back {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--accent-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.login-card .notice { margin-top: 16px; }
/* E-mail first + code step (2026-10-27, mockups A + C) and the invitation page (mockup B). */
.login-who { margin: 14px 0 0; font-size: 13px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.login-link { background: none; border: none; padding: 0; color: var(--accent-ink); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.login-forgot { display: block; margin: 14px auto 0; }
.login-hint { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.login-step-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 0; }
.login-card input.login-code { font-family: var(--mono); font-size: 18px; letter-spacing: 4px; text-align: center; }
.login-steps { display: flex; gap: 6px; margin: 16px 0 4px; }
.login-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.login-steps span.on { background: var(--accent); }
/* "or" between Microsoft and the e-mail box (2026-10-28, option A). */
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
a.login-btn-ms { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; }
/* "View as" banner (2026-10-28, option 3A) - every signed-in page, from session-guard.js. */
.viewas-banner { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--warn-soft); color: var(--warn-ink); border-bottom: 1px solid var(--warn-ink); font-size: 13px; }
/* The importer's fixed side rail starts under the banner. */
body.viewing-as nav.rail { top: var(--viewas-h, 44px); height: calc(100% - var(--viewas-h, 44px)); }
.viewas-banner button { font: inherit; font-size: 12.5px; padding: 3px 12px; border-radius: 6px; border: 1px solid var(--warn-ink); background: transparent; color: var(--warn-ink); cursor: pointer; }
.login-btn.login-btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.login-btn.login-btn-ghost:not(:disabled):hover { background: var(--surface-2); color: var(--text); }
.invite-auth { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.invite-qr { width: 148px; height: 148px; flex: none; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; box-sizing: border-box; }
.invite-qr svg { width: 100%; height: 100%; display: block; }
.invite-key { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text); background: var(--surface-2); border-radius: var(--radius); padding: 6px 8px; margin-top: 6px; }
.invite-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--mono); font-size: 13.5px; }
.invite-actions { display: flex; gap: 8px; margin-top: 10px; }
.invite-actions .login-btn { margin-top: 0; }
@media (max-width: 480px) { .invite-auth { flex-direction: column; align-items: stretch; } .invite-qr { align-self: center; } }

/* Header user chip */
.user-chip { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; margin-right: 16px; }
/* "service" tag beside the fallback identity's name. */
.svc-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 2px 7px; border-radius: 999px; margin-left: 4px;
  background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.75);
}
.user-action, .btn-link.user-action { color: #fff; }
.user-action:hover { text-decoration: underline; }
button#signInBtn { margin-right: 16px; }

/* Refresh buttons share one size (the template one now lives in the left card, full width). */
.btn-refresh { min-width: 215px; justify-content: center; }
.setup-side .ws-tpl input { font-family: var(--mono); text-align: center; }

/* Template-refresh preview states in the standard fields grid */
.field-row.will-remove { background: var(--danger-soft); }
.field-row.not-added { background: var(--surface-2); opacity: 0.65; }
.badge-muted {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-new,
.badge-removed {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-new { background: var(--accent-soft); color: var(--accent-ink); }
.badge-removed { background: var(--danger-soft); color: var(--danger-ink); }

/* Restored-mapping notice at the top of the mapping grid */
.map-restore-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-ink);
  font-size: 13px;
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

/* Highlighted object badge on the Review step */
.obj-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  vertical-align: baseline;
}

/* Global settings panel (full-page view, like the template setup) */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row label { display: flex; flex-direction: column; gap: 2px; max-width: 560px; }
.settings-row label .muted { font-size: 12px; }
.settings-row select { width: 300px; }
.settings-row input[type="checkbox"] { width: 18px; height: 18px; }

/* Document separators in the Review table (grouped objects) */
.doc-sep td {
  background: var(--bg);
  border-top: 1px solid var(--border-strong);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
}
/* Review table: cells WRAP so the table always fits the panel width - no
   horizontal scrollbar at all. Long values fold inside their column instead
   of widening the table (the preview shows a curated subset of columns, so
   the fit is comfortable). Row tints paint plainly - no sticky columns, no
   scroll container beyond the page itself. */
#previewTable tbody td { white-space: normal; overflow-wrap: break-word; }
/* The Issues column must stay readable (2026-09-27): the panel is 990 px
   wide, and nowrap headers ("ACCOUNTING DATE") used to set a floor under
   every data column that squeezed Issues to ~90 px - a hold folded into
   twenty lines. Review headers wrap like their cells, and Issues keeps a
   floor; when the sum still overflows, the wrapper scrolls sideways. */
/* Headers wrap at spaces only (2026-11-04, option A): the body's overflow-wrap: anywhere split them
   mid-word ("CATE / GORY"); a column is at least its longest header word wide, and when the columns
   (Administration can add more) still don't fit, the wrapper scrolls sideways. */
#previewTable thead th { white-space: normal; overflow-wrap: normal; padding-left: 10px; padding-right: 10px; }
#previewTable tbody td { padding-left: 10px; padding-right: 10px; }
#previewTable thead th:last-child, #previewTable tbody td:last-child { min-width: 230px; }
#previewTable tbody tr.doc-gap td, #previewTable tbody tr.diff-detail td, #previewTable tbody tr.issue-detail td { min-width: 0; }
/* Rows that will UPDATE an existing record (updatesExisting routes, e.g.
   GESBPS2): accent tint + an UPDATE badge - visually distinct from both the
   error red (held back) and the warning amber. */
#previewTable tbody tr.row-update { background: var(--accent-soft); }
.upd-badge {
  display: inline-block; margin-right: 6px; padding: 1px 7px;
  font-size: 10px; font-weight: 600; letter-spacing: .32px; text-transform: uppercase;
  color: #fff; background: var(--accent-strong); border-radius: 999px; white-space: nowrap;
}

/* Minimal grouping in the Review table: a slim gap around multi-line
   documents, an accent stripe on their rows, and a numbered "grp N" badge -
   a group's rows can sit far apart in the file, so the badge is what ties
   them together (hover it for the full row list). */
.doc-gap td { padding: 0; height: 10px; background: var(--bg); border-bottom: none; }
#previewTable tr.grp-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Option B1 (2026-09-26): the document's first row carries a named badge
   ("Sales invoice 1 · 3 lines") with a hover card; the other rows say
   "line 2 of 3"; a mouse anywhere on the document tints all its rows. */
.grp-badge {
  position: relative; display: inline-block; margin-left: 7px; padding: 1px 8px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 999px; cursor: help;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.grp-line { margin-left: 7px; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
#previewTable tbody tr.doc-hover td { background: rgba(7, 190, 227, 0.12); }
.grp-card { position: absolute; left: 100%; top: 50%; width: 0; height: 0; }
.grp-card::after {
  content: attr(data-tip); position: absolute; left: 12px; top: -14px; z-index: 6; width: 300px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45;
  padding: 9px 12px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  letter-spacing: 0; text-transform: none; white-space: normal; text-align: left;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.grp-card::before {
  content: ""; position: absolute; left: 0; top: -6px; border: 6px solid transparent; border-right-color: var(--brand);
  opacity: 0; transition: opacity 0.15s;
}
.grp-card.open::after, .grp-card.open::before, .grp-badge:hover .grp-card::after, .grp-badge:hover .grp-card::before { opacity: 1; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 26px; }
:root:not([data-theme]) .foot, :root[data-theme="light"] .foot { color: #6e6e6e; }
:root[data-theme="comfort"] .foot { color: #625b4f; }

@media (max-width: 900px) {
  .app-header .app-name small { display: none; }
}
@media (max-width: 720px) {
  /* Phones (2026-09-25): the rail becomes a bottom bar instead of vanishing -
     Activity, Settings and Administration stay reachable; the folder pill and
     the app name make room for the user's name. */
  .rail {
    top: auto; bottom: 0; left: 0; right: 0;
    width: auto; height: 56px;
    flex-direction: row; justify-content: space-around; align-items: center;
    padding: 0 8px; gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }
  .rail .spacer, .rail .rail-spacer, .rail hr, .rail .rail-toggle { display: none; }
  .app { padding-left: 24px; padding-bottom: 72px; }
  .app-header { padding-left: 20px; }
  .app-header .logo-img { height: 24px; }
  .app-header .app-divider, .app-header .app-name, .app-header .conn { display: none; }
  .user-chip { margin-right: 8px; min-width: 0; }
  .user-chip b { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
  .step .label { display: none; }
  .map-row { grid-template-columns: 1fr; gap: 8px; }
  .map-row .arrow { display: none; }
}

/* Review step: analysis / reference-check progress + the grid pager. */
.preview-loading {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); padding: 10px 2px;
}
.preview-loading-row td {
  text-align: center; color: var(--muted); font-size: 12.5px; padding: 14px 10px;
}
.preview-loading-row .spinner { display: inline-block; vertical-align: -3px; margin-right: 6px; }
#previewMore { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager-btn { font-size: 12.5px; padding: 4px 12px; }
.pager-label { font-size: 12.5px; color: var(--muted); }

/* ---------- First-run guided tour (tour.js, user-approved 2026-09-04) ----
   Three real-screen stops + a canned practice import. The spotlight ring's
   huge box-shadow dims everything else; all layers ignore clicks except the
   tip, skip and done cards. Status colors reuse the validated Activity
   palette. */
#tourRoot.hidden { display: none; }
.tour-spot {
  position: fixed; z-index: 950; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(9, 26, 32, 0.62);
  transition: all 0.3s ease;
}
.tour-tip {
  position: fixed; z-index: 960; width: 292px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  transition: all 0.3s ease;
}
.tour-tip .t-k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.tour-tip h3 { margin: 3px 0 5px; font-size: 14.5px; color: var(--text); }
.tour-tip p { margin: 0 0 11px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tour-tip .t-row { display: flex; align-items: center; gap: 8px; }
.t-dots { display: flex; gap: 4px; margin-right: auto; }
.t-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.t-dots span.on { background: var(--accent); }
.tour-skip {
  /* Below the header bar, so it never sits on the folder pill at narrow widths (2026-09-25). */
  position: fixed; top: 64px; right: 16px; z-index: 960;
  font: inherit; font-size: 12px; color: var(--brand-ink); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-btn);
}
.tour-skip:hover { text-decoration: underline; }
/* Map step: which file columns are still unmapped, and how many required fields are missing (2026-09-25). */
.map-summary { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.map-summary b { font-weight: 600; }
.map-summary .ms-cols { color: var(--muted); }
.map-summary.ms-missing { border-left: 3px solid var(--danger); }
/* Results: long X3 messages wrap instead of scrolling sideways (2026-09-25). */
#logTable td:last-child { white-space: normal; overflow-wrap: anywhere; min-width: 320px; }
.tour-done {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 970;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 12px;
  padding: 20px 26px; text-align: center; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28); max-width: 380px;
}
.tour-done h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.tour-done p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.tour-done.hidden { display: none; }
/* The canned practice-import panel, centered over the app. */
.tour-scenebox {
  position: fixed; z-index: 940; left: 50%; top: 50%; transform: translate(-50%, -52%);
  width: min(720px, calc(100vw - 60px)); max-height: calc(100vh - 80px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 20px 18px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}
.tour-scenebox.hidden { display: none; }
.tour-scenebox { --t-ok: #2e7d32; --t-upd: #0570a6; --t-held: #c08a15; }
.t-steps { display: flex; gap: 8px; margin-bottom: 14px; }
.t-steps span { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; font-size: 11.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.t-steps span b { width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2, var(--border)); display: grid; place-items: center; font-size: 9.5px; color: var(--muted); flex: none; }
.t-steps span.on { border-color: var(--accent); color: var(--text); }
.t-steps span.on b { background: var(--accent-strong); color: #fff; }
.t-steps span.done b { background: var(--t-ok, #2e7d32); color: #fff; }
.t-lead { font-size: 14.5px; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.t-drop { border: 2px dashed var(--border); border-radius: 12px; padding: 18px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.t-file { display: inline-block; background: var(--accent-soft, #e1f7fc); color: var(--accent); border-radius: 9px; padding: 7px 15px; font-size: 12px; margin-top: 10px; }
.t-csv { margin: 12px auto 0; max-width: 540px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; font-size: 10.5px; text-align: left; }
.t-csv table, .t-tab table { border-collapse: collapse; width: 100%; }
.t-csv th, .t-tab th { background: var(--surface-2, transparent); color: var(--muted); font-weight: 600; padding: 5px 9px; text-align: left; }
.t-csv td, .t-tab td { padding: 5px 9px; border-top: 1px solid var(--border); color: var(--text); }
.t-tab { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 12px; }
.t-ok { color: var(--t-ok, #2e7d32); font-weight: 600; }
.t-mut { color: var(--muted); font-style: italic; }
.t-plan { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.t-tile { border: 1px solid var(--border); border-radius: 9px; padding: 6px 13px; font-size: 11.5px; color: var(--muted); }
.t-tile b { display: block; font-size: 15px; }
.t-tile.t-c b { color: var(--t-ok); }
.t-tile.t-u b { color: var(--t-upd); }
.t-tile.t-h b { color: var(--t-held); }
.t-b { display: inline-block; border-radius: 9px; padding: 1px 9px; font-size: 10.5px; font-weight: 600; }
.t-b.t-c { background: rgba(46, 125, 50, 0.14); color: var(--t-ok); }
.t-b.t-u { background: rgba(5, 112, 166, 0.14); color: var(--t-upd); }
.t-b.t-h { background: rgba(192, 138, 21, 0.16); color: var(--t-held); }
.t-practice { margin-top: 10px; border: 1px dashed var(--t-held); color: var(--t-held); border-radius: 9px; padding: 7px 12px; font-size: 12px; background: rgba(192, 138, 21, 0.07); }
/* Scenes added 2026-09-26: the Documents card, the field-set card, the Review's
   toggle and group marker, the results' action row - all canned lookalikes. */
.t-two { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.t-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text); }
.t-cap { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.t-input { border: 1px solid var(--border); border-radius: 7px; padding: 5px 9px; color: var(--muted); margin-bottom: 7px; }
.t-input span { color: var(--text); margin-left: 6px; }
.t-btn { display: block; text-align: center; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); margin-top: 6px; }
.t-btn-blue { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.t-btn-green { background: var(--t-ok); border-color: var(--t-ok); color: #fff; }
.t-note { margin-top: 9px; font-size: 11px; line-height: 1.4; border-radius: 7px; padding: 6px 9px; }
.t-okbox { background: rgba(46, 125, 50, 0.1); color: var(--t-ok); border-left: 3px solid var(--t-ok); }
.t-dim { opacity: 0.55; }
.t-sub { margin-top: 10px; font-size: 11.5px; }
.t-radio { padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; display: flex; justify-content: space-between; gap: 8px; }
.t-radio span { color: var(--muted); font-size: 11px; }
.t-radio.t-on { border-color: var(--accent); }
.t-pill { border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; font-size: 9.5px; text-transform: uppercase; }
.t-link { color: var(--accent); font-size: 11.5px; margin-top: 8px; }
.t-banner { background: rgba(46, 125, 50, 0.1); border-left: 3px solid var(--t-ok); color: var(--t-ok); padding: 8px 12px; border-radius: 7px; font-size: 12px; margin-bottom: 10px; }
.t-banner u { color: var(--accent); margin-left: 8px; }
.t-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); margin: 0 0 10px; }
.t-sw { width: 30px; height: 16px; border-radius: 8px; background: var(--accent); position: relative; display: inline-block; }
.t-sw::after { content: ""; position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.t-grp { display: inline-block; background: rgba(5, 112, 166, 0.14); color: var(--t-upd); border-radius: 999px; padding: 0 7px; font-size: 9.5px; font-weight: 600; margin-left: 4px; white-space: nowrap; }
.t-grpline { margin-left: 4px; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
/* The group stop shows the Review's hover state: the document's rows tinted, the card open. */
.t-grp { position: relative; }
/* Its own name (2026-11-04): it shared .t-card with the Documents / Field set panels and hid them (tour stops 4-5 empty). */
.t-hovercard { display: none; position: absolute; left: calc(100% + 12px); top: -8px; z-index: 6; width: 300px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 400; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); white-space: normal; text-align: left; letter-spacing: 0; }
.t-show-hover .t-hovercard { display: block; }
/* The canned tour panels and tip hold short words only: break inside a word only when it can't fit at all
   (the body's overflow-wrap: anywhere split "NE/XT", "FINI/SH", "Curre/ncy", "TEA/M"). */
.tour-tip, .tour-scenebox, .tour-done { overflow-wrap: break-word; }
.t-show-hover tr.t-doc td { background: rgba(7, 190, 227, 0.12); }
.t-chip { display: inline-block; border: 1px solid var(--border); border-radius: 8px; padding: 0 7px; font-size: 10px; color: var(--muted); margin-left: 4px; }
.t-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.t-actions .t-btn { flex: 1; margin-top: 0; }
/* "Take the tour" - quiet entry (option A, 2026-09-04): a small "?" circle
   beside the function search; the tooltip carries the explanation. */
.pk-searchrow { display: flex; align-items: center; gap: 8px; }
.pk-searchrow .pk-search { flex: 1; }
.pk-tour {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: color .15s, border-color .15s, box-shadow .15s;
}
.pk-tour:hover, .pk-tour:focus-visible {
  color: var(--accent-ink); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
/* Admin role (2026-09-04): non-admins view Configure fields read-only - the
   write controls disappear (CSS wins over per-render JS toggles) and the
   managed note shows. The server refuses the writes regardless. */
.setup-managed { display: none; font-size: 12.5px; margin: 12px 0 0; }
/* Field sets (2026-09-15): every user saves a personal set, so Save stays; Reset and the schema refresh are the administrator's. */
body.no-admin #setupReset,
body.no-admin #refreshSchema { display: none !important; }
/* Configure fields (user decisions 2026-09-15): the step-1 card on the left -
   FIELD SET rows (.ws-set, shared with step 1) with Team sets / My sets captions and
   hover actions, then the TEMPLATE box - the fields alone on the right. The panel
   keeps its centred 1040 px column. */
.setup-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px; margin-top: 8px; align-items: start; }
.setup-main { min-width: 0; }
.setup-side .ws-set { position: relative; }
.setup-side .ws-grp { display: flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--accent-ink, #058cab); margin: 8px 0 2px 2px; }
.setup-side .ws-grpn { margin-left: auto; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.setup-side .ss-act { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.setup-side .ws-set:hover .ss-act, .setup-side .ws-set.on .ss-act, .setup-side .ws-set:focus-within .ss-act { opacity: 1; }
.setup-side .ws-set:hover .ws-n, .setup-side .ws-set.on .ws-n { visibility: hidden; } /* the count yields to the actions */
.setup-side .ws-set:not(:hover):not(.on) .ss-act { opacity: 0; }
.setup-side .ss-btn { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 11px; cursor: pointer; }
.setup-side .ss-btn:hover { color: var(--accent-ink, #058cab); border-color: var(--accent); }
.setup-side .ss-menu { position: absolute; right: 6px; top: calc(100% - 2px); z-index: 20; min-width: 230px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; text-align: left; }
.setup-side .ss-mi { font: inherit; font-size: 12.5px; font-weight: 400; text-align: left; padding: 8px 12px; border: none; background: none; color: var(--text); cursor: pointer; }
.setup-side .ss-mi:hover { background: var(--accent-soft); }
.setup-side .ss-mi.danger { color: var(--danger-ink, #c62828); border-top: 1px solid var(--border); }
.setup-side .ss-empty { font-size: 12px; color: var(--muted); padding: 4px 8px; }
.setup-side .ss-plus { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--accent-ink, #058cab); background: none; border: none; padding: 6px 8px; cursor: pointer; text-align: left; }
.setup-side .ss-plus:hover { text-decoration: underline; }
.setup-side .sc-edit { display: flex; gap: 6px; align-items: center; width: 100%; }
.setup-side .sc-edit input { font: inherit; font-size: 13px; padding: 3px 8px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--text); flex: 1; min-width: 0; }
.setup-side .ws-set.editing .ws-name { flex: 1; overflow: visible; }
.setup-side .ws-set.editing .badge, .setup-side .ws-set.editing .ws-n, .setup-side .ws-set.editing .ss-act { display: none; }
.setup-side .sc-k { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.setup-side .ws-tpl { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.setup-side .ws-tpl .setup-meta { line-height: 1.4; }
.setup-side .ws-tpl input { font: inherit; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: 100%; box-sizing: border-box; text-transform: uppercase; }
.setup-side .ws-tpl .btn { width: 100%; justify-content: center; white-space: nowrap; }
.setup-set-tag { font-size: 12.5px; font-weight: 400; text-transform: none; letter-spacing: 0; }
/* The right column starts with the Standard fields header (user's call 2026-09-15:
   the two sentences above the grid are gone; one is now the ⓘ tooltip). */
.setup-first-head { margin-top: 0; margin-bottom: 8px; }
.sec-info { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 10px; font-weight: 600; display: grid; place-items: center; cursor: help; flex: none; }
.sec-info:hover, .sec-info:focus-visible { border-color: var(--accent); color: var(--accent-ink, #058cab); outline: none; }
/* The grid takes the room between the header and the fixed Continue bar; it never
   goes under 340 px and scrolls inside. */
.field-list-tall { max-height: max(340px, calc(100vh - 328px)); }
.setup-main .setup-toolbar { flex-wrap: wrap; row-gap: 8px; margin-top: 0; }
@media (max-width: 860px) { .setup-body { grid-template-columns: 1fr; } }
.field-row .fr-label .badge-gone { font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; border-radius: 999px; padding: 1px 7px; margin-left: 8px; background: var(--danger-soft); color: var(--danger-ink); }
.field-row .fr-label .badge-added { font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; border-radius: 999px; padding: 1px 7px; margin-left: 8px; background: var(--accent-soft); color: var(--accent-ink); }
/* Step 1 two-column work view (user decision 2026-09-15, "option 2"): the
   dropzone stretches on the left, the side card on the right holds the field
   set (radio list) and the document tools. */
.wv-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px; margin-top: 14px; align-items: stretch; }
.wv-main { display: flex; flex-direction: column; min-width: 0; }
.wv-main .dropzone { margin-top: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.wv-side { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wv-side h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600; }
.ws-sets { display: flex; flex-direction: column; gap: 2px; }
.ws-set { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: none; border-radius: 6px; background: transparent; font: inherit; font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer; width: 100%; }
.ws-set:hover { background: var(--surface); }
.ws-set.on { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); cursor: default; }
.ws-set i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--border-strong, #bdbdbd); flex: none; }
.ws-set.on i { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.ws-set .ws-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-set .ws-n { color: var(--muted); margin-left: auto; font-size: 11.5px; flex: none; }
.ws-set .badge { flex: none; font-size: 9.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; border-radius: 999px; padding: 1px 6px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.ws-set .badge.mine { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.ws-more { align-self: flex-start; border: none; background: none; font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; padding: 3px 8px; }
.ws-more:hover { color: var(--accent-ink); text-decoration: underline; }
.ws-link { align-self: flex-start; border: none; background: none; font: inherit; font-size: 12px; font-weight: 500; color: var(--accent-ink); cursor: pointer; padding: 4px 8px; }
.ws-link:hover { text-decoration: underline; }
.ws-docs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.ws-docs .wv-doc { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.ws-docs .doc-search { margin: 0; display: block; width: 100%; }
/* Same footprint as the buttons below it (user's call, 2026-09-15): full width, 40.75 px tall. */
.ws-docs input#exampleNum { width: 100%; box-sizing: border-box; padding: 10px 34px 10px 12px; font-size: 12.5px; line-height: 18.75px; }
.ws-docs .btn { width: 100%; justify-content: center; }
/* The recent-documents list opens rightwards over the dropzone, where there is room. */
.ws-docs .recent-list { left: 0; right: auto; width: max-content; max-width: 420px; }
@media (max-width: 860px) { .wv-body { grid-template-columns: 1fr; } }
/* Every user may refresh the import template (2026-09-14): the controls stay,
   and the commit button appears once a refresh preview is pending. */
body.no-admin #setupSave.refresh-commit { display: inline-flex !important; }
body.no-admin .setup-managed { display: block; }
/* Map-step auto-skip (option A, 2026-09-07): the stepper shows step 2 as a
   green check while skipped; the Review banner carries the escape hatch. */
#stepper .step.auto .num { background: var(--success-strong); border-color: var(--success-strong); color: #fff; }
#mapSkipNote { display: flex; align-items: center; gap: 12px; }
#mapSkipNote .btn-link { margin-left: auto; white-space: nowrap; }
/* Live import progress (option 8, 2026-09-07): segmented outcome bar + a
   sticky run head so long logs never scroll the counters away. The single
   accent .bar is replaced by per-outcome segments in the status palette. */
.progress { display: flex; }
.progress .seg { height: 100%; width: 0; transition: width 0.25s ease; }
.progress .s-ok { background: var(--success); border-radius: 999px 0 0 999px; }
.progress .s-upd { background: var(--accent); }
.progress .s-skip { background: var(--warn); }
.progress .s-fail { background: var(--danger); }
.run-head { position: sticky; top: calc(var(--header-h) + 6px); z-index: 5; background: var(--bg); padding: 6px 0 2px; }
/* (The plan-sentence experiment was removed 2026-09-07 at the user's call -
   the update diff carries the perceptibility instead.) */
/* Review update diff - presentation A (user-approved 2026-09-07): a "N
   changes" chip on the UPDATE row, a detail row underneath grouped by field
   section, the amber blanking warning, and the aggregate line above the grid.
   Status colors reuse the validated Activity palette. */
.diff-chip {
  display: inline-block; margin-left: 6px; padding: 1px 9px; font: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--accent-ink); background: transparent; border: 1px solid var(--accent-ink); border-radius: 999px;
  cursor: pointer; white-space: nowrap; vertical-align: middle;
}
.diff-chip:hover { background: var(--accent-soft); }
.diff-chip.blanks { color: var(--warn-ink); border-color: var(--warn-ink); }
.diff-chip.none { color: var(--muted); border-color: var(--border); cursor: default; }
#previewTable tbody tr.diff-detail td { background: var(--surface-2); padding: 10px 14px 12px 44px; font-size: 12.5px; }
/* A held row's long explanation (2026-09-27): the cell keeps one short line
   and a "why?" chip; the paragraph opens as a full-width row underneath,
   the diff-detail pattern - never folded into the narrow Issues column. */
.why-chip {
  display: inline-block; margin-left: 6px; padding: 1px 9px; font: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--danger-ink); background: transparent; border: 1px solid var(--danger-ink); border-radius: 999px;
  cursor: pointer; white-space: nowrap; vertical-align: middle;
}
.why-chip:hover { background: var(--danger-soft); }
#previewTable tbody tr.issue-detail td {
  background: var(--surface-2); padding: 10px 14px 12px 44px; font-size: 12.5px; line-height: 1.5;
  color: var(--text); font-weight: 400; white-space: normal;
}
.diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 26px; }
.diff-section-h { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.diff-list { list-style: none; margin: 0; padding: 0; }
.diff-lines-note { margin-top: 8px; font-size: 12px; }
.diff-lines-note.muted { color: var(--muted); }
.diff-list li { padding: 2px 0; }
.diff-list .fld { color: var(--muted); margin-right: 6px; }
.diff-list .old { color: var(--danger-ink); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff-list .arr { color: var(--muted); padding: 0 5px; }
.diff-list .new { color: var(--success-ink); font-weight: 600; }
.diff-list .blank { color: var(--warn-ink); font-weight: 700; }
.diff-warn { margin-top: 8px; border: 1px dashed var(--warn); color: var(--warn-ink); background: var(--warn-soft); border-radius: var(--radius); padding: 7px 11px; font-size: 12px; }
.diff-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }
/* Shared mapping profiles (2026-09-07): the bar above the mapping grid. */
.map-profiles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: 12.5px; }
.map-profiles .mp-label { font-weight: 600; color: var(--brand-ink); }
.map-profiles .mp-select { font: inherit; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 420px; }
.map-profiles .mp-danger { color: var(--danger-ink); }
.map-profiles .mp-note { color: var(--muted); font-size: 12px; }
/* Restart-needed banner (2026-09-07): amber strip above the stepper, admins only. */
.stale-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 9px 14px; border: 1px solid var(--warn); border-left-width: 4px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn-ink); font-size: 13px; }
.stale-banner.hidden { display: none; }
.stale-banner .sb-icon { font-size: 16px; }
/* License banner (multi-Sage step 4): amber while imports still run, red once they pause. */
.license-banner.stop { border-color: var(--danger-ink); background: var(--danger-soft); color: var(--danger-ink); }
/* No license yet (C, 2026-10-28, mockup 1A): one page instead of the importer. */
.no-license { max-width: 460px; margin: 60px auto; text-align: center; padding: 32px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.no-license .nl-icon { width: 34px; height: 34px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.no-license h2 { margin: 10px 0 6px; font-size: 19px; font-weight: 600; color: var(--brand-ink); }
.no-license p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.no-license .nl-hint { margin: 14px 0 0; font-size: 12.5px; }
body.no-license-mode #stepper, body.no-license-mode .app > .panel { display: none !important; }
/* A function outside the license's packs: shown, greyed, not selectable. */
.obj-card.locked { opacity: .55; cursor: not-allowed; border-style: dashed; }
.obj-card.locked:hover { border-color: var(--border); }
/* "Add Sales to your license" on a locked card (company admins, 2026-10-28). */
.obj-card .oc-add { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.obj-card.locked:has(.oc-add) { opacity: .8; }
.pk-pill.lock { margin-left: 8px; }
.stale-banner code { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1px 7px; color: var(--text); }

/* Files waiting in a watched folder (2026-09-28): the Upload step's side card. */
.ws-waiting { margin-top: 14px; }
.ws-waiting-list { display: flex; flex-direction: column; gap: 6px; }
.ws-waiting-file {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  font: inherit; font-size: 12.5px; text-align: left; padding: 7px 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.ws-waiting-file:hover { border-color: var(--accent); background: var(--accent-soft); }
.ws-waiting-file:disabled { opacity: .6; cursor: progress; }
.ws-waiting-file .wf-name { font-weight: 500; word-break: break-all; }
.ws-waiting-file .wf-meta { font-size: 11px; color: var(--muted); }

/* ---------- Delete page (2026-10-29, "G" - the Export page's layout, ex-* classes) ---------- */
.del-note { margin: 8px 0 0; font-size: 12px; color: var(--danger-ink); }
/* Delete laid out like the import's upload step (2026-11-02, mockup A) */
.del-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.del-title h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.del-pill { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--danger-ink) 40%, var(--border)); color: var(--danger-ink); background: var(--danger-soft); flex: none; }
.del-side h4 + h4, .del-side .del-note + h4, .del-side .ex-hint + h4 { margin-top: 10px; }
.del-check { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.dropzone.dropzone-danger { margin-top: 0; border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); }
.dropzone.dropzone-danger:hover, .dropzone.dropzone-danger.drag { border-color: var(--danger); background: var(--danger-soft); }
.dropzone.dropzone-danger .dz-icon { background: var(--danger); color: #fff; }
.del-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0 10px; }
.del-or::before, .del-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.wv-main .del-one { justify-content: center; }
.del-safe { margin: 12px 0 0; font-size: 12.5px; text-align: center; }
.ex-side .del-note + h4, .ex-side .ex-select + h4 { margin-top: 14px; }
.del-table td { overflow-wrap: anywhere; }
.del-one { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.del-one #delOne { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.del-one input { width: 150px; }
.del-tpl { font-size: 12px; }
#delMsg { margin-top: 10px; }
.del-list { margin-top: 12px; max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.del-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.del-table th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 500; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.del-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.del-table .ds { white-space: nowrap; }
.del-table .ds.ok { color: var(--success-ink); }
.del-table .ds.off { color: var(--muted); }
.del-table .ds.bad { color: var(--danger-ink); }
/* Documents Sage X3 won't delete (2026-11-02, mockup A): greyed row, amber reason */
.del-table .ds.no { color: var(--warn-ink); font-weight: 500; }
.del-table tr.locked td { background: var(--surface-2); color: var(--faint); }
.del-table tr.locked td.ds.no { color: var(--warn-ink); }
/* "Open in Sage X3" on documents a delete left in place (2026-11-03) - the import's code link look, readable on greyed rows. */
.del-table a.codelink { color: var(--accent-ink); text-decoration: none; border-bottom: 1px dotted currentColor; }
.del-table a.codelink:hover { border-bottom-style: solid; }
.del-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.del-confirm .spacer { flex: 1; }
.del-confirm #delType { width: 130px; }
.del-warn { font-size: 12px; }
.btn.btn-danger { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
.btn.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Pre-import questionnaire (2026-10-01; wizard layout 2026-10-30) ---------- */
/* While the questionnaire is open it is the only thing under the work-view header row. */
#workView.qn-active > :not(.wv-top):not(#qnView) { display: none; }
.qn-view { margin-top: 6px; }
/* Stepper | topic page | live rail */
.qn-wiz { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.qn-side { background: var(--surface-2); border-right: 1px solid var(--border); padding: 14px 0 12px; }
.qn-side-title { margin: 0 16px 10px; font-size: 14px; font-weight: 500; color: var(--brand-ink); }
.qn-grp { padding: 10px 16px 4px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.qn-step { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 16px 7px 13px; font: inherit; font-size: 13px; color: var(--text); text-align: left; background: none; border: 0; border-left: 3px solid transparent; cursor: pointer; }
.qn-step:hover { background: var(--surface); }
.qn-step i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-style: normal; background: var(--surface); flex: none; color: var(--muted); }
.qn-step.done i { background: var(--success-strong); border-color: var(--success-strong); color: #fff; }
.qn-step.cur { border-left-color: var(--accent); background: var(--surface); font-weight: 500; color: var(--brand-ink); }
.qn-step.cur i { border-color: var(--accent); color: var(--accent-ink); }
.qn-step.cur.done i { background: var(--success-strong); color: #fff; }
.qn-step-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-step-n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qn-side-foot { margin: 14px 16px 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.5; }
.qn-side-foot p { margin: 0 0 6px; }
.qn-link { font: inherit; font-size: 12px; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.qn-main { padding: 18px 22px 0; min-width: 0; display: flex; flex-direction: column; }
.qn-head { display: flex; align-items: center; gap: 14px; margin: 0 0 4px; }
.qn-head h3 { margin: 0; font-size: 17px; font-weight: 500; color: var(--brand-ink); flex: 1; }
.qn-crumb { font-size: 12px; margin-bottom: 2px; }
.qn-sub { margin: 4px 0 12px; font-size: 13px; }
.qn-list { margin-top: 8px; }
.qn-q { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.qn-q.missing { border-color: var(--danger); background: var(--danger-soft); }
.qn-txt { font-size: 13.5px; line-height: 1.45; }
.qn-ref { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--muted); font-family: var(--mono); background: var(--bg); padding: 1px 7px; border-radius: var(--radius); vertical-align: 1px; }
.qn-req { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--danger-ink); }
.qn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qn-ans { display: flex; gap: 6px; flex-wrap: wrap; }
.qn-ans textarea { width: 100%; min-width: 320px; }
.qn-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.qn-pill { font: inherit; font-size: 13px; padding: 6px 16px; border: 0; border-left: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.qn-pill:first-child { border-left: 0; }
.qn-pill:hover { color: var(--accent-ink); background: var(--accent-soft); }
.qn-pill.sel { background: var(--accent-strong); color: #fff; }
.qn-x3, .qn-evidence, .qn-err { font-size: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qn-evidence input { flex: 1; min-width: 220px; font-size: 12.5px; padding: 5px 8px; }
.qn-err { color: var(--danger-ink); }
.qn-chip { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.qn-chip.ok { background: var(--success-soft); color: var(--success-ink); }
.qn-chip.diff { background: var(--warn-soft); color: var(--warn-ink); }
.qn-chip.unk { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.qn-chip.live { background: var(--accent-soft); color: var(--accent-ink); }
.qn-notice { margin-bottom: 10px; }
.qn-foot { margin-top: auto; padding: 12px 0 16px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.qn-saved { font-size: 12.5px; }
.qn-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 14px 16px; }
.qn-card h4 { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--brand-ink); display: flex; gap: 8px; align-items: center; }
.qn-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.qn-card ul { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.qn-card li { padding: 6px 0; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.qn-card li:first-child { border-top: 0; }
.qn-card li code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: var(--radius); flex: none; }
.qn-ok { color: var(--success-ink); flex: none; }
.qn-bad { color: var(--danger-ink); flex: none; }
.qn-todo { color: var(--faint); flex: none; }
/* The Review step strip */
.qn-applied { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-lg); padding: 9px 14px; margin-bottom: 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qn-applied b { font-weight: 500; color: var(--brand-ink); margin-right: 4px; }
.qn-tag { background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--accent-ink); }
/* The Finish confirm box (mockup B, 2026-11-02) */
.qn-modal { position: fixed; inset: 0; z-index: 400; background: rgba(6, 52, 60, .35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.qn-modal-box { width: 560px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.qn-modal-box h3 { margin: 0 0 6px; font-size: 16px; font-weight: 500; color: var(--brand-ink); }
.qn-modal-box p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.qn-modal-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; }
.qn-modal-table td { padding: 6px 8px; border-top: 1px solid var(--border); }
.qn-modal-table td code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: var(--radius); }
.qn-modal-box .nav { margin-top: 12px; }
.qn-modal-err { margin: 8px 0 0; }
/* Before the first answer (mockup B, 2026-11-04): keep Sage X3 as it is, or answer the questionnaire. */
.qn-choose { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 22px 24px; }
.qn-choose h3 { margin: 0 0 4px; font-size: 17px; font-weight: 500; color: var(--brand-ink); }
.qn-choose-sub { margin: 0; font-size: 13px; }
.qn-choose-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 10px; }
.qn-choose-card { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.qn-choose-card.rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.qn-choose-card h4 { margin: 0; font-size: 15px; font-weight: 500; color: var(--brand-ink); }
.qn-choose-card p { margin: 0; font-size: 13px; line-height: 1.5; }
.qn-choose-card .btn { align-self: flex-start; margin-top: 6px; }
.qn-choose-meta { font-size: 12px; color: var(--muted); }
.qn-choose-foot { margin: 0; font-size: 12px; }
.qn-drift-acts { flex-wrap: wrap; gap: 8px; }
.qn-drift-acts .btn { flex: 1 1 auto; }
/* The upload page's side card: the Questionnaire group */
.ws-qn { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.ws-qn p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.45; }
@media (max-width: 1100px) { .qn-wiz { grid-template-columns: 210px minmax(0, 1fr); } }
@media (max-width: 760px) { .qn-wiz { grid-template-columns: 1fr; } .qn-side { border-right: 0; border-bottom: 1px solid var(--border); } .qn-ans textarea { min-width: 0; } }

/* ---------- Export page (2026-10-08) ---------- */
.ex-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 10px; }
.ex-side { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.ex-side h4, .ex-main h4, .ex-history h4 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.ex-side h4 + h4, .ex-side .ws-sets + h4, .ex-side .ex-select + h4, .ex-side .ex-radios + h4 { margin-top: 14px; }
.ex-select { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.ex-radios, .ex-modes { display: flex; gap: 16px; font-size: 13px; }
.ex-radios label, .ex-modes label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ex-modes { margin-bottom: 10px; }
.ex-main { min-width: 0; }
.ex-search { position: relative; display: block; margin: 0; width: 320px; max-width: 100%; }
.ex-search input { width: 100%; box-sizing: border-box; padding: 8px 34px 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 13px; background: var(--surface); color: var(--text); }
.ex-search .recent-list { left: 0; right: auto; min-width: 320px; }
.ex-hint { font-size: 12px; margin: 6px 0 0; }
.ex-filters { margin: 8px 0 0; }
.ex-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.ex-actions #exportMsg { font-size: 12.5px; color: var(--muted); min-width: 0; flex: 1 1 auto; }
.ex-actions #exportMsg.err { color: var(--danger-ink, #c62828); }
.ex-actions #exportMsg.ok { color: var(--success-ink); }
.ex-history { margin-top: 24px; }
.ex-history .muted { font-size: 12px; margin: 0 0 8px; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ex-table th, .ex-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ex-table th { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.ex-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ex-table .eh-sel { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-table .eh-actions { white-space: nowrap; display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.ex-table .eh-actions a { color: var(--accent-ink, #058cab); text-decoration: none; }
.ex-table .eh-actions a:hover { text-decoration: underline; }
@media (max-width: 900px) { .ex-body { grid-template-columns: 1fr; } }
.ex-filters .ep-row { grid-template-columns: minmax(120px, 1.2fr) 205px minmax(90px, 1fr) minmax(90px, 1fr) 28px; } /* operator column fits "equal to or greater than" (2026-10-20) */

/* ---------- Dropdowns (2026-10-20, user's pick "C", picker-select.js) ----------
 * Every <select> gets class "pk" from picker-select.js: a clear arrow (some local rules used
 * the background shorthand and wiped it - the Export Function box looked like a text box),
 * a stronger border that turns cyan on hover, and the app's own list on click. "pick-full"
 * selects (one per panel: Export function, Activity filters, Settings, sheet, shared mapping,
 * admin pickers) are bolder and show an icon (data-pick-icon); repeated row selects (mapping
 * columns, export conditions, admin tables) stay compact. Same day, user's pick "A": no
 * "Change" cue, "pick-fit" boxes are sized by picker-select.js to their LONGEST option (up to
 * the space available), and a name that still cannot fit ends with "…". */
select.pk { cursor: pointer; border-color: var(--border-strong); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E") !important; background-repeat: no-repeat !important; background-position: right 10px center !important; padding-right: 30px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select.pk:hover:not(:disabled) { border-color: var(--accent); }
select.pk[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(7, 190, 227, 0.18); }
select.pk:disabled { cursor: default; opacity: .6; }
select.pk.pick-full { font-weight: 600; font-size: 13px; min-height: 38px; }
select.pk.pick-fit { max-width: 100%; }
select.pk.pick-full[data-pick-icon] { padding-left: 38px !important; background-position: right 10px center, left 11px center !important; }
select.pk.pick-full[data-pick-icon="function"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%273%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%2714%27%20y%3D%273%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%2714%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%2714%27%20y%3D%2714%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="function"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%273%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%2714%27%20y%3D%273%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%2714%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%2714%27%20y%3D%2714%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="user"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%278%27%20r%3D%274%27%2F%3E%3Cpath%20d%3D%27M4%2021v-1a6%206%200%200%201%206-6h4a6%206%200%200%201%206%206v1%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="user"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%278%27%20r%3D%274%27%2F%3E%3Cpath%20d%3D%27M4%2021v-1a6%206%200%200%201%206-6h4a6%206%200%200%201%206%206v1%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="theme"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27M12%203a9%209%200%200%200%200%2018z%27%20fill%3D%27%23058cab%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="theme"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27M12%203a9%209%200%200%200%200%2018z%27%20fill%3D%27%234fd0ee%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="calendar"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%275%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M16%203v4M8%203v4M3%2011h18%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="calendar"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%275%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M16%203v4M8%203v4M3%2011h18%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="clock"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27M12%207v5l3%202%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="clock"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27M12%207v5l3%202%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="sheet"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M3%2010h18M9%204v16%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="sheet"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2718%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M3%2010h18M9%204v16%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="mapping"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%207h13M13%203l4%204-4%204%27%2F%3E%3Cpath%20d%3D%27M20%2017H7M11%2013l-4%204%204%204%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="mapping"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%207h13M13%203l4%204-4%204%27%2F%3E%3Cpath%20d%3D%27M20%2017H7M11%2013l-4%204%204%204%27%2F%3E%3C%2Fsvg%3E") !important; }
select.pk.pick-full[data-pick-icon="area"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23058cab%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%204h5l2%203h9a1%201%200%200%201%201%201v10a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V5a1%201%200%200%201%201-1z%27%2F%3E%3C%2Fsvg%3E") !important; }
:root[data-theme="dark"] select.pk.pick-full[data-pick-icon="area"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23757575%27%20stroke-width%3D%272.5%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpolyline%20points%3D%276%209%2012%2015%2018%209%27%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%234fd0ee%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%204h5l2%203h9a1%201%200%200%201%201%201v10a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V5a1%201%200%200%201%201-1z%27%2F%3E%3C%2Fsvg%3E") !important; }
.pk-pop { position: fixed; z-index: 2000; display: flex; flex-direction: column; max-width: min(440px, calc(100vw - 16px)); max-height: min(340px, calc(100vh - 16px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.pk-pop .pk-filter { margin: 8px 8px 4px; width: auto; font-size: 13px; padding: 6px 10px; }
.pk-list { overflow: auto; padding: 4px 0; }
.pk-grp { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--accent-ink); padding: 8px 12px 3px; }
.pk-it { position: relative; padding: 7px 32px 7px 12px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-it.hi { background: var(--accent-soft); }
.pk-it.sel { font-weight: 600; }
.pk-it.sel::after { content: "\2713"; position: absolute; right: 12px; color: var(--accent-ink); }
.pk-it.off { color: var(--faint); cursor: default; }
.pk-none { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }

/* Refresh-from-template result as one line (option A, 2026-10-30): headline + "Show what changed". */
.notice.notice-line .nt-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0; }
.notice.notice-line .nt-more { font-weight: 500; font-size: 12.5px; color: inherit; text-decoration: underline; white-space: nowrap; }
.notice.notice-line ul.nt-list { margin-top: 8px; }

/* Sage X3 kit files that must be loaded into a Sage (2026-11-04, option B, administrators only):
   a red dot on the connection pill and the Sage in the switcher, a banner inside that Sage,
   and to-do / done chips per Sage in Administration → Sage X3 kit. */
.ndot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); flex: none; }
.conn { position: relative; }
.conn .ndot { position: absolute; top: -3px; right: -3px; box-shadow: 0 0 0 2px var(--brand); }
.sage-item small.sage-need { color: var(--danger-ink); }
.kit-banner { margin: 0 0 14px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-left-width: 4px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger-ink); font-size: 13.5px; }
.kit-banner.hidden { display: none; }
.kit-banner .kb-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kit-banner .kb-top .kb-title { flex: 1; font-weight: 600; }
.kit-banner .kb-files { margin: 8px 0 0 19px; display: grid; gap: 6px; }
.kit-banner .kb-file { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: color-mix(in srgb, var(--surface) 55%, transparent); border-radius: 8px; padding: 6px 10px; }
.kit-banner .kb-file .kb-w { flex: 1; min-width: 200px; }
.kit-banner .kb-file .kb-w b { color: var(--text); }
.kit-banner .kb-file .kb-w small { display: block; font-size: 12px; opacity: 0.85; }
.kit-banner .kb-file.kb-done { background: var(--success-soft); color: var(--success-ink); }
.kit-banner .kb-hint { margin: 6px 0 0 19px; font-size: 12px; opacity: 0.85; }
.kit-banner .btn-link { color: var(--accent-ink); }
.kit-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px 2px 8px; font-size: 12px; margin: 0 6px 6px 0; border: 1px solid var(--border); white-space: nowrap; }
.kit-chip.todo { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); color: var(--danger-ink); }
.kit-chip.done { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: var(--success-soft); color: var(--success-ink); }
.kit-chip button { font: inherit; font-size: 11.5px; border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 0 0 0 4px; text-decoration: underline; }
.kit-sages { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.kit-needs { margin-top: 4px; }
.kit-needs summary { cursor: pointer; font-size: 12px; color: var(--accent-ink); margin-bottom: 4px; }
.kit-sages label { display: inline-flex; gap: 6px; align-items: center; }
