/* u-FIR foundation: the single token block, the app shell and the shared components.
   Loaded last from main.js so it is the one source of truth. The embedded Casebook board
   keeps its original stylesheet in its own document and is never targeted here. */

/* ===================================================================== tokens */
:root,
#workspace-shell,
#workspace-entry,
dialog#modal {
  /* Department palette (Rajasthan house style, AP grammar) */
  --ap-navy-900: #0b1440;
  --ap-navy-800: #14206b;
  --ap-royal: #2447d8;
  --ap-royal-600: #1b2fa8;
  --ap-royal-50: #eef2ff;
  --ap-sky-2: #4f7cff;
  --ap-rose: #c2185b;
  --ap-rose-600: #a3134c;
  --ap-rose-2: #ff5c8d;
  --ap-rose-50: #fde8f0;
  --ap-magenta: #d6249f;
  --ap-teal: #0b7f73;
  --ap-teal-600: #096b61;
  --ap-teal-2: #14b8a6;
  --ap-teal-50: #e3f6f2;
  --ap-gold: #ffb300;
  --ap-gold-50: #fff1cf;
  --ap-marigold: #ff8a00;
  --ap-marigold-50: #fff1cf;
  --ap-violet: #6d28d9;
  --ap-violet-50: #f3e8ff;
  --ap-maroon: #b32d30;
  --ap-green: #047857;
  --ap-green-50: #d1fae5;
  --ap-amber: #b45309;
  --ap-amber-50: #fef3c7;
  --ap-red: #be123c;
  --ap-red-50: #ffe4e6;
  --ap-sky: #0369a1;
  --ap-sky-50: #e0f2fe;

  /* Ink and ground */
  --ink: #0d1533;
  --ink-2: #2c3760;
  --muted: #5b6585;
  --line: #dfe5f7;
  --line-strong: #c9d3f5;
  --ground: #f5f7ff;
  --well: #f3f6ff;
  --surface: #ffffff;
  --row-hover: #f5f7ff;

  /* Gradients: only where the department speaks (masthead, hero, tiles, active nav, primary). */
  --g-masthead: linear-gradient(110deg in srgb, #14206b 0%, #2038c0 42%, #c2185b 74%, #ff8a00 100%);
  --g-royal: linear-gradient(120deg, #4f7cff -25%, #2447d8 45%, #1b2fa8 100%); /* light stop sits outside button text (AA) */
  --g-warm: linear-gradient(120deg, #ffcf33, #ff8a00);
  --hero: linear-gradient(120deg, #14206b 0%, #1e2f96 45%, #2447d8 100%);

  /* Type */
  --font-ui: "Noto Sans", "Noto Sans Telugu", "Segoe UI", sans-serif;
  --font-telugu: "Noto Sans Telugu", "Noto Sans", "Segoe UI", sans-serif;
  --font-display: "Anek Latin", "Anek Telugu", "Noto Sans", "Noto Sans Telugu", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-hero: clamp(1.625rem, 1.1rem + 2vw, 2.5rem);
  --fs-h1: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --fs-h2: 1.25rem;
  --fs-h3: 1.0625rem;
  --fs-body: 1rem;
  --fs-control: .9375rem;
  --fs-meta: .875rem;
  --fs-badge: .78125rem;
  --lh-body: 1.5;

  /* Space, radius, depth, layers */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --gutter: clamp(16px, 3vw, 32px);
  --r-lg: 16px;
  --r-hero: 22px;
  --r-md: 14px;
  --r-sm: 12px;
  --r-pill: 999px;
  /* Depth: surfaces sit on the ground with one hairline; only floating layers (menus, dialogs, toasts) lift. */
  --shadow: 0 0 0 1px rgba(20, 32, 107, .07), 0 1px 2px rgba(20, 32, 107, .06);
  --shadow-up: 0 16px 40px rgba(20, 32, 107, .18);
  --shadow-command: 0 1px 2px rgba(20, 32, 107, .16);
  --z-header: 30;
  --z-drawer: 50;
  --z-dock: 42;
  --z-toast: 60;

  /* Controls and motion */
  --control-height: 48px;
  --command-height: 48px;
  --compact-height: 44px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 160ms;
  --t-enter: 260ms;
  --focus-ring: 3px solid var(--ap-gold);

  /* Shell geometry */
  --strip-height: 36px;
  --bar-height: 64px;
  --sidebar-width: 248px;
  --dock-height: 64px;

  /* Destination accents (overridden per destination) */
  --a: #4f7cff;
  --b: #2447d8;
  --glyph: #fff;

  /* Short aliases used by route stylesheets. */
  --royal: var(--ap-royal);
  --royal-50: var(--ap-royal-50);
  --rose: var(--ap-rose);
  --rose-50: var(--ap-rose-50);
  --teal-50: var(--ap-teal-50);
  --marigold: var(--ap-marigold);
  --marigold-50: var(--ap-marigold-50);
  --gold: var(--ap-gold);
  --gold-50: var(--ap-gold-50);
  --maroon: var(--ap-maroon);
  --violet: var(--ap-violet);
  --ok: var(--ap-green); --ok-50: var(--ap-green-50);
  --warn: var(--ap-amber); --warn-50: var(--ap-amber-50);
  --bad: var(--ap-red); --bad-50: var(--ap-red-50);
  --info: var(--ap-sky); --info-50: var(--ap-sky-50);
  --navy-900: var(--ap-navy-900);
  --navy-800: var(--ap-navy-800);
  --red: var(--ap-red);
  --font-body: var(--font-ui);

  /* Legacy names read by older feature stylesheets: all point at the tokens above. */
  --txt: var(--ink);
  --dim: var(--muted);
  --bg: var(--ground);
  --panel: var(--surface);
  --panel2: #eef3fb;
  --paper: var(--surface);
  --primary: var(--ap-royal);
  --primary-bright: var(--ap-royal);
  --teal: var(--ap-teal);
  --teal-light: var(--ap-teal-50);
  --blue: var(--ap-royal);
  --amber: var(--ap-amber);
  --green: var(--ap-green);
  --green-light: var(--ap-green-50);
  --amber-light: var(--ap-amber-50);
  --blue-light: var(--ap-sky-50);
  --focus: var(--ap-royal);
  --gov-navy: var(--ap-navy-800);
  --gov-navy-deep: var(--ap-navy-900);
  --gov-saffron: var(--ap-gold);
  --raja-blue: var(--ap-royal);
  --raja-teal: var(--ap-teal);
  --raja-rose: var(--ap-rose);
  --raja-gold: var(--ap-gold);
  --raja-amber: var(--ap-amber);
  --raja-ink: var(--ink);
  --raja-muted: var(--muted);
  --raja-line: var(--line);
  --raja-ground: var(--ground);
  --task-ink: var(--ink);
  --task-paper: var(--ground);
  --task-line: var(--line);
  --task-soft: var(--ap-royal-50);
  --task-focus: var(--ap-gold);
  --task-accent: var(--ap-royal);
  --v-blue: var(--ap-royal);
  --v-teal: var(--ap-teal);
  --v-green: var(--ap-teal);
  --v-pink: var(--ap-rose);
  --v-violet: var(--ap-violet);
  --v-gold: var(--ap-gold);
  --v-navy: var(--ap-navy-800);
  --v-saffron: var(--ap-marigold);
  --v-grad: var(--g-royal);
  --v-shadow: var(--shadow);
  --v-shadow-up: var(--shadow-up);
  --v-r: var(--r-md);
  --v-ease: var(--ease);
  --radius: var(--r-md);
  --shadow-1: var(--shadow);
  --shadow-2: var(--shadow-up);
  --ring: 0 0 0 4px rgba(36, 71, 216, .14);
  --sans: var(--font-ui);
  --mono: var(--font-mono);
  --motion-press: 80ms;
  --motion-control: var(--t-fast);
  --motion-enter: var(--t-enter);
  --motion-ease: var(--ease);
  --control-well: none;
  --control-elevation: none;
  --control-elevation-up: var(--shadow);
  --command-tint: rgba(36, 71, 216, .32);
  --command-elevation: var(--shadow-command);
  color-scheme: light;
}

/* Destination accents: the same pair colours the nav tile, the dock and the workspace hero. */
:is([data-nav="overview"], [data-nav="cases"], [data-workspace="overview"], [data-workspace="cases"], [data-workspace="case"]) { --a: #4f7cff; --b: #2447d8; --hero: linear-gradient(120deg, #14206b 0%, #1e2f96 45%, #2447d8 100%); }
:is([data-nav="documents"], [data-workspace="documents"]) { --a: #ffcf33; --b: #ff8a00; --b-text: #b45309; --glyph: #0b1440; --hero: linear-gradient(120deg, #7a1d06 0%, #b32d30 50%, #ff8a00 100%); }
:is([data-nav="people"], [data-nav="crm"], [data-workspace="people"], [data-workspace="crm"]) { --a: #2dd4bf; --b: #0b7f73; --hero: linear-gradient(120deg, #064e48 0%, #0b7f73 50%, #2447d8 100%); }
:is([data-nav="reports"], [data-workspace="reports"]) { --a: #c084fc; --b: #6d28d9; --hero: linear-gradient(120deg, #3b0764 0%, #6d28d9 50%, #c026d3 100%); }
:is([data-nav="intelligence"], [data-nav="board"], [data-nav="analytics"], [data-workspace="intelligence"], [data-workspace="board"], [data-workspace="analytics"]) { --a: #38bdf8; --b: #0369a1; --hero: linear-gradient(120deg, #0b1440 0%, #0369a1 55%, #14b8a6 100%); }
:is([data-nav="assistant"], [data-nav="laws"], [data-workspace="assistant"], [data-workspace="laws"]) { --a: #818cf8; --b: #4338ca; --hero: linear-gradient(120deg, #1e1b4b 0%, #4338ca 55%, #2447d8 100%); }
:is([data-nav="activity"], [data-nav="settings"], [data-workspace="activity"], [data-workspace="settings"]) { --a: #94a3b8; --b: #475569; --hero: linear-gradient(120deg, #0b1440 0%, #14206b 50%, #475569 100%); }
[data-review], [data-workspace="review"] { --a: #ff5c8d; --b: #c2185b; --hero: linear-gradient(120deg, #7a0f3d 0%, #c2185b 55%, #ff8a00 100%); }

html { font-size: 100%; }
html[data-text-size="large"] { font-size: 112.5%; }
html[data-text-size="larger"] { font-size: 125%; }
html, body { background: var(--ground); }
body { color: var(--ink); }

#workspace-shell,
#workspace-entry,
dialog#modal {
  font-family: var(--font-ui);
  font-size: max(1rem, 16px);
  line-height: var(--lh-body);
  letter-spacing: 0;
  color: var(--ink);
}
#workspace-shell:lang(te),
#workspace-entry:lang(te),
dialog#modal:lang(te),
#workspace-shell :lang(te),
dialog#modal :lang(te) {
  --font-ui: "Noto Sans Telugu", "Noto Sans", "Segoe UI", sans-serif;
  --font-display: "Anek Telugu", "Noto Sans Telugu", "Anek Latin", "Noto Sans", "Segoe UI", sans-serif;
  --lh-body: 1.7;
}
#workspace-shell:lang(te),
#workspace-entry:lang(te),
dialog#modal:lang(te) { line-height: 1.7; }
#app :is(#workspace-shell, #workspace-entry, #modal) :is(button, input, select, textarea) { font-family: var(--font-ui); letter-spacing: 0; }
#app :is(#workspace-shell, #workspace-entry, #modal) ::selection { background: #ffd98a; color: var(--ap-navy-900); }
#app :is(#workspace-shell, #workspace-entry, #modal) :is(input, textarea)::placeholder { color: #6a7a8b; opacity: 1; }

/* One focus ring everywhere: marigold, 3px, offset 2px. */
#app :is(#workspace-shell, #workspace-entry, #modal) :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible,
.choice-dialog :is(a, button, input):focus-visible,
.detail-panel-dialog :is(a, button, input):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
  scroll-margin: 8px;
}

/* Counts and IDs align. */
#app #workspace-shell :is(.nav-count, .stage, .register-stage, .reports-pill, .count, [data-count], .tabular, time, strong[data-count], .queue-summary strong, .reports-stat strong, .activity-tile strong, .settings-stat strong) { font-variant-numeric: tabular-nums; }
#app :is(#workspace-shell, #modal) .mono { font-family: var(--font-mono); font-size: .875rem; font-weight: 600; letter-spacing: .02em; }

/* ===================================================================== frame */
#app {
  display: grid;
  height: 100svh;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--ground);
}

/* Skip link */
#app #workspace-shell .skip-link {
  position: fixed;
  top: -80px;
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 1000;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--ap-gold);
  color: var(--ap-navy-900);
  font-weight: 750;
  text-decoration: none;
}
#app #workspace-shell .skip-link:focus { top: max(8px, env(safe-area-inset-top, 0px)); }

/* ---------- Masthead: one official band (brand, search, language, text size, help, profile) ---------- */
#app #workspace-shell .masthead {
  position: relative;
  z-index: var(--z-header);
  grid-row: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search right";
  align-items: center;
  column-gap: var(--space-5);
  height: auto;
  min-height: calc(var(--bar-height) + env(safe-area-inset-top, 0px));
  margin: 0;
  padding: env(safe-area-inset-top, 0px) max(var(--gutter), env(safe-area-inset-right, 0px)) 3px max(var(--gutter), env(safe-area-inset-left, 0px));
  border: 0;
  background: var(--g-masthead);
  color: #fff;
  box-shadow: 0 4px 18px rgba(20, 32, 107, .24);
  overflow: visible;
}
/* The tricolour runs as a thin underline under the band. */
#app #workspace-shell .masthead::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, #ff9933 0 33.33%, #ffffff 33.33% 66.66%, #138808 66.66% 100%);
}
#app #workspace-shell .masthead::after { content: none; display: none; animation: none; }
#app #workspace-shell .masthead > * { position: relative; z-index: 1; }

#app #workspace-shell :is(.text-size-control, .header-languages) {
  display: inline-flex;
  flex: none;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: var(--r-sm);
  background: rgba(11, 20, 64, .36);
  box-shadow: none;
}
#app #workspace-shell :is(.text-size-control, .header-languages) button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 38px;
  height: auto;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
}
#app #workspace-shell .text-size-control button { min-width: 30px; padding: 0 7px; }
#app #workspace-shell .text-size-control button[data-size="large"] { font-size: 1rem; }
#app #workspace-shell .text-size-control button[data-size="larger"] { font-size: 1.125rem; }
#app #workspace-shell :is(.text-size-control, .header-languages) button:hover { background: rgba(255, 255, 255, .16); color: #fff; }
#app #workspace-shell :is(.text-size-control, .header-languages) button[aria-pressed="true"] { background: var(--ap-gold); color: var(--ap-navy-900); }
#app #workspace-shell .header-languages button[lang="te"] { font-family: "Anek Telugu", "Noto Sans Telugu", sans-serif; }
#app #workspace-shell .header-languages .lang-short { display: none; }

/* Brand: emblem, u-FIR, and the government and department line under it */
#app #workspace-shell .masthead > .brand { grid-area: brand; display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: calc(var(--bar-height) - 3px); }
#app #workspace-shell .masthead a.brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; color: #fff; text-decoration: none; }
#app #workspace-shell .masthead .gov-emblem {
  flex: none;
  width: 42px;
  height: 42px;
  padding: 3px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
  filter: none;
  animation: none;
}
#app #workspace-shell .masthead .brand-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0;
  row-gap: 3px;
  min-width: 0;
  color: #fff;
  font-family: "Anek Latin", "Noto Sans", sans-serif;
  font-size: 1.375rem;
  font-stretch: 112%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
#app #workspace-shell .masthead .brand-word { flex: 1 0 100%; font: inherit; }
#app #workspace-shell .masthead .brand-name > :is(small, span) {
  display: block;
  margin: 0;
  padding: 0;
  color: #dbe6ff;
  font-family: var(--font-ui);
  font-size: .75rem;
  font-stretch: 100%;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#app #workspace-shell .masthead .brand-name > span { flex: 0 1 auto; min-width: 0; color: #dbe6ff; }
#app #workspace-shell .masthead .brand-name > span::before { content: "·"; padding: 0 5px; }
#app #workspace-shell .masthead .brand-name > small { flex: 0 1 auto; min-width: 0; }
#app #workspace-shell:lang(te) .masthead .brand-name > :is(small, span) { font-size: .8125rem; }
/* Wordmark: దర్యాప్తు large in Anek Telugu, then "Daryaptu" and the department line underneath. */
#app #workspace-shell .masthead .brand-word { font-family: "Anek Telugu Brand", "Anek Telugu", "Noto Sans Telugu", sans-serif; font-size: 1.5rem; font-stretch: 100%; font-weight: 700; line-height: 1.05; padding-bottom: .2em; }
#app #workspace-shell .masthead .brand-name > small.brand-latin { flex: none; color: #fff; font-family: "Anek Latin", "Noto Sans", sans-serif; font-weight: 800; letter-spacing: .02em; }
#app #workspace-shell .masthead .brand-name > small.access-gov::before { content: "·"; padding: 0 5px; }

/* Global search: one white field, one border, a royal Search command inside. */
#app #workspace-shell .masthead .global-search {
  grid-area: search;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  justify-self: center;
  width: 100%;
  max-width: 560px;
  min-height: 44px;
  margin: 0;
  padding: 2px 2px 2px 14px;
  border: 0;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}
#app #workspace-shell .masthead .global-search > svg { flex: none; width: 20px; height: 20px; color: var(--ap-royal); }
#app #workspace-shell .masthead .global-search input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 1rem;
}
#app #workspace-shell .masthead .global-search:focus-within { outline: var(--focus-ring); outline-offset: 2px; box-shadow: 0 8px 20px rgba(0, 0, 0, .16); }
#app #workspace-shell .masthead .global-search input[type="search"]:focus-visible { outline: none; }
#app #workspace-shell .masthead .search-submit {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--ap-royal);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--fs-control);
  font-weight: 750;
  cursor: pointer;
}
#app #workspace-shell .masthead .search-submit:hover { background: var(--ap-royal-600); }
#app #workspace-shell .global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(420px, 60svh);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-up);
}
#app #workspace-shell .global-search-results a { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
#app #workspace-shell .global-search-results a:hover,
#app #workspace-shell .global-search-results a[aria-selected="true"] { background: var(--ap-royal-50); }
#app #workspace-shell .global-search-results .search-result-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--g-royal); color: #fff; }
#app #workspace-shell .global-search-results .search-result-icon svg { width: 18px; height: 18px; color: #fff; }
#app #workspace-shell .global-search-results strong { display: block; font-size: .9375rem; font-weight: 700; line-height: 1.35; }
#app #workspace-shell .global-search-results small { display: block; margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); }
#app #workspace-shell .global-search-results a > svg:last-child { display: none; }

/* Right side: help and account */
#app #workspace-shell .masthead-right { grid-area: right; display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; color: #fff; }
#app #workspace-shell .masthead :is(.icon-button, .account-control) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex: none;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--r-sm);
  background: rgba(11, 20, 64, .36);
  color: #fff;
  box-shadow: none;
  text-decoration: none;
  transform: none;
}
#app #workspace-shell .masthead .icon-button { width: 44px; padding: 0; }
#app #workspace-shell .masthead .icon-button:hover:not(:disabled) { background: rgba(11, 20, 64, .5); border-color: rgba(255, 255, 255, .5); color: #fff; }
#app #workspace-shell .masthead .icon-button > svg { width: 22px; height: 22px; }
#app #workspace-shell .masthead .account-control {
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--g-warm);
  color: var(--ap-navy-900);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: none;
}
#app #workspace-shell .masthead .account-control:hover { background: var(--g-warm); filter: brightness(1.05); color: var(--ap-navy-900); }
#app #workspace-shell .masthead .account-control > svg { inline-size: 20px; block-size: 20px; width: 22px; height: 22px; padding: 0; border-radius: 0; background: none; color: var(--ap-navy-900); }
#app #workspace-shell .masthead .account-name { display: block; max-width: 16ch; overflow: hidden; color: inherit; font-size: inherit; white-space: nowrap; text-overflow: ellipsis; }
#app #workspace-shell .masthead .mobile-menu { display: none !important; }

/* ---------- Layout ---------- */
#app #workspace-shell .app-layout {
  position: relative;
  grid-row: 2;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  min-width: 0;
}

/* ---------- Sidebar ---------- */
#app #workspace-shell .sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
}
#app #workspace-shell .sidebar nav,
#app #workspace-shell .sidebar-bottom { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); }
#app #workspace-shell .sidebar .nav-group-label {
  display: block;
  margin: var(--space-3) var(--space-3) var(--space-1);
  padding: 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
#app #workspace-shell .sidebar .nav-group-label:first-child { margin-top: 0; }
#app #workspace-shell:lang(te) .sidebar .nav-group-label { font-size: .875rem; }
#app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a, .workspace-signout, .workspace-help-nav) {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: start;
  text-decoration: none;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}
#app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a, .workspace-signout, .workspace-help-nav) > span:not(.nav-count) { position: static; min-width: 0; width: auto; max-width: none; padding: 0; border: 0; background: transparent; opacity: 1; overflow-wrap: normal; word-break: keep-all; }
#app #workspace-shell .sidebar nav a > svg {
  flex: none;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--a), var(--b));
  color: var(--glyph);
  stroke-width: 2;
  box-shadow: none;
}
#app #workspace-shell .sidebar :is(.sidebar-bottom a, .workspace-signout, .workspace-help-nav) > svg { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: #eef3fb; color: var(--ink-2); box-shadow: none; }
#app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a, .workspace-signout, .workspace-help-nav):hover { background: var(--row-hover); color: var(--ink); }
#app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a).active {
  background: var(--g-royal);
  color: #fff;
  font-weight: 750;
  box-shadow: none;
}
#app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a).active > svg { background: #fff; color: var(--b); box-shadow: none; }
#app #workspace-shell .sidebar .nav-count {
  margin-left: auto;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--ap-gold);
  color: var(--ap-navy-900);
  font-family: var(--font-display);
  font-size: var(--fs-badge);
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}
#app #workspace-shell .sidebar .nav-count:empty { display: none; }
#app #workspace-shell .sidebar nav a.active .nav-count { background: #fff; color: var(--ap-navy-800); }
#app #workspace-shell .sidebar-bottom { margin-top: auto; }
#app #workspace-shell .sidebar :is(.workspace-help-nav, .sidebar-bottom .workspace-help-nav) { display: none; }
#app #workspace-shell .sidebar .workspace-signout { color: var(--ap-rose); }
#app #workspace-shell .sidebar .workspace-signout > svg { background: var(--ap-rose-50); color: var(--ap-rose); }
#app #workspace-shell .nav-scrim { display: none; }

/* ---------- Main ---------- */
#app #workspace-shell #main {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: var(--space-6) var(--gutter) var(--space-10);
  background: var(--ground);
}
#app #workspace-shell #main.board-main { padding: var(--space-4) var(--gutter); }

/* Mobile dock (phones only) */
#app #workspace-shell .mobile-dock { display: none; }

/* ===================================================================== components */

/* ---------- Headings ---------- */
#app :is(#workspace-shell, #modal) :is(h1, h2, h3) { color: var(--ink); letter-spacing: 0; overflow-wrap: break-word; }
#app #workspace-shell #main h1,
#app #workspace-entry h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.005em;
}
#app #workspace-shell #main h2,
#app #modal h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 750; line-height: 1.3; }
#app #workspace-shell #main h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700; line-height: 1.35; }
#app #workspace-shell:lang(te) #main :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.5; }

#app #workspace-shell #main .page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-6);
}
#app #workspace-shell #main .page-heading > div:first-child { min-width: 0; }
#app #workspace-shell #main .page-heading h1 { margin: 0; }
#app #workspace-shell #main .heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
/* No eyebrow kicker above page titles; the reference stays as quiet meta text. */
#app #workspace-shell #main .page-heading .eyebrow { display: block; margin: 0 0 2px; color: var(--muted); font-size: var(--fs-meta); font-weight: 600; letter-spacing: 0; text-transform: none; }

/* ---------- Buttons ---------- */
#app :is(#workspace-shell, #modal) :is(.button, .small-button, .reports-button, .activity-button, .settings-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: var(--command-height);
  min-height: var(--command-height);
  margin: 0;
  padding: 0 18px;
  border: 1.5px solid #c3cffa;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ap-royal);
  font-family: var(--font-display);
  font-size: max(1rem, 16px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  box-shadow: none;
  filter: none;
  transform: none;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
#app :is(#workspace-shell, #modal) :is(.button, .small-button, .reports-button, .activity-button, .settings-button) > svg { flex: none; width: 18px; height: 18px; animation: none; }
#app :is(#workspace-shell, #modal) :is(.button, .small-button, .reports-button, .activity-button, .settings-button):hover:not(:disabled) { border-color: var(--ap-royal); background: var(--ap-royal-50); color: var(--ap-royal-600); transform: none; }
#app :is(#workspace-shell, #modal) :is(.button, .small-button):active:not(:disabled) { filter: brightness(.96); transform: none; }
#app :is(#workspace-shell, #modal) .small-button { min-block-size: var(--compact-height); min-height: var(--compact-height); padding: 0 14px; font-size: .875rem; }

/* Primary: royal */
#app :is(#workspace-shell, #modal) :is(.button.primary, .reports-button-primary, .settings-button-primary, .choice-done, .assistant-form button[type="submit"]) {
  border-color: transparent;
  background: var(--g-royal);
  color: #fff;
  box-shadow: var(--shadow-command);
}
#app :is(#workspace-shell, #modal) :is(.button.primary, .reports-button-primary, .settings-button-primary, .choice-done, .assistant-form button[type="submit"]):hover:not(:disabled) { border-color: transparent; background: var(--ap-royal-600); color: #fff; box-shadow: var(--shadow-command); }
/* Attention: rose (review, submit for review) */
#app :is(#workspace-shell, #modal) .button:is(.attention, .rose) { border-color: var(--ap-rose); background: var(--ap-rose); color: #fff; box-shadow: var(--shadow-command); }
#app :is(#workspace-shell, #modal) .button:is(.attention, .rose):hover:not(:disabled) { border-color: var(--ap-rose-600); background: var(--ap-rose-600); color: #fff; }
/* Verify: teal */
#app :is(#workspace-shell, #modal) .button:is(.verify, .teal) { border-color: var(--ap-teal); background: var(--ap-teal); color: #fff; box-shadow: var(--shadow-command); }
#app :is(#workspace-shell, #modal) .button:is(.verify, .teal):hover:not(:disabled) { border-color: var(--ap-teal-600); background: var(--ap-teal-600); color: #fff; }
/* Danger: outlined until confirmed */
#app :is(#workspace-shell, #modal) :is(.button.danger, [data-action="remove-case"].button, [data-action="confirm-remove"].button) { border-color: #f0b7c2; background: #fff; color: var(--ap-red); box-shadow: none; }
#app :is(#workspace-shell, #modal) :is(.button.danger, [data-action="remove-case"].button):hover:not(:disabled) { border-color: var(--ap-red); background: var(--ap-red-50); color: var(--ap-red); }
#app #modal .modal-actions .button.danger:last-child { border-color: var(--ap-red); background: var(--ap-red); color: #fff; }
/* Disabled: readable label, clearly inactive */
#app :is(#workspace-shell, #modal) :is(.button, .small-button, .reports-button, .activity-button, .settings-button):disabled,
#app :is(#workspace-shell, #modal) :is(.button, .small-button)[aria-disabled="true"] {
  border-color: var(--line-strong);
  background: #eef2f8;
  color: #4a5a6c;
  box-shadow: none;
  transform: none;
  filter: none;
  opacity: 1;
  cursor: not-allowed;
}

/* Icon buttons: 44x44 white squares */
#app :is(#workspace-shell, #modal) :is(.icon-button, .fir-icon-button, .explorer-icon-button, .assistant-icon-link, .detail-panel-icon-trigger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-inline-size: 44px;
  min-block-size: 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink-2);
  box-shadow: none;
  transform: none;
  cursor: pointer;
}
#app :is(#workspace-shell, #modal) :is(.icon-button, .fir-icon-button, .explorer-icon-button, .assistant-icon-link, .detail-panel-icon-trigger) > svg { width: 20px; height: 20px; animation: none; }
#app :is(#workspace-shell, #modal) :is(.icon-button, .fir-icon-button, .explorer-icon-button, .assistant-icon-link, .detail-panel-icon-trigger):hover:not(:disabled) { border-color: var(--ap-royal); background: var(--ap-royal-50); color: var(--ap-royal); transform: none; }

/* Links */
#app :is(#workspace-shell, #modal) .text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ap-royal);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
#app :is(#workspace-shell, #modal) .text-link:hover { color: var(--ap-royal-600); text-decoration-thickness: 2.5px; }
#app :is(#workspace-shell, #modal) .text-link > svg { width: 16px; height: 16px; flex: none; transform: none; transition: none; }
/* AI tell: a decorative arrow after every label. Arrows stay only on icon-only controls and external links. */
/* A labelled control keeps its words and drops the trailing arrow (↗ everywhere, → on text links). Icon-only controls (no element besides the
   icon and an aria-label) keep it, and so do links that leave u-FIR in a new tab. */
#app :is(#workspace-shell, #modal) :is(a, button):not(.icon-button, .fir-icon-button, .explorer-icon-button, .assistant-icon-link, [target="_blank"]):is(:has(> :not(svg, i)), :not([aria-label])) > :is(svg.lucide-arrow-up-right, i[data-lucide="arrow-up-right"]),
#app #workspace-shell #main :is(.case-map-fir-link, .case-map-link-fir) > svg:last-child,
#app #workspace-shell #main :is(a, button.text-link):not(.button, .icon-button, .fir-icon-button, .explorer-icon-button, .assistant-icon-link):is(:has(> :not(svg, i)), :not([aria-label])) > :is(svg.lucide-arrow-right, i[data-lucide="arrow-right"]),
#app :is(#workspace-shell, #modal) .summary-open { display: none; }

/* ---------- Inputs and selects ---------- */
#app :is(#workspace-shell #main, #modal, #workspace-shell .sidebar) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]), select, textarea) {
  min-height: var(--control-height);
  margin: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
#app :is(#workspace-shell #main, #modal) textarea { min-height: 96px; line-height: var(--lh-body); }
#app :is(#workspace-shell #main, #modal) :where(input, select, textarea):hover:not(:disabled) { border-color: #8ea3c4; }
#app :is(#workspace-shell #main, #modal) :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus { border-color: var(--ap-royal); box-shadow: 0 0 0 4px rgba(36, 71, 216, .14); outline: none; }
#app :is(#workspace-shell #main, #modal) :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
#app :is(#workspace-shell, #modal, #workspace-entry) :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--ap-red); background: #fff8f9; }
#app :is(#workspace-shell #main, #modal) :is(input[type="checkbox"], input[type="radio"]) { width: 20px; height: 20px; accent-color: var(--ap-royal); }
#app :is(#workspace-shell #main, #modal) label { color: var(--ink-2); font-size: var(--fs-meta); font-weight: 650; }

/* Framed search fields: the frame owns the border, the inner input has none. */
#app :is(#workspace-shell #main, #modal) :is(.search-field, .explorer-search) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height);
  padding: 0 4px 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: none;
}
#app :is(#workspace-shell #main, #modal) :is(.search-field, .explorer-search) > svg { position: static; flex: 0 0 18px; width: 18px; height: 18px; color: var(--muted); }
#app :is(#workspace-shell #main, #modal) :is(.search-field, .explorer-search) :is(input[type="search"], input[type="text"], input:not([type])) {
  flex: 1;
  min-width: 0;
  min-height: calc(var(--control-height) - 4px);
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
#app :is(#workspace-shell #main, #modal) :is(.search-field, .explorer-search):focus-within { border-color: var(--ap-royal); outline: var(--focus-ring); outline-offset: 2px; box-shadow: none; }
#app :is(#workspace-shell #main, #modal) :is(.search-field, .explorer-search) :is(input[type="search"], input[type="text"], input:not([type])):focus-visible { outline: none; box-shadow: none; }

/* Pickers look like selects: chevron down, one line, never broken mid-word. */
#app :is(#workspace-shell, #modal) .choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  height: auto;
  margin: 0;
  padding: 0 12px 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: start;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  box-shadow: none;
  cursor: pointer;
}
#app :is(#workspace-shell, #modal) .choice-trigger:hover { border-color: var(--ap-royal); background: #fff; }
#app :is(#workspace-shell, #modal) .choice-value { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; word-break: keep-all; }
#app :is(#workspace-shell, #modal) .choice-arrow {
  flex: none;
  width: 10px;
  height: 10px;
  margin: -4px 4px 0 0;
  border-right: 2px solid var(--ap-royal);
  border-bottom: 2px solid var(--ap-royal);
  color: transparent;
  font-size: 0;
  line-height: 0;
  transform: rotate(45deg);
}
#app :is(#workspace-shell, #modal) .choice-control { display: block; min-width: 0; max-width: 100%; }
.choice-dialog { border: 0; border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(11, 20, 64, .3); }
.choice-dialog::backdrop, .detail-panel-dialog::backdrop { background: rgba(11, 20, 64, .5); }
.choice-option { min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.choice-option:is([aria-current="true"], [aria-pressed="true"]) { border-color: var(--ap-royal); background: var(--ap-royal-50); color: var(--ap-royal); }

/* ---------- Chips (filters with counts) ---------- */
#app :is(#workspace-shell, #modal) :is(.chips, .ufir-chips) { display: flex; flex-wrap: nowrap; gap: var(--space-2); overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
#app :is(#workspace-shell, #modal) :is(.chip, .ufir-chip) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
#app :is(#workspace-shell, #modal) :is(.chip, .ufir-chip) > :is(b, .count) { min-width: 0; padding: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: var(--fs-badge); font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
#app :is(#workspace-shell, #modal) :is(.chip, .ufir-chip):hover { border-color: var(--ap-royal); color: var(--ap-royal); }
#app :is(#workspace-shell, #modal) :is(.chip, .ufir-chip):is([aria-pressed="true"], [aria-current="page"], [aria-current="true"], .active) { border-color: var(--ap-navy-800); background: var(--ap-navy-800); color: #fff; }
#app :is(#workspace-shell, #modal) :is(.chip, .ufir-chip):is([aria-pressed="true"], [aria-current="page"], [aria-current="true"], .active) > :is(b, .count) { background: transparent; color: rgba(255, 255, 255, .85); }

/* ---------- Tabs: one row, solid active, scroll sideways on phones ---------- */
#app #workspace-shell #main :is(.case-tabs, .queue-tabs, .ufir-tabs) {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  width: auto;
  max-width: 100%;
  margin: 0 0 var(--space-5);
  padding: 6px;
  overflow-x: auto;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  scrollbar-width: none;
}
#app #workspace-shell #main :is(.case-tabs a, .queue-tabs button, .ufir-tabs > :is(a, button)) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}
#app #workspace-shell #main :is(.case-tabs a, .queue-tabs button, .ufir-tabs > :is(a, button)):hover:not(.active):not([aria-pressed="true"]):not([aria-selected="true"]) { background: var(--ap-royal-50); color: var(--ap-royal); }
#app #workspace-shell #main :is(.case-tabs a.active, .queue-tabs button.active, .queue-tabs button[aria-pressed="true"], .ufir-tabs > :is(.active, [aria-selected="true"], [aria-pressed="true"], [aria-current="page"])) {
  background: var(--ap-royal);
  color: #fff;
  font-weight: 750;
  box-shadow: none;
}
#app #workspace-shell #main .queue-tabs button > span,
#app #workspace-shell #main :is(.case-tabs a, .ufir-tabs > :is(a, button)) > :is(.count, .tab-count, span:last-child:not(:first-child)) { min-width: 0; padding: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: var(--fs-badge); font-weight: 750; font-variant-numeric: tabular-nums; }
#app #workspace-shell #main :is(.queue-tabs button.active, .queue-tabs button[aria-pressed="true"]) > span,
#app #workspace-shell #main :is(.case-tabs a.active, .ufir-tabs > :is(.active, [aria-selected="true"], [aria-pressed="true"])) > :is(.count, .tab-count, span:last-child:not(:first-child)) { background: transparent; color: rgba(255, 255, 255, .85); }

/* ---------- Status tags: one meaning per colour, app-wide ---------- */
#app :is(#workspace-shell, #modal) :is(.stage, .register-stage, .reports-pill, .visual-case-stage, .intel-case-stage, .case-map-stage, .assistant-case-stage, .shared-summary-stage, .fact-state, .status-tag) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-inline-size: 100%;
  min-height: 24px;
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: #eceef5;
  color: #4a5270;
  font-family: var(--font-ui);
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: none;
}
#app :is(#workspace-shell, #modal):lang(te) :is(.stage, .register-stage, .reports-pill, .fact-state, .status-tag) { font-size: .8125rem; }
#app :is(#workspace-shell, #modal) :is(.stage-intake, .register-stage-intake, .reports-stage-intake, .shared-stage-intake, [data-stage="intake"] .visual-case-stage) { background: var(--ap-sky-50); color: var(--ap-sky); }
#app :is(#workspace-shell, #modal) :is(.stage-review, .register-stage-review, .reports-stage-review, .shared-stage-review, [data-stage="review"] .visual-case-stage) { background: var(--ap-rose-50); color: var(--ap-rose); }
#app :is(#workspace-shell, #modal) :is(.stage-investigating, .register-stage-investigating, .reports-stage-investigating, .shared-stage-investigating, [data-stage="investigating"] .visual-case-stage) { background: var(--ap-royal-50); color: var(--ap-royal); }
#app :is(#workspace-shell, #modal) :is(.stage-ready, .register-stage-ready, .reports-stage-ready, .shared-stage-ready, [data-stage="ready"] .visual-case-stage, .fact-verified .fact-state) { background: var(--ap-green-50); color: var(--ap-green); }
#app :is(#workspace-shell, #modal) :is(.stage-closed, .register-stage-closed, .reports-stage-closed, .shared-stage-closed, [data-stage="closed"] .visual-case-stage) { background: #eceef5; color: #4a5270; }
#app :is(#workspace-shell, #modal) .fact-pending .fact-state { background: var(--ap-amber-50); color: var(--ap-amber); }
#app :is(#workspace-shell, #modal) .fact-rejected .fact-state { background: var(--ap-red-50); color: var(--ap-red); }
#app :is(#workspace-shell, #modal) :is(.stage, .register-stage)::before { content: ""; flex: none; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#app :is(#workspace-shell, #modal) .stage > span { flex-shrink: 0; }

/* ---------- Surfaces, wells, rows (no cards in cards) ---------- */
#app #workspace-shell #main :is(.surface, .ufir-surface) { padding: var(--space-5); border: 0; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); }
#app #workspace-shell #main :is(.surface, .ufir-surface) :is(.surface, .ufir-surface) { padding: var(--space-4); border-radius: 12px; background: var(--well); box-shadow: none; }
#app #workspace-shell #main :is(.well, .ufir-well) { padding: var(--space-3) var(--space-4); border: 0; border-radius: 12px; background: var(--well); box-shadow: none; }
#app #workspace-shell #main :is(.quote, .ufir-quote) { margin: 0; padding: var(--space-3) var(--space-4); border: 0; border-inline-start: 4px solid var(--ap-rose); border-radius: 0 12px 12px 0; background: var(--well); color: var(--ink); font-size: 1rem; }

/* Tables: one surface, tinted header, hairline rows */
#app #workspace-shell #main :is(.case-table, .register-table, .reports-table, .hotspot-table, .risk-table, .trail-table, .explorer-table, .file-table) { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
#app #workspace-shell #main :is(.case-table, .register-table, .reports-table, .hotspot-table, .risk-table, .trail-table, .explorer-table, .file-table) thead th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #eef3fb;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: 0;
  text-align: start;
  text-transform: none;
}
#app #workspace-shell #main :is(.case-table, .register-table, .reports-table, .hotspot-table, .risk-table, .trail-table, .explorer-table, .file-table) tbody :is(td, th) { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .9375rem; vertical-align: middle; }
#app #workspace-shell #main :is(.case-table, .register-table, .reports-table, .hotspot-table, .risk-table, .trail-table, .explorer-table, .file-table) tbody tr:hover { background: var(--row-hover); }
#app #workspace-shell :is(.register-scroll, .reports-scroll, .hotspot-scroll, .risk-table-wrap, .trail-table-wrap, .explorer-table-scroll, .table-scroll):focus-visible { outline-offset: -3px; }

/* ---------- Empty and failure states ---------- */
#app #workspace-shell #main :is(.empty-state, .quiet-state) {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-5);
  border: 0;
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}
#app #workspace-shell #main .empty-state > svg {
  box-sizing: border-box;
  width: 72px;
  height: 72px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--a), var(--b));
  color: #fff;
}
#app #workspace-shell #main .empty-state :is(h2, h3) { margin: 0; color: var(--ink); font-size: 1.125rem; }
#app #workspace-shell #main .empty-state p { max-width: 46ch; margin: 0; font-size: 1rem; }
#app #workspace-shell #main [role="alert"].quiet-state > svg { background: linear-gradient(135deg, #e84a86, #c2185b); }

/* Banner: tinted strip with icon, sentence and action (warnings stay, not as footnotes) */
#app #workspace-shell #main :is(.banner, .ufir-banner) { display: flex; align-items: center; gap: var(--space-3); padding: 14px 16px; border: 1px solid #f6c76b; border-radius: 12px; background: var(--ap-amber-50); color: #7a3a06; font-size: .9375rem; }
#app #workspace-shell #main :is(.banner, .ufir-banner).is-review { border-color: #f4a3c3; background: var(--ap-rose-50); color: #8c1243; }
#app #workspace-shell #main :is(.banner, .ufir-banner).is-error { border-color: #f7a8b8; background: var(--ap-red-50); color: #8f1229; }
#app #workspace-shell #main :is(.banner, .ufir-banner) > svg { flex: none; width: 22px; height: 22px; padding: 0; border-radius: 0; background: none; color: inherit; }

/* Workspace hero: one band per page, gradient per destination, real-count sentence, two actions. */
#app #workspace-shell #main .ufir-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 0; max-height: none; margin: 0 0 var(--space-5); padding: clamp(18px, 3vw, 28px); border-radius: var(--r-hero); background: var(--hero); color: #fff; box-shadow: none; overflow: hidden; }
#app #workspace-shell #main .ufir-hero :is(h1, h2, p, span, strong) { color: #fff; }
#app #workspace-shell #main .ufir-hero .button { border-color: transparent; background: #fff; color: var(--ap-navy-800); box-shadow: none; }
#app #workspace-shell #main .ufir-hero .button.glass { border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
#app #workspace-shell #main .ufir-hero .photo-frame, #app #workspace-shell #main .photo-frame { border: 3px solid #fff; border-radius: 18px; box-shadow: 0 14px 30px rgba(0, 0, 0, .18); object-fit: cover; }

/* Stat tile: 50px gradient icon tile, label, big tabular number. */
#app #workspace-shell #main .ufir-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
#app #workspace-shell #main .ufir-stat { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
#app #workspace-shell #main .ufir-stat > svg { box-sizing: border-box; flex: none; width: 50px; height: 50px; padding: 13px; border-radius: 16px; background: linear-gradient(135deg, var(--a), var(--b)); color: var(--glyph); }
#app #workspace-shell #main .ufir-stat strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
#app #workspace-shell #main .ufir-stat span { display: block; color: var(--muted); font-size: .875rem; font-weight: 650; }

/* ---------- Dialogs ---------- */
#app dialog#modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: var(--space-6);
  border: 0;
  border-top: 5px solid var(--ap-royal);
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(11, 20, 64, .3);
}
#app dialog#modal::backdrop { background: rgba(11, 20, 64, .5); backdrop-filter: none; }
#app dialog#modal .modal-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-4); }
#app dialog#modal .modal-heading h2 { margin: 0; font-size: 1.375rem; font-weight: 800; }
#app dialog#modal .modal-heading .icon-button { border-color: transparent; background: transparent; }
#app dialog#modal .modal-heading .icon-button:hover { border-color: var(--line); background: var(--ground); color: var(--ink); }
#app dialog#modal .modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
#app dialog#modal .help-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; }
#app dialog#modal .help-list > :is(.button, .text-link) { justify-content: flex-start; width: 100%; margin: 0; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fff; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1rem; font-weight: 650; }
#app dialog#modal .help-list > :is(.button, .text-link) > svg:first-child { width: 22px; height: 22px; color: var(--ap-royal); }
#app dialog#modal .help-list > :is(.button, .text-link):hover { border-color: var(--ap-royal); background: var(--ap-royal-50); color: var(--ap-royal); }
#app dialog#modal .help-list > .text-link > svg.lucide-arrow-up-right { margin-inline-start: auto; }
.detail-panel-dialog { border: 0; border-top: 5px solid var(--ap-royal); border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(11, 20, 64, .3); }
.detail-panel-heading { background: #fff; }
.choice-close, .detail-panel-close { border-color: transparent; background: transparent; }
/* The FIR "more actions" list is a plain menu once it sits inside its dialog. */
#app #workspace-shell .detail-panel-body .case-menu-panel,
#app #workspace-shell dialog .case-menu-panel {
  position: static;
  inset: auto;
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#app #workspace-shell .case-menu-panel > :is(a, button) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  text-align: start;
  text-decoration: none;
  box-shadow: none;
}
#app #workspace-shell .case-menu-panel > :is(a, button):hover { background: var(--ap-royal-50); color: var(--ap-royal); }
#app #workspace-shell .case-menu-panel > [data-action="remove-case"] { color: var(--ap-red); }
#app #workspace-shell .case-menu-panel > [data-action="remove-case"]:hover { background: var(--ap-red-50); color: var(--ap-red); }

/* ---------- Toasts ---------- */
#app .notice {
  position: fixed;
  z-index: var(--z-toast);
  top: auto;
  right: max(var(--gutter), env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  left: auto;
  transform: none;
  display: none;
  align-items: center;
  gap: var(--space-3);
  max-width: min(440px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--ap-navy-900);
  color: #fff;
  font-family: var(--font-ui);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 18px 40px rgba(11, 20, 64, .3);
}
#app .notice.visible { display: flex; }
#app .notice.error { background: #8c1243; color: #fff; }
/* No :has() on #app here: it made every change inside the app restyle the whole page (CRM opened ~3x slower). */
html:lang(te) #app .notice { line-height: 1.7; }


/* ---------- Casebook host: dark surround for the original board (its own CSS is untouched) ---------- */
#app #workspace-shell #casebook-frame { background: #0c0a09; border-radius: 14px; }
#app #workspace-shell .board-main .board-surface { border: 0; border-radius: 14px; overflow: hidden; background: #0c0a09; box-shadow: var(--shadow-up); min-height: 300px; }
#app #workspace-shell .board-main #casebook-frame { min-height: 300px; }

/* ===================================================================== de-slop sweep
   App-wide tells removed once here so every route stays consistent:
   - no hover lifts: rows, cards, covers and tiles answer hover with colour or border only;
   - photo destination tiles carry no floating pill CTA (the whole tile is the link). */
#app #workspace-shell #main :is(.visual-case, .crm-person, .law2-cover, .document-card, .metric, .quick-intake-option, .feature-destination, .ufir-stat):hover,
#app #workspace-shell #main .law2 .law-form-preview:hover img,
#app #workspace-shell #main button.case-hero-photo:hover img,
#app #workspace-shell .task-row > a:hover { transform: none; translate: none; }
#app #workspace-shell #main .feature-destination .feature-destination-action { display: none; }

/* ===================================================================== motion */
@media (prefers-reduced-motion: no-preference) {
  /* One quiet fade answers "the page changed"; no per-section stagger. */
  #app #workspace-shell #main:not(.board-main) > .route-enter { animation: ufir-fade var(--t-fast) ease both; }
  #app .notice.visible { animation: ufir-toast var(--t-enter) var(--ease) both; }
  #app dialog#modal[open] { animation: ufir-dialog var(--t-enter) var(--ease) both; }
}
@keyframes ufir-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ufir-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ufir-toast { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ufir-dialog { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================================================================== tablet */
@media (min-width: 761px) and (max-width: 1180px) {
  #app #workspace-shell { --sidebar-width: 224px; }
  #app #workspace-shell .masthead { column-gap: var(--space-4); }
  #app #workspace-shell .masthead .brand-name > span { display: none; }
  #app #workspace-shell .masthead .account-name { display: none; }
  #app #workspace-shell .masthead .account-control { width: 44px; padding: 0; justify-content: center; }
  #app #workspace-shell .masthead .account-control > svg { width: 22px; height: 22px; }
  /* Text size stays in Settings at these widths; the band keeps language, help and profile. */
  #app #workspace-shell .masthead .text-size-control { display: none; }
}
@media (min-width: 761px) and (max-width: 960px) {
  #app #workspace-shell .masthead .search-submit { display: none; }
}

/* ===================================================================== phone */
@media (max-width: 760px) {
  #app #workspace-shell { --bar-height: 56px; --gutter: 12px; }
  #app #workspace-shell .masthead {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand search right";
    column-gap: var(--space-2);
    min-height: calc(var(--bar-height) + env(safe-area-inset-top, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  #app #workspace-shell .masthead-right { flex: none; gap: 6px; padding-block: 0; }
  #app #workspace-shell .text-size-control { display: none; }
  #app #workspace-shell .header-languages button { min-width: 36px; min-height: 40px; padding: 0 8px; font-size: .875rem; }
  #app #workspace-shell .header-languages .lang-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #app #workspace-shell .header-languages .lang-short { display: inline; }
  #app #workspace-shell .masthead > .brand { gap: 6px; min-height: calc(var(--bar-height) - 3px); }
  #app #workspace-shell .masthead .mobile-menu { display: inline-flex !important; }
  #app #workspace-shell .masthead a.brand { gap: var(--space-2); }
  #app #workspace-shell .masthead .gov-emblem { width: 36px; height: 36px; padding: 3px; border-radius: 9px; }
  #app #workspace-shell .masthead .brand-name { font-size: 1.1875rem; row-gap: 2px; }
  #app #workspace-shell .masthead .brand-word { font-size: 1.3125rem; }
  #app #workspace-shell .masthead .brand-name > small.access-gov { display: none; }
  #app #workspace-shell .masthead .brand-name > :is(small, span) { font-size: .75rem; }
  #app #workspace-shell .masthead .brand-name > span { display: none; }
  #app #workspace-shell .masthead-right > .icon-button[data-action="help"] { display: none; }
  #app #workspace-shell .masthead .account-control { width: 44px; min-width: 44px; padding: 0; border-radius: 50%; }
  #app #workspace-shell .masthead .account-control > svg { box-sizing: border-box; inline-size: 22px; block-size: 22px; width: 22px; height: 22px; padding: 0; }
  #app #workspace-shell .masthead .account-name { display: none; }
  /* Phones: search is a 44px icon in the band; focusing it opens the full-width field over the band. */
  #app #workspace-shell .masthead .global-search {
    grid-area: search;
    justify-self: end;
    position: relative;
    z-index: 2;
    width: 44px;
    min-width: 44px;
    max-width: none;
    min-height: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: var(--r-sm);
    background: rgba(11, 20, 64, .36);
    color: #fff;
    box-shadow: none;
    overflow: hidden;
  }
  #app #workspace-shell .masthead .global-search > svg { position: absolute; left: 11px; top: 50%; margin-top: -10px; color: #fff; pointer-events: none; }
  #app #workspace-shell .masthead .global-search input[type="search"] { width: 100%; height: 42px; min-height: 42px; padding: 0 0 0 44px; color: transparent; caret-color: transparent; cursor: pointer; }
  #app #workspace-shell .masthead .global-search input[type="search"]::placeholder { color: transparent; }
  #app #workspace-shell .masthead .search-submit { display: none; }
  #app #workspace-shell .masthead .global-search:is(:focus-within, :has(input:not(:placeholder-shown))) {
    position: absolute;
    grid-area: auto;
    grid-column: 1 / -1;
    grid-row: 1;
    inset: 4px 0 auto 0;
    width: auto;
    height: 46px;
    margin: 0;
    padding: 2px 2px 2px 0;
    border: 0;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
    overflow: visible;
  }
  #app #workspace-shell .masthead .global-search:is(:focus-within, :has(input:not(:placeholder-shown))) > svg { color: var(--ap-royal); }
  #app #workspace-shell .masthead .global-search:is(:focus-within, :has(input:not(:placeholder-shown))) input[type="search"] { color: var(--ink); caret-color: auto; cursor: text; }
  #app #workspace-shell .masthead .global-search:is(:focus-within, :has(input:not(:placeholder-shown))) input[type="search"]::placeholder { color: var(--muted); }
  #app #workspace-shell .masthead .global-search:is(:focus-within, :has(input:not(:placeholder-shown))) .search-submit { display: inline-flex; padding: 0 14px; }

  #app #workspace-shell .app-layout { display: block; grid-template-columns: minmax(0, 1fr); }
  #app #workspace-shell .sidebar {
    position: absolute;
    z-index: var(--z-drawer);
    top: 0;
    left: 0;
    width: min(320px, calc(100vw - 44px));
    max-inline-size: calc(100vw - 44px);
    height: 100%;
    max-block-size: 100svh;
    padding: var(--space-4) var(--space-3) max(var(--space-4), env(safe-area-inset-bottom, 0px));
    background: var(--ground);
    box-shadow: 0 0 40px rgba(11, 20, 64, .3);
    transform: translateX(-105%);
    visibility: hidden;
  }
  body.nav-open #app #workspace-shell .sidebar { transform: none; visibility: visible; }
  #app #workspace-shell .sidebar :is(.workspace-help-nav, .sidebar-bottom .workspace-help-nav) { display: flex; }
  /* The drawer is one white surface: nav and account links share it, divided by a hairline, never two floating boxes. */
  #app #workspace-shell .sidebar { gap: 0; background: #fff; }
  #app #workspace-shell .sidebar :is(nav, .sidebar-bottom) { padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  #app #workspace-shell .sidebar-bottom { position: static; margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
  body.nav-open #app #workspace-shell .nav-scrim { display: block; position: absolute; z-index: 45; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(11, 20, 64, .6); }
  #app #workspace-shell #main { padding: var(--space-4) var(--gutter) calc(var(--dock-height) + 28px + env(safe-area-inset-bottom, 0px)); }

  #app #workspace-shell .mobile-dock {
    position: fixed;
    z-index: var(--z-dock);
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -8px 28px rgba(11, 20, 64, .14);
  }
  #app #workspace-shell .mobile-dock a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 0;
    border-radius: 14px;
    background: transparent;
    color: var(--ink-2);
    font-family: var(--font-display);
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
  }
  #app #workspace-shell .mobile-dock a > svg { box-sizing: border-box; width: 30px; height: 30px; padding: 5px; border-radius: 10px; background: linear-gradient(135deg, var(--a), var(--b)); color: var(--glyph); }
  #app #workspace-shell .mobile-dock a > span:first-of-type { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; word-break: keep-all; }
  #app #workspace-shell:lang(te) .mobile-dock a { font-size: .8125rem; font-stretch: 75%; letter-spacing: 0; }
  #app #workspace-shell .mobile-dock a.active { background: var(--ap-royal-50); color: var(--ap-royal); }
  #app #workspace-shell .mobile-dock .nav-count {
    position: absolute;
    top: 2px;
    left: calc(50% + 6px);
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--ap-gold);
    color: var(--ap-navy-900);
    font-size: .75rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
  }
  #app #workspace-shell .mobile-dock .nav-count:empty { display: none; }
  #app #workspace-shell .mobile-dock a:focus-visible { outline-offset: -3px; }
  body.nav-open #app #workspace-shell .mobile-dock { visibility: hidden; }

  #app .notice { right: 12px; left: 12px; max-width: none; transform: none; margin: 0; bottom: calc(var(--dock-height, 64px) + 18px + env(safe-area-inset-bottom, 0px)); }
  #app #workspace-shell #main .page-heading { align-items: stretch; margin-bottom: var(--space-4); text-align: start; }
  #app #workspace-shell #main .page-heading > div:first-child { align-self: flex-start; }
}
@media (max-width: 359px) {
  #app #workspace-shell .masthead .brand-name { display: none; }
}

/* ===================================================================== forced colours */
@media (forced-colors: active) {
  #app #workspace-shell .masthead { background: Canvas; color: CanvasText; border-color: CanvasText; }
  #app #workspace-shell .sidebar nav a > svg { background: Canvas; color: CanvasText; box-shadow: none; }
  #app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a).active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  #app #workspace-shell .sidebar :is(nav a, .sidebar-bottom a).active :is(span, svg) { background: transparent; color: inherit; }
  #app #workspace-shell #main :is(.case-tabs a.active, .queue-tabs button.active, .queue-tabs button[aria-pressed="true"]) { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  #app :is(#workspace-shell, #modal, #workspace-entry) :is(a, button, input, select, textarea, [tabindex]):focus-visible { outline-color: Highlight; }
  #app :is(#workspace-shell, #modal) :is(.button.primary, .button.attention, .button.verify) { forced-color-adjust: none; background: ButtonText; color: ButtonFace; }
}
