/* GeoForgeX Web — a copy of the desktop app: WPF UI's Fluent theme with the desktop's orange
   accent (ApplicationAccentColorManager.Apply(#EA580C)), Segoe UI 14 on #202020 (dark, the
   desktop's default) or #FAFAFA (light). Every colour below is a resolved desktop brush
   (desktop-tokens.json): the alpha fills are the WPF UI brushes themselves, so layered cards
   compose exactly as they do on the desktop. */

/* ── tokens: dark (the default; data-theme="dark", and "system" on a dark OS) ── */
:root {
  /* the window, the content frame, cards (CardBackgroundFillColorDefault / Secondary), strokes */
  --bg: #202020; --frame: rgba(255,255,255,.0153); --card: rgba(255,255,255,.051); --card2: rgba(255,255,255,.031);
  --stroke: rgba(0,0,0,.098); --divider: rgba(255,255,255,.082);
  /* controls (ControlFillColorDefault / Secondary / Tertiary) and their strokes */
  --ctl: rgba(255,255,255,.059); --ctl2: rgba(255,255,255,.082); --ctl3: rgba(255,255,255,.031); --ctl-dis: rgba(255,255,255,.043);
  --ctl-stroke: rgba(255,255,255,.071); --ctl-edge: rgba(255,255,255,.094); --ctl-strong: rgba(255,255,255,.545);
  --input: rgba(255,255,255,.059); --input-focus: rgba(30,30,30,.702);
  /* text (TextFillColorPrimary / Secondary / Tertiary / Disabled) */
  --fg: #ffffff; --fg2: rgba(255,255,255,.773); --fg3: rgba(255,255,255,.529); --fg-dis: rgba(255,255,255,.365);
  /* the accent: the desktop's literal #EA580C, WPF UI's accent fill/text in this theme */
  --orange: #ea580c; --orange-l: #fb923c; --accent: #ea580c; --accent-fill: #ff884a; --accent-pri: #ff742c; --accent-text: #ff9c69; --accent-ink: #ffffff;
  --accent-hover: #f97316; --accent-press: #c2410c;
  --blue: #3b82f6; --green: #22c55e; --emerald: #10b981; --amber: #f59e0b; --yellow: #fbbf24; --red: #ef4444; --purple: #8b5cf6; --cyan: #06b6d4;
  --success: #10b981; --error: #ef4444; --warning: #f59e0b; --info: #3b82f6;
  /* surfaces that must be opaque (menus, flyouts, tooltips, dialogs) */
  --raised: #2c2c2c; --flyout: #2c2c2c; --dialog: #202020; --sheet: #2b2b2b;
  /* the navigation pane */
  --nav-sel: rgba(255,255,255,.059); --nav-hover: rgba(255,255,255,.059); --nav-icon: #ffffff; --nav-gsep: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.1) 5%, rgba(255,255,255,.22) 10%, rgba(255,255,255,.31) 15%, rgba(255,255,255,.33) 20%, rgba(255,255,255,.24) 30%, rgba(255,255,255,.24) 70%, rgba(255,255,255,.33) 80%, rgba(255,255,255,.31) 85%, rgba(255,255,255,.22) 90%, rgba(255,255,255,.1) 95%, rgba(255,255,255,0) 100%); --stroke-solid: #1d1d1d;
  /* the result grids (GeoForgeXDataGrid) */
  --grid-head: rgba(255,255,255,.031); --grid-alt: rgba(255,255,255,.031); --grid-line: rgba(0,0,0,.098);
  --sel: rgba(59,130,246,.125); --sel-cell: rgba(59,130,246,.188); --sel-focus: rgba(59,130,246,.376);
  /* kept names (older rules): mapped onto the desktop brushes */
  --primary: var(--bg); --primary-light: #2b2b2b; --primary-dark: #1c1c1c;
  --panel: var(--card); --panel2: var(--card2); --hover: var(--card2);
  --fill: var(--ctl); --fill-hover: var(--ctl2); --fill-press: var(--ctl3); --fill-strong: rgba(255,255,255,.12);
  --ctl-hover: var(--ctl2); --ctl-focus: var(--input-focus);
  --line: var(--stroke); --line2: var(--ctl-stroke);
  --muted: var(--fg2); --faint: var(--fg3); --disabled: var(--fg-dis); --paper: #ffffff;
  --g300: #d1d5db; --g400: #9ca3af; --g500: #6b7280; --g600: #4b5563; --rp-title: #e6edf3; --rp-value: #e8ebf0; --rp-label: #8b93a5;
  --accent-soft: rgba(234,88,12,.16); --accent-ring: rgba(234,88,12,.5);
  --ok-soft: rgba(16,185,129,.10); --info-soft: rgba(59,130,246,.14); --warn-soft: rgba(245,158,11,.12); --bad-soft: rgba(239,68,68,.12); --neutral-soft: rgba(255,255,255,.08);
  --ok-ink: #22c55e; --info-ink: #60a5fa; --warn-ink: #f59e0b; --bad-ink: #f87171;
  --shadow-sm: none; --shadow-hover: 0 4px 12px rgba(0,0,0,.28); --shadow: 0 8px 32px rgba(0,0,0,.42); --backdrop: rgba(0,0,0,.5);
  --rail: var(--bg); --rail-fg: var(--fg); --rail-muted: var(--fg2); --rail-line: var(--stroke); --rail-hover: var(--nav-hover); --rail-on: var(--nav-sel);
  --ph-bg: var(--card); --ph-fg: var(--fg); --ph-sub: var(--fg2); --ph-eyebrow: var(--fg3); --ph-line: var(--stroke); --ph-btn: var(--ctl-stroke); --ph-btn-hover: var(--ctl2); --ph-field: var(--ctl);

  /* spacing: the desktop's own (multiples of 4) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 40px; --s8: 48px; --s9: 64px;
  --gutter: 32px; --content: 1200px; --topbar: 48px;
  --block: 16px; --title-gap: 16px; --ctl-gap: 8px; --group-gap: 16px; --chip-gap: 8px; --form-gap: 16px; --row-h: 36px; --cell-x: 12px;
  /* shape: WPF UI's 4 px on controls (ControlCornerRadius), 8 px on cards */
  --r-sm: 4px; --r-ctl: 4px; --r: 8px; --r-lg: 12px; --r-pill: 999px;
  /* type: Segoe UI 14 (the window's font), the desktop's sizes */
  --font: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font);
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  --fs-title: 26px; --fs-h2: 20px; --fs-section: 16px; --fs-body: 14px; --fs-small: 13px; --fs-caption: 12px; --fs-eyebrow: 11px;
  --ease: 120ms ease;
  color-scheme: dark;
}
/* ── light: WPF UI's Fluent light with the orange accent ── */
:root[data-theme="light"] {
  --bg: #fafafa; --frame: rgba(255,255,255,.21); --card: rgba(255,255,255,.702); --card2: rgba(246,246,246,.502);
  --stroke: rgba(0,0,0,.059); --divider: rgba(0,0,0,.059);
  --ctl: rgba(255,255,255,.702); --ctl2: rgba(249,249,249,.502); --ctl3: rgba(249,249,249,.302); --ctl-dis: rgba(249,249,249,.302);
  --ctl-stroke: rgba(0,0,0,.059); --ctl-edge: rgba(0,0,0,.161); --ctl-strong: rgba(0,0,0,.447);
  --input: rgba(255,255,255,.702); --input-focus: #ffffff;
  --fg: rgba(0,0,0,.894); --fg2: rgba(0,0,0,.62); --fg3: rgba(0,0,0,.447); --fg-dis: rgba(0,0,0,.361);
  --accent-fill: #d14e0b; --accent-pri: #dd530b; --accent-text: #c44a0a;
  --raised: #f9f9f9; --flyout: #f9f9f9; --dialog: #ffffff; --sheet: #fbfbfb;
  --nav-sel: rgba(0,0,0,.035); --nav-hover: rgba(0,0,0,.035); --nav-icon: #ea580c; --nav-gsep: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.04) 5%, rgba(0,0,0,.09) 10%, rgba(0,0,0,.125) 15%, rgba(0,0,0,.13) 20%, rgba(0,0,0,.104) 30%, rgba(0,0,0,.104) 70%, rgba(0,0,0,.13) 80%, rgba(0,0,0,.125) 85%, rgba(0,0,0,.09) 90%, rgba(0,0,0,.04) 95%, rgba(0,0,0,0) 100%); --stroke-solid: #ebebeb;
  --grid-head: rgba(246,246,246,.502); --grid-alt: rgba(246,246,246,.502); --grid-line: rgba(0,0,0,.059);
  --sel: rgba(59,130,246,.10); --sel-cell: rgba(59,130,246,.16); --sel-focus: rgba(59,130,246,.28);
  --primary-light: #fbfbfb; --primary-dark: #e9e9e9; --fill-strong: rgba(0,0,0,.09);
  --g300: #4b5563; --g400: #5f6672; --g500: #6b7280; --g600: #9ca3af; --rp-title: #1a1a1a; --rp-value: #1a1a1a; --rp-label: #5f6672;
  --accent-soft: rgba(234,88,12,.10); --accent-ring: rgba(234,88,12,.45);
  --ok-soft: rgba(16,185,129,.12); --info-soft: rgba(59,130,246,.10); --warn-soft: rgba(245,158,11,.14); --bad-soft: rgba(239,68,68,.10); --neutral-soft: rgba(0,0,0,.06);
  --ok-ink: #16a34a; --info-ink: #1d4ed8; --warn-ink: #b45309; --bad-ink: #c42b1c;
  --shadow-hover: 0 4px 12px rgba(0,0,0,.08); --shadow: 0 8px 32px rgba(0,0,0,.16); --backdrop: rgba(0,0,0,.3);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #fafafa; --frame: rgba(255,255,255,.21); --card: rgba(255,255,255,.702); --card2: rgba(246,246,246,.502);
    --stroke: rgba(0,0,0,.059); --divider: rgba(0,0,0,.059);
    --ctl: rgba(255,255,255,.702); --ctl2: rgba(249,249,249,.502); --ctl3: rgba(249,249,249,.302); --ctl-dis: rgba(249,249,249,.302);
    --ctl-stroke: rgba(0,0,0,.059); --ctl-edge: rgba(0,0,0,.161); --ctl-strong: rgba(0,0,0,.447);
    --input: rgba(255,255,255,.702); --input-focus: #ffffff;
    --fg: rgba(0,0,0,.894); --fg2: rgba(0,0,0,.62); --fg3: rgba(0,0,0,.447); --fg-dis: rgba(0,0,0,.361);
    --accent-fill: #d14e0b; --accent-pri: #dd530b; --accent-text: #c44a0a;
    --raised: #f9f9f9; --flyout: #f9f9f9; --dialog: #ffffff; --sheet: #fbfbfb;
    --nav-sel: rgba(0,0,0,.035); --nav-hover: rgba(0,0,0,.035); --nav-icon: #ea580c; --nav-gsep: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.04) 5%, rgba(0,0,0,.09) 10%, rgba(0,0,0,.125) 15%, rgba(0,0,0,.13) 20%, rgba(0,0,0,.104) 30%, rgba(0,0,0,.104) 70%, rgba(0,0,0,.13) 80%, rgba(0,0,0,.125) 85%, rgba(0,0,0,.09) 90%, rgba(0,0,0,.04) 95%, rgba(0,0,0,0) 100%); --stroke-solid: #ebebeb;
    --grid-head: rgba(246,246,246,.502); --grid-alt: rgba(246,246,246,.502); --grid-line: rgba(0,0,0,.059);
    --sel: rgba(59,130,246,.10); --sel-cell: rgba(59,130,246,.16); --sel-focus: rgba(59,130,246,.28);
    --primary-light: #fbfbfb; --primary-dark: #e9e9e9; --fill-strong: rgba(0,0,0,.09);
    --g300: #4b5563; --g400: #5f6672; --g500: #6b7280; --g600: #9ca3af; --rp-title: #1a1a1a; --rp-value: #1a1a1a; --rp-label: #5f6672;
    --accent-soft: rgba(234,88,12,.10); --accent-ring: rgba(234,88,12,.45);
    --ok-soft: rgba(16,185,129,.12); --info-soft: rgba(59,130,246,.10); --warn-soft: rgba(245,158,11,.14); --bad-soft: rgba(239,68,68,.10); --neutral-soft: rgba(0,0,0,.06);
    --ok-ink: #16a34a; --info-ink: #1d4ed8; --warn-ink: #b45309; --bad-ink: #c42b1c;
    --shadow-hover: 0 4px 12px rgba(0,0,0,.08); --shadow: 0 8px 32px rgba(0,0,0,.16); --backdrop: rgba(0,0,0,.3);
    color-scheme: light;
  }
}
/* the theme's own pictures: the white logo on dark, the dark one on light */
.logo-on-light, .when-light { display: none !important; }
:root[data-theme="light"] .logo-on-light, :root[data-theme="light"] .when-light { display: inline-flex !important; }
:root[data-theme="light"] .logo-on-dark, :root[data-theme="light"] .when-dark { display: none !important; }
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .logo-on-light, :root[data-theme="system"] .when-light { display: inline-flex !important; }
  :root[data-theme="system"] .logo-on-dark, :root[data-theme="system"] .when-dark { display: none !important; }
}

/* ── base ────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.36 var(--font); -webkit-font-smoothing: antialiased; font-optical-sizing: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0; font-family: var(--font); }
h1 { font-size: var(--fs-title); line-height: 1.25; }
h2 { font-size: var(--fs-section); line-height: 1.3; }
h3 { font-size: var(--fs-body); line-height: 1.35; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--accent-fill); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--fs-caption); letter-spacing: .02em; color: var(--fg2); font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.note { font-size: var(--fs-small); color: var(--fg2); margin: var(--s2) 0 0; line-height: 1.5; }
.caption { font-size: var(--fs-caption); color: var(--fg2); }
.muted { color: var(--fg2); }
.small { font-size: var(--fs-caption); }
.good { color: var(--ok-ink); } .bad { color: var(--bad-ink); }
.mt { margin-top: var(--s6); } .mt-s { margin-top: var(--s3); } .mt-m { margin-top: var(--s5); }
.inline { display: inline; }
.center { text-align: center; margin-top: var(--s3); }
.self-end { align-self: end; }
.grow { flex: 1; min-width: 0; }
/* icons: the desktop's Fluent glyphs at the desktop's FontSize (16 unless a class says otherwise) */
.ic { width: 16px; height: 16px; flex: none; fill: currentColor; vertical-align: middle; overflow: visible; }
.ic.sm, .ic.s14 { width: 14px; height: 14px; }
.ic.s11 { width: 11px; height: 11px; } .ic.s12 { width: 12px; height: 12px; } .ic.s13 { width: 13px; height: 13px; } .ic.s15 { width: 15px; height: 15px; }
.ic.s17 { width: 17px; height: 17px; } .ic.s18 { width: 18px; height: 18px; } .ic.s19 { width: 19px; height: 19px; }
.ic.lg, .ic.s20 { width: 20px; height: 20px; } .ic.s21 { width: 21px; height: 21px; } .ic.s22 { width: 22px; height: 22px; } .ic.s24 { width: 24px; height: 24px; }
.ic.xl, .ic.s28 { width: 28px; height: 28px; } .ic.s32 { width: 32px; height: 32px; } .ic.s48 { width: 48px; height: 48px; } .ic.s64 { width: 64px; height: 64px; }
::selection { background: var(--accent); color: #fff; }
/* WPF UI scrollbars: a thin rounded thumb, no track */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.36); border-radius: 4px; border: 2.5px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.55); border-width: 1.5px; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.36); background-clip: padding-box; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.5); background-clip: padding-box; }

/* ── the window: title bar, info bar, navigation pane + frame, status bar (MainWindow.xaml) ── */
/* The window never scrolls (the WPF MainWindow fills its window): the title bar, the info bar and the
   status bar take their height, the body takes the rest, and only regions inside a page scroll.
   A flex column, so a dismissed (display: none) info bar cannot drop the body into an auto row. */
html, body { overflow: hidden; }
.win { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-width: 0; overflow: hidden; }
.win > * { flex: none; }
.win > .body { flex: 1 1 auto; }
/* title bar: 48 px, the logo, "GeoForgeX" and the version, the layout / help / theme buttons */
.titlebar { height: 48px; display: flex; align-items: center; background: var(--bg); border-bottom: 1px solid var(--stroke-solid); min-width: 0; }
.tb-brand { display: inline-flex; align-items: center; margin-left: 16px; color: var(--fg); text-decoration: none; min-width: 0; white-space: nowrap; }
.tb-brand:hover { color: var(--fg); }
.tb-logo { width: 24px; height: 24px; margin-right: 8px; flex: none; }
.tb-name { font-size: 14px; font-weight: 600; line-height: 1; }
.tb-ver { font-size: 10px; opacity: .5; margin: 2px 0 0 6px; line-height: 1; }
.tb-tools { margin-left: auto; display: flex; align-items: center; height: 100%; }
.tbbtn { width: 46px; height: 32px; display: inline-grid; place-items: center; border: 0; padding: 0; background: transparent; color: var(--fg); cursor: pointer; text-decoration: none; list-style: none; }
.tbbtn::-webkit-details-marker { display: none; }
.tbbtn:hover { color: var(--fg); background: var(--ctl); }
.tbbtn > span { display: inline-grid; place-items: center; }
.tbsep { width: 1px; height: 20px; background: gray; opacity: .3; margin: 0 2px; }
.tb-account { position: relative; }
.tb-account > summary .av { width: 24px; height: 24px; font-size: 11px; }
.tb-account .menu-list { right: 8px; min-width: 260px; }
.ml-head { display: grid; padding: 8px 12px 6px; gap: 1px; }
.ml-head b { font-weight: 600; }
.ml-head span, .ml-note { color: var(--fg2); font-size: 12px; }
.ml-note { padding: 0 12px 6px; }
.ml-label { display: block; color: var(--fg2); font-size: 12px; padding: 2px 12px 4px; }
.tb-account .ws-form { padding: 0 8px 6px; }
.tb-account .ws-form select { width: 100%; height: 32px; border: 1px solid var(--ctl-stroke); border-bottom-color: var(--ctl-edge); background: var(--ctl); border-radius: var(--r-ctl); padding: 0 8px; }
.av { width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
/* info bar: the desktop's notice (InfoBar), a gold Premium glyph, the message, Dismiss */
.infobar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--stroke-solid); min-height: 46px; }
.ib-off .infobar { display: none; }
.ib-icon { width: 17px; height: 17px; margin-right: 8px; }
.ib-text { font-size: 13px; line-height: 1.35; }
.ib-dismiss { height: 28px; padding: 0 8px; font-size: 12px; border-radius: var(--r-ctl); border: 1px solid var(--ctl-stroke); border-bottom-color: var(--ctl-edge); background: transparent; color: var(--fg); cursor: pointer; margin-left: 12px; }
.ib-dismiss:hover { background: var(--ctl); }
/* body: the NavigationView pane and the content frame */
.body { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.navpane { width: 49px; display: flex; flex-direction: column; border-right: 1px solid var(--stroke-solid); background: var(--bg); min-height: 0; overflow: hidden; transition: width .15s ease; }
:root[data-nav="open"] .navpane { width: 249px; }
.nv-toggle { flex: none; display: grid; place-items: center; width: 38px; height: 36px; margin: 1px 0 0 5px; padding: 0 0 0 1px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--fg); cursor: pointer; justify-content: start; padding-left: 12px; }
.nv-toggle:hover { background: var(--nav-hover); }
.nv-toggle .ic { width: 16px; height: 16px; }
.nv-head { display: none; flex: none; margin: 7px 0 0; padding: 12px 16px; height: 41px; border-bottom: 1px solid var(--stroke); font-size: 11px; font-weight: 600; opacity: .7; line-height: 16px; white-space: nowrap; }
:root[data-nav="open"] .nv-head { display: block; }
/* the separators: the pane's own gradient line under the header and above the footer, the flat item separator between groups */
.nv-items { flex: 1 1 auto; min-height: 0; overflow: hidden auto; display: flex; flex-direction: column; gap: 2px; padding: 0 0 4px; }
.nv-items::before, .nv-foot::before { content: ""; flex: none; display: block; height: 1px; margin: 12px 4px 2px; background: var(--nav-gsep); }
:root[data-nav="open"] .nv-items::before { margin: 10px 4px 4px; }
.nv-foot { flex: none; display: flex; flex-direction: column; gap: 0; padding-bottom: 5px; }
.nv-foot::before { margin: 0 4px 5px; }
.nv-foot > .nv-sep:first-child { display: none; }
.nv-sep { flex: none; border: 0; height: 1px; margin: 7px 5px 8px; background: var(--divider); }
.nv-foot .nv-sep { margin: 9px 5px; }
/* NavigationViewItem: 38 px, 4-px radius, a 16-px glyph 12 px in, the label 12 px after it; the selected one tinted with a 3-px accent pill on its left edge */
.nv-item { position: relative; flex: none; display: flex; align-items: center; gap: 12px; height: 38px; margin: 0 5px; padding: 0 0 0 12px; border-radius: var(--r-ctl); color: var(--fg); text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; }
.nv-item .ic { width: 16px; height: 16px; color: var(--nav-icon); }
.nv-item > span { opacity: 0; transition: opacity .1s; }
:root[data-nav="open"] .nv-item > span { opacity: 1; }
a.nv-item:hover { background: var(--nav-hover); color: var(--fg); }
.nv-item.on { background: var(--nav-sel); }
.nv-item.on::before { content: ""; position: absolute; left: 0; top: 50%; height: 16px; margin-top: -8px; width: 3px; border-radius: 2px; background: var(--accent-pri); }
.nv-item.locked { cursor: default; opacity: .6; color: #6b7280; }
.nv-item.locked .ic { color: #6b7280; }
.nv-item.lic.ok .ic { color: #22c55e; }
.nv-item.lic.ok.inproject .ic { color: var(--nav-icon); }
/* the frame: 16/12 margins, the back pill above the card, the card itself (8-px radius, the card fill at 30 %) */
.frame { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 16px; }
.backpill { flex: none; align-self: flex-start; position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px 0 10px; margin-bottom: 8px; border: 1px solid var(--accent-fill); border-radius: 6px; color: var(--accent-text); font-size: 13px; font-weight: 600; text-decoration: none; isolation: isolate; }
.backpill::before { content: ""; position: absolute; inset: -1px; border-radius: 6px; background: var(--accent-fill); opacity: .12; z-index: -1; transition: opacity var(--ease); }
.backpill:hover { color: var(--accent-text); }
.backpill:hover::before { opacity: .24; }
.backpill:active::before { opacity: .36; }
.backpill .ic { transition: transform var(--ease); }
.backpill:hover .ic { transform: translateX(-3px); }
.framecard { flex: 1 1 auto; min-height: 0; min-width: 0; border: 1px solid var(--stroke); border-radius: 8px; background: var(--frame); background-clip: padding-box; overflow: hidden; position: relative; }
/* Every page fills the card exactly: it lays out its fixed rows (title, banners, toolbars) at their
   height and gives the rest to one inner region that scrolls (.page-scroll, a table card, a list).
   overflow: auto on the page itself is only the last resort. */
.page { height: 100%; min-height: 0; overflow: auto; padding: 24px 32px; }
/* .page-col: a page whose header (and sub-navigation) stay put and whose .page-scroll takes the rest;
   the scroller spans the card so its bar sits at the frame's edge, as the desktop's ScrollViewer. */
.page.page-col { display: flex; flex-direction: column; overflow: hidden; padding: 24px 0 0; }
.page.page-col > * { flex: none; margin-left: 32px; margin-right: 32px; }
.page.page-col > .page-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 0 32px 24px; }
.page-scroll { min-height: 0; overflow: auto; }
.page.page-col > .tblwrap.page-scroll { flex: 0 1 auto; margin: 0 32px; padding: 0; }
.page-col > .tblwrap.page-scroll + .pager { margin-bottom: 20px; }
.tblwrap.page-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.page.wide { padding: 16px; }
/* status bar: the ✓ and the page's words on the left, the open document chip on the right */
.statusbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--stroke-solid); min-height: 42px; min-width: 0; }
.sb-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; white-space: nowrap; }
.sb-status .ic { color: var(--orange); }
.sb-status > span { overflow: hidden; text-overflow: ellipsis; }
.sb-chip { margin-left: auto; display: inline-flex; align-items: center; height: 21px; padding: 0 4px 0 8px; border: 1px solid rgba(234,88,12,.227); border-radius: 6px; background: rgba(234,88,12,.078); color: var(--orange); font-size: 11px; font-weight: 600; min-width: 0; max-width: 60%; }
.sb-chip > .ic { width: 12px; height: 12px; margin-right: 5px; }
.sb-chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.sb-chip-x { display: inline-grid; place-items: center; width: 19px; height: 17px; margin-left: 6px; border: 1px solid rgba(255,255,255,.07); border-radius: 4px; color: var(--orange); }
:root[data-theme="light"] .sb-chip-x { border-color: rgba(0,0,0,.06); }
.sb-chip-x:hover { background: rgba(234,88,12,.12); color: var(--orange); }
.sb-chip-x .ic { width: 11px; height: 11px; }

/* ── the window at other sizes ──
   Short windows (a 1366×768 or 1280×720 laptop): the frame and the back pill give back a little
   height, so the pages' own rows keep theirs. */
@media (max-height: 820px) and (min-width: 760px) {
  .frame { padding: 8px 12px; }
  .backpill { min-height: 28px; margin-bottom: 6px; }
}
/* Tablet (under 1100 px): the pane folds to its icons on its own, whatever was remembered;
   the hamburger then opens it over the page (.nav-peek) instead of pushing the frame. */
@media (max-width: 1099.98px) {
  .body { position: relative; grid-template-columns: 49px minmax(0, 1fr); }
  .body > .frame { grid-column: 2; grid-row: 1; }
  :root[data-nav="open"] .navpane { width: 49px; }
  :root[data-nav="open"] .nv-head { display: none; }
  :root[data-nav="open"] .nv-item > span { opacity: 0; }
  :root[data-nav="open"] .nv-items::before { margin: 12px 4px 2px; }
  :root.nav-peek .navpane { position: absolute; top: 0; bottom: 0; left: 0; z-index: 40; width: 249px; box-shadow: 8px 0 24px rgba(0,0,0,.35); }
  :root.nav-peek .nv-head { display: block; }
  :root.nav-peek .nv-item > span { opacity: 1; }
  :root.nav-peek .nv-items::before { margin: 10px 4px 4px; }
}
/* Phone (under 760 px): the desktop has no phone mode, so the frame scrolls as one page here;
   pages drop their fixed heights (their own rules at this width) and nothing scrolls sideways. */
@media (max-width: 759.98px) {
  .framecard { overflow: hidden auto; }
  .page { height: auto; min-height: 100%; overflow: visible; }
  .page.page-col { display: block; padding: var(--s5) var(--gutter) var(--s7); }
  .page.page-col > * { margin-left: 0; margin-right: 0; }
  .page.page-col > .page-scroll, .page.page-col > .tblwrap.page-scroll { padding: 0; margin-left: 0; margin-right: 0; }
  .page-scroll { overflow: visible; }
}
/* kept for older markup */
.iconbtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); cursor: pointer; transition: background var(--ease); }
.iconbtn:hover { background: var(--ctl); }
.linkbtn { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.crumb { color: var(--fg2); font-size: var(--fs-small); }
.work { position: relative; overflow: auto; min-width: 0; min-height: 0; }

/* ── page header card: a Fluent card, the title in the accent orange, the page's figures along the bottom ── */
.ph { position: relative; background: var(--ph-bg); color: var(--ph-fg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin-bottom: var(--block); }
.ph-top { display: flex; align-items: flex-start; gap: var(--s4) var(--s6); flex-wrap: wrap; }
.ph-text { flex: 1 1 320px; min-width: 0; display: grid; gap: 6px; }
.ph-text > * { min-width: 0; }
.ph-eyebrow { font-size: var(--fs-caption); letter-spacing: 0; color: var(--ph-eyebrow); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.ph-eyebrow:hover { color: var(--fg); }
/* the title: 24 px semibold in the accent, at most two lines with an ellipsis; the full name is its tooltip */
.ph-title { color: var(--accent); font-family: var(--font-display); font-size: var(--fs-title); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ph-sub { color: var(--ph-sub); font-size: var(--fs-body); line-height: 1.5; display: flex; flex-wrap: wrap; gap: var(--chip-gap) var(--group-gap); align-items: center; }
/* advice lives here as a small link, never as a banner */
.ph-sub .hint { color: var(--accent-text); font-size: var(--fs-small); text-decoration: none; }
.ph-sub .hint:hover { color: var(--accent-hover); text-decoration: underline; }
.ph-sub b { color: var(--fg); font-weight: 600; }
.ph-sub a { color: var(--accent-text); }
.ph-actions { display: flex; align-items: center; gap: var(--ctl-gap); flex-wrap: wrap; justify-content: flex-end; margin-left: auto; padding-top: 2px; }
.ph-actions form.inline { display: inline; }
.ph .chip.plain { background: var(--fill); color: var(--fg); }
.ph-below { margin-top: var(--title-gap); }
.ph-below:not(:has(> :not([hidden]))) { display: none; }
/* progress inside the card (the Deeds queue, page preparation, the live run): blue is "running" */
.ph .qbanner, .ph .prep { background: var(--fill); border: 1px solid var(--line); color: var(--fg); box-shadow: none; margin: 0; padding: var(--s4) 20px; }
.ph .qbanner .qtext span, .ph .prep { color: var(--muted); }
.ph .qbanner.warn { background: var(--warn-soft); border-color: rgba(245,158,11,.28); }
.ph .qbanner:not([hidden]) + .prep:not([hidden]) { margin-top: var(--s3); }
.ph .bar { background: var(--fill-strong); }
.ph .bar span, .ph .qbanner .bar span { background: var(--info); }
.ph-stats { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s7); margin-top: var(--title-gap); padding-top: 20px; border-top: 1px solid var(--ph-line); align-items: flex-end; }
.ph-stat { display: grid; gap: 2px; min-width: 0; }
.ph-label { font-size: 12px; letter-spacing: 0; color: var(--rp-label); font-weight: 600; white-space: nowrap; }
.ph-line { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ph-value { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; line-height: 1.25; color: var(--rp-value); }
.ph-value small, .ph-line small { font-size: var(--fs-caption); color: var(--muted); font-weight: 400; }
/* the figure that needs looking at is amber (a status), never orange: orange is the primary action and the selection */
.ph-stat.is-attn .ph-value, .ph-stat.attn .ph-value { color: var(--warn-ink); }   /* .attn: deeds.js toggles it */
.ph-stat .assumed { color: var(--warn-ink); }
.ph-stats .chip { align-self: center; }
.ph-tools { display: flex; align-items: center; gap: var(--ctl-gap); flex-wrap: wrap; margin-left: auto; }

/* ── page structure ─────────────────────────────────────────────────────────── */
.head { display: flex; align-items: center; gap: var(--ctl-gap) var(--group-gap); flex-wrap: wrap; margin-bottom: var(--title-gap); }
.head.tight { margin-bottom: var(--s3); }
.head .sub { color: var(--muted); margin-top: 4px; font-size: var(--fs-small); }
.head .actions { margin-left: auto; display: flex; gap: var(--ctl-gap); flex-wrap: wrap; align-items: center; }
.head .actions form.inline { display: inline; }
.shead { display: flex; align-items: center; gap: var(--ctl-gap); margin-bottom: var(--title-gap); }
.shead h2 { margin-right: auto; font-size: var(--fs-body); color: var(--fg); font-weight: 600; }
.shead .count { color: var(--faint); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.section { margin-top: var(--block); }
/* the first block under the header card (or under a message) needs no margin of its own */
.ph + .section, .alert + .section, .msgs + .section { margin-top: 0; }
/* one message at a time: in a .msgs group only the first message that is set shows */
.msgs > .alert:not([hidden]) ~ .alert { display: none !important; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--block); }
.two > *, .stack > * { min-width: 0; }
.stack { display: grid; gap: var(--block); align-content: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--block); align-items: start; }
.row { display: flex; align-items: center; gap: var(--ctl-gap); flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow-sm); }
.card > h2 { margin-bottom: var(--s1); font-size: var(--fs-section); }
/* a card's own title: Fluent's Body Strong (14 px semibold) */
.card > h3, .card > .head h3 { font-size: var(--fs-body); color: var(--fg); font-weight: 600; margin-bottom: var(--s3); }
.card > .head h3 { margin-bottom: 0; }
.card > .eyebrow { margin-bottom: var(--s4); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: var(--ctl-gap); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0 auto 0 0; font-size: var(--fs-body); color: var(--fg); font-weight: 600; }
.card-body { padding: var(--s5); }

/* empty state: an icon in a soft circle, one sentence, one action */
.empty { display: grid; justify-items: center; gap: var(--s2); text-align: center; color: var(--muted); padding: var(--s8) var(--s5); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow-sm); }
.empty .ic-tile { margin-bottom: var(--s2); border-radius: 50%; }
.empty b, .empty h3 { color: var(--fg); font-size: var(--fs-section); font-weight: 600; }
.empty p { max-width: 480px; }
.empty .btn, .empty .drop { margin-top: var(--s3); }
.ic-tile { width: 48px; height: 48px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ic-tile.navy { background: var(--accent); color: #fff; }
.ic-tile.quiet { background: var(--panel2); color: var(--muted); }
.ic-tile.big { width: 56px; height: 56px; border-radius: var(--r); }
.ic-tile.round { border-radius: 50%; }

.alert { border: 1px solid var(--line); background: var(--info-soft); color: var(--fg); border-radius: var(--r-ctl); padding: var(--s4) 20px; margin-bottom: var(--block); font-size: var(--fs-small); line-height: 1.55; }
.alert.warn { background: var(--warn-soft); }
.alert.good { background: var(--ok-soft); }
.alert.bad { background: var(--bad-soft); }
.alert .linkbtn, .alert a { color: inherit; font-weight: 600; }
.alert.inset { margin-bottom: var(--form-gap); }

/* skeleton rows while a list loads */
.skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--panel2) 25%, var(--hover) 50%, var(--panel2) 75%); background-size: 200% 100%; animation: gfx-shimmer 1.4s linear infinite; }
.skel.w40 { width: 40%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; } .skel.w20 { width: 20%; }
@keyframes gfx-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
tr.skelrow td { height: var(--row-h); }

/* ── controls: Fluent buttons (accent, standard, subtle), text boxes with the accent underline ── */
.btn { min-height: 32px; border: 1px solid var(--line); border-bottom-color: var(--line2); background: var(--ctl); border-radius: var(--r-ctl); padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); white-space: nowrap; font-weight: 400; font-size: 14px; text-decoration: none; color: var(--fg); transition: background var(--ease), border-color var(--ease), color var(--ease); }
.btn:hover { background: var(--ctl-hover); color: var(--fg); }
.btn:active { background: var(--fill-press); color: var(--muted); }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--disabled); background: var(--fill-press); cursor: default; }
/* a disabled accent button: Fluent's AccentFillColorDisabled, never a washed-out orange */
.btn.primary:disabled, .btn.primary[aria-disabled="true"] { opacity: 1; background: var(--fill-strong); border-color: transparent; color: var(--disabled); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: rgba(255,255,255,.08); border-bottom-color: rgba(0,0,0,.24); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-ink); }
.btn.primary:active:not(:disabled) { background: var(--accent-press); color: rgba(255,255,255,.82); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg); }
.btn.ghost:hover { color: var(--fg); background: var(--fill); border-color: transparent; }
.btn.ghost:active { background: var(--fill-press); }
.btn.danger { color: var(--bad-ink); }
.btn.danger:hover { background: var(--error); border-color: var(--error); color: #fff; }
.btn.sm { min-height: 28px; padding: 0 10px; font-size: var(--fs-small); border-radius: var(--r-sm); }
.btn.lg { min-height: 40px; padding: 0 20px; font-size: 14px; border-radius: var(--r-ctl); }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn.wide { width: 100%; margin-top: var(--s5); }
.field { display: grid; gap: var(--s2); margin-top: var(--form-gap); font-size: var(--fs-small); }
.field > span { color: var(--fg); font-weight: 400; }
/* TextBox: control fill, a hairline frame with a stronger bottom edge; focused, a darker fill and a 2-px accent underline */
.field input, .field select, .field textarea, .input, .short, .tiny { border: 1px solid var(--line); border-bottom-color: var(--ctl-edge); background: var(--ctl); border-radius: var(--r-ctl); padding: 0 11px; height: 32px; width: 100%; transition: background var(--ease), box-shadow var(--ease); }
.field input:hover, .field select:hover, .field textarea:hover, .input:hover, .select:hover { background: var(--ctl-hover); }
.field textarea { height: auto; padding: 6px 11px; }
.field input[type="file"] { padding: 4px 11px; height: auto; }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; height: auto; accent-color: var(--accent); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .short:focus, .tiny:focus, .select:focus, .rowmode:focus { outline: 0; background: var(--ctl-focus); border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.short { width: 88px; height: 32px; padding: 0 10px; } .tiny { width: 64px; height: 28px; padding: 0 6px; display: inline-block; border-radius: var(--r-sm); }
.search { display: flex; align-items: center; gap: var(--s2); border: 1px solid var(--line); border-bottom-color: var(--ctl-edge); background: var(--ctl); border-radius: var(--r-ctl); padding: 0 11px; height: 32px; min-width: 240px; color: var(--faint); transition: background var(--ease), box-shadow var(--ease); }
.search:hover { background: var(--ctl-hover); }
.search:focus-within { background: var(--ctl-focus); border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.search input { border: 0; background: transparent; outline: 0; width: 100%; color: var(--fg); height: 100%; font-size: 14px; }
.search input::placeholder, .field input::placeholder { color: var(--faint); }
.select { height: 32px; border: 1px solid var(--line); border-bottom-color: var(--line2); background: var(--ctl); border-radius: var(--r-ctl); padding: 0 11px; }
select option { background: var(--raised); color: var(--fg); }
/* segmented control: Fluent's SelectorBar / toggle group, a quiet track with the current one raised */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--fill-press); padding: 2px; gap: 2px; }
.seg.wrap { flex-wrap: wrap; }
.seg label { position: relative; display: inline-flex; }
.seg label > input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label > span, .seg > a, .seg > button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; cursor: pointer; color: var(--muted); font-weight: 400; border-radius: var(--r-sm); border: 0; background: transparent; text-decoration: none; font-size: var(--fs-small); transition: background var(--ease), color var(--ease); }
.seg label > span:hover, .seg > a:hover, .seg > button:hover { background: var(--fill); color: var(--fg); }
.seg label > input:checked + span, .seg > .on { background: var(--ctl-hover); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line), inset 0 -2px 0 var(--accent); font-weight: 600; }
.seg label > input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: -2px; }
.seg.icons > a, .seg.icons > button { width: 32px; padding: 0; justify-content: center; }
.seg.sm label > span, .seg.sm > a, .seg.sm > button { min-height: 24px; padding: 0 10px; font-size: var(--fs-caption); }

/* status chips: Fluent InfoBadge-like — a dot, a word, a tinted ground (green, blue, amber, red, grey) */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-sm); padding: 0 8px; height: 24px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; line-height: 1; color: var(--muted); background: var(--neutral-soft); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.plain::before { display: none; }
.c-analyzed { color: var(--ok-ink); background: var(--ok-soft); }
.c-ready { color: var(--info-ink); background: var(--info-soft); }
.c-analyzing { color: var(--info-ink); background: var(--info-soft); }
.c-analyzing::before { animation: gfx-pulse 1.4s ease-in-out infinite; }
.c-queued { color: var(--muted); background: var(--neutral-soft); }
.c-pages { color: var(--warn-ink); background: var(--warn-soft); }
.c-failed { color: var(--bad-ink); background: var(--bad-soft); }
@keyframes gfx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* status dots (legacy; project cards now use chips) */
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.sdot.ok { background: var(--success); }
.sdot.run { background: var(--info); animation: gfx-pulse 1.4s ease-in-out infinite; }
.sdot.attn { background: var(--warning); }
.sdot.idle { background: var(--line2); }

/* Fluent toggle switch: the settings' on/off rows (.toggle) use it, as the desktop's ToggleSwitch */
.toggle input[type="checkbox"], input.switch { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 40px !important; height: 20px !important; padding: 0 !important; margin: 0; border-radius: 10px; border: 1px solid var(--ctl-edge); background: var(--fill-press); cursor: pointer; transition: background var(--ease), border-color var(--ease); }
.toggle input[type="checkbox"]::before, input.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform var(--ease), background var(--ease); }
.toggle input[type="checkbox"]:hover::before, input.switch:hover::before { transform: scale(1.12); }
.toggle input[type="checkbox"]:checked, input.switch:checked { background: var(--accent); border-color: var(--accent); }
.toggle input[type="checkbox"]:checked::before, input.switch:checked::before { background: #fff; transform: translateX(20px); }
.toggle input[type="checkbox"]:disabled, input.switch:disabled { opacity: .5; cursor: default; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ── tables: the desktop grid's look (GeoForgeXDataGrid): header strip, hairlines, blue selection ── */
.tblwrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.tblwrap + * { margin-top: var(--s5); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl.compact { font-size: var(--fs-small); }
.tbl th { text-align: left; font-size: 12px; letter-spacing: 0; color: var(--fg); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel2); }
.tbl td { padding: 8px 12px; height: var(--row-h); border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; transition: background var(--ease); }
.tbl.compact td { padding: 8px 12px; height: var(--row-h); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tbody tr.sel td, .tbl tbody tr[aria-selected="true"] td { background: var(--sel); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .act { white-space: nowrap; text-align: right; width: 1%; }
.tbl .act > * + * { margin-left: var(--s3); }
.tbl .act .menu > summary { opacity: .7; transition: opacity var(--ease); }
.tbl tr:hover .act .menu > summary, .tbl .act .menu[open] > summary, .tbl .act .menu > summary:focus-visible { opacity: 1; }
.rowlink { color: inherit; text-decoration: none; }
a.rowlink:hover, a.rowlink:hover b { color: var(--accent-text); }
.pager { display: flex; gap: var(--s1); margin-top: var(--s5); flex-wrap: wrap; justify-content: center; }

/* ── menus (⋯): a Fluent MenuFlyout ──────────────────────────────────────────── */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; background: var(--raised); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px; display: grid; text-align: left; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; min-height: 32px; padding: 0 12px; border-radius: var(--r-sm); color: var(--fg); text-decoration: none; cursor: pointer; font-size: 14px; font-weight: 400; white-space: nowrap; transition: background var(--ease); }
.menu-list .ic { width: 16px; height: 16px; color: var(--fg); }
.menu-list a:hover, .menu-list button:hover { background: var(--fill); }
.menu-list .danger, .menu-list .danger .ic { color: var(--error); }
.menu-list button:disabled { color: var(--disabled); cursor: default; background: none; }
.menu-list form { margin: 0; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px -4px; }

/* ── dialogs: a Fluent ContentDialog (layer body, window-coloured command bar) ──
   Every dialog is a modal on an opaque surface (--sheet: #2b2b2b dark, #fbfbfb light; the layer
   fills are translucent and let the page show through), centred over a dimmed backdrop, with
   its body scrolling when it is taller than the window. Esc and a click on the backdrop close it. */
dialog.sheet { width: min(540px, calc(100% - 32px)); max-height: calc(100% - 48px); margin: auto; border: 1px solid var(--line2); border-radius: var(--r-lg); background: var(--sheet); color: var(--fg); padding: 0; box-shadow: var(--shadow); overflow: auto; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: var(--backdrop); }
dialog.sheet[open] { animation: gfx-rise .15s ease-out; }
@keyframes gfx-rise { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
dialog.sheet > form { margin: 0; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
dialog.sheet .sheet-head, dialog.sheet .sheet-foot { flex: none; }
dialog.sheet .sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.sheet-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s5) 0; }
.sheet-head > div { margin-right: auto; }
.sheet-head h2 { font-size: 20px; font-weight: 600; }
.sheet-head .note { margin-top: 4px; }
.sheet-body { padding: var(--s2) var(--s5) var(--s5); }
.sheet-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s5); border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.sheet-foot .btn { min-width: 104px; }
.closebtn { width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); display: grid; place-items: center; cursor: pointer; margin: -4px -6px 0 0; flex: none; transition: background var(--ease); }
.closebtn:hover { background: var(--fill); }
/* the in-page confirm (app.js gfxConfirm): icon, question, one line, two buttons */
dialog.sheet.confirm { width: min(460px, calc(100% - 32px)); }
dialog.sheet.confirm .sheet-head { padding-bottom: var(--s5); align-items: flex-start; }
dialog.sheet.confirm .sheet-head h2 { font-size: 20px; line-height: 1.3; }
dialog.sheet.confirm .cmsg { color: var(--muted); font-size: 14px; margin-top: 6px; white-space: pre-line; }
dialog.sheet.confirm .ic-tile { width: 40px; height: 40px; border-radius: 50%; background: var(--info-soft); color: var(--info-ink); }
dialog.sheet.confirm .ic-tile.danger { background: var(--bad-soft); color: var(--bad-ink); }
.btn.danger.solid { background: var(--error); border-color: var(--error); color: #fff; }
.btn.danger.solid:hover { background: #dc2626; border-color: #dc2626; }

/* Fluent tooltips (app.js shows them on icon-only buttons and anything with data-tip) */
.tip { position: fixed; z-index: 120; background: var(--raised); color: var(--fg); border: 1px solid var(--line2); font-size: 12px; font-weight: 400; line-height: 1.45; padding: 6px 8px 7px; border-radius: var(--r-sm); box-shadow: 0 4px 12px rgba(0,0,0,.26); max-width: 340px; pointer-events: none; opacity: 0; transition: opacity var(--ease); white-space: pre-line; }
.tip.show { opacity: 1; }
.tip b { display: block; font-weight: 600; margin-bottom: 4px; }
.tip .tnote { display: block; color: var(--faint); font-size: 11px; margin-top: 4px; }

/* ── drop zone ──────────────────────────────────────────────────────────────── */
.drop { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding: var(--s7) var(--s5); border: 1.5px dashed var(--line2); border-radius: var(--r); background: var(--panel2); color: var(--muted); cursor: pointer; transition: border-color var(--ease), background var(--ease); font-size: var(--fs-small); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop b { color: var(--fg); font-size: 15px; font-weight: 600; }
.drop .ic-tile { margin-bottom: var(--s2); }
.drop .btn { margin-top: var(--s3); pointer-events: none; }
.drop.busy { opacity: .6; pointer-events: none; }
.drop.big { padding: var(--s9) var(--s5); }
.fileinput { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.filebtn { position: relative; }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.filebtn.busy { opacity: .6; pointer-events: none; }
.files { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); }
.files li { display: flex; align-items: center; gap: var(--s3); padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--panel); font-size: var(--fs-small); }
.files li .ic { color: var(--muted); }
.files li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.files li .size { color: var(--faint); font-size: var(--fs-caption); white-space: nowrap; }

/* ── stepper ────────────────────────────────────────────────────────────────── */
.stepper { list-style: none; display: flex; align-items: center; padding: 0; margin: 0 0 var(--title-gap); flex-wrap: wrap; row-gap: var(--s2); }
.stepper li { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; }
.stepper li + li::before { content: ""; width: 36px; height: 1.5px; background: var(--line2); margin: 0 14px; border-radius: 2px; }
.stepper li > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line2); background: var(--panel); font-size: 12px; font-weight: 600; color: var(--muted); }
.stepper li.done { color: var(--fg); }
.stepper li.done > span { background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.stepper li.done + li::before { background: var(--success); opacity: .55; }
.stepper li.on { color: var(--fg); font-weight: 600; }
.stepper li.on > span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ── choice cards (radio as cards: mode, model) ─────────────────────────────── */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.choice { position: relative; display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s5); padding-right: var(--s7); border: 1.5px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.choice:hover { border-color: var(--line2); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ic-tile { width: 44px; height: 44px; background: var(--panel2); color: var(--muted); }
.choice b { display: block; font-size: 15px; font-weight: 600; }
.choice .help { display: block; color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.choice::after { content: ""; position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--panel); box-sizing: border-box; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:checked) .ic-tile { background: var(--accent-soft); color: var(--accent); }
.choice:has(input:checked)::after { border: 5.5px solid var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice:has(input:disabled) { cursor: default; opacity: .7; }
.choices.compact .choice { padding: var(--s4); padding-right: var(--s7); gap: var(--s3); }
.choices.compact .choice .ic-tile { width: 36px; height: 36px; border-radius: 10px; }

/* ── stats (a quiet row inside a card; the page figures live in the header card) ─ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.stats .stat { padding: var(--s4) var(--s5); display: grid; gap: 2px; min-width: 0; align-content: start; align-items: start; }
.stats .stat + .stat { border-left: 1px solid var(--line); }
.stats .stat > span { font-size: 12px; color: var(--rp-label); font-weight: 600; }
.stats .stat b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats .stat b small { font-size: var(--fs-small); color: var(--faint); font-weight: 500; }
.stats .stat.attn b { color: var(--accent); }

/* ── home ───────────────────────────────────────────────────────────────────── */
.welcome { margin-bottom: var(--s6); }
.welcome .lic { display: flex; align-items: center; gap: var(--s2); color: var(--muted); margin-top: var(--s2); font-size: var(--fs-small); flex-wrap: wrap; }
.ph .lic { display: inline-flex; align-items: center; gap: var(--s2); }
.entry { display: grid; grid-template-columns: 1fr 1fr; gap: var(--block); }
.entry > * { min-width: 0; }
.entry-card { display: flex; flex-direction: column; gap: var(--s5); padding: var(--s5); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); color: inherit; min-height: 316px; }
.entry-card .top { display: flex; gap: var(--s4); align-items: flex-start; }
.entry-card h2 { font-size: var(--fs-section); }
.entry-card .top p { color: var(--muted); margin-top: 4px; font-size: var(--fs-small); }
.entry-card > .drop, .entry-card > form { flex: 1; display: grid; }
.steps-mini { flex: 1; display: grid; align-content: center; gap: 14px; padding: var(--s5); border-radius: var(--r-ctl); background: var(--panel2); }
.steps-mini div { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--fs-small); }
.steps-mini div > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line2); font-size: 12px; font-weight: 600; color: var(--fg); flex: none; }
.steps-mini div b { color: var(--fg); font-weight: 600; }
.entry-card .foot { display: flex; align-items: center; gap: var(--ctl-gap); flex-wrap: wrap; }

/* ── project cards ──────────────────────────────────────────────────────────── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: var(--s5); }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: border-color var(--ease), box-shadow var(--ease); min-width: 0; }
.pcard:hover { border-color: var(--line2); box-shadow: var(--shadow-hover); }
/* The desktop's plot thumbnail (PlotThumbnailBuilder): drawn on its navy #0A1929 in either theme. */
.pcard-pic { position: relative; display: block; aspect-ratio: 16 / 10; background: #0a1929; border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
.pcard-pic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.pcard-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pcard-body { position: relative; display: grid; gap: 2px; padding: var(--s4) var(--s5) 18px; min-width: 0; }
.pc-title { min-width: 0; padding-right: 36px; }
.pc-name { display: block; font-weight: 600; font-size: 15px; color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* the whole card opens the project */
.pcard:has(.pc-name:hover) .pc-name { color: var(--accent); }
.pc-client { font-size: var(--fs-small); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: var(--s2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-status { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-caption); color: var(--muted); margin-top: var(--s3); white-space: nowrap; min-width: 0; }
.pc-status .when { margin-left: auto; color: var(--faint); }
.pc-menu { position: absolute; top: 10px; right: 10px; z-index: 3; }
.pc-menu > summary { color: var(--muted); }
.pc-badge { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: var(--chip-gap); }
.pc-badge .chip { background: var(--raised); color: var(--fg); border: 1px solid var(--line); }
.pgrid.as-list { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow-sm); }
.pgrid.as-list .pcard { flex-direction: row; align-items: center; border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); padding: 10px var(--s4); gap: var(--s4); background: transparent; }
.pgrid.as-list .pcard:last-child { border-bottom: 0; }
.pgrid.as-list .pcard:hover { background: var(--hover); }
.pgrid.as-list .pcard-pic { width: 88px; flex: none; border-radius: var(--r-sm); }
.pgrid.as-list .pcard-pic::after { box-shadow: inset 0 0 0 1px var(--line); }
.pgrid.as-list .pcard-body { flex: 1; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) 40px; align-items: center; gap: var(--s4); padding: 0; }
.pgrid.as-list .pc-title { padding-right: 0; }
.pgrid.as-list .pc-meta, .pgrid.as-list .pc-status { margin-top: 0; }
.pgrid.as-list .pc-menu { position: relative; top: auto; right: auto; justify-self: end; }
.pgrid.as-list .pc-badge { display: none; }
/* the one slim context row under the header card: no card of its own, 12 px between controls */
.toolbar { display: flex; align-items: center; gap: var(--ctl-gap); flex-wrap: wrap; margin-bottom: var(--title-gap); }
.toolbar .search { flex: 1; max-width: 440px; }
.toolbar .spacer { flex: 1; }
.toolbar .label { font-size: var(--fs-small); color: var(--muted); }

/* ── deeds page: the toolbar strip under the header card ───────────────────── */
.phead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5) var(--s6); align-items: center; margin-bottom: var(--s5); }
.phead h1 { overflow-wrap: anywhere; }
.phead .sub { color: var(--muted); margin-top: 6px; display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.phead .stats { min-width: 520px; }
.pbar { display: flex; align-items: center; gap: var(--ctl-gap); flex-wrap: wrap; margin-bottom: var(--title-gap); }
.pbar .label { font-size: var(--fs-small); color: var(--muted); font-weight: 500; }
.pbar .spacer { flex: 1; }
.rowmode { height: 32px; border: 1px solid var(--line2); background: var(--panel); border-radius: var(--r-sm); padding: 0 8px; font-size: var(--fs-small); }
.rowerr { color: var(--bad-ink); font-size: var(--fs-caption); margin-top: 4px; max-width: 340px; }
.prep { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); margin-bottom: var(--title-gap); font-size: var(--fs-small); }
.prep.bad { background: var(--bad-soft); border-color: transparent; }
.prep.bad .bar { display: none; }
.bar { height: 5px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin-top: var(--s2); }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s; }
.bar.indet { width: 96px; margin: 6px 0 0; }
.bar.indet span { width: 35%; animation: gfx-indet 1.4s ease-in-out infinite; }
@keyframes gfx-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
.elapsed { margin-left: 6px; font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }

/* ── page picker ────────────────────────────────────────────────────────────── */
.picker-bar { display: flex; align-items: center; gap: var(--ctl-gap); font-size: var(--fs-small); color: var(--muted); margin: 0 0 var(--title-gap); flex-wrap: wrap; }
.picker-bar b { color: var(--fg); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s4); }
.thumbs[hidden] { display: none; }
.thumb { position: relative; display: grid; gap: var(--s2); justify-items: center; padding: 10px 10px 8px; background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; font-size: var(--fs-caption); color: var(--muted); transition: border-color var(--ease), background var(--ease); }
.thumb:hover { border-color: var(--line2); }
.thumb canvas { width: 100%; max-width: 150px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.thumb canvas.broken { background: var(--panel2); }
.thumb::after { content: ""; position: absolute; top: 16px; right: 16px; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line2); background: var(--panel); box-sizing: border-box; }
.thumb[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); font-weight: 600; }
.thumb[aria-pressed="true"]::after { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a0d04' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--accent); }
.thumb:disabled { cursor: default; }

/* ── account & settings ─────────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; font-size: var(--fs-small); margin: var(--s3) 0 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.seat { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.seat:last-of-type { border-bottom: 0; }
.seat .av { width: 30px; height: 30px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line); font-size: 11px; font-weight: 600; }
.seat .em { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.seat .us { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toggle.col { flex-direction: column; align-items: stretch; }
.toggle:last-child { border-bottom: 0; padding-bottom: 0; }
.card > .eyebrow + .toggle, .card > .eyebrow + form > .toggle:first-child { padding-top: 0; }
.toggle > div > span { color: var(--muted); font-size: var(--fs-caption); display: block; margin-top: 2px; }
.toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.licline { display: flex; gap: var(--s5); flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); margin-top: var(--s4); }
.licline b { color: var(--fg); font-weight: 500; }
.gauge { display: block; width: 100%; height: 6px; border-radius: 999px; overflow: hidden; border: 0; background: var(--panel2); -webkit-appearance: none; appearance: none; margin-top: var(--s2); }
.gauge::-webkit-progress-bar { background: var(--panel2); border-radius: 999px; }
.gauge::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.gauge::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* ── auth pages: one Fluent card on the window ─────────────────────────────── */
.auth-body { display: grid; place-items: center; background: var(--bg); min-height: 100%; }
/* the sign-in pages are not the app window: they centre in it and only scroll if a window is too short for the card */
html:has(> body.auth-body), html > body.auth-body { overflow: auto; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--fg); margin-bottom: var(--s4); }
.auth-brand .auth-logo { width: 56px; height: 56px; object-fit: contain; }
.auth-brand .mark { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--orange); color: #fff; }
.auth-brand .mark svg { width: 20px; height: 20px; fill: currentColor; }
.auth-brand .wm > span { color: var(--orange); }
.auth-brand small { margin-left: 6px; font-size: 11px; font-weight: 600; opacity: .6; }
.auth-main { width: min(100%, 440px); padding: var(--s6) var(--s4); }
.auth-brand { justify-content: center; color: var(--rail-fg); padding: 0 0 var(--s5); }
.signin { padding: var(--s6); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.signin h1 { font-size: 24px; }
.signin .note a { color: var(--accent-text); }

/* ── toast: bottom right, three seconds ─────────────────────────────────────── */
.toast { position: fixed; right: 24px; bottom: 24px; transform: translateY(8px); background: var(--raised); color: var(--fg); border: 1px solid var(--line2); border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow); font-size: var(--fs-small); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; max-width: min(420px, calc(100% - 32px)); z-index: 100; display: flex; align-items: center; gap: var(--s3); }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast .tmsg { flex: 1; min-width: 0; }
.toast .tact { flex: none; min-height: 28px; padding: 0 10px; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--ctl); color: var(--accent-text); font-weight: 600; cursor: pointer; }
.toast .tact:hover { background: var(--ctl-hover); }

/* blocks a few secondary screens still use */
.action { display: flex; gap: var(--s4); align-items: center; padding: var(--s5); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; transition: border-color var(--ease); }
.action:hover { border-color: var(--line2); }
.action b { display: block; }
.action span { color: var(--muted); font-size: var(--fs-small); }
.action.as-label { cursor: pointer; position: relative; }
.action.as-label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  :root { --gutter: 32px; }
  .phead { grid-template-columns: 1fr; }
  .phead .stats { min-width: 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .pgrid.as-list .pcard-body { grid-template-columns: minmax(0, 1fr) 40px; gap: 2px var(--s3); }
  .pgrid.as-list .pc-meta, .pgrid.as-list .pc-status { grid-column: 1; }
  .pgrid.as-list .pc-menu { grid-column: 2; grid-row: 1 / 4; }
}
@media (max-width: 759.98px) {
  :root { --gutter: 32px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .rail { grid-row: auto; flex-direction: row; align-items: center; padding: 0 var(--s2); overflow-x: auto; gap: var(--s1); }
  .brand { padding: 10px var(--s1); }
  .brand .wm, .brand small { display: none; }
  .nav, .nav-group, .nav-foot { flex-direction: row; flex: none; overflow: visible; border: 0; margin: 0; padding: 0; gap: 2px; }
  .nav .eyebrow, .railfoot .lic { display: none; }
  .nav a { min-height: 40px; padding: 0 10px; white-space: nowrap; }
  .nav a.on::before { display: none; }
  .railfoot { border: 0; margin: 0 0 0 auto; padding: 0; }
  .topbar { height: auto; min-height: var(--topbar); flex-wrap: wrap; padding-block: 8px; gap: var(--s2); }
  .page, .page.wide { padding: var(--s5) var(--gutter) var(--s7); }
  .ph { padding: var(--s5); border-radius: var(--r); }
  .ph-actions { margin-left: 0; justify-content: flex-start; width: 100%; }
  .ph-stats { gap: var(--s4) var(--s5); }
  .two, .entry { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat + .stat { border-left: 0; }
  .stats .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .search { min-width: 0; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .stepper li + li::before { width: 14px; margin: 0 8px; }
  .entry-card { min-height: 0; }
  .pgrid { grid-template-columns: 1fr; }
  .drop.big { padding: var(--s7) var(--s4); }
  .toast { right: 16px; left: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* The hidden attribute must win over every explicit display rule (e.g. .btn is inline-flex). */
[hidden] { display: none !important; }
.drop .ic-tile.quiet { background: var(--panel); color: var(--muted); box-shadow: var(--shadow-sm); }
.doc-done { display: flex; align-items: center; gap: var(--s5); padding: var(--s6); flex-wrap: wrap; }
.doc-done h2 { font-size: 20px; }
.doc-go { width: 100%; }
.picker-bar h2 { margin-right: auto; font-size: var(--fs-section); }
.stats .stat b .chip { vertical-align: 3px; margin-left: 6px; letter-spacing: 0; }
.tbl .act > *, .tbl .act .menu { vertical-align: middle; }
/* Narrow screens: the Deeds table keeps the deed, its status and the actions; the rest is on
   the Result page. Columns are hidden by name ([data-col]), never by position. */
@media (max-width: 759.98px) {
}
@media (max-width: 767px) {
}
.thumbs > .alert, .thumbs > .muted { grid-column: 1 / -1; }
.drop.compact { padding: var(--s4) var(--s5); grid-auto-flow: column; justify-content: center; align-items: center; gap: var(--s3); }
.drop.compact .ic-tile, .drop.compact .caption { display: none; }
.drop.compact .btn { margin-top: 0; }
@media (max-width: 759.98px) { .drop.compact { grid-auto-flow: row; } }

/* Deeds: the desktop table extras (queue banner, search, columns, tract rows, trash) */
.qbanner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow-sm); }
.qbanner[hidden] { display: none; }
.qbanner.warn { background: var(--warn-soft); border-color: transparent; }
.qbanner .qtext { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-small); }
.qbanner .qtext span { color: var(--muted); }
.qbanner .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.qbanner .bar[hidden] { display: none; }
.qbanner .bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .45s ease; }
.dtools { display: flex; align-items: center; gap: var(--s3); }
.dtools[hidden] { display: none; }
.dtools .search { width: 320px; flex: none; }
@media (max-width: 759.98px) { .pbar > .dtools { display: contents; } .pbar .search { flex: 1 1 100%; width: auto; } .pbar .spacer { display: none; } .pbar .mhint { order: 0; } }
.dtools .spacer { flex: 1; }
.colchooser .menu-list { min-width: 170px; }
.colchooser label.chk { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; font-size: var(--fs-small); cursor: pointer; }
.pbar .mhint { font-size: var(--fs-caption); }
.pbar .mhint:empty { display: none; }
ul.removed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
ul.removed li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.removed li .btn { margin-left: auto; }

/* help sheets shared by Result and Export (the desktop's CAD Plot Script and Carlson DXF dialogs) */
dialog.sheet#cad-help, dialog.sheet#dxf-help { width: min(640px, calc(100% - 32px)); }
.cadgroup { display: inline-flex; gap: 4px; }
.cadchips { display: flex; flex-wrap: wrap; gap: var(--chip-gap); margin: 4px 0 12px; }
ol.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: var(--fs-small); }
.sheet-body > label.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); margin-top: 10px; }

/* page picker: the large preview (the desktop's preview panel) */
.thumb { position: relative; }
.thumb .peek { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: var(--panel); border: 1px solid var(--line2); color: var(--muted); font-size: 13px; opacity: 0; transition: opacity var(--ease); }
.thumb:hover .peek, .thumb:focus-visible .peek { opacity: 1; }
.thumb .peek:hover { color: var(--fg); border-color: var(--accent); }
dialog.preview-sheet { width: min(1100px, calc(100% - 32px)); }
.preview-sheet .sheet-head { align-items: center; }
.preview-sheet .pv-tools { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.preview-sheet .pv-tools .num { min-width: 44px; text-align: center; font-size: var(--fs-caption); color: var(--muted); }
.pv-view { height: min(76vh, 900px); overflow: auto; background: var(--panel2); margin: 12px; border-radius: var(--r-ctl); cursor: grab; display: grid; place-items: center; }
.pv-view.dragging { cursor: grabbing; }
.pv-view canvas { display: block; box-shadow: var(--shadow-sm); }

/* Settings: the desktop sections (plot appearance, legal styling, DXF) */
.settings .plotpreview { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); display: block; margin: 4px 0 12px; }
.settings .colours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0 14px; }
.settings .colours.off { opacity: .45; pointer-events: none; }
.settings .swatchfield { display: flex; align-items: center; gap: 8px; font-size: var(--fs-caption); color: var(--muted); }
.settings .swatchfield input { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line2); border-radius: 6px; background: none; cursor: pointer; }
.settings .flags { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0; font-size: var(--fs-small); }
.settings .flags label { display: inline-flex; align-items: center; gap: 6px; }
.settings input[type=range] { width: 100%; accent-color: var(--accent); }
.settings .legalpreview { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px; margin: 4px 0 12px; font-size: var(--fs-small); line-height: 22px; }
.settings .legalpreview .lb { color: var(--info); font-weight: 700; font-size: .85em; }
.settings .legalpreview .lsel { background: var(--accent-soft); font-weight: 600; }
.settings .legalpreview.seps .lsel { display: block; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.settings .checkfield { flex-direction: row; align-items: center; gap: 10px; }
.settings .inlinefields { display: inline-flex; align-items: center; gap: 8px; }
.settings .cardfoot { display: flex; align-items: center; gap: var(--ctl-gap); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
@media (max-width: 759.98px) { .settings .colours { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.settings .field input[type=range] { border: 0; height: auto; padding: 0; box-shadow: none; }
.settings .checkfield { display: flex; }
.settings .checkfield input { width: auto; height: auto; }
/* the desktop's Quick Rating after an export */
.rating { display: grid; gap: 10px; }
.rating .rrow { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; font-size: var(--fs-small); }
.rating .stars { display: inline-flex; gap: 2px; }
.rating .stars button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--line2); cursor: pointer; padding: 0 2px; }
.rating .stars button.on { color: var(--accent); }
.rating .rrow.req span::after { content: " *"; color: var(--accent); }

/* How it works */
ol.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); max-width: 860px; }
ol.howto li { display: flex; gap: var(--s4); align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow-sm); }
ol.howto h3 { margin: 2px 0 6px; font-size: var(--fs-body); }
ol.howto p { margin: 0; color: var(--muted); font-size: var(--fs-small); }

/* ── the spacing system, continued (docs/WEB_UI_GUIDE.md §2a) ─────────────────── */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
}
/* menus opened from the header card read like every other menu */
.ph .menu-list { color: var(--fg); }
.ph .menu-list button, .ph .menu-list a { color: var(--fg); }
/* a choice in a menu (the Result page's Layout) shows a check on the current one */
.layoutmenu .menu-list button.on { font-weight: 600; }
.layoutmenu .menu-list button.on::after { content: "✓"; margin-left: auto; color: var(--accent-text); font-weight: 700; }
/* checkboxes in a menu (Layers, Columns) */
.menu-list label.chk { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 12px; border-radius: var(--r-sm); font-size: var(--fs-small); cursor: pointer; white-space: nowrap; }
.menu-list label.chk:hover { background: var(--fill); }
.menu-list label.chk input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* the count chip in the header card (warnings): quiet, opens a side panel */
.cchip { display: inline-flex; align-items: center; gap: var(--s2); height: 30px; padding: 0 6px 0 12px; border: 1px solid var(--line2); border-radius: var(--r-ctl); background: var(--ctl); color: var(--fg); font-size: var(--fs-small); font-weight: 600; cursor: pointer; list-style: none; transition: background var(--ease), border-color var(--ease); }
.cchip::-webkit-details-marker { display: none; }
.cchip:hover, details[open] > .cchip { background: var(--ctl-hover); }
.cchip .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn-ink); font-size: 11px; font-weight: 700; }
.cchip .count.note-count { background: var(--info-soft); color: var(--info-ink); }
.cchip.ghost { color: var(--muted); }
.cchip.ghost .count:not(.note-count) { background: var(--fill); color: var(--muted); }

/* side panel: the body of a <details> that slides in from the right, over the page */
.sidepop > .side { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100vw); background: var(--panel); color: var(--fg); border-left: 1px solid var(--line); box-shadow: var(--shadow); padding: var(--s5); overflow: auto; display: flex; flex-direction: column; gap: var(--s5); font-size: var(--fs-small); text-align: left; animation: gfx-slide .15s ease-out; }
.side-head { display: flex; align-items: center; gap: var(--ctl-gap); }
.side-head h2 { margin-right: auto; font-size: var(--fs-section); }
.side-foot { display: flex; gap: var(--ctl-gap); flex-wrap: wrap; }
@keyframes gfx-slide { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── WPF UI controls, as the desktop draws them ─────────────────────────────── */
.ic.s40 { width: 40px; height: 40px; }
/* ui:Button: Secondary (control fill, hairline frame), Primary (the accent, white type as the desktop sets it), Transparent (frame only) */
.fbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--ctl-stroke); border-radius: var(--r-ctl); background: var(--ctl); color: var(--fg); font-size: 14px; line-height: 1.36; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background var(--ease), color var(--ease); }
.fbtn:hover { background: var(--ctl2); color: var(--fg); }
.fbtn:active { background: var(--ctl3); color: var(--fg2); }
.fbtn:disabled, .fbtn[aria-disabled="true"] { background: var(--ctl-dis); color: var(--fg-dis); cursor: default; }
.fbtn.accent { background: var(--accent-pri); border-color: rgba(255,255,255,.08) rgba(255,255,255,.08) rgba(0,0,0,.25); color: #fff; }
:root[data-theme="light"] .fbtn.accent { border-bottom-color: rgba(0,0,0,.4); }
.fbtn.accent:hover:not(:disabled) { background: var(--accent-fill); color: #fff; }

.fbtn.accent:disabled { background: var(--ctl-dis); border-color: var(--ctl-stroke); color: var(--fg-dis); }
.fbtn.orange { background: linear-gradient(135deg, #fb923c, #ea580c); border-color: transparent; color: #fff; }
.fbtn.orange:hover { filter: brightness(1.06); color: #fff; }
.fbtn.clear { background: transparent; }
.fbtn.clear:hover { background: var(--ctl); }
.fbtn.icon { padding: 0 8px; min-width: 32px; }
.fbtn.lg { min-height: 38px; padding: 0 14px; }
.fbtn .ic { flex: none; }
summary.fbtn { list-style: none; }
summary.fbtn::-webkit-details-marker { display: none; }
/* ui:TextBox: control fill, hairline frame with a darker bottom edge, the accent underline when focused */
.tbox { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px 0 10px; border: 1px solid var(--ctl-stroke); border-bottom-color: var(--ctl-edge); border-radius: var(--r-ctl); background: var(--ctl); color: var(--fg); min-width: 0; }
:root:not([data-theme="light"]) .tbox { border-bottom-color: rgba(255,255,255,.13); }
.tbox:hover { background: var(--ctl2); }
.tbox:focus-within { background: var(--input-focus); border-bottom: 2px solid var(--accent-fill); padding-bottom: 0; }
.tbox .ic { color: var(--fg); }
.tbox input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 14px; }
.tbox input::placeholder { color: var(--fg2); }
.tbox input::-webkit-search-cancel-button { filter: grayscale(1); }

.ic.s26 { width: 26px; height: 26px; }
/* the plot thumbnail (shared with Projects): the desktop's tile, navy in both themes with an accent edge, the
   picture drawn by the server in the desktop's own colours (PlotThumbnailRenderer) and inset 2px as the desktop's Image */
.pthumb { flex: none; width: 64px; height: 48px; margin-right: 12px; border: 1px solid rgba(234,88,12,.227); border-radius: 8px; background: #0a1929; display: grid; place-items: center; overflow: hidden; color: #ea580c; }
.pthumb > .ic { opacity: .4; }
/* The glyph is the frame's placeholder: hidden behind a picture, back when the picture fails (project-preview.js). */
.pthumb > img + .ic { display: none; }
.pthumb img { width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }

/* a page whose own content scrolls (a list or a grid that fills the frame) */
.page.fill { height: 100%; display: flex; flex-direction: column; padding: 24px 32px 20px; }
@media (max-width: 759.98px) { .page.fill { height: auto; min-height: 100%; padding: 16px; } }

/* The project preview on hover (project-preview.js), the desktop's ProjectPreviewPopup in both
   themes: a 336 px navy card, rounded 12, edged 1.5 px in the accent with an orange glow; the
   #101828 title strip with the green dot, "Preview", the five layer toggles in their 8 px tray
   and the close button; the 220 px plot with its hint along the foot. */
.pv-pop { position: fixed; z-index: 70; width: 336px; border-radius: 12px; background: #0a1929; box-shadow: 0 0 18px rgba(234,88,12,.35); color: #e6edf3; font-family: "Segoe UI", var(--font); overflow: hidden; }
.pv-pop[hidden] { display: none; }
.pv-pop::after { content: ""; position: absolute; inset: 0; border: 1.5px solid #ea580c; border-radius: 12px; pointer-events: none; }
.pv-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 6px 10px; background: #101828; }
.pv-name { display: flex; align-items: center; min-width: 0; }
.pv-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #10b981; margin-right: 8px; }
.pv-title { font-size: 12px; font-weight: 600; line-height: 16px; color: #e6edf3; }
.pv-tools { display: flex; align-items: center; }
.pv-layers { display: flex; padding: 2px; border-radius: 8px; background: rgba(255,255,255,.094); }
.pv-layer { width: 24px; height: 22px; margin: 0 1px; padding: 0; border: 0; border-radius: 5px; background: transparent; font: 700 10px/22px "Segoe UI", var(--font); text-align: center; cursor: pointer; opacity: .42; }
.pv-layer:hover { opacity: .9; }
.pv-layer[aria-pressed="true"] { background: rgba(255,255,255,.227); opacity: 1; }
.pv-layer:focus-visible, .pv-close:focus-visible { outline: 2px solid #ea580c; outline-offset: 1px; }
.pv-close { display: grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 0; border-radius: 6px; background: rgba(255,255,255,.094); color: #d1d5db; cursor: pointer; }
.pv-close:hover { background: rgba(234,88,12,.25); }
.pv-stage { position: relative; height: 220px; background: #0a1929; }
.pv-canvas { display: block; width: 336px; height: 220px; cursor: move; touch-action: none; }
.pv-canvas.dragging { cursor: move; }
.pv-note { position: absolute; inset: 0; display: grid; place-items: center; color: #6b7280; font-size: 14px; }
.pv-note[hidden] { display: none; }
.pv-hint { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: grid; place-items: center; background: rgba(10,25,41,.6); color: #9ca3af; font-size: 10px; pointer-events: none; }
/* Fluent CheckBox (20 px, radius 4, the accent fill and a white tick when on), as the desktop draws it */
input.fcheck { -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border-radius: 4px; border: 1px solid var(--fg3); background: var(--ctl3); cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle; transition: background var(--ease), border-color var(--ease); }
input.fcheck.sm { width: 18px; height: 18px; }
input.fcheck:hover { background: var(--ctl2); }
input.fcheck:checked { border-color: var(--accent-pri); background: var(--accent-pri) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
input.fcheck:disabled { cursor: default; }
input.fcheck:checked:disabled { opacity: .75; }
input.fcheck:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }

/* Fluent ComboBox: no native arrow, the desktop chevron at the right */
select.fcombo, select.ex-in { -webkit-appearance: none; appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; cursor: pointer; }
select.fcombo option, select.ex-in option { background: var(--bg); color: var(--fg); }
