/* --- css/style.css --- */
/* ================================================================
   CarVision Damage Analyst  ·  style.css  (entry point)
   ================================================================
   All styles are split into focused modules under ./css/.
   Import order matters — later files can override earlier ones.
   ================================================================ */

/* --- css/base/1_variables.css --- */
/* ================================================================
   1_variables.css  —  Design tokens · Reset · Base · Scrollbar
   ================================================================ */

/* ── Page-navigation transition (View Transitions API) ──────── */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation-duration: 0.1s; animation-timing-function: ease-out; }
::view-transition-new(root) { animation-duration: 0.1s; animation-timing-function: ease-in; }

/* ── Admin nav tab: hidden by default, shown via html.is-admin ── */
/* Toggled synchronously from sessionStorage before first paint   */
.nav-admin-tab { display: none !important; }
html.is-admin .nav-admin-tab { display: flex !important; align-items: center; gap: 6px; }

/* ── Reset & Root ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #07090e;
  --surface:     #0c1018;
  --surface-hi:  #111926;
  --surface-lo:  #090c12;
  --border:      #1a2535;
  --border-hi:   #263345;
  --accent:      #FF1B6D;
  --accent-dim:  #6B2D8D;
  --accent-glow: #FF1B6D28;
  --blue:        #3b82f6;
  --teal:        #0d9488;
  --green:       #16a34a;
  --amber:       #d97706;
  --orange:      #ea580c;
  --red:         #dc2626;
  --crimson:     #991b1b;
  --purple:      #8b5cf6;
  --gold:        #eab308;
  --slate:       #6b7280;
  --text:        #d6e3f0;
  --text-hi:     #eef4fc;
  --muted:       #7a96ad;
  --mono:        'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --sans:        'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;
  --r-sm:        4px;
  --r-md:        6px;
  /* Mobile fixed top-nav's height (base/2_layout.css's unconditional
     .top-nav rule) — anything else fixed-positioned below it (.rp-tabs in
     9_report.css, #results-panel's clearance in 24_responsive.css) reads
     this instead of re-declaring 58px, so the two can never drift apart
     into a visible gap or overlap. */
  --nav-h:       58px;
  /* Real rendered height of .analyst-subnav (html/partials/analyst_subnav.
     html — index.html/windshield.html only), measured the same way as
     --nav-h above (see core/nav-init.js::syncSubnavHeight). 0 on every page
     that doesn't render it, and 0 until first measured, so nothing that
     reads it needs its own separate absent-element fallback. */
  --subnav-h:    0px;
  /* ── Fleet page aliases ──────────────────────────────────────── */
  --surface2:    #111926;
  --border2:     #263345;
  --radius:      6px;
  --yellow:      #d97706;
  --green-dim:   rgba(22,163,74,.12);
  --red-dim:     rgba(220,38,38,.12);
  --yellow-dim:  rgba(217,119,6,.12);
  --orange-dim:  rgba(234,88,12,.12);
  /* ── Knowledge Base page aliases ─────────────────────────────── */
  --text-primary:     var(--text-hi);
  --text-secondary:   var(--muted);
  --bg-panel:          var(--surface);
  --bg-input:          var(--surface-hi);
  --border-main:       var(--border-hi);
  --accent-primary:    var(--accent);
  --accent-secondary:  var(--blue);

  /* ── Motion tokens ────────────────────────────────────────────
     One shared vocabulary for every transition/animation in the app,
     instead of each component picking its own duration/easing ad hoc.
     --ease-out-soft matches the easing already used by the confirm
     dialog's entrance (modalFadeIn, 7_modals.css) — kept as the
     one "the standard" curve, not a new one competing with it. */
  --dur-fast:      120ms;
  --dur-base:      200ms;
  --dur-slow:      320ms;
  --ease-out-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme="light"] {
  --bg:          #f0f4f8;
  --surface:     #ffffff;
  --surface-hi:  #f8fafc;
  --surface-lo:  #e2e8f0;
  --border:      #cbd5e1;
  --border-hi:   #94a3b8;
  --accent:      #E60050;
  --accent-dim:  rgba(230, 0, 80, 0.12);
  --accent-glow: rgba(230, 0, 80, 0.25);
  --blue:        #2563eb;
  --teal:        #0f766e;
  --green:       #15803d;
  --amber:       #b45309;
  --orange:      #c2410c;
  --red:         #b91c1c;
  --crimson:     #7f1d1d;
  --text:        #334155;
  --text-hi:     #0f172a;
  --muted:       #64748b;
  --surface2:    #f8fafc;
  --border2:     #cbd5e1;
  --text-primary:     var(--text-hi);
  --text-secondary:   var(--muted);
  --bg-panel:          var(--surface);
  --bg-input:          var(--surface-hi);
  --border-main:       var(--border-hi);
  --accent-primary:    var(--accent);
  --accent-secondary:  var(--blue);
}

html {
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  scroll-behavior: smooth;
  /* Stops a scroll gesture that reaches the top/bottom of one scrollable
     area (a modal body, a sidebar list) from "chaining" into scrolling the
     page/overlay behind it — the single biggest source of janky-feeling
     scroll on mobile Safari/Chrome, where an overscrolled inner list would
     otherwise drag the whole backdrop with it. */
  overscroll-behavior: none;
}

body {
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  /* Removes the grey/black flash Android/older iOS paint on every tap —
     buttons and links already have their own :hover/:active feedback
     (see 4_buttons.css), so the browser's default highlight only ever
     fights with it instead of adding anything. */
  -webkit-tap-highlight-color: transparent;
}

/* Every scrollable panel gets smooth momentum + no scroll-chaining into
   whatever sits behind it (a modal body scrolling past its own bottom
   must never also scroll the page underneath). Contain, not none — an
   inner list can still be scrolled to its own end, it just stops there. */
.modal-bd, .modal-body, .history-scroll, .settings-panel,
.sidebar-panel, .vehicle-list, .yolo-validation-scroll {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Shared entrance for any top-right dropdown panel (account menu,
   notification panel, …) — anchored so it grows out of its trigger
   button instead of just materializing in place. */
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Shared entrance for a tab/pane that just became the active one (admin's
   .admin-tab-body, the vehicle detail panel's #vpanel-* panes, …) — a
   plain display:none/shown toggle in every case, class- or inline-style-
   driven, both restart this the same way. */
@keyframes paneFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduced motion ───────────────────────────────────────────
   Respected globally, not per-component — anyone with this OS/browser
   preference set gets near-instant state changes everywhere at once. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-lo); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Global utilities ──────────────────────────────────────── */
.hidden { display: none !important; }

.mono-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}
/* --- css/base/2_layout.css --- */
/* ================================================================
   2_layout.css  —  App shell · Panels · Resize handle · Header · Brand
   ================================================================ */

/* ── Top nav ─────────────────────────────────────────────────── */
.top-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-logo-pill {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 5px;
  padding: 3px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 8px rgba(0,0,0,.35);
}

.brand-logo-pill img {
  height: 20px;
  width: auto;
  display: block;
}

.top-nav-brand .brand-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-hi);
  white-space: nowrap;
}

.top-nav-brand .brand-sub {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.top-nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  background: none;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}

.nav-tab:hover {
  color: var(--text-hi);
  border-color: var(--border-hi);
  background: var(--surface-hi);
}

.nav-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.top-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Analyst section sub-nav (Bodywork / Windshield) ─────────────
   Shared by index.html and windshield.html — see
   html/partials/analyst_subnav.html. Sits directly under .top-nav so the
   two workspaces read as sibling sub-tabs of one "ANALYST" section rather
   than two unrelated top-level pages. */

.subnav-tab {
  padding: 5px 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}

.subnav-tab:hover {
  color: var(--text-hi);
  background: var(--surface-hi);
}

.subnav-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Hidden entirely during the immersive analysis-fullscreen view (see
   #app.analysis-fullscreen below) — the Bodywork/Glass switcher has nothing
   useful to do mid-analysis (leaving it would abandon the run — see
   exitAnalysisFullscreen()'s confirm dialog), and on a phone-width screen
   reclaiming its strip is the difference between the live narration feed
   having room to breathe and being squeezed into a sliver below the 3D map.
   .analyst-subnav is a sibling of #app, not a descendant (see
   core/nav-init.js's own comment on syncSubnavHeight), so :has() on their
   shared ancestor is the only way to reach it from #app's own state — same
   pattern 9_report.css already uses to fix .top-nav for this exact view.
   See 24_responsive.css for the matching fix to #app's own reserved
   top padding, which otherwise leaves a --subnav-h-tall gap behind. */

/* ── App layout ─────────────────────────────────────────────── */

/* Immersive analysis mode — set on #app by the bodywork and glass page
   controllers. The upload/config panel and resize handle are hidden entirely;
   the results panel (already flex:1) naturally expands to the full width.
   Each controller restores the normal split view when the analysis is reset. */

/* .panel-peek (toggled by togglePanelPeek() in core/app.js, via the "☰"
   button next to "‹ BACK") lets the reviewer glance at/edit the upload &
   config panel WITHOUT leaving full-screen mode or losing the in-progress
   analysis — a lighter-weight peek, not the full reset "‹ BACK" does. The
   resize handle stays hidden even while peeking, to keep this simple. */

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  margin-bottom: 0 !important;
}

/* ── Input panel ─────────────────────────────────────────────── */

.panel-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Resize handle ───────────────────────────────────────────── */
.resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--border);
  position: relative;
  transition: background .15s;
  user-select: none;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: var(--accent-dim);
}
.resize-handle::after {
  content: '';
  position: absolute;
  inset: 0 -4px;  /* widen the hit target without changing visuals */
}

/* ── Panel header ────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  gap: 12px;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* ── Account menu (dropdown) ───────────────────────────────────
   Consolidates Profile/Settings/admin-only page tools/Logout behind
   one trigger instead of a growing row of same-weight icon buttons —
   Theme + History stay as standalone icons since they're single-purpose
   and used far more often than the account-management actions. */
.account-menu { position: relative; }

/* Trigger is circular (unlike the square icon buttons beside it) since it
   doubles as an avatar — shows, in priority order: the user's uploaded
   photo, else initials on a solid accent circle, else the plain person
   icon (before /api/auth/me has loaded, or for a user with neither). */
.account-menu-trigger {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
}
/* Absolute + inset:0 (not width/height:100%) deliberately — as a flex
   item inside .icon-btn's flex row, a percentage-sized child was sizing
   to its own content (the 2-letter text) instead of filling the button,
   rendering as a tall oval rather than a circle. Positioning against the
   trigger's own padding box sidesteps that flex sizing entirely. */
.account-trigger-avatar,
.account-trigger-initials {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.account-trigger-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-trigger-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
  padding: 6px;
  z-index: 300;
  transform-origin: top right;
  animation: dropdownIn var(--dur-base) var(--ease-out-soft);
}
.account-menu-panel.hidden { display: none; }

.account-menu-user {
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-hi);
  word-break: break-word;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.account-menu-item:hover { background: var(--surface); color: var(--text-hi); }
.account-menu-item:active { background: var(--border); }
/* Theme/history duplicate the standalone top-nav icons, only for when
   24_responsive.css's mobile breakpoint hides those and needs a home for
   them inside the account menu instead — desktop keeps the standalone
   icons, so this stays hidden until that breakpoint says otherwise. */
.account-menu-item.mobile-only-item { display: none; }
.account-menu-item svg { flex-shrink: 0; color: var(--muted); }
.account-menu-item:hover svg { color: var(--accent); }

.account-menu-item-danger:hover { color: var(--red); }
.account-menu-item-danger:hover svg { color: var(--red); }

.account-menu-divider { height: 1px; background: var(--border); margin: 6px 2px; }

/* ── Brand ───────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }

.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-hi);
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out-soft), background var(--dur-fast);
}
.icon-btn:hover { color: var(--text-hi); border-color: var(--border-hi); background: var(--surface-hi); }
.icon-btn:active { transform: scale(0.90); }

/* ── IP sections ─────────────────────────────────────────────── */

.optional-badge {
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 2px;
  padding: 0 5px;
  line-height: 16px;
}

.ip-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

/* ── Results panel ───────────────────────────────────────────── */

/* ── Action area (analyze button static footer) ──────────────── */

/* ── Token row ───────────────────────────────────────────────── */

/* ── Collapsible sections ─────────────────────────────────────── */
.collapsible-section {
  display: block;
  margin: 0;
  padding: 0;
}

.collapsible-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.collapsible-section > summary::-webkit-details-marker { display: none; }

.toggle-arrow {
  font-size: 8px;
  color: var(--accent);
  transition: transform .2s;
  flex-shrink: 0;
}
.toggle-arrow.open { transform: rotate(90deg); }

/* ── Infer-vehicle toggle row ────────────────────────────────── */
.infer-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding: 7px 10px;
  background: var(--surface-lo); border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

/* ── Manual vehicle toggle ───────────────────────────────────── */
.manual-vehicle-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 8px; padding: 6px 10px;
  background: none; border: 1px dashed var(--border);
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--text); text-align: left;
  transition: border-color .15s, color .15s;
}
.manual-vehicle-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── Plate lookup ────────────────────────────────────────────── */
.plate-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.plate-field {
  font-family: var(--mono);
  font-size: 16px; /* >=16px: iOS Safari zooms the page on focus below this */
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
}

.vehicle-card {
  margin-top: 10px;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 12px;
}

.vehicle-card .vc-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.vehicle-card .vc-row:last-child { border-bottom: none; }
.vehicle-card .vc-key {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  min-width: 90px;
}
.vehicle-card .vc-val {
  font-weight: 500;
  color: var(--text-hi);
  text-align: right;
}

/* ── Generic info rows ───────────────────────────────────────── */

/* ── App footer (full width) ─────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface) !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  margin: 0 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50;
}

.app-footer p {
  margin: 0;
}

.footer-slogan {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.text-muted {
  color: #4b6173;
}

/* Ensure scrollable containers have padding matching footer height (70px) to prevent content hiding */
.sidebar,
.content,
.db-page,
.admin-page,
.ws-page {
  padding-bottom: 70px !important;
  margin-bottom: 0 !important;
}
/* --- css/base/3_forms.css --- */
/* ================================================================
   3_forms.css  —  Form controls · Inputs · Selects · Textarea
                   Range slider · Two-col layout · Tag checkboxes
   ================================================================ */

/* ── Field labels & hints ────────────────────────────────────── */
.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.field-hint-inline { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 10px; }
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── Text input ──────────────────────────────────────────────── */
.text-input {
  width: 100%;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-hi);
  font-family: var(--sans);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.text-input::placeholder { color: var(--muted); font-size: 11px; }

/* ── Select (full-width) ─────────────────────────────────────── */
.select-input {
  width: 100%;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.select-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Select (compact) ────────────────────────────────────────── */
.select-sm {
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Textarea ────────────────────────────────────────────────── */
.textarea-input {
  width: 100%;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-hi);
  font-family: var(--sans);
  font-size: 12px;
  padding: 7px 10px;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.textarea-input::placeholder { color: var(--muted); font-size: 11px; }

/* ── Two-column grid ─────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Tag checkbox group ──────────────────────────────────────── */
.tag-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 2px;
}

.tag-check {
  position: relative;
}
.tag-check input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.tag-check label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 7px;
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.tag-check input[type=checkbox]:checked + label {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.tag-check label:hover { border-color: var(--muted); color: var(--text); }

/* ── Range slider ────────────────────────────────────────────── */
.range-input {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border-hi);
  outline: none;
  cursor: pointer;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out-soft);
}
.range-input:hover::-webkit-slider-thumb,
.range-input:active::-webkit-slider-thumb { transform: scale(1.25); }
.range-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* ── Multiselect autocomplete ────────────────────────────────── */
.multiselect-wrapper {
  position: relative;
}
.multiselect-wrapper .text-input { margin-bottom: 0; }
.multiselect-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}
.multiselect-suggestions.hidden { display: none; }
.multiselect-suggestion {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.multiselect-suggestion:hover,
.multiselect-suggestion.highlighted {
  background: var(--accent-glow);
  color: var(--accent);
}
.multiselect-suggestion:last-child { border-bottom: none; }

/* ── Tag group (selected items) ──────────────────────────────── */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.tag-item-close {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  transition: opacity .1s;
}
.tag-item-close:hover { opacity: 0.6; }

/* ── Parts Modal Styles ──────────────────────────────────────── */
.parts-category {
  margin: 12px;
}
.parts-category .field-label {
  margin-bottom: 8px;
  color: var(--accent);
}
.parts-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.parts-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 11px;
  user-select: none;
  transition: background .1s;
}
.parts-item input[type="checkbox"] {
  cursor: pointer;
}
.parts-item:hover {
  background: var(--surface-hi);
}

/* ── Parts Selector Panel (Balloon inflation) ─────────────────── */
.parts-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 500px;
  max-width: 90vw;
  height: 70vh;
  max-height: 600px;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  z-index: 90;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: transform var(--dur-slow) var(--ease-out-back);
}
.parts-panel:not(.hidden) {
  transform: translate(-50%, -50%) scale(1);
}
.parts-panel.hidden {
  pointer-events: none;
}
.parts-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}
.parts-panel-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.parts-panel-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.parts-panel-search .text-input {
  margin: 0;
}
.parts-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.parts-panel-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: flex-end;
}

/* Backdrop for panel (slightly darkens background) */
.parts-panel:not(.hidden)::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: -1;
}

/* ── Export Report Modal ──────────────────────────────────────── */
.export-section {
  margin-bottom: 16px;
}
.export-section-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.export-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}
.export-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
}
.export-checkbox span {
  color: var(--text);
}
.export-checkbox input[type="checkbox"]:checked + span {
  color: var(--accent);
  font-weight: 500;
}
.export-part-options {
  margin: 0 0 2px 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-soft, rgba(120, 136, 160, 0.06));
}
.export-part-options.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.export-option-title {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font: 700 10px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
}
.export-description-option {
  margin-top: 10px;
}
.export-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--accent-glow);
  border-radius: var(--r-sm);
  color: var(--accent);
  font-size: 12px;
  margin: 12px 0;
}
.export-status.hidden {
  display: none;
}
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* --- css/base/4_buttons.css --- */
/* ================================================================
   4_buttons.css  —  All button variants
   ================================================================ */

/* ── Primary button ──────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out-soft);
}
.btn-primary:hover { opacity: .85; }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:disabled {
  background: var(--border-hi);
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary:disabled:hover { opacity: 1; }

/* ── Secondary button ────────────────────────────────────────── */
.btn-secondary {
  background: var(--surface-hi);
  color: var(--text);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out-soft);
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary:active:not(:disabled) { transform: scale(0.97); }

/* ── Ghost XS button ─────────────────────────────────────────── */
.btn-ghost-xs {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.btn-ghost-xs:hover { color: var(--text); border-color: var(--muted); }
.btn-ghost-xs:disabled { opacity: 0.35; cursor: default; }

/* ── Primary XS button ───────────────────────────────────────── */
.btn-primary-xs {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary-xs:hover { opacity: .85; }
.btn-primary-xs:disabled { opacity: 0.35; cursor: default; }

/* ── Analyse button ──────────────────────────────────────────── */

/* Was missing entirely — hover had a lift, but pressing the button gave no
   feedback at all until the click actually registered. Quick press-down,
   faster than the hover transition so it reads as an immediate response to
   the touch/click rather than another eased animation. */

/* One-off attention ring after a mobile photo upload/Guided Capture batch
   finishes (see _drawAttentionToAnalyzeButton() in core/app.js) — an
   expanding ring that fades out, not a loop, since this only needs to
   catch the eye once right after scrollIntoView(), not keep pulsing. */

@keyframes btn-analyze-attention {
  0%   { box-shadow: 0 4px 16px var(--accent-glow), 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 4px 16px var(--accent-glow), 0 0 0 12px rgba(255, 27, 109, 0); }
  100% { box-shadow: 0 4px 16px var(--accent-glow), 0 0 0 0 rgba(255, 27, 109, 0); }
}

/* ── Open 3D map button ──────────────────────────────────────── */
.btn-open-3d {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 7px 20px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-open-3d:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.btn-3d-icon {
  font-size: 15px;
  line-height: 1;
}

/* ── Icon XS button ──────────────────────────────────────────── */
.btn-icon-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  vertical-align: middle;
}
.btn-icon-xs:hover:not(:disabled) {
  background: var(--border);
  color: var(--text-hi);
  border-color: var(--border-hi);
}
.btn-icon-xs:active:not(:disabled) {
  transform: scale(0.92);
}
.btn-icon-xs:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-icon-xs.btn-danger {
  color: var(--red);
  border-color: rgba(220,38,38,0.2);
  background: rgba(220,38,38,0.06);
}
.btn-icon-xs.btn-danger:hover:not(:disabled) {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-icon-xs.btn-success {
  color: var(--green);
  border-color: rgba(22,163,74,0.2);
  background: rgba(22,163,74,0.06);
}
.btn-icon-xs.btn-success:hover:not(:disabled) {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.btn-icon-xs.btn-primary {
  color: var(--blue);
  border-color: rgba(59,130,246,0.2);
  background: rgba(59,130,246,0.06);
}
.btn-icon-xs.btn-primary:hover:not(:disabled) {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.icon-xs {
  width: 13px;
  height: 13px;
  display: block;
}

/* ── Spinner & Toast Notifications ──────────────────────────────── */
.admin-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: admin-spin 0.6s linear infinite;
  margin: 20px auto;
}
@keyframes admin-spin {
  to { transform: rotate(360deg); }
}

.app-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.app-toast {
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--text-hi);
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  min-width: 260px;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: admin-toast-in 0.2s cubic-bezier(0, 0, 0.2, 1);
  transition: all 0.2s ease;
}
.app-toast.error {
  border-left-color: var(--red);
}
.app-toast.success {
  border-left-color: var(--green);
}
.app-toast.info {
  border-left-color: var(--blue);
}
.app-toast-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.app-toast-close:hover {
  color: var(--text-hi);
}
@keyframes admin-toast-in {
  from {
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* --- css/components/5_upload.css --- */
/* ================================================================
   5_upload.css  —  Upload zone · Image preview · Mask status
                    Multi-image thumbnail strip
   ================================================================ */

/* ── Upload zone ─────────────────────────────────────────────── */
.camera-capture-zone {
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  /* Was 38px 20px — stacked icon+title+subtitle at that padding routinely
     pushed the "OR" divider and the manual upload zone below it entirely
     off-screen, reading as "there's no upload option" rather than "scroll
     to see it" until the reviewer happened to scroll. Trimmed so both
     input options are visible together on an ordinary viewport height,
     not just a tall one. */
  padding: 18px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  background: linear-gradient(135deg, var(--surface-lo), rgba(255, 27, 109, 0.05));
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.camera-capture-zone:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface-lo), var(--accent-glow));
  box-shadow: 0 0 12px var(--accent-glow), 0 4px 20px rgba(255, 27, 109, 0.15);
  transform: translateY(-2px);
}

.camera-capture-zone:active {
  transform: translateY(1px);
}

.camera-icon {
  color: var(--accent);
  margin-bottom: 6px;
  animation: pulse-glow 2.5s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Shrinks the inline 32x32 SVG (section_upload.html) without touching the
   template — part of the same height-trim as .camera-capture-zone above. */
.camera-icon svg { width: 26px; height: 26px; }

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(255, 27, 109, 0.2));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(255, 27, 109, 0.5));
  }
}

.camera-title {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: 1.5px;
  margin-bottom: 3px;
}

.camera-sub {
  font-size: 11px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.3;
}

.upload-zone {
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-md);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface-lo);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Compact upload zone styles */

/* .upload-zone-small's own display:flex !important above (needed for its
   compact Fleet-toast layout) otherwise beats a plain .hidden class on the
   same element — .hidden's display:none !important (1_variables.css) ties
   on specificity and loses on source order, since 1_variables.css loads
   before this file. #upload-zone/#pm-upload-zone are the two manual-upload
   zones that carry both classes together (permission-gated — see
   applyPermissionGating() in core/app.js and renderAccountMenuTrigger() in
   core/nav-actions.js) — an ID+class selector outranks a bare class
   regardless of load order, so this is what actually keeps them hidden
   until JS confirms the permission is granted. */
#pm-upload-zone.hidden {
  display: none !important;
}

/* ── Preview ─────────────────────────────────────────────────── */

/* ── Mask status bar ─────────────────────────────────────────── */

/* ── Multi-image thumbnail strip ────────────────────────────────── */

/* ── Video progress block ────────────────────────────────────── */

.progress-label {
  font-size: 12px;
  color: var(--text-hi);
  font-weight: 500;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff4d8f);
  width: 0%;
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.5px;
  text-align: center;
}

/* Brief highlight when jumped to from a Home quick action (?quick_action=upload)
   — same visual language as .db-advisor-highlight on the Dashboard page. */

/* --- css/components/6_dataset.css --- */
/* ================================================================
   6_dataset.css — Dataset browser and context override: LAYOUT ONLY
   ================================================================
   Markup uses design-system components (fx-panel-*, fx-tabs, fx-select,
   fx-thumb-grid, fx-pager, fx-combo); this file arranges them. */

/* ── Dataset browser ─────────────────────────────────────────── */
.ds-pane { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.ds-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-select { flex: 1; min-width: 96px; }

/* ── Context override ────────────────────────────────────────── */
.ctx-row { display: flex; align-items: center; gap: var(--space-2); }
.ctx-row .fx-hint { flex: 1; min-width: 0; }
/* --- css/components/7_modals.css --- */
/* ================================================================
   7_modals.css  —  Overlay base · Settings panel · History overlay
                    YOLO validation modal · Modal shared elements
   ================================================================ */

/* ── Overlay base ────────────────────────────────────────────── */
/* Every overlay/modal in this file animates in the same two-layer way:
   the backdrop fades (overlayFadeIn), the dialog fades+scales+rises
   (modalFadeIn, already used by .confirm-panel — every other dialog class
   below now shares it instead of popping in via the bare .hidden toggle).
   Pure CSS, no JS timing involved — an animation on an element replays
   automatically every time it goes from display:none to shown, so
   removing .hidden is all any caller ever has to do. */
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,9,14,.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn var(--dur-base) var(--ease-out-soft);
}
.overlay.hidden { display: none; }

/* ── Modal overlay (higher z-index than history) ──────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,9,14,.85);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-dialog) + var(--fx-layer, 0));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn var(--dur-base) var(--ease-out-soft);
}
.modal-overlay.hidden { display: none; }

.modal-content {
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalFadeIn var(--dur-slow) var(--ease-out-soft);
}

/* ── Shared modal header / body / footer ─────────────────────── */
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-hd .mono-label {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-hi);
}
.modal-bd {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-ft {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Width variants for .modal-content (admin dialogs, CA-159) ─── */
.modal-content.modal-md { width: 640px; }
.modal-content.modal-lg { width: 880px; }

/* ── Inline success/error feedback within a modal body ─────────
   Shared by any modal that shows a save result inline (My Profile,
   KB parameters, …) instead of each spot hardcoding its own colors —
   .kb-update-success/.kb-update-error are set directly as classNames
   by app.js's updateKbParameters(), so they're defined here too rather
   than requiring a second class on the element. */
.modal-status-banner,
.kb-update-success,
.kb-update-error {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.4;
}
.modal-status-banner.is-success,
.kb-update-success {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid var(--green);
  color: var(--green);
}
.modal-status-banner.is-error,
.kb-update-error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
}

/* ── Profile avatar (My Profile modal) ─────────────────────────── */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.profile-avatar-frame {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-placeholder {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* ── Settings panel ──────────────────────────────────────────── */
.settings-panel {
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  width: 460px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn var(--dur-slow) var(--ease-out-soft);
}

/* Settings section heading */
.settings-section-hd {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

/* ── My Profile · API Keys (CA-19) ──────────────────────────────
   New-key inline form, one-time raw-key reveal, and the list of a
   user's own keys — all within the My Profile modal, next to the
   button that opens each. ── */
.apikey-new-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.apikey-new-form > .text-input { width: 100%; }

.apikey-new-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.apikey-new-form-hint {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.apikey-scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.apikey-scope-chip input { cursor: pointer; }

.apikey-reveal {
  background: var(--surface-lo);
  border: 1px solid var(--amber);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.apikey-reveal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.apikey-reveal-row code {
  flex: 1;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-hi);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  overflow-x: auto;
  white-space: nowrap;
  user-select: all;
}

.apikey-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.apikey-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 11.5px;
}
.apikey-row.revoked { opacity: .55; }
.apikey-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.apikey-row-label { color: var(--text-hi); font-weight: 600; }
.apikey-row-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apikey-row-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 2px 14px;
}

/* ── History overlay ─────────────────────────────────────────── */

/* Fullscreen: panel fills the screen */

.history-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.history-loading.hidden { display: none; }

@keyframes hd-spin { to { transform: rotate(360deg); } }
.history-loading-msg {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--muted);
}
.history-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
  color: var(--muted);
}

.he-select { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent); }
.he-review-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.he-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.he-time {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  letter-spacing: .5px; padding-top: 2px;
}
.he-main { min-width: 0; }
.he-part {
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  letter-spacing: 1.5px; color: var(--text-hi); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.he-damages {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.he-vehicle {
  font-size: 10px; color: var(--accent); margin-top: 3px;
  font-family: var(--mono); letter-spacing: .5px;
}
.he-cost {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--accent); white-space: nowrap; padding-top: 2px;
}

.history-footer {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* PREV/Page N of M/NEXT — same sticky idiom as .history-footer above (top),
   just anchored to the bottom of the SAME bounded .history-scroll
   container instead. #history-pages specifically, not the shared
   .ds-pages class (also used by the dataset browser, which doesn't need
   this) — .history-panel has a real, fixed height (min(90vh,900px)) and
   .history-scroll is a proper flex:1/overflow-y:auto region, so unlike the
   page-level "html/body" scroll-root problem elsewhere in this app,
   position:sticky here has an unambiguous, bounded container to stick
   within — the exact case sticky positioning is meant for. */
#history-pages {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--surface);
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.history-detail-header {
  padding: 16px 28px;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border);
}

/* History entry thumbnail */
.he-thumb-wrap {
  position: relative;
  width: 52px;
  height: 40px;
  align-self: center;
}
.he-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: block;
}
.he-thumb-ph {
  width: 52px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--border-hi);
}
.he-thumb-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 8px;
  font-family: var(--mono);
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
}

/* History detail image viewer */
.hd-image-viewer {
  border-bottom: 1px solid var(--border);
  background: var(--surface-hi);
  padding: 16px 28px;
}

/* Damage-mask click-to-inspect overlay — only present when the history
   entry has clean (rawImages) originals to draw a live outline over; see
   history_detail.js/core/app.js's renderHistoryDetail. Sized/positioned by
   JS (_hdContentRect) to the photo's actual letterboxed content rect, not
   the wrap's full box. */

/* ── History image fullscreen viewer (modal_history_fullscreen.html) ──
   Deliberately its own small modal, not the big SAM-editing #fullscreen-
   modal — see that HTML file's own comment for why. */
.hd-fs-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-dialog) + var(--fx-layer, 0));  /* CA-193: same scale as every dialog; opening order decides */
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hd-fs-modal.hidden { display: none; }

.hd-fs-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.hd-fs-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s;
}
.hd-fs-close:hover { background: rgba(255, 255, 255, 0.2); }

.hd-fs-prev { left: 22px; }
.hd-fs-next { right: 22px; }
.hd-fs-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .5px;
}

/* ── YOLO Validation modal ────────────────────────────────────── */
.yolo-validation-panel {
  position: relative;
  width: 480px;
  max-width: 90vw;
  max-height: 70vh;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn var(--dur-slow) var(--ease-out-soft);
}

.yolo-validation-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.yolo-val-section {
  margin-bottom: 20px;
}

.yolo-val-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-hi);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.yolo-val-item {
  font-size: 12px;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: var(--surface-lo);
  border-left: 3px solid var(--blue);
  border-radius: 2px;
}

.yolo-val-item.confirmed  { border-left-color: var(--green); }

.yolo-val-item.conflict   { border-left-color: var(--amber); }
.yolo-val-item.missed     { border-left-color: var(--muted); }

.yolo-val-item-label {
  font-weight: 500;
  color: var(--text);
}

.yolo-val-item-reason {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Fullscreen Preview Modal ─────────────────────────────────── */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 300;
  display: flex;
  flex-direction: column;
  animation: overlayFadeIn var(--dur-base) var(--ease-out-soft);
}
.fullscreen-modal.hidden {
  display: none;
}

.fullscreen-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 310;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.fullscreen-close:hover {
  background: rgba(0,0,0,0.9);
}

/* Redesigned as a compact column: one row of visually-grouped tool
   clusters (nav / zoom / AI tools), with the live status line — previously
   crammed inline against the last button — on its own row underneath so it
   never fights buttons for space or gets clipped. */

/* Each cluster (nav, zoom, AI tools) reads as one pill instead of loose
   buttons floating in the same row as everything else. */

/* Lighter-weight separator between AI-tool sub-groups (segment / rect /
   auto-search) — a full divider between every button there read as too
   heavy for how closely related they are. */

.fs-control-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.fs-control-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Zoom's four buttons are icon-only (−, +, ⟲) or a bare number — square,
   evenly-sized, instead of stretching to fit text like the label buttons. */

.fs-image-index,
.fs-zoom-level {
  color: rgba(255,255,255,0.92);
  font-family: var(--mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.02em;
}

.fs-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fs-canvas-wrapper {
  position: relative;
  display: inline-block;
  max-width: fit-content;
}

#fs-canvas {
  display: block;
  max-width: none;
  max-height: none;
  cursor: grab;
}

/* ── Custom Confirmation Modal ───────────────────────────────── */
.confirm-panel {
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 16px;
  animation: modalFadeIn var(--dur-base) var(--ease-out-soft);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.confirm-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.confirm-icon {
  color: var(--accent);
  font-size: 20px;
}

.confirm-hd .mono-label {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-hi);
}

.confirm-bd {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 4px 0;
}

.confirm-ft {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ── Mobile: Modals take up the entire screen, edge-to-edge (footer is
   hidden when modal open — see 29_footer_feedback.css's body:has() rule) ── */
@media (max-width: 1024px) {
  .modal-overlay {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
  }
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
  }
  .modal-bd,
  .modal-body {
    min-height: 0;
    overflow-y: auto !important;
  }
  /* #doc-reader-overlay (Terms/Privacy/Data Usage/Documentation),
     #consent-enforcement-overlay (mandatory legal-policy acceptance gate),
     and #changelog-overlay (what's new / release history) all share
     .modal-overlay (so they already get the align-items/justify-content
     stretch above) but their dialog is a .settings-panel, not
     .modal-content — that class never got the edge-to-edge sizing, so it
     kept its own inline width:min(…,96vw)/max-height:88-90vh caps, leaving
     a visible gap on the right and below instead of filling the screen
     like every other mobile modal. !important is required here to beat
     that inline style. */
  #doc-reader-overlay .settings-panel,
  #consent-enforcement-overlay .settings-panel,
  #changelog-overlay .settings-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
  }
  /* .modal-overlay's align-items/justify-content:stretch above is meant for
     the big edge-to-edge .modal-content dialogs — #custom-confirm-overlay/
     #custom-alert-overlay share the same .modal-overlay class but wrap a
     small, content-sized .confirm-panel with no explicit size of its own,
     so the SAME stretch rules pulled it to fill the viewport: vertically
     (align-items) it stretched to full height with content pinned at the
     top; horizontally, "justify-content: stretch" isn't actually a valid
     flexbox value (it's a Grid one), so browsers fell back to flex-start —
     packing the panel against the LEFT edge instead of centering it. Fixing
     just align-self on .confirm-panel only ever addressed the vertical
     half of this. Override both axes on the two overlays themselves
     instead — same centered layout as desktop, just with breathing room
     instead of edge-to-edge. */
  #custom-confirm-overlay,
  #custom-alert-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
  /* Same fix, generalised: any overlay wrapping a .modal-compact dialog
     (see its own comment in 24_responsive.css) needs the same re-centering,
     not just the two built-in confirm/alert helpers. */
  .modal-overlay:has(.modal-compact) {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
}

/* ── Phones (CA-102): History detail photo viewer — touch controls always
   visible (no hover on touch), 44px targets, swipe handled in
   history_detail.js, signature canvases roomy enough to sign. ─────────── */
@media (max-width: 768px) {
  
  
  
  
  
  
  .history-detail-header { flex-wrap: wrap; gap: 8px; }
  canvas[id$="-signature-canvas"] { min-height: 140px; }
}

/* ── Desktop open/close motion for every overlay ─────────────────
   Open: backdrop fades (overlayFadeIn above) and the dialog rises + scales
   in. :where() keeps the default at zero specificity, so dialogs with their
   own animation keep it.
   Close: js/core/nav-init.js adds .mm-closing the moment .hidden lands and
   removes it ~180ms later, so .hidden + .mm-closing stays visible just long
   enough to play the exit. Phones keep the bottom-sheet motion from
   40_mobile_sheets.css; reduced-motion users get none. */
@keyframes mmPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes mmOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes mmPanelOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px) scale(.97); }
}
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  :where(.overlay, .modal-overlay) > :where(*),
  :where(.modal-overlay) > :where(.modal-wrapper) > :where(*) {
    animation: mmPanelIn .22s cubic-bezier(.2, .8, .2, 1);
  }
  :is(.overlay, .modal-overlay).hidden.mm-closing {
    display: flex !important;
    pointer-events: none;
    animation: mmOverlayOut .18s ease-in forwards;
  }
  :is(.overlay,
.modal-overlay).mm-closing > * {
    animation: mmPanelOut .18s ease-in forwards !important;
  }
}
/* --- css/components/8_chips_badges.css --- */
/* ================================================================
   8_chips_badges.css  —  Verdict · Urgency · Safety chips
                          Severity badges · Confidence · Sys-tags
   ================================================================
   CA-84 rewrite — every colour below used to be a hardcoded hex (often a
   SECOND, slightly different hex for what was meant to be the same
   semantic colour as elsewhere in the app, e.g. #22c55e here vs the actual
   --green token) with an ad-hoc, inconsistent alpha suffix per rule. Now a
   single formula, driven entirely by the theme tokens (1_variables.css) so
   every chip actually follows light/dark mode instead of a color frozen at
   whatever it happened to be typed as:
     color:      var(--x)
     border:     color-mix(in srgb, var(--x) 45%, transparent)
     background: color-mix(in srgb, var(--x) 14%, transparent)
   Every chip/badge also gets a leading status dot (●) in the same colour —
   a small, deliberate detail (common in status-driven dashboard UI) that
   reads as "designed" rather than just coloured text in a box. */

/* ── Verdict / Urgency / Safety chips ───────────────────────── */

/* Condition */

/* Urgency */

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.55; } }

/* Safety */

/* ── Severity badges ─────────────────────────────────────────── */
.sev {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1.3px;
  padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid; text-transform: uppercase;
}
.sev::before { content: '●'; font-size: 7px; line-height: 1; }
.sev-minor    { color: var(--green);  border-color: color-mix(in srgb, var(--green) 45%, transparent);  background: color-mix(in srgb, var(--green) 12%, transparent); }
.sev-moderate { color: var(--amber);  border-color: color-mix(in srgb, var(--amber) 45%, transparent);  background: color-mix(in srgb, var(--amber) 12%, transparent); }
.sev-severe   { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 45%, transparent); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.sev-critical { color: var(--red);    border-color: color-mix(in srgb, var(--red) 45%, transparent);    background: color-mix(in srgb, var(--red) 12%, transparent); }

/* ── Confidence ──────────────────────────────────────────────── */
.conf {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 6px; border-radius: var(--r-sm); text-transform: uppercase;
}

/* ── Graduated percentage pill (e.g. damage extent_percent) — colour scales
   with the value itself rather than a fixed enum, low = good (green) through
   high = bad (red), same palette as the chips above. ── */
.pct {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 6px; border-radius: var(--r-sm); border: 1px solid;
}
.pct-good { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pct-warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.pct-bad  { color: var(--red);   border-color: color-mix(in srgb, var(--red) 45%, transparent);   background: color-mix(in srgb, var(--red) 14%, transparent); }

/* ── System tags ─────────────────────────────────────────────── */

/* ── Per-damage repair/replace badge ─────────────────────────── */

/* ── Primary / Unlisted / Relate tags ───────────────────────── */

/* ── Summary hero pills ──────────────────────────────────────── */

/* CA-84 follow-up: "bind the damage photos tooltips the same" — the hero's
   damage pills get the same hover-preview mask thumbnail as the Damages/
   Parts/Decision tabs' own hover targets; a brighter border on hover is the
   only visual cue needed since these were already an obviously-inspectable
   list of chips. */

/* ── Prose values (Decision tab) ─────────────────────────────────
   Structural integrity / repair techniques arrive as full sentences now;
   render them as readable text, not as uppercase chips. */

/* ── Approach tag ────────────────────────────────────────────── */

/* ── Source tag ──────────────────────────────────────────────── */

/* ── Tech mini-tag ───────────────────────────────────────────── */

/* --- css/components/10_damage_cards.css --- */
/* ================================================================
   10_damage_cards.css  —  Damage cards · Part cards · Repairability
                           Cost section · Quality · Observations
   ================================================================ */

/* ── Damage table (CA-84) ──────────────────────────────────────────
   Replaces the old one-card-per-damage list: one row per damage with
   quantitative/qualitative columns at a glance, click a row (or its
   chevron) to smoothly expand a detail row underneath — same shared
   .dmg-row / .dmg-row-detail / .dmg-row-arrow shape reused by the Parts
   list below for a consistent row/expand feel across both tabs. */

/* ...except the Damages table's own 3rd column (Parts cross-links), which
   holds wrapped free-text links rather than a badge and reads better
   left-aligned like the Damage column next to it. */

/* Damages table: arrow, damage, parts, severity, extent, area, progression,
   complexity, verdict — 9 columns. Widths come only from this header row
   (table-layout:fixed) so a row expanding never reflows the columns. */

   /* fits "• MODERATE" / "• CRITICAL" */

/* Parts table (CA-84 follow-up: "the parts should also be a table like the
   damages... exactly the same style"): arrow + Part + Confidence — the
   latter is always present so it earns its own column; primary/verdict/
   listing/damage are conditional — most parts leave most of them blank,
   which read as mostly-empty columns — so they're badges inside the Part
   cell instead (see .part-row-badges below). */

/* Per-image breakdown table (Quality & Notes — CA-84 follow-up: "so much
   scroll... group things, organize them"): arrow + Image + Quality +
   Lighting, notes tucked behind the expand arrow instead of every image
   always showing a full card. */

/* Badge-bearing cells never overflow into a neighbouring column — they clip
   with an ellipsis instead, so two adjacent badges can never visually
   overlap regardless of locale/content length. */

/* The hover-preview tooltip triggers only over the damage name itself, not
   the whole row (the row's own click still toggles the detail expand) — an
   underline-on-hover signals specifically where that lives. */

/* Parts/Damage cross-link column — a wrapped row of small link buttons
   (dmg-part-link in Damages' Parts column, dmg-row-link in Parts' Damage
   column), left-aligned like the name column rather than centered like the
   badge columns. */

/* Parts table row: confidence/primary/verdict/listing/damage-links all live
   here as badges instead of their own columns (CA-84 follow-up — a column
   each was mostly empty space, since most parts carry only 1-2 of these).
   Badges sit on the SAME line as the name (not stacked below it) so every
   row is a consistent height whether or not a given part has any badges. */

/* Row highlight when jumped to from another tab (CA-84 follow-up:
   "make parts and damages clickable and redirect to their highlight item
   row, when referenced in another tab"). */
@keyframes dmgRowFlash {
  0%   { background: var(--accent-glow); }
  100% { background: transparent; }
}

/* Damage hover-preview tooltip (CA-84 follow-up) — one shared floating
   element per page, positioned next to the cursor; see _wireDamageHoverPreview
   in app.js/history_detail.js. */

/* Detail row — always in the DOM; collapses via max-height so the toggle
   animates smoothly instead of snapping open/closed. */

/* Conflict warning — a "repair" verdict damage that shares a part with a
   "replace" verdict one; the part is replaced as a whole regardless. */

/* ── Identified Parts — vertical group tabs (CA-84) ────────────────
   Groups car_parts by the same anatomical sections the KB's own "3D/2D
   Models" tab uses (see PART_GROUPS in core/app.js/history_detail.js) —
   a sidebar of sections next to the selected section's part cards, instead
   of one flat list that can run to 80+ cards on a full analysis. */

.parts-vtab-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  width: 190px;
}

.parts-vtab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.parts-vtab:hover { color: var(--text-hi); border-color: var(--border-hi); }
.parts-vtab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.parts-vtab-label { display: flex; align-items: center; gap: 5px; min-width: 0; }

/* Shared inline SVG icon sizing — see _WARN_ICON in
   core/app.js/history_detail.js. Inherits colour from whichever badge/label
   wraps it rather than the icon carrying its own. */

/* Below this, the sidebar competes too much with the content for width —
   collapse into a horizontal, scrollable strip of section pills above the
   part cards instead, same trade .rp-tabs/.admin-tabs already make at
   their own narrow breakpoints. */
@media (max-width: 720px) {
  
  .parts-vtab-list {
    flex-direction: row;
    width: auto;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .parts-vtab { flex-shrink: 0; }
}

/* ── Part identification cards ──────────────────────────────────── */

/* Confidence-coded left border */

/* Justification collapse */

/* ── Part expand ─────────────────────────────────────────────── */

/* ── Decision tab (CA-84 follow-up: "the decision tab is still very very
   disorganized ... organize better, it's so confusing") ─────────────────
   One bordered DECISION card — verdict + urgency, the reasoning right under
   it, the three vehicle-status readings, the recommended techniques — then
   two labelled tables: PART DECISIONS and RISKS & OPEN POINTS. Markup:
   renderRepairability in core/app.js and components/history_detail.js. */

/* The three status readings reuse the Quality tab's qi-item cells; the card
   supplies the frame, so the strip itself is borderless and just re-pads the
   cells to line up with the card's 22px inner gutter. */

/* Neutral chips — the accent-pink .approach-tag reads as an alert, and these
   are just the names of methods. */

/* PART DECISIONS / RISKS & OPEN POINTS — same bordered-rows-with-a-header
   look as the damages/parts tables, built on a grid (not a <table>) so the
   columns collapse cleanly on a narrow screen. */

/* Divides the Repair Plan tab into clearly labeled sections (CA-84 follow-
   up: "restyle the whole repair plan... and the structure as well") instead
   of every piece — breakdown, techniques, status, notes — just stacking
   with no heading to tell them apart. */

.verdict-icon { font-size: 22px; }
/* Repairability compact rows */

/* ── Cost section ───────────────────────────────────────────────── */

/* Cost summary card */

/* Exclusions note */

/* ── Quality indicators ──────────────────────────────────────── */

/* Quality indicator row (qi-) */

/* Grid used by the inferred-vehicle make/model/year card (CA-84: the
   per-image quality breakdown that used to share this name/grid — .iv-card
   and friends — is a compact table now, see .iv-table above). */

/* ── Observations ────────────────────────────────────────────── */

/* Observations table (CA-84 follow-up: "so much scroll... verbose... group
   things, organize them") — one compact row per observation instead of a
   full card each; no arrow/expand column since the text is the point and
   just wraps in place. Custom column widths throughout (not the shared
   .dmg-table arrow+auto convention — this table has no arrow column, so
   column 1 is the auto one instead of column 2). */

/* ── Detail note (special considerations) ────────────────────── */

/* ── No-data messages ───────────────────────────────────────────── */
.no-data-msg {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 10px 0;
  letter-spacing: 0.5px;
}

.no-data-msg.ok { color: var(--green); }

/* ── Report header (legacy helper) ──────────────────────────── */

/* ── Assessment section header (r-section) ─────────────────── */

/* .r-sec-body collapse is animated by UiCollapse (core/ui_collapse.js) */

/* ── Damage list (legacy) ────────────────────────────────────── */

/* --- css/components/12_3d_map.css --- */
/* ================================================================
   12_3d_map.css  -  layout of the 3D damage viewer (modal, wizard step 2,
   fleet / history / knowledge panels) and its immersive full-screen mode.

   CA-160: LAYOUT ONLY. Colour, border, radius, font and shadow come from the
   design system (css/ds/components-3d.css: fx-viewer*, fx-key*, fx-item*,
   fx-sev, fx-pick, fx-imgbox ...). The d3-* / a3d-* classes are structural
   hooks the viewer scripts (js/components/damage3d/) rely on.

   Cascade note: the design-system files load AFTER this one, so a rule here
   that sets a property an fx-* class also sets uses two-class selectors
   (".d3-panel .d3-x") to win the tie.
   ================================================================ */

/* ── Hosts ─────────────────────────────────────────────────────── */
#analyst-3d-wrap { position: relative; }
#analyst-3d-wrap #a3d-placeholder {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease;
}
#analyst-3d-panel { transition: opacity .5s ease; }

/* ── Panel ─────────────────────────────────────────────────────── */
#damage3d-overlay { z-index: calc(var(--z-dialog) + 10); }   /* opened from dialogs (History, reports): sits above them */
/* Phase 1 (live assessment) shows the 3D model only; the photo column belongs to the confirmation step */
#analyst-3d-wrap.automated-mode .d3-img-viewer, #analyst-3d-wrap.automated-mode .d3-photos-btn { display: none; }
.d3-panel {
  --d3-side-w: 300px;
  position: relative;
  width: 96vw;
  max-width: 1600px;
  height: 90vh;
  max-height: 940px;
}
.d3-panel:fullscreen,
.d3-panel:-webkit-full-screen,
:fullscreen .d3-panel,
:-webkit-full-screen .d3-panel {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
}

/* ── Header ────────────────────────────────────────────────────── */
.d3-panel .d3-header { flex: 0 0 auto; }
.d3-panel .d3-header-left { flex: 1 1 200px; min-width: 0; }
.d3-panel .d3-header-title { white-space: nowrap; }
.d3-panel .d3-header-controls { flex: 0 1 auto; justify-content: flex-end; }
.d3-panel .d3-edit-banner { white-space: normal; }
.d3-panel .d3-nav-btn { flex: none; }
.d3-panel .d3-nav-label { min-width: 112px; }
.d3-panel .d3-proj-switch { flex: none; }

/* Phone view switch (Photo / Model / Damages): only offered while reviewing damages on a phone */
.d3-panel .d3-view-switch { display: none; flex: 0 0 auto; }
.d3-panel .d3-view-switch .fx-tab { flex: 1 1 0; justify-content: center; min-width: 0; height: var(--touch-h); }

/* ── Body: photo panel | canvas | side panel ───────────────────── */
.d3-panel .d3-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.d3-panel .d3-img-viewer { flex: 0 0 clamp(300px, 35%, 540px); }
.d3-panel .d3-canvas-wrap { position: relative; flex: 1 1 0; width: auto; min-width: 0; height: auto; min-height: 0; overflow: hidden; }
/* the canvas fills its stage by absolute positioning, so its size never depends on a percentage-height chain */
.d3-panel .d3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; cursor: grab; }
.d3-panel .d3-canvas:active { cursor: grabbing; }
.d3-panel .d3-sidebar { flex: 0 0 var(--d3-side-w); width: var(--d3-side-w); }
.d3-panel .d3-sidebar:not(:has(> :not(.hidden))) { display: none; }

/* Floating controls over the canvas */
.d3-panel .d3-overall-view-btn { top: var(--space-4); left: var(--space-4); }
/* CA-441: draw a damage on the 2D map (edit mode) - button bottom-left, hint top-centre, stroke over the canvas */
.d3-panel .d3-draw-btn { bottom: var(--space-4); left: var(--space-4); }
.d3-panel .d3-draw-hint { top: var(--space-4); left: 50%; transform: translateX(-50%); max-width: calc(100% - 2 * var(--space-4)); pointer-events: none; }
.d3-panel .d3-drawing .d3-canvas { touch-action: none; cursor: crosshair; }
.d3-panel .a3d-mobile-projection-toggle { display: none; top: var(--space-2); right: var(--space-2); }

/* 2D grid frames are positioned by the script (percent of the canvas) */
.d3-panel .d3-viewport-border { z-index: 1; }

/* Part tooltip follows the pointer */
.d3-panel .d3-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: none;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%) translateY(-8px);
  transition: opacity .1s ease, transform .1s ease;
}

/* Model-load veil covers the canvas until the vehicle is in the scene */
.d3-panel .d3-loading-veil {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6);
}
.d3-panel .d3-veil-card { width: min(320px, 100%); padding: 0; }
.d3-panel .d3-veil-card .fx-progress { width: 100%; }

/* Explode / isolate toolbar (script-built, top-left of the canvas) */
.d3-panel .d3-explode-bar { top: var(--space-3); left: var(--space-3); }
.d3-panel .d3-explode-btn { flex: none; }

/* ── Side panel ────────────────────────────────────────────────── */
.d3-panel .d3-legend-wrap { flex: 0 0 auto; }
.d3-panel .d3-legend-title { cursor: default; }
.d3-panel .d3-legend-chevron { display: none; }
.d3-panel .d3-all-damages { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.d3-panel .d3-detail { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.d3-panel .d3-hint { flex: 0 0 auto; margin-top: auto; }
.d3-panel .a3d-mobile-add-prompt { display: none; }
.d3-panel .d3-ad-hd { margin-bottom: var(--space-2); }
.d3-panel .d3-ad-row { gap: var(--space-2); }
.d3-panel .d3-ad-info { min-width: 0; }

/* Edit mode (CA-381): the damages list is the editor. A wider side panel, the legend folded away by default, one
   compact row per damage, and the open one expands in place into its card (essentials, then "More details"). */
.d3-panel.d3-editing { --d3-side-w: 380px; }
.d3-panel.d3-editing .d3-legend-title { cursor: pointer; }
.d3-panel.d3-editing .d3-legend-chevron { display: inline-grid; transition: transform .15s; }
.d3-panel.d3-editing .d3-legend-wrap.collapsed .d3-legend-chevron { transform: rotate(-90deg); }
.d3-panel.d3-editing .d3-legend-wrap.collapsed .d3-legend { display: none; }
.d3-panel.d3-editing .d3-legend-wrap.collapsed .d3-legend-title { margin-bottom: 0; }
.d3-panel .d3-ad-list { display: grid; gap: var(--space-2); }
ul.d3-ad-list { margin: 0; padding: 0; list-style: none; }
.d3-panel .d3-ad-item { gap: 0; padding: 0; }
.d3-panel .d3-ad-item > .d3-ad-row { padding: var(--space-3); cursor: pointer; }
.d3-panel .d3-ad-item > .d3-ad-row .fx-list-text { flex: 1; }
.d3-panel .d3-ad-body { gap: var(--space-3); padding: var(--space-3); }
.d3-panel .d3-ad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.d3-panel .d3-ad-grid > * { min-width: 0; }
.d3-panel .d3-ad-span { grid-column: 1 / -1; }
.d3-panel .d3-ad-thumbs { gap: var(--space-2); }
.d3-panel .d3-ad-thumb { --thumb-w: 64px; --thumb-h: 44px; overflow: hidden; }
.d3-panel .d3-ad-thumb .fx-thumb-badge { position: absolute; left: 2px; bottom: 2px; }
.d3-panel .d3-ad-notice { margin: 0; }
.d3-panel .d3-ad-more > .fx-disclosure-bd { padding-top: var(--space-2); }
/* the open card is the whole story: the explanatory hints step aside so it gets the room */
.d3-panel .d3-sidebar:has(.d3-ad-item.is-open) .d3-hint { display: none; }
.d3-panel .d3-ad-top,
.d3-panel .d3-ad-prev,
.d3-panel .d3-ad-next { display: none; }
.d3-panel .d3-ad-top-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d3-panel .d3-ad-foot { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-3); }
.d3-panel .d3-ad-foot-tools,
.d3-panel .d3-ad-foot-main { display: flex; align-items: center; gap: var(--space-2); }

.d3-panel .d3-detail-hd { align-items: flex-start; margin-bottom: var(--space-3); }
.d3-panel .d3-detail-title { display: grid; gap: var(--space-1); min-width: 0; justify-items: start; }
.d3-panel .d3-dmg-list,
.d3-panel .d3-edit-list { display: grid; gap: var(--space-2); }
.d3-panel .d3-edit-list { margin-bottom: var(--space-3); }
.d3-panel .d3-edit-row-main { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.d3-panel .d3-edit-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d3-panel .d3-edit-row-btns { gap: 0; }
.d3-panel .d3-dmg-card details > summary { cursor: pointer; }

/* Form pieces shared by the editor card */
.d3-panel .d3-f-checks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.d3-panel .d3-flip-btns { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.d3-panel .d3-flip-btns .fx-btn { flex: 1 1 auto; min-width: 0; }
.d3-panel .d3-add-btn { margin-top: var(--space-1); }

/* Review footer */
.d3-footer { flex: 0 0 auto; }
.d3-footer .d3-footer-btns { display: flex; align-items: center; gap: var(--space-2); flex: none; }

/* ── Photo panel (js/components/damage3d/imgViewer.js) ─────────── */
.d3-img-viewer .d3-iv-hd { flex: 0 0 auto; }
.d3-img-viewer .d3-iv-main { flex: 1 1 0; }
.d3-img-viewer .d3-iv-img { cursor: zoom-in; }
.d3-img-viewer .d3-iv-nav { top: 50%; transform: translateY(-50%); }
.d3-img-viewer .d3-iv-prev { left: var(--space-2); }
.d3-img-viewer .d3-iv-next { right: var(--space-2); }
.d3-img-viewer .d3-iv-expand { right: var(--space-2); bottom: var(--space-2); }
.d3-img-viewer .d3-iv-sam-overlay { position: absolute; left: 0; top: 0; pointer-events: auto; }
/* Live-drag preview of the rectangle tool: a paint target only; the drag itself is captured on .d3-iv-sam-overlay */
.d3-img-viewer .d3-iv-rect-overlay { position: absolute; left: 0; top: 0; pointer-events: none; }
.d3-img-viewer .d3-iv-main.sam-mode-active,
.d3-img-viewer .d3-iv-main.sam-mode-active canvas { cursor: crosshair; }
.d3-img-viewer .d3-iv-strip { flex: 0 0 auto; }
.d3-img-viewer .d3-iv-toolbar { flex-wrap: wrap; }
.d3-img-viewer .d3-iv-toolbar .fx-seg { flex-wrap: wrap; max-width: 100%; }
.d3-img-viewer .d3-iv-sam-btn { flex: 0 0 auto; white-space: nowrap; }
.d3-img-viewer .d3-iv-sam-bar { flex: 0 0 auto; }
.d3-img-viewer .d3-iv-sam-bar .fx-select-wrap { flex: 0 1 200px; min-width: 120px; }
.d3-img-viewer .d3-iv-sam-bar-info { display: grid; flex: 1 1 auto; min-width: 0; }
.d3-img-viewer .d3-iv-sam-bar-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d3-img-viewer .d3-iv-sam-discard { margin-left: auto; }
.d3-img-viewer .d3-iv-bar-actions { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.d3-img-viewer .d3-iv-bar-actions .fx-select-wrap { flex: 0 1 160px; min-width: 120px; }
.d3-photo-chips { margin-top: var(--space-1); }
.d3-img-viewer .d3-iv-part-input { flex: 1 1 140px; min-width: 0; }
.d3-img-viewer .d3-iv-part-confirm { flex: none; }
/* Edit hint floats over the top of the photo, never in the column flow (CA-375) */
.d3-img-viewer .d3-iv-sam-hint { position: absolute; top: var(--space-2); left: 50%; z-index: 9; max-width: calc(100% - 2 * var(--space-6)); transform: translateX(-50%); text-align: center; pointer-events: none; }
.d3-img-viewer .d3-iv-sam-hint.hidden { display: none; }
/* Fixed-height dock for the photo bars: a bar appearing or leaving never resizes the photo (CA-375) */
.d3-img-viewer .d3-iv-dock { display: flex; flex-direction: column; flex: 0 0 auto; height: calc(38px + var(--space-4) + 1px); }
.d3-img-viewer .d3-iv-dock > .d3-iv-sam-bar { flex: 1 1 auto; flex-wrap: nowrap; min-height: 0; overflow: hidden; }
.d3-img-viewer .d3-iv-dock .d3-iv-bar-actions { flex-wrap: nowrap; }
.d3-img-viewer .d3-iv-dock .fx-select-wrap { min-width: 72px; }
.d3-img-viewer .d3-iv-dock .d3-iv-sam-bar-type,
.d3-img-viewer .d3-iv-dock .d3-iv-sam-bar-label,
.d3-img-viewer .d3-iv-dock .fx-viewer-media-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d3-img-viewer .d3-iv-dock .d3-iv-sam-bar-label { flex: 0 1 auto; min-width: 0; }

/* Full-screen photo */
.d3-iv-fullscreen-overlay .d3-iv-fs-stage { width: 92vw; height: 88vh; }
.d3-iv-fullscreen-overlay .d3-iv-fs-mask-overlay { position: absolute; cursor: zoom-in; }
.d3-iv-fullscreen-overlay .d3-iv-fs-mask-tip {
  position: absolute;
  z-index: 3;
  max-width: none;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}
.d3-iv-fullscreen-overlay .d3-iv-fs-tip-desc { display: block; max-width: 260px; margin-top: 2px; white-space: normal; }
.d3-iv-fullscreen-overlay .d3-iv-fs-close { top: var(--space-4); right: var(--space-4); }
.d3-iv-fullscreen-overlay .d3-iv-fs-nav { top: 50%; transform: translateY(-50%); }
.d3-iv-fullscreen-overlay .d3-iv-fs-prev { left: var(--space-5); }
.d3-iv-fullscreen-overlay .d3-iv-fs-next { right: var(--space-5); }
.d3-iv-fullscreen-overlay .d3-iv-fs-count { bottom: var(--space-5); left: 50%; transform: translateX(-50%); }

/* ── Phones: one column; during damage confirmation one section at a time ── */
@media (max-width: 768px) {
  .d3-panel { width: 100vw; max-width: none; height: 100dvh; max-height: none; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .d3-panel .d3-header { padding-top: calc(var(--space-2) + env(safe-area-inset-top, 0px)); }
  .d3-panel .d3-header-left { flex-basis: 100%; }
  .d3-panel .d3-header-sub,
  .d3-panel .d3-edit-banner,
  .d3-panel .d3-hint { display: none; }
  .d3-panel .d3-nav,
  .d3-panel .d3-photos-btn,
  .d3-panel #d3-fullscreen-btn { display: none; }
  .d3-panel .d3-header-controls { flex: 1 1 100%; justify-content: space-between; }

  /* stacked, scrolling column (read-only history / fleet views) */
  .d3-panel .d3-body { flex-direction: column; overflow-x: hidden; overflow-y: auto; }
  .d3-panel .d3-img-viewer { flex: 0 0 auto; max-height: 55vh; }
  .d3-panel .d3-iv-main { flex: 0 0 auto; min-height: 160px; touch-action: pan-y; }
  .d3-panel .d3-iv-img { height: auto; }
  .d3-panel .d3-canvas-wrap { flex: 0 0 46dvh; width: 100%; min-height: 280px; touch-action: none; }
  .d3-panel .d3-canvas { touch-action: none; }
  .d3-panel .d3-sidebar { flex: 1 1 auto; width: 100%; overflow: visible; }
  .d3-panel .d3-detail,
  .d3-panel .d3-all-damages { flex: none; overflow: visible; }

  /* legend: collapsible from its title */
  .d3-panel .d3-legend-title { min-height: var(--touch-h); margin: 0; cursor: pointer; }
  .d3-panel .d3-legend-chevron { display: inline-grid; transition: transform .15s; }
  .d3-panel .d3-legend-wrap.collapsed .d3-legend-chevron { transform: rotate(-90deg); }
  .d3-panel .d3-legend-wrap.collapsed .d3-legend { display: none; }
  .d3-panel .d3-leg-row { min-height: 32px; }
  .d3-panel .d3-f-checks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .d3-panel .d3-f-check { min-height: var(--touch-h); }
  .d3-panel .d3-flip-btns .fx-btn,
  .d3-panel .d3-ad-foot .fx-btn { min-height: var(--touch-h); }
  .d3-panel .d3-ad-grid { grid-template-columns: minmax(0, 1fr); }
  .d3-panel .d3-ad-item > .d3-ad-row { min-height: var(--touch-h); }

  /* footer: the one confirm action is a full-width bar */
  .d3-footer { flex-direction: column; align-items: stretch; padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); }
  .d3-footer .d3-footer-note { display: none; }
  .d3-footer .d3-footer-btns { width: 100%; }
  .d3-footer .d3-footer-btns .fx-btn { flex: 0 0 auto; min-height: var(--touch-h-lg); height: auto; }
  /* CA-381: the long "Confirm and build repair plan" label wraps inside its button instead of running off the screen. */
  .d3-footer .d3-footer-btns .fx-btn--primary { flex: 1 1 0; min-width: 0; white-space: normal; }

  /* photo panel touch targets */
  .d3-img-viewer .d3-iv-toolbar { gap: var(--space-2); }
  .d3-img-viewer .d3-iv-sam-btn { min-height: var(--touch-h); }
  .d3-img-viewer .d3-iv-dock { height: calc(var(--touch-h) + var(--space-4) + 1px); }
  .d3-img-viewer .d3-iv-dock .d3-iv-sam-bar-label { display: none; }
  .d3-img-viewer .d3-iv-dock .d3-iv-bar-actions .fx-select-wrap { flex: 0 1 128px; }
  .d3-img-viewer .d3-iv-main.sam-mode-active .d3-iv-sam-overlay { touch-action: none; }
  .d3-iv-fullscreen-overlay .d3-iv-fs-stage { width: 100vw; height: 100dvh; }
  .d3-iv-fullscreen-overlay .d3-iv-fs-close { top: calc(var(--space-2) + env(safe-area-inset-top, 0px)); }

  .d3-panel .d3-explode-btn { min-height: var(--touch-h); }
  .d3-panel .d3-explode-btn span { display: none; }

  /* ── Damage confirmation: Photo / Model / Damages, one section at a time ──
     The wizard (#analyst-3d-wrap) keeps its state as .mobile-review-* classes (core/app.js); the modal keeps it as
     data-d3-view on the panel (damage3d/views.js). Both end up in the same rules. */
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-view-switch,
  #damage3d-overlay.damage-confirmation-mode .d3-view-switch { display: flex; }

  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-header { display: none; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-legend-wrap,
  #damage3d-overlay.damage-confirmation-mode .d3-legend-wrap { display: none; }

  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-body,
  #damage3d-overlay.damage-confirmation-mode .d3-body { position: relative; display: block; overflow: hidden; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-img-viewer,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-canvas-wrap,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-sidebar,
  #damage3d-overlay.damage-confirmation-mode .d3-img-viewer,
  #damage3d-overlay.damage-confirmation-mode .d3-canvas-wrap,
  #damage3d-overlay.damage-confirmation-mode .d3-sidebar {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  #analyst-3d-wrap.mobile-review-photo .d3-img-viewer:not(.hidden),
  #damage3d-overlay.damage-confirmation-mode .d3-panel[data-d3-view="photo"] .d3-img-viewer:not(.hidden) { display: flex; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode).mobile-review-model .d3-canvas-wrap,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode):not(.mobile-review-photo):not(.mobile-review-editor) .d3-canvas-wrap,
  #damage3d-overlay.damage-confirmation-mode .d3-panel[data-d3-view="model"] .d3-canvas-wrap { display: block; }
  #analyst-3d-wrap.mobile-review-editor .d3-sidebar,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode).mobile-review-editor .d3-sidebar,
  #damage3d-overlay.damage-confirmation-mode .d3-panel[data-d3-view="editor"] .d3-sidebar { display: flex; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode).mobile-review-model .a3d-mobile-projection-toggle,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode):not(.mobile-review-photo):not(.mobile-review-editor) .a3d-mobile-projection-toggle { display: inline-flex; }

  /* the damage list, or the detail of the part picked in 3D, never both */
  #analyst-3d-wrap .d3-sidebar:has(.d3-detail:not(.hidden)) .d3-all-damages,
  #damage3d-overlay .d3-sidebar:has(.d3-detail:not(.hidden)) .d3-all-damages { display: none; }
  #analyst-3d-wrap.review-confirmation-mode .d3-sidebar:has(> .d3-detail.hidden) .a3d-mobile-add-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: var(--space-2) var(--space-3);
  }
  #analyst-3d-wrap.review-confirmation-mode .d3-sidebar .a3d-mobile-add-prompt .fx-btn { flex: none; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-detail,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-all-damages,
  #damage3d-overlay.damage-confirmation-mode .d3-detail,
  #damage3d-overlay.damage-confirmation-mode .d3-all-damages { flex: none; overflow: visible; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-add-btn,
  #damage3d-overlay.damage-confirmation-mode .d3-add-btn { position: sticky; bottom: 0; z-index: 3; min-height: var(--touch-h); }

  /* The open damage fills the Damages view: top bar (back, number, type, delete), the card, and a sticky
     Previous / Done / Next bar. The other rows step aside. */
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-list:has(> .is-open) > .d3-ad-item:not(.is-open),
  #damage3d-overlay.damage-confirmation-mode .d3-ad-list:has(> .is-open) > .d3-ad-item:not(.is-open),
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-item.is-open > .d3-ad-row,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-item.is-open > .d3-ad-row,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-all-damages:has(.is-open) > .d3-ad-hd,
  #damage3d-overlay.damage-confirmation-mode .d3-all-damages:has(.is-open) > .d3-ad-hd,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-sidebar:has(.d3-ad-item.is-open) .a3d-mobile-add-prompt,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-foot-tools,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-foot-tools { display: none; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-all-damages:has(.is-open),
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-list:has(> .is-open),
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-item.is-open,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card,
  #damage3d-overlay.damage-confirmation-mode .d3-all-damages:has(.is-open),
  #damage3d-overlay.damage-confirmation-mode .d3-ad-list:has(> .is-open),
  #damage3d-overlay.damage-confirmation-mode .d3-ad-item.is-open,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card { display: flex; flex-direction: column; flex: 1 0 auto; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-body,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-body { flex: 1 0 auto; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-top,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-top { display: flex; position: sticky; top: 0; z-index: 3; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-foot,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-foot { position: sticky; bottom: 0; z-index: 3; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-prev,
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-next,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-prev,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-next { display: inline-flex; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-foot-main,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-foot-main { flex: 1; }
  #analyst-3d-wrap.review-confirmation-mode:not(.automated-mode) .d3-ad-card .d3-ad-foot-main .fx-btn,
  #damage3d-overlay.damage-confirmation-mode .d3-ad-card .d3-ad-foot-main .fx-btn { flex: 1; justify-content: center; }
}

/* ── Immersive full screen (js/components/damage3d/immersive.js) ──
   The panel becomes a fixed 100dvh overlay (also the Fullscreen API target). The header is a bar over the canvas; the
   side panel is a bottom drawer (peek / half / full) on phones and a 360px right panel on desktop. */
html.d3-imm-lock, body.d3-imm-lock { overflow: hidden; overscroll-behavior: none; }
/* iOS fallback (no element fullscreen): the body is pinned and the scroll offset kept in a custom property */
body.d3-imm-fixed { position: fixed; top: calc(-1 * var(--d3-scroll-y, 0px)); left: 0; right: 0; }
.d3-imm-close, .d3-imm-title, .d3-imm-drawer-head { display: none; }

/* design-exception: size and margin must beat the legacy ".d3-panel-inline { width/height/max-*: ... !important }" in pages/23_vehicles_page.css until that file is converted */
.d3-panel.d3-immersive {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: block;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  margin: 0 !important;
  flex: none;
  overflow: hidden;
  overscroll-behavior: none;
  animation: d3ImmIn .22s cubic-bezier(.2, .7, .2, 1);
}
.d3-panel.d3-immersive.d3-imm-leave { animation: d3ImmOut .2s ease forwards; }
@keyframes d3ImmIn  { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes d3ImmOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.985); } }
@supports (height: 100dvh) {
  /* design-exception: same legacy !important sizing as above */
  .d3-panel.d3-immersive { height: 100dvh !important; }
}

/* top bar */
.d3-panel.d3-immersive .d3-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  flex-wrap: nowrap;
  gap: var(--space-3);
  padding: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 12px) var(--space-2) calc(env(safe-area-inset-left, 0px) + 12px);
}
.d3-panel.d3-immersive .d3-header-left,
.d3-panel.d3-immersive .d3-nav,
.d3-panel.d3-immersive .d3-view-switch,
.d3-panel.d3-immersive .a3d-mobile-projection-toggle,
.d3-panel.d3-immersive #close-damage3d,
.d3-panel.d3-immersive #d3-fullscreen-btn,
.d3-panel.d3-immersive #d3-fullscreen-btn-inline,
.d3-panel.d3-immersive #a3d-fullscreen-btn { display: none; }
.d3-panel.d3-immersive .d3-imm-close { display: inline-grid; flex: none; }
.d3-panel.d3-immersive .d3-imm-title { display: block; flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d3-panel.d3-immersive .d3-header-controls { display: flex; flex-wrap: nowrap; flex: none; width: auto; align-items: center; }

/* the canvas fills the screen */
.d3-panel.d3-immersive .d3-body { position: absolute; inset: 0; display: block; padding: 0; overflow: hidden; }
.d3-panel.d3-immersive .d3-canvas-wrap { position: absolute; inset: 0; width: auto; height: auto; min-height: 0; max-height: none; flex: none; }
.d3-panel.d3-immersive .d3-canvas { width: 100%; height: 100%; display: block; touch-action: none; -webkit-user-select: none; user-select: none; }
.d3-panel.d3-immersive .d3-explode-bar { top: calc(env(safe-area-inset-top, 0px) + 68px); left: calc(env(safe-area-inset-left, 0px) + 12px); }
.d3-panel.d3-immersive .d3-overall-view-btn { top: calc(env(safe-area-inset-top, 0px) + 112px); }
.d3-panel.d3-immersive .d3-footer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }

/* photo panel overlays the canvas, above the drawer's peek row */
.d3-panel.d3-immersive .d3-img-viewer:not(.hidden) {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 22;
  top: calc(env(safe-area-inset-top, 0px) + 61px);
  bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  overflow: auto;
}

/* drawer (phones / portrait) */
.d3-panel.d3-immersive .d3-sidebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 25;
  display: block;
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0 calc(env(safe-area-inset-right, 0px) + 12px) env(safe-area-inset-bottom, 0px) calc(env(safe-area-inset-left, 0px) + 12px);
  transition: height .25s cubic-bezier(.2, .7, .2, 1);
}
.d3-panel.d3-immersive[data-snap="peek"] .d3-sidebar { height: calc(112px + env(safe-area-inset-bottom, 0px)); }
.d3-panel.d3-immersive[data-snap="half"] .d3-sidebar { height: 46dvh; overflow-y: auto; }
.d3-panel.d3-immersive[data-snap="full"] .d3-sidebar { height: calc(100dvh - 68px); overflow-y: auto; }
.d3-panel.d3-immersive:has(.d3-footer:not(.hidden)) .d3-sidebar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.d3-panel.d3-immersive .d3-sidebar > .d3-detail,
.d3-panel.d3-immersive .d3-sidebar > .d3-all-damages { flex: none; overflow: visible; }

.d3-panel.d3-immersive .d3-imm-drawer-head {
  display: block;
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 calc(-1 * (env(safe-area-inset-right, 0px) + 12px)) 0 calc(-1 * (env(safe-area-inset-left, 0px) + 12px));
  padding: 0 calc(env(safe-area-inset-right, 0px) + 12px) 0 calc(env(safe-area-inset-left, 0px) + 12px);
  touch-action: none;
}
.d3-panel.d3-immersive .d3-imm-chips { padding: 2px 0 var(--space-3); touch-action: pan-x; }
.d3-panel.d3-immersive .d3-imm-empty { line-height: 44px; }
.d3-panel.d3-immersive .d3-imm-summary { display: flex; align-items: center; gap: var(--space-3); padding: 2px 0 var(--space-3); touch-action: pan-y; }
.d3-panel.d3-immersive .d3-imm-summary.hidden { display: none; }
.d3-panel.d3-immersive[data-snap="peek"] .d3-imm-summary { display: none; }
.d3-panel.d3-immersive .d3-imm-thumb { flex: none; width: 64px; height: 64px; }
.d3-panel.d3-immersive .d3-imm-sum-body { min-width: 0; flex: 1; }
.d3-panel.d3-immersive .d3-imm-sum-meta { align-items: center; margin-top: var(--space-1); }
.d3-panel.d3-immersive .d3-imm-count { margin-left: auto; }

/* desktop / landscape: right-side panel, the canvas re-fits to the remaining width */
@media (min-width: 769px) and (min-aspect-ratio: 1/1) {
  .d3-panel.d3-immersive .d3-canvas-wrap { right: 360px; }
  .d3-panel.d3-immersive .d3-sidebar,
  .d3-panel.d3-immersive[data-snap] .d3-sidebar {
    left: auto;
    right: 0;
    bottom: 0;
    top: calc(env(safe-area-inset-top, 0px) + 61px);
    width: 360px;
    height: auto;
    overflow-y: auto;
  }
  .d3-panel.d3-immersive:has(.d3-footer:not(.hidden)) .d3-sidebar { bottom: 64px; }
  .d3-panel.d3-immersive .d3-imm-drawer-head { margin: 0 calc(-1 * var(--space-3)); padding: var(--space-3) var(--space-3) 0; }
  .d3-panel.d3-immersive .d3-imm-handle { display: none; }
  .d3-panel.d3-immersive .d3-imm-chips { flex-wrap: wrap; overflow: visible; }
  .d3-panel.d3-immersive[data-snap] .d3-imm-summary:not(.hidden) { display: flex; }
  .d3-panel.d3-immersive .d3-img-viewer:not(.hidden) { right: 360px; bottom: 0; }
  .d3-panel.d3-immersive .d3-footer { right: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .d3-panel.d3-immersive, .d3-panel.d3-immersive.d3-imm-leave { animation: none; }
  .d3-panel.d3-immersive .d3-sidebar { transition: none; }
}
/* --- css/components/14_yolo.css --- */
/* ================================================================
   14_yolo.css — YOLO model rows and inference controls: LAYOUT ONLY
   ================================================================
   Markup uses design-system components (fx-panel-*, fx-list, fx-btn,
   fx-dialog, fx-check, fx-range, fx-media-overlay); this file arranges them. */

/* ── Model rows (fx-list-item) ───────────────────────────────── */
.yolo-models { margin-bottom: var(--space-1); }
.yolo-model-row .fx-list-end { flex: none; }
.yolo-model-row .fx-list-sub { white-space: normal; overflow-wrap: anywhere; }

/* ── Run buttons ─────────────────────────────────────────────── */
.yolo-run-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ── Inference progress over the preview photo ───────────────── */
.infer-overlay .pm-host { width: min(280px, 82%); margin-top: 0; }

/* ── Damage config dialog: indented sub-options ──────────────── */
.yolo-sub { display: grid; gap: var(--space-3); padding-left: var(--space-6); }
/* --- css/pages/15_login.css --- */
/* analyst/static/css/pages/15_login.css — the login, register and error pages are design-system pages now
   (CA-160, html/partials/public_*.html). Only two legacy rules other areas still use remain here, until those
   areas move to fx-field / fx-banner: .form-group (Fleet forms) and .error-banner (Analyst, Glass). */


.form-group {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 10px);
}

.form-group label {
  color: var(--muted);
  font-size: 12px; /* Increased from 11px */
}

.error-banner {
  background: rgba(153, 27, 27, 0.2);
  border: 1px solid var(--crimson);
  border-radius: var(--r-md);
  color: #fca5a5;
  padding: 14px 18px;
  font-size: 13px;
  font-family: var(--sans);
  line-height: 1.4;
  text-align: center;
}
/* --- css/components/16_review.css --- */
/* ================================================================
   16_review.css  —  Analysis review modal + reviews display
   ================================================================ */

/* Segmented status control */

/* Comment field — only visible when status != good */

/* ── Reviews display (in history detail) ──────────────────────── */

/* Clickable review cards + detail view */

/* --- css/components/18_video_hud.css --- */
/* ================================================================
   18_video_hud.css  —  Video upload modal · Frame extraction HUD
                         Progress tracking · Frame review grid
   ================================================================ */

/* ── Video HUD Panel ─────────────────────────────────────────── */

/* ── Stage 1: Upload Zone ────────────────────────────────────── */

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

/* ── Stage 2: Processing Progress ───────────────────────────── */

.progress-label {
  font-size: 14px;
  color: var(--text-hi);
  font-weight: 500;
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-lo);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF1B6D, #FF4D8F);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.5px;
}

/* ── Stage 3: Frame Review Grid ─────────────────────────────── */

/* ── Review Footer ───────────────────────────────────────────– */

/* ── Stage 4: Success Message ───────────────────────────────– */

/* ── Button Styles ──────────────────────────────────────────── */
.btn-confirm {
  background: linear-gradient(135deg, #FF1B6D, #FF4D8F);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
  letter-spacing: 0.5px;
}
.btn-confirm:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 27, 109, 0.3);
}
.btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}
.icon-btn:hover {
  color: var(--text-hi);
}
/* --- css/pages/19_admin.css --- */
/* analyst/static/css/pages/19_admin.css — LEGACY leftovers (CA-160). The Admin page itself is on the design system
   (ds/ + pages/53_admin.css + pages/admin/*.css). What remains here is used OUTSIDE Admin only, by components other
   areas still own: .type-badge (shared history modal: app.js, history_detail.js, nav-actions.js) and .admin-loading
   (doc reader: legal.js, modal_doc_reader.html). Delete each rule when its owner converts. */

/* ── Activity entry-type badge (Activity tab: analyst vs. fleet checkout/checkin) ── */
.type-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.6;
  white-space: nowrap;
}

.type-badge.analyst {
  background: rgba(122,150,173,.1);
  color: var(--muted);
  border: 1px solid var(--border);
}

.type-badge.checkout {
  background: rgba(59,130,246,.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,.25);
}

.type-badge.checkin {
  background: rgba(22,163,74,.15);
  color: #4ade80;
  border: 1px solid rgba(22,163,74,.3);
}

.type-badge.comparison {
  background: rgba(168,85,247,.12);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,.3);
}

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
/* --- css/pages/23_vehicles_page.css --- */
/* ── Layout ── */
  .layout { display: flex; flex: 1; overflow: hidden; }

  /* ── Sidebar ── */
  .sidebar {
    width: 320px;
    min-width: 240px;
    max-width: 640px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
  }
  .badge {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid;
  }
  .badge-open   { color: var(--green);  border-color: var(--green);  background: var(--green-dim); }
  .badge-closed { color: var(--muted);  border-color: var(--border); background: transparent; }
  .badge-damage { color: var(--red);    border-color: var(--red);    background: var(--red-dim); }
  .badge-clean  { color: var(--green);  border-color: var(--green);  background: var(--green-dim); }
  .badge-warn   { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-dim); }
  .btn-add {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: var(--accent-glow, rgba(255,27,109,.12));
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 1.5px;
    transition: all .15s;
  }
  .btn-add:hover { background: var(--accent); color: #fff; }

  /* #import-csv-btn shares .sidebar-add's row with the (flex:1, inline-
     styled) Register Vehicle button, but .btn-add's own width:100% —
     correct for that button standing alone — makes this ICON-ONLY
     button also demand the full row width, so flexbox ends up splitting
     the row between two "full width" competitors instead of a wide
     button plus a small square icon button beside it. */
  #import-csv-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px;
  }

  /* ── Content ── */
  .content { flex: 1; overflow-y: auto; padding: 28px 32px; }

  /* Vehicle detail's four tab panes (switchVehicleTab in vehicles.js toggles
     these via inline style.display, not a class) — a CSS animation restarts
     the same way on any display:none -> shown transition regardless of
     whether that was driven by a class or an inline style, so this needs
     no JS changes to take effect on every tab switch. */
  #vpanel-sessions, #vpanel-maintenance, #vpanel-damages, #vpanel-timeline {
    animation: paneFadeIn var(--dur-base) var(--ease-out-soft);
  }

  /* Sidebar's Vehicles/Clients/Contracts panels (switchSidebarTab in
     clients_contracts.js toggles these via inline style.display, same
     restart-on-unhide behaviour as above) and the vehicle/client/contract
     detail views that replace them. */
  .sidebar-panel, #vehicleDetail, #clientDetail, #contractDetail {
    animation: paneFadeIn var(--dur-base) var(--ease-out-soft);
  }

  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 14px;
    color: var(--muted);
  }
  .empty-state svg { opacity: .3; }
  .empty-state p {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--muted);
  }

  /* ── Buttons ── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    border: 1px solid;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--mono);
    letter-spacing: 1px;
    transition: all var(--dur-fast) var(--ease-out-soft);
    white-space: nowrap;
  }
  .btn:active:not(:disabled) { transform: scale(0.97); }
  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0e14;
    font-weight: 600;
  }
  .btn-primary:hover { opacity: .85; }
  .btn-ghost {
    background: transparent;
    border-color: var(--border2);
    color: var(--muted);
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
  .btn-danger {
    background: transparent;
    border-color: var(--border2);
    color: var(--muted);
  }
  .btn-danger:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
  .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

  /* ── Section heading ── */
  .section-title {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 32px;
    box-sizing: border-box;
  }
  .section-title svg { opacity: .6; }

  /* Normalized section title controls */
  .section-title .btn,
  .section-title button.btn {
    font-size: 10px !important;
    padding: 4px 10px !important;
    height: 22px !important;
    line-height: 1;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: var(--mono) !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    margin: 0 !important;
    border-radius: var(--radius, 4px) !important;
  }

  /* ── Session timeline ── */
  .timeline { display: flex; flex-direction: column; gap: 10px; }
  .chevron {
    color: var(--muted);
    transition: transform .2s;
    flex-shrink: 0;
  }
  .chevron.open { transform: rotate(90deg); }

  .analysis-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  .analysis-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
  }
  .analysis-box .ab-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-bottom: 8px;
  }
  .analysis-box .ab-id {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text);
    word-break: break-all;
  }
  .analysis-box .ab-empty { color: var(--muted); font-size: 11px; font-style: italic; }
  .analysis-cols { align-items: start; }

  .damage-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
  .damage-list li {
    padding: 8px 12px;
    border-radius: var(--radius);
    border-left: 3px solid var(--red);
    background: var(--red-dim);
    font-size: 12px;
  }

  /* ── Modals ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,8,14,.8);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
  }
  .modal-overlay.hidden { display: none; }
  .modal {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 10px;
    width: 480px;
    max-width: 95vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .modal-wide { width: 660px; }
  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 14px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .modal-header h3 {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text);
    margin: 0;
  }
  .modal-header svg { color: var(--accent); }
  .modal-close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-close-btn:hover {
    color: var(--text);
  }
  .modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
  }
  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px 24px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
  }

  /* ── Form ── */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .form-group { margin-bottom: 14px; }
  .form-group label {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 7px 10px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
  }
  .form-group input::placeholder,
  .form-group textarea::placeholder { color: var(--muted); }
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus { border-color: var(--accent); }
  .form-group select option { background: var(--surface); }

  /* ── Spinner ── */
  .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    flex-shrink: 0;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .history-pick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .12s, background .12s;
    background: var(--bg);
  }
  .history-pick-item:hover { border-color: var(--border2); background: rgba(255,255,255,.02); }
  /* The copyable history-id line uses user-select:all — style its selection
     highlight to match the theme instead of the browser's jarring default blue. */
  .history-pick-item ::selection { background: var(--accent); color: #0b0e14; }

  .ab-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .ab-actions {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  }

  /* ── Photo Manager Modal CSS ── */
  .photo-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
  }
  .upload-zone:hover {
    border-color: var(--accent) !important;
    background: rgba(240, 135, 61, 0.04);
  }
  .upload-zone.drag-over {
    border-color: var(--accent) !important;
    background: rgba(255, 27, 109, 0.08);
  }

  .divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Rent-A-Car Enhancements ────────────────────────────────────────────── */

/* Visual Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

/* Elevated Analysis Cards */
.analysis-box {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: box-shadow 0.2s;
}
.analysis-box:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.analysis-box.is-clean {
  border-top: 3px solid var(--green);
}
.analysis-box.is-damaged {
  border-top: 3px solid var(--red);
}

/* Vehicle Readiness Badges */
.badge-ready { background: var(--green); color: #fff; border: 1px solid var(--green); font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.badge-maintenance { background: var(--red); color: #fff; border: 1px solid var(--red); font-weight: 600; padding: 4px 8px; border-radius: 4px; }
/* Vehicle has open ledger damage but no pending maintenance yet — distinct from the
   session-level .badge-damage verdict badge used inside comparison results. */
.badge-vehicle-damaged { background: var(--orange); color: #fff; border: 1px solid var(--orange); font-weight: 600; padding: 4px 8px; border-radius: 4px; }

/* ── Synthetic Damage Generation modal ─────────────────────────── */
/* Staged groups/config can grow tall once photos are added — without an
   explicit min-height:0 here, the flex algorithm can let this body's content
   push against (and visually compress) the tab switcher above it instead of
   scrolling internally. */
#syntheticDamageModal #sd-pane-generate,
#syntheticDamageModal #sd-pane-history {
  min-height: 0;
}
#syntheticDamageModal .modal-body {
  min-height: 0;
}


/* Custom hover tooltip — replaces native title="" popups (which look like raw
   browser chrome and can't be styled) for anything showing substantive warning
   text, e.g. the unfair-comparison / no-matching-camera-angle icons. Pure CSS,
   no JS needed: put the text in data-tooltip and it appears above the trigger
   on hover/focus. */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 320px;
  background: var(--surface-hi, #1a1e28);
  color: var(--text, #e8eaf0);
  border: 1px solid var(--border-hi, #333944);
  border-radius: var(--radius, 6px);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  font-family: var(--mono);
  letter-spacing: 0.2px;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  z-index: 400;
  pointer-events: none;
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-hi, #333944);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  z-index: 400;
  pointer-events: none;
}
[data-tooltip]:hover::after, [data-tooltip]:hover::before,
[data-tooltip]:focus::after, [data-tooltip]:focus::before {
  opacity: 1;
  visibility: visible;
}
#sd-dropzone.drag-over {
  border-color: var(--accent) !important;
  background: rgba(255, 27, 109, 0.08);
}
#sd-dropzone:hover {
  border-color: var(--accent);
  background: rgba(255, 27, 109, 0.04);
}

.sd-group-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}
.sd-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sd-group-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.sd-group-name-input {
  flex: 1;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-hi);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
}
.sd-group-name-input:focus { border-color: var(--accent); }
.sd-group-count {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}
.sd-group-remove {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 3px 7px;
  transition: all .12s;
}
.sd-group-remove:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

.sd-thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sd-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.sd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sd-thumb-remove {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 15px;
  height: 15px;
  line-height: 13px;
  text-align: center;
  border-radius: 50%;
  background: rgba(11, 14, 20, 0.85);
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}
.sd-thumb-remove:hover { background: var(--red); color: #fff; }

/* ── Batch/vehicle status chips ─────────────────────────────────── */
.sd-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}
.sd-status-pending { color: var(--muted); border-color: var(--border-hi); background: transparent; }
.sd-status-running { color: var(--blue); border-color: #3b82f644; background: #3b82f610;
                      animation: blink 1.5s ease-in-out infinite; }
.sd-status-done    { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.sd-status-error   { color: var(--red); border-color: var(--red); background: var(--red-dim); }

.sd-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 11px;
}
.sd-progress-row .sd-vehicle-name { flex: 1; color: var(--text); }
.sd-progress-row .sd-vehicle-error { color: var(--red); font-size: 10px; }

.sd-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  flex-wrap: wrap;
}
.sd-history-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 180px; }
.sd-history-title { font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 600; }
.sd-history-meta  { font-size: 10.5px; color: var(--muted); }
.sd-history-progress {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.sd-history-actions { display: flex; gap: 8px; align-items: center; }

/* ── History detail sub-view (in-place swap, no nested modal) ────────────── */
.sd-detail-header,
.sd-detail-config {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
}
.sd-detail-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: 11.5px;
}
.sd-detail-key {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  min-width: 130px;
  flex-shrink: 0;
}
.sd-detail-val { color: var(--text); }
.sd-detail-config { margin-top: 10px; }

.sd-detail-vehicles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.sd-detail-vehicle {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}
.sd-detail-vehicle-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sd-detail-vehicle-head .sd-vehicle-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.sd-damage-plan-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text);
}
.sd-damage-plan-list li {
  padding: 4px 8px;
  background: var(--surface-lo);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
}

/* ── Synthetic damage: background-watch toast + toolbar badge ────────────── */
.sd-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  animation: sd-toast-in .18s ease-out;
}
.sd-toast.sd-toast-error { border-left-color: var(--red); }
.sd-toast.hidden { display: none; }

@keyframes sd-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sd-toast-msg {
  flex: 1;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.4;
}
.sd-toast-view {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sd-toast-view:hover { background: var(--accent); color: var(--surface); }
.sd-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color .15s;
}
.sd-toast-close:hover { color: var(--text-hi); }

#synthetic-damage-btn { position: relative; }
.sd-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface);
}

/* ── Mobile Responsiveness for Fleet Analyst ── */
@media (max-width: 1024px) {
  .analysis-cols {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .chevron {
    position: absolute;
    right: 16px;
    top: 16px;
  }
}

/* Inline 3D model overrides and blending. No transparent backgrounds: in fullscreen the panel
   is the top layer and a see-through stage showed the browser's black backdrop (CA-185). */
.d3-panel-inline {
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
  max-width: none !important;
  height: 720px !important;
  max-height: none !important;
  border-radius: 0 !important;
  margin-bottom: 12px;
}
.d3-panel-inline .d3-body {
  height: 100% !important;
  grid-template-columns: 1fr 300px !important;
}
/* Review-gate photos panel (see openFleet3DReview/.d3-img-viewer) — this
   panel never had a 3rd (img-viewer) column before, so the base 2-column
   override above doesn't leave room for it; only kicks in once setImages()
   adds .photos-open. */
.d3-panel-inline .d3-body.photos-open {
  grid-template-columns: clamp(300px, 35%, 540px) 1fr 300px !important;
}
.d3-panel-inline .d3-canvas {
  background: transparent !important;
  border: none !important;
}

@media (max-width: 680px) {
  .d3-panel-inline {
    height: auto !important;
  }
  .d3-panel-inline .d3-body {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
  }
  .d3-panel-inline .d3-body.photos-open {
    grid-template-columns: 1fr !important;
    grid-template-rows: 42vh auto auto !important;
  }
  .d3-panel-inline .d3-img-viewer {
    min-height: 42vh;
    max-height: 42vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  /* Size the stage, not the canvas: the canvas fills its stage and the 2D grid frames are placed
     against the stage, so a fixed-height canvas left frames (and fullscreen) hanging past it (CA-185).
     Fullscreen (.d3-immersive, set for both the Fullscreen API and its fallback) lays the stage out itself. */
  .d3-panel-inline:not(.d3-immersive) .d3-canvas-wrap {
    flex: 0 0 auto;
    height: 340px;
  }
  .d3-panel-inline .d3-sidebar {
    border-left: none !important;
    border-top: 1px solid var(--border) !important;
  }
}

/* ── Guided live capture (camera + real-time car-framing AI guidance) ──── */
.pm-camera-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Was 12px 0 — trimmed alongside .camera-capture-zone's own padding cut
     (5_upload.css) so the manual upload zone below it fits on-screen
     together with the camera option instead of needing a scroll to find. */
  margin: 8px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
}
.pm-camera-divider::before, .pm-camera-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Guided Capture (lc-*) moved to components/53_live_capture.css (layout) + ds/components-capture.css (CA-160). */

/* ── Clients / Contracts detail panes (reuse vehicle-detail visual language) ── */
.vd-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
/* Wrapping KPI row (many tiles, phones): .vd-stats.vd-stats-wrap */
.vd-stats-wrap { flex-wrap: wrap; margin-bottom: 16px; gap: 10px; }
.vd-stats-wrap .stat-card { flex: 1 1 140px; min-width: 0; }

/* Client type badges (reuse .badge base from vehicle sidebar rows) */
.badge-individual { color: var(--muted); border-color: var(--border); background: transparent; }
.badge-company     { color: var(--blue);  border-color: var(--blue);  background: rgba(59,130,246,.12); }

/* Contract status badges (used in list rows, contract header and mini-cards) */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid;
}
.status-badge.status-ok      { color: var(--green);  border-color: var(--green);  background: var(--green-dim); }
.status-badge.status-warn    { color: var(--yellow);  border-color: var(--yellow);  background: var(--yellow-dim); }
.status-badge.status-default { color: var(--muted);  border-color: var(--border); background: transparent; }

.fj-pill-title {
  display: inline-block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-progress-toast-mount {
  padding: 10px 12px 12px;
  overflow-y: auto;
}
/* The mounted _LiveFeed/_RepairPlanFeed builds its own .live-feed-compact
   inside this mount — no max-width centering needed here (unlike the
   Analyst tab's full-panel presentation), it already fits the toast. */
.fleet-progress-toast-mount .live-feed { max-width: none; }

/* Comparison narrator (see streamSessionCompare in core/streaming.js) stacks
   two feeds — rental and facility — inside the same toast mount. */
.live-feed-compare-section { margin-bottom: 14px; }
.live-feed-compare-section:last-child { margin-bottom: 0; }
.live-feed-compare-hd {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.fleet-progress-toast-phase1.hidden,
.fleet-progress-toast-phase2.hidden { display: none; }

/* Compact live counter bar in Fleet job feeds */
.compact-feed-counters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  margin: 6px 0 2px;
  /* Was a hardcoded dark navy rgba() + white text, written back when this
     panel was dark-only — on the light theme's white toast surface that
     put a medium-gray label (--muted resolves lighter/darker per theme)
     on a near-equally-dark pill background, i.e. awful contrast either
     way. --surface-hi/--border/--text-hi already track the active theme
     everywhere else in this panel, so this pill now does too. */
  background: var(--surface-hi);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.compact-feed-counters .fpt-narration-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 24px;
  margin-left: auto;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  background: var(--surface) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}
.compact-feed-counters .fpt-narration-toggle:hover,
.compact-feed-counters .fpt-narration-toggle:focus-visible {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.compact-feed-counters .fpt-narration-toggle .live-narration-toggle-icon {
  display: grid; place-items: center; width: 14px; height: 14px;
}
.compact-feed-counters .fpt-narration-toggle svg { width: 14px; height: 14px; display: block; }
.fleet-progress-toast-mount .live-feed-item {
  align-items: flex-start; padding-inline: 10px;
}
.fleet-progress-toast-mount .live-feed-item-text { line-height: 1.45; padding-top: 0; }
.fleet-progress-toast-mount .live-feed.narration-collapsed .live-feed-list {
  display: flex !important;
  min-height: 0 !important;
  max-height: 0 !important;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transform: translateY(-6px);
}
.fleet-progress-toast-mount .narration-collapsed > .live-feed,
.fleet-progress-toast-mount .narration-collapsed .fpt-phase-status {
  display: none !important;
}
/* The toggle renders a bare chevron svg inside .fpt-sticky-header; the mount carries .narration-collapsed. */
.compact-feed-counters .fpt-narration-toggle svg { transition: transform .15s ease-out; }
.fleet-progress-toast-mount .narration-collapsed .fpt-narration-toggle svg,
.narration-collapsed > .fpt-sticky-header .fpt-narration-toggle svg {
  transform: rotate(180deg);
}
.compact-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.compact-counter-pill strong {
  color: var(--text-hi);
  font-size: 11px;
}
.compact-counter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.compact-counter-dot.green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.compact-counter-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.compact-counter-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }

/* Sticks the mini 3D preview + PARTS/DAMAGES counters to the top of
   .fleet-progress-toast-mount (the scrolling ancestor — overflow-y:auto)
   while .live-feed-list scrolls underneath. `top: 0` resolves against that
   ancestor's PADDING box, so this naturally rests exactly where it already
   sits before any scrolling — no offset math needed. The background is only
   there to occlude list items sliding up behind it while stuck. */
.fpt-sticky-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

/* ── Fleet toast mini 3D map preview (see _LiveFeed's mini-3D-map section,
   core/streaming.js) — a small, non-interactive live-build preview of the
   vehicle inside the checkout/check-in progress toast, mirroring the Analyst
   tab's own #analyst-3d-wrap.automated-mode look during streaming, but sized
   for the toast's fixed 340px width instead of a full results panel. Hidden
   entirely until the AI's own inferred_vehicle narrates a body style in
   (see _activateMiniD3) — no placeholder shimmer, unlike the Analyst tab's
   eager pre-init, to keep this addition low-risk/self-contained. */
.fpt-3d {
  /* No horizontal padding of its own — .fleet-progress-toast-mount (the
     ancestor two levels up, through .fpt-sticky-header which adds none of
     its own) already contributes the toast's 12px side padding; adding more
     here would indent this box relative to the narration list below it,
     which relies on that same outer padding. */
  margin-bottom: 10px;
}
/* Text style comes from the design system's .fx-hint (set in core/streaming.js) - no mono/uppercase (CA-217). */
.fpt-3d-label { margin-bottom: 6px; }
/* Compound selector (.fpt-3d-panel.d3-panel-inline) — deliberately more
   specific than the shared .d3-panel-inline rules a few hundred lines above
   (this file's own #dmg-3d-panel/openFleet3DReview overrides, 720px tall,
   2-column body) so this mini variant's own sizing always wins regardless
   of source order, without touching those shared rules at all. */
.fpt-3d-panel.d3-panel-inline {
  height: 150px !important;
  margin-bottom: 0 !important;
  border-radius: var(--r-sm, 6px) !important;
  border: 1px solid var(--border) !important;
}
/* The Fleet live preview is a read-only model snapshot. Review navigation
   belongs to the full damage-review workspace and must never consume space
   inside this compact panel, even if shared 3D chrome is injected later. */
.fpt-3d .a3d-mobile-review-nav,
.fpt-3d-panel .a3d-mobile-review-nav {
  display: none !important;
}
.fpt-3d-panel.d3-panel-inline .d3-body {
  /* Base .d3-body is a 3-column grid (img-viewer | canvas | sidebar) — this
     mini panel only ever has the canvas column, so a lone .d3-canvas-wrap
     child would otherwise auto-place into column 1 (width 0, the img-viewer
     slot) and render at zero width. */
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
}
.fpt-3d-panel.d3-panel-inline .d3-canvas {
  height: 100% !important;
}
/* --- css/components/53_live_capture.css --- */
/* components/53_live_capture.css - LAYOUT ONLY for Guided Capture (#liveCaptureModal).
   Shared by Analyst, Fleet check-in/out, /windshield and the public capture page /c/<token>.
   All paint (colour, border, radius, font, shadow) comes from the design system:
   ds/components.css + ds/components-capture.css (fx-cam-*, fx-guide-*, fx-thumb-*, fx-disclosure).
   Markup: templates/html/modals/modal_live_capture.html. JS: js/components/live_capture.js.
   Two layouts, switched by the shell state class, not by viewport width:
     - default: desktop chrome (header, steps, stage with HUD, warnings, tips, gallery strip, footer)
     - .is-immersive: camera-app layout, the stage fills the screen (phones start here; Fullscreen API). */

/* ── Shell ───────────────────────────────────────────────────────── */
.lc-modal { width: 100%; height: 100dvh; max-height: 100dvh; overflow: hidden; }
.lc-header { flex: none; }
.lc-body { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-3); min-height: 0; overflow-y: auto; }
.lc-modal.is-tips .lc-body { display: none; }
.lc-footer { flex: none; }
.lc-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Immersive: video and its own HUD only */
.lc-modal.is-immersive .lc-header,
.lc-modal.is-immersive .lc-steps,
.lc-modal.is-immersive .lc-warnings,
.lc-modal.is-immersive .lc-tips,
.lc-modal.is-immersive .lc-gallery-row,
.lc-modal.is-immersive .lc-footer { display: none; }
.lc-modal.is-immersive .lc-body { position: absolute; inset: 0; gap: 0; overflow: hidden; }
.lc-modal.is-immersive .lc-video-wrap { position: absolute; inset: 0; min-height: 0; }

/* ── Tips screen (before the camera starts, once per step) ───────── */
.lc-tips-overlay { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: var(--space-4) var(--space-4) 0; overflow-y: auto; }
.lc-tips-overlay.hidden { display: none; }
.lc-tips-overlay-content { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-4); width: 100%; max-width: 560px; min-height: 0; margin: 0 auto; }
.lc-tips-overlay-header { display: grid; gap: var(--space-1); flex: none; }
.lc-tips-overlay-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--control-h); }
.lc-tips-overlay-bar .fx-hint { margin: 0; }
.lc-tips-overlay-bar .lc-tips-close { display: none; }
.lc-modal.is-immersive .lc-tips-overlay-bar .lc-tips-close { display: inline-grid; }
.lc-tips-overlay-header .fx-muted { margin: 0; }
.lc-tips-overlay-grid { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.lc-tips-overlay-footer { flex: none; margin: auto calc(var(--space-4) * -1) 0; }

/* ── Step indicator ──────────────────────────────────────────────── */
.lc-body .lc-steps { display: flex; flex: none; margin: var(--space-4) var(--space-4) 0; overflow-x: auto; }
.lc-steps .lc-step { flex: 1 1 0; justify-content: flex-start; height: auto; min-width: 0; min-height: var(--control-h); padding-top: var(--space-1); padding-bottom: var(--space-1); text-align: left; }
.lc-step-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.lc-step-title, .lc-step-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-step .fx-seg-mark { margin-left: auto; }
/* Windshield mode: step 3 becomes the required first step, step 1 disappears (CSS order, no DOM moves) */
#lcSteps.lc-steps-windshield #lcStepBtn1 { display: none; }
#lcSteps.lc-steps-windshield #lcStepBtn3 { order: 1; }
#lcSteps.lc-steps-windshield #lcStepBtn2 { order: 2; }

/* ── Stage ───────────────────────────────────────────────────────── */
.lc-video-wrap { flex: 1 1 auto; width: 100%; min-height: 240px; }
#lcVideo { width: 100%; height: 100%; object-fit: cover; }
.lc-flash { position: absolute; inset: 0; }

/* Reference outline + labels + where-to-stand map */
.lc-static-mask { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lc-static-mask.hidden { display: none; }
#lcStaticMaskShape { transform-box: fill-box; transform-origin: center; }
#lcStaticMaskShape[data-phase="front"],
#lcStaticMaskShape[data-phase="rear"] { transform: scale(1.66); }
#lcStaticMaskShape[data-phase="front_right"],
#lcStaticMaskShape[data-phase="rear_right"],
#lcStaticMaskShape[data-phase="rear_left"],
#lcStaticMaskShape[data-phase="front_left"] { transform: scale(1.52); }
#lcStaticMaskShape[data-phase="right"],
#lcStaticMaskShape[data-phase="left"] { transform: scale(1.36); }
/* CA-258: a half of a side - the side's silhouette enlarged so the half this step covers fills the frame and the
   other half runs off the inner edge (right: front is on the screen's right; left: front is on the screen's left). */
#lcStaticMaskShape[data-phase="right_front"],
#lcStaticMaskShape[data-phase="left_rear"] { transform: translateX(-47%) scale(2.05); }
#lcStaticMaskShape[data-phase="right_rear"],
#lcStaticMaskShape[data-phase="left_front"] { transform: translateX(47%) scale(2.05); }
.lc-static-mask-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lc-static-mask-labels.hidden { display: none; }
.lc-static-mask-label { position: absolute; top: 50%; max-width: calc(50% - 24px); padding: var(--space-1) var(--space-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform: translateY(-50%); }
.lc-static-mask-label.is-left { left: max(12px, env(safe-area-inset-left, 0px)); }
.lc-static-mask-label.is-right { right: max(12px, env(safe-area-inset-right, 0px)); }
.lc-static-mask-label.is-single { top: max(108px, calc(env(safe-area-inset-top, 0px) + 100px)); left: 50%; transform: translateX(-50%); }   /* below the step pill and the status banner */
.lc-persp-map { position: absolute; left: var(--space-3); bottom: 112px; z-index: 2; width: 88px; height: 88px; padding: var(--space-1); pointer-events: none; }
.lc-persp-map.hidden { display: none; }

/* ── HUD on the stage ────────────────────────────────────────────── */
.lc-hud-top { position: absolute; top: var(--space-2); left: var(--space-2); right: var(--space-2); z-index: 3; display: flex; flex-direction: column; gap: var(--space-2); }
.lc-status-row { display: flex; align-items: center; gap: var(--space-2); }
.lc-status-banner { display: flex; flex: 1 1 auto; align-items: flex-start; gap: var(--space-2); min-width: 0; padding: var(--space-1) var(--space-3); }
.lc-status-list { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-1); min-width: 0; margin: 0; padding: 0; list-style: none; }
.lc-status-list li { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.lc-status-icon { display: inline-flex; flex: none; }
.lc-status-banner .lc-status-more { display: none; flex: none; padding: 0 var(--space-1); }
.lc-modal.is-immersive .lc-status-banner.is-multi:not(.is-expanded) .lc-status-more:not(:empty) { display: inline-flex; }
.lc-rec-hud { display: none; align-items: center; gap: var(--space-2); flex: none; padding: var(--space-1) var(--space-3); }
.lc-rec-hud.is-active { display: flex; }
.lc-hud-stepper { display: none; }
.lc-back-btn.hidden { display: none; }
.lc-controls .hidden { display: none; }

/* Bottom controls: thumbnail / switch camera on the left, shutter in the centre, Smart capture on the right */
.lc-controls { --shutter: 64px; position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-6); }
.lc-left-controls { display: flex; align-items: center; justify-self: start; gap: var(--space-2); }
.lc-right-controls { display: flex; align-items: center; justify-self: end; gap: var(--space-2); }
.lc-capture-col { position: relative; display: flex; justify-content: center; justify-self: center; }
.lc-capture-hint { position: absolute; top: 100%; left: 50%; margin-top: var(--space-2); padding: 0 var(--space-3); transform: translateX(-50%); white-space: nowrap; }
.lc-capture-col .lc-hud-next-btn { display: none; position: absolute; bottom: calc(100% + var(--space-3)); left: 50%; transform: translateX(-50%); }
.lc-mini-thumb-btn #lcMiniThumbPreview { display: inline-flex; }
/* CA-495: Smart capture looks the same in both modes - icon + label; icon only at phone width (either mode) */
.lc-auto-toggle { padding: var(--space-1) var(--space-3); }
.lc-auto-icon { display: inline-flex; }
.lc-auto-icon .fx-icon { width: 18px; height: 18px; }
.lc-info-icon { cursor: help; }

/* ── Immersive HUD: one row of controls, status line below, controls around the shutter ── */
.lc-modal.is-immersive .lc-hud-top { top: calc(env(safe-area-inset-top, 0px) + var(--space-2)); left: calc(env(safe-area-inset-left, 0px) + var(--space-3)); right: calc(env(safe-area-inset-right, 0px) + var(--space-3)); flex-direction: row; flex-wrap: wrap; align-items: center; }
.lc-modal.is-immersive .lc-status-row { display: contents; }
.lc-modal.is-immersive .lc-back-btn { order: 1; }
.lc-modal.is-immersive .lc-hud-stepper { order: 2; display: flex; flex: 1 1 0; align-items: center; gap: var(--space-2); min-width: 0; height: var(--touch-h); padding: 0 var(--space-4); overflow: hidden; }
.lc-modal.is-immersive .nc-control-group { order: 3; }
.lc-modal.is-immersive .lc-rec-hud { order: 4; height: var(--touch-h); }
.lc-modal.is-immersive .lc-immersive-toggle { order: 5; }
.lc-modal.is-immersive .lc-status-banner { order: 9; flex: 0 0 100%; align-items: flex-start; }
.lc-modal.is-immersive .lc-status-list li:not(:first-child) { display: none; }
.lc-modal.is-immersive .lc-status-banner.is-expanded li:not(:first-child) { display: flex; }
.lc-hud-step-badge { flex: none; white-space: nowrap; }   /* "Rear-left corner · 6/8" stays one line; the instruction gives way */
.lc-hud-instruction { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-hud-next-hint { display: none; }
.lc-modal.is-immersive .lc-hud-stepper.is-expanded { align-self: flex-start; flex-wrap: wrap; height: auto; min-height: var(--touch-h); padding-top: var(--space-2); padding-bottom: var(--space-2); overflow: visible; }
.lc-modal.is-immersive .lc-hud-stepper.is-expanded .lc-hud-instruction { flex-basis: 100%; white-space: normal; }
.lc-modal.is-immersive .lc-hud-stepper.is-expanded .lc-hud-next-hint { display: block; }
.lc-modal.is-immersive .lc-controls { --shutter: 72px; padding-right: calc(env(safe-area-inset-right, 0px) + var(--space-4)); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-4)); padding-left: calc(env(safe-area-inset-left, 0px) + var(--space-4)); }
.lc-modal.is-immersive .lc-capture-col .lc-hud-next-btn:not(:disabled) { display: inline-flex; }
.lc-modal.is-immersive .lc-capture-hint { display: none; }
.lc-modal.is-immersive .lc-auto-toggle { height: var(--touch-h); padding: 0 var(--space-3); }

/* Rotated phone held in landscape: shutter at the right edge, secondary controls in the corners */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .lc-modal.is-immersive .lc-controls { --shutter: 56px; top: 0; padding-top: var(--space-3); pointer-events: none; }
  .lc-modal.is-immersive .lc-left-controls,
  .lc-modal.is-immersive .lc-capture-col,
  .lc-modal.is-immersive .lc-right-controls,
  .lc-modal.is-immersive .lc-mask-toggle-btn { pointer-events: auto; }
  .lc-modal.is-immersive .lc-left-controls { position: absolute; left: var(--space-4); bottom: var(--space-3); }
  .lc-modal.is-immersive .lc-capture-col { position: absolute; top: 50%; right: var(--space-4); transform: translateY(-50%); }
  .lc-modal.is-immersive .lc-right-controls { position: absolute; right: var(--space-4); bottom: var(--space-3); }
  .lc-modal.is-immersive .lc-capture-col .lc-hud-next-btn { left: auto; right: 0; transform: none; }
  .lc-modal.is-immersive .lc-mask-toggle-btn { position: static; margin: 0; }
}

/* ── Warnings and tips boxes ─────────────────────────────────────── */
.lc-warnings, .lc-tips { flex: none; margin: 0 var(--space-4); }
.lc-warnings.hidden { display: none; }
.lc-warnings-list { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.lc-warnings-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.lc-tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-4); }
.lc-tip { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.lc-tip-text { min-width: 0; }

/* ── Evidence gallery ────────────────────────────────────────────── */
.lc-gallery-row { position: relative; display: flex; flex: none; flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-3) var(--space-6); }
.lc-gallery-groups { display: flex; flex-direction: column; gap: var(--space-3); }
.lc-gallery-group { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.lc-gallery-group-label { display: flex; align-items: center; gap: var(--space-2); }
.lc-gallery-thumbs { display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-1); overflow-x: auto; overflow-y: visible; }
.lc-thumb-wrap { position: relative; flex: none; }
.lc-thumb-video { gap: 0; }
.lc-gallery-row .lc-gallery-sheet-close { display: none; position: absolute; top: var(--space-2); right: var(--space-2); }
.lc-gallery-empty { padding: var(--space-1) 0; }
.lc-modal.is-immersive.is-gallery-open .lc-gallery-row { display: flex; position: absolute; right: 0; bottom: 0; left: 0; z-index: 30; max-height: 48vh; padding-top: var(--space-8); padding-right: var(--space-4); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-4)); padding-left: var(--space-4); overflow-y: auto; }
.lc-modal.is-immersive.is-gallery-open .lc-gallery-row .lc-gallery-sheet-close { display: inline-grid; }

/* ── Dialogs: preview, review, quality summary, camera error ─────── */
.lc-preview-stage { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.lc-preview-stage img, .lc-preview-stage video { max-width: 100%; max-height: 60vh; min-width: 0; object-fit: contain; }
.lc-preview-stage img.hidden, .lc-preview-stage video.hidden { display: none; }
.fx-dialog-ft.lc-preview-footer { align-items: center; justify-content: space-between; }
.lc-review-groups { display: flex; flex-direction: column; gap: var(--space-4); --thumb-size: 64px; }
.lc-review-groups .lc-gallery-thumbs { flex-wrap: wrap; overflow: visible; }
.lc-confirm-rows { margin: 0; }
.lc-cam-error-thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.lc-cam-error-thumbs.hidden { display: none; }

/* ── Tooltip (appended to <body>, positioned from JS through --tip-x / --tip-y) ── */
.lc-problem-tooltip.fx-tooltip { position: fixed; top: var(--tip-y, 0); left: var(--tip-x, 0); z-index: var(--z-toast); display: grid; gap: var(--space-1); opacity: 0; pointer-events: none; transition: opacity 0.1s ease-out; }
.lc-problem-tooltip.is-open { opacity: 1; }
.lc-problem-tooltip-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* ── Phone, not immersive (the user left the camera layout): stack the chrome ── */
@media (max-width: 768px) {
  .lc-body .lc-steps { margin-right: var(--space-3); margin-left: var(--space-3); }
  .lc-step-sub { display: none; }
  .lc-warnings, .lc-tips { margin-right: var(--space-3); margin-left: var(--space-3); }
  .lc-tips-grid { grid-template-columns: 1fr; }
  .lc-gallery-row { padding-right: var(--space-4); padding-left: var(--space-4); }
  .lc-controls { padding-right: var(--space-3); padding-left: var(--space-3); }
  .lc-capture-hint { display: none; }
  .lc-auto-text { display: none; }
}
@media (max-width: 768px) and (orientation: portrait) {
  .lc-controls { --shutter: 72px; }
  /* CA-495: only on a phone held upright does the immersive row lack room for the guide-outline button; lift it above the right group */
  .lc-modal.is-immersive .lc-mask-toggle-btn { position: absolute; right: calc(env(safe-area-inset-right, 0px) + var(--space-4)); bottom: 100%; margin-bottom: calc(var(--space-1) * -1); }
}
/* --- css/components/25_sam.css --- */
/* ── 25_sam.css — interactive segmentation tools: LAYOUT ONLY ─────────
   Fullscreen preview (toolbar, mask panel, part bars), the Fleet photo-manager
   lightbox shell (the 3D-review photo panel d3-iv-* lives in 12_3d_map.css).
   Components come from the design system (css/ds/components-tools.css:
   fx-toolbar, fx-card--float, fx-seg, fx-list ...); nothing here sets colour,
   border, radius, font or shadow for the fullscreen preview. */

/* ── Fullscreen preview: work area ── */
.fs-viewport { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
.fs-canvas-wrapper { position: relative; display: inline-block; max-width: fit-content; }
#fs-canvas { display: block; max-width: none; max-height: none; cursor: grab; }
#fs-canvas-wrapper.sam-mode-active #fs-canvas { cursor: crosshair; }
.fs-status { justify-content: center; margin: var(--space-2) var(--space-4) 0; }
.fs-rect-overlay { position: fixed; inset: 0; width: 100%; height: 100%; z-index: calc(var(--z-dialog) + 1); display: none; pointer-events: none; }

/* Crosshair while SAM click mode is armed (Fleet lightbox) */
.pm-fs-stage.sam-mode-active,
.pm-fs-stage.sam-mode-active canvas {
  cursor: crosshair !important;
}

/* ── Fullscreen preview: pending part bar and selected-detection bar ── */
.fs-part-bar {
  position: absolute;
  top: calc(var(--appbar-h) + var(--space-12));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: calc(100% - var(--space-8));
  padding: var(--space-2) var(--space-3);
}
.fs-part-bar .fx-input { width: 220px; min-width: 0; }
#fs-yolo-select-bar { top: calc(var(--appbar-h) + var(--space-12) * 2 + var(--space-2)); }

/* ── Fullscreen preview: AI masks panel ── */
.fs-sam-panel {
  position: absolute;
  top: calc(var(--appbar-h) + var(--space-12));
  right: var(--space-4);
  width: 320px;
  max-height: calc(100% - var(--appbar-h) - var(--space-12) - var(--space-4));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fs-sam-body { display: grid; gap: var(--space-3); min-height: 0; overflow-y: auto; }
.fs-sam-panel-actions { display: flex; gap: var(--space-2); }
.fs-sam-panel-actions .fx-btn { flex: 1; }
.fs-sam-list .fx-list-item, .fs-sam-row { display: flex; align-items: center; gap: var(--space-2); min-height: 0; padding: var(--space-2) var(--space-3); }
.fs-sam-list .fx-select-wrap, .fs-sam-list .fx-input { flex: 1; min-width: 0; }
.fs-sam-empty { padding: var(--space-2) var(--space-3); }

/* History-image fullscreen mode: AI editing is meaningless on past analyses */
#fullscreen-modal.fs-history-mode .fs-sam-tools,
#fullscreen-modal.fs-history-mode .fs-sam-panel { display: none; }

/* ── Fleet photo-manager fullscreen lightbox (shell layout) ── */
.pm-fs-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  flex-direction: column;
}
.pm-fs-modal.hidden { display: none; }

.pm-fs-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
}
.pm-fs-close { margin-left: auto; }

.pm-fs-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: var(--space-3);
}

.pm-fs-stage { position: relative; }
.pm-fs-stage canvas {
  max-width: calc(100vw - 320px);
  max-height: calc(100vh - 110px);
  display: block;
}

/* The lightbox reuses the mask panel */
.pm-fs-modal .fs-sam-panel { top: var(--appbar-h); }

@media (max-width: 1024px) {
  .pm-fs-toolbar { flex-wrap: wrap; row-gap: var(--space-2); }
  .pm-fs-close { margin-left: 0; }
  .pm-fs-stage canvas {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 160px);
  }
}

/* ── Phones: bars and mask panel dock at the edges, controls reach touch size ── */
@media (max-width: 768px) {
  .fs-part-bar {
    top: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
    transform: none;
    flex-wrap: wrap;
    max-width: none;
  }
  #fs-yolo-select-bar { top: calc(var(--space-2) + var(--touch-h) + var(--space-12)); }
  .fs-part-bar .fx-input { flex: 1; width: auto; }
  .fs-sam-panel, .pm-fs-modal .fs-sam-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: 45dvh;
  }
  .fs-canvas-wrapper.rect-draw-mode canvas { touch-action: none; }
  .pm-fs-stage canvas { max-height: calc(100dvh - 200px); }
}

/* ── Guided tour popover content ── */
.sam-tour-body { display: grid; gap: var(--space-1); }
.sam-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sam-tour-nav { display: flex; gap: var(--space-2); }
/* --- css/components/26_fleet_tutorial.css --- */
/* analyst/static/css/components/26_fleet_tutorial.css — Fleet guided tour (CA-160). Layout and
   behaviour only: the spotlight and the tour card are design-system components (fx-tour-spot,
   fx-tour in ds/components-fleet.css). */

/* Phone frame (CA-425): on a computer the tour draws the phone screens (Scan, guided capture) inside the
   design-system phone (fx-device--phone, toggled by fleet_tutorial.js). The screen keeps a real phone's 390 x 844
   CSS px, so it lays out exactly as on a phone, and is scaled to the window (--fl-tour-phone-s) and placed so the
   tour card fits beside it (--fl-tour-phone-x). */
.fl-tour-phone.fx-device.fx-device--phone { position: fixed; inset: auto; left: var(--fl-tour-phone-x, 50%); top: 50%; width: 402px; height: 856px; max-width: none; transform: translate(-50%, -50%) scale(var(--fl-tour-phone-s, 1)); }
.fl-tour-phone .lc-modal { height: 100%; max-height: 100%; }

/* Track chooser rows */
.fl-tut-track { width: 100%; justify-content: space-between; align-items: center; gap: var(--space-3); text-align: left; }

/* ── Pointer events restriction during the tour ───────────────────── */
/* design-exception: the tour must make every page control inert except the tour card and the spotlighted target, whatever their own pointer-events */
body.tut-active * { pointer-events: none !important; }

body.tut-active .tut-tooltip,
body.tut-active .tut-tooltip *,
body.tut-active .tut-target,
/* design-exception: re-enables the tour card and the opted-in target over the rule above */
body.tut-active .tut-target * { pointer-events: auto !important; }

/* ── Client-demo tours (cfg.pausable / cfg.sheetOnPhone / transition cards): CA-309, shared by every module. The engine
   sets body.tut-demo and .tut-wide while such a tour runs, so the other module tours keep their own look. ── */
/* Step meta line (step n of N + chapter) */
.tut-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }

/* Transition card: acting-as badge, progress, result / error, actions */
.tut-transition { display: grid; gap: var(--space-2); justify-items: start; }
.tut-transition > * { max-width: 100%; }
.tut-transition .fx-progress { width: 100%; }
.tut-tr-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Floating resume control while the tour is paused (the page is fully usable) */
.tut-resume { position: fixed; right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); z-index: var(--z-toast); }

/* Phones: the tour card is a bottom sheet; the engine keeps the target visible above it */
/* design-exception: a step without a target keeps the dimmed backdrop but draws no ring */
body.tut-demo .fx-tour-spot.tut-nospot { outline: none; }

/* Desktop: room for the longest footer (pt / de / fr labels) on one row */
.tut-tooltip.fx-tour.tut-wide:not(.tut-sheet) { width: 460px; }

.tut-tooltip.tut-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 46dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
.tut-tooltip.tut-sheet .fx-card-ft { flex-wrap: nowrap; }

/* Computer, a target with no free side (CA-425): the page and its dialogs give up a column on the right and the tour
   card sits in it, so it never covers what it explains (tutorial_engine.js _dockedFor). */
body.tut-docked .fx-app { margin-inline-end: 492px; }
body.tut-docked .fx-scrim,
body.tut-docked .fx-screen,
body.tut-docked .fx-cam { right: 492px; }

/* A dialog that is open during the tour (confirm, estimate, MEMO, message...) stays usable above the overlay */
/* design-exception: re-enables the top-most open dialog over the tour's blanket pointer-events rule */
body.tut-active.tut-demo .tut-live-dialog,
body.tut-active.tut-demo .tut-live-dialog * { pointer-events: auto !important; }
/* design-exception: ring-only spotlight (no dimming) when the target sits inside a lifted dialog */
body.tut-demo .fx-tour-spot.tut-ring { box-shadow: none; }

/* Between steps the card stays up and glides to its next place (no blink to an empty overlay); while the next step
   prepares, its actions wait. Reduced motion: it jumps instead. */
@media (prefers-reduced-motion: no-preference) {
  body.tut-demo .tut-tooltip.fx-tour.active { transition: opacity .15s ease-out, top .22s ease-out, left .22s ease-out; }
}
body.tut-demo .tut-tooltip.tut-busy .fx-card-ft { pointer-events: none; }
/* --- css/components/27_advisor.css --- */
/* ================================================================
   27_advisor.css  —  Glass Authorization assistant chat widget (legacy)
   ================================================================
   Used ONLY by the Glass area's own assistant (modal_glass_advisor.html +
   js/pages/glass_advisor.js). The AI Fleet Advisor now uses the design-system
   chat component (css/ds/components-chat.css, fx-chat-*); delete this file
   when the Glass assistant adopts it too.
   ================================================================ */

.advisor-root { position: relative; z-index: 9000; }

/* Shared baseline nudge for every inline SVG icon this widget generates
   (see icon() in advisor.js) — keeps stroke icons visually centred next to
   adjacent text instead of sitting on the text baseline. */
.advisor-icon-svg { vertical-align: -2px; flex-shrink: 0; }

/* ── FAB ─────────────────────────────────────────────────────── */
/* Ordinary bottom-right corner — the Fleet page's old .tut-start-btn FAB
   this used to stack above (see git history) was folded into the account
   menu as a plain menu item, so this is the only fixed-position control
   left in this corner on every page. */
.advisor-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 130%);
  box-shadow: 0 8px 24px rgba(255, 27, 109, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 9000;
  transition: transform .18s ease, box-shadow .18s ease;
}
.advisor-fab:hover  { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 28px rgba(255, 27, 109, 0.45), 0 2px 6px rgba(0,0,0,.3); }
.advisor-fab:active { transform: translateY(0) scale(0.97); }

.advisor-fab-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: .55;
  animation: advisor-pulse 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes advisor-pulse {
  0%   { transform: scale(0.85); opacity: .55; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.advisor-fab-icon-close { display: none; }
.advisor-fab-active .advisor-fab-icon-chat  { display: none; }
.advisor-fab-active .advisor-fab-icon-close { display: block; }
.advisor-fab-active .advisor-fab-ring       { display: none; }

/* ── Panel shell (glassmorphism) ─────────────────────────────── */
.advisor-panel {
  position: fixed;
  right: 24px;
  /* FAB bottom (24) + FAB height (58) + gap (12) */
  bottom: 94px;
  width: 400px;
  height: min(640px, calc(100dvh - 200px));
  max-height: calc(100dvh - 200px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border-hi);
  background: linear-gradient(180deg, rgba(17, 25, 38, 0.86) 0%, rgba(12, 16, 24, 0.92) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 27, 109, 0.08);
  z-index: 9001;
  overflow: hidden;
  transform-origin: bottom right;
  animation: advisor-panel-in .22s cubic-bezier(.2, .9, .3, 1.3);
}
:root[data-theme="light"] .advisor-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(240, 244, 248, 0.94) 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(230, 0, 80, 0.10);
}
.advisor-panel.hidden { display: none; }

@keyframes advisor-panel-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ──────────────────────────────────────────────────── */
.advisor-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.advisor-header-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.advisor-header-glyph {
  display: inline-flex;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
  flex-shrink: 0;
}
.advisor-header-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.advisor-header-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-hi);
}
.advisor-header-sub {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.advisor-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.advisor-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, border-color .12s, background .12s;
}
.advisor-icon-btn:hover { color: var(--text-hi); background: var(--surface-hi); border-color: var(--border-hi); }

/* ── History dropdown ────────────────────────────────────────── */
.advisor-history-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  /* Anchored under the history button — header-actions now holds 3 icon
     buttons (history, fullscreen, close) at 28px + 4px gap each. */
  right: 78px;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  z-index: 20;
  padding: 6px;
}
.advisor-history-dropdown.hidden { display: none; }
.advisor-history-loading, .advisor-history-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.advisor-history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.advisor-history-item:hover { background: var(--surface); }
.advisor-history-item-main { min-width: 0; flex: 1; }
.advisor-history-item-title {
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.advisor-history-item-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 2px;
}
.advisor-history-item-delete {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s;
}
.advisor-history-item-delete:hover { color: var(--red); background: rgba(220, 38, 38, 0.12); }

/* ── Tabs bar ────────────────────────────────────────────────── */
.advisor-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.advisor-tabs-list {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.advisor-tabs-list::-webkit-scrollbar { display: none; }

.advisor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 148px;
  padding: 5px 6px 5px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .12s, background .12s;
}
.advisor-tab:hover { border-color: var(--border-hi); }
.advisor-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.advisor-tab-label {
  font-size: 10.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.advisor-tab.active .advisor-tab-label { color: #fff; }
.advisor-tab-close {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.advisor-tab-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }

.advisor-new-tab-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px dashed var(--border-hi);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, border-color .12s;
}
.advisor-new-tab-btn:hover { color: var(--accent); border-color: var(--accent); border-style: solid; }

/* ── Messages area ───────────────────────────────────────────── */
.advisor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.advisor-msg { display: flex; animation: advisor-msg-in .22s ease; }
@keyframes advisor-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.advisor-msg-user      { justify-content: flex-end; }
.advisor-msg-assistant { justify-content: flex-start; }
.advisor-msg-error     { justify-content: flex-start; }

.advisor-bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-word;
}
.advisor-bubble-user {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 130%);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.advisor-bubble-assistant {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.advisor-bubble-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #f3a3a3;
  border-bottom-left-radius: 4px;
}

.advisor-bubble-assistant p { margin: 0 0 8px; }
.advisor-bubble-assistant p:last-child { margin-bottom: 0; }
.advisor-h { font-family: var(--mono); color: var(--text-hi); margin: 4px 0 6px; letter-spacing: .5px; }
.advisor-list { margin: 0 0 8px 18px; padding: 0; }
.advisor-list li { margin-bottom: 3px; }

/* ── Markdown tables (comparisons, VIN/plate lists, etc.) ────── */
.advisor-table-wrap {
  overflow-x: auto;
  margin: 4px 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.advisor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.advisor-table th,
.advisor-table td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.advisor-table thead th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-hi);
  background: var(--surface-lo);
  border-bottom: 1px solid var(--border-hi);
  white-space: nowrap;
}
.advisor-table tbody tr:last-child td { border-bottom: none; }
.advisor-table tbody tr:hover { background: var(--surface); }
.advisor-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
:root[data-theme="light"] .advisor-table tbody tr:nth-child(even) { background: rgba(15, 23, 42, 0.025); }
.advisor-table td .advisor-pill { margin: 0; }

.advisor-inline-code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.advisor-code-block {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-x: auto;
  margin: 4px 0 8px;
}
.advisor-bubble-assistant a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.advisor-usage {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .5px;
  color: var(--muted);
  opacity: .8;
}

/* ── Entity pills (deep-link badges embedded in markdown) ─────── */
.advisor-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: 1px solid;
  cursor: pointer;
  margin: 0 2px;
  vertical-align: baseline;
  transition: transform .1s ease, opacity .1s ease;
}
.advisor-pill:hover { transform: translateY(-1px); opacity: .88; }
/* Vehicle/session/damage/client/contract colour + the damage variant's
   severity modifiers below all derive their border/background tint from the
   same semantic CSS var as their text color via color-mix() — never a
   hardcoded hex — so they automatically track 1_variables.css (incl. the
   light theme's own --blue/--teal/--red overrides) instead of drifting out
   of sync with it. Background tint is intentionally strong (26%) rather
   than a barely-there wash — these need to read as colored chips at a
   glance inside a dense bulleted breakdown, not blend into the surrounding
   bubble text. */
.advisor-pill-vehicle {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  background: color-mix(in srgb, var(--blue) 26%, transparent);
}
.advisor-pill-session {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 55%, transparent);
  background: color-mix(in srgb, var(--teal) 26%, transparent);
}
/* Client pill uses the brand accent (pink) rather than --accent-dim — the
   latter is a solid purple hex in dark theme but an already-translucent
   rgba in light theme (see 1_variables.css), which color-mix() would
   double-fade into an almost invisible border/background there. */
.advisor-pill-client {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
/* Contract pill uses --crimson — a darker/more muted red than the
   catastrophic-damage pill's bright --red, distinguishable at a glance
   rather than clashing with it. */
.advisor-pill-contract {
  color: var(--crimson);
  border-color: color-mix(in srgb, var(--crimson) 55%, transparent);
  background: color-mix(in srgb, var(--crimson) 26%, transparent);
}
/* Default/unknown severity — neutral amber, same as before */
.advisor-pill-damage {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: color-mix(in srgb, var(--amber) 26%, transparent);
}
/* Severity-specific damage pill colours (advisor.js appends one of these as
   a modifier class once it knows the damage's severity — see
   renderEntityPill/parseEntityRef) — minor→green, moderate→amber,
   severe→orange, catastrophic→red, mirroring the same semantic ladder
   .sev-minor/.sev-moderate/.sev-severe/.sev-critical already use elsewhere
   (8_chips_badges.css) for damage severity badges. */
.advisor-pill-damage-minor {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
  background: color-mix(in srgb, var(--green) 24%, transparent);
}
.advisor-pill-damage-moderate {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: color-mix(in srgb, var(--amber) 24%, transparent);
}
.advisor-pill-damage-severe {
  color: var(--orange);
  border-color: color-mix(in srgb, var(--orange) 55%, transparent);
  background: color-mix(in srgb, var(--orange) 24%, transparent);
}
.advisor-pill-damage-catastrophic {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 55%, transparent);
  background: color-mix(in srgb, var(--red) 24%, transparent);
}

/* ── Standalone severity value badge ([severity:LEVEL] — see
   renderSeverityBadge in advisor.js) ───────────────────────────
   Deliberately smaller/lighter than a full .advisor-pill: no border, no
   icon, no click affordance — it's a colored VALUE, not a navigable entity,
   so it shouldn't visually compete with the real entity pills around it. */
.advisor-severity-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 5px;
  margin: 0 1px;
  vertical-align: baseline;
}
.advisor-severity-minor        { color: var(--green);  background: color-mix(in srgb, var(--green) 20%, transparent); }
.advisor-severity-moderate     { color: var(--amber);  background: color-mix(in srgb, var(--amber) 20%, transparent); }
.advisor-severity-severe       { color: var(--orange); background: color-mix(in srgb, var(--orange) 20%, transparent); }
.advisor-severity-catastrophic { color: var(--red);    background: color-mix(in srgb, var(--red) 20%, transparent); }

/* ── Tool-use indicator cards ─────────────────────────────────── */
.advisor-tool-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.advisor-tool-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.advisor-tool-card.done { color: var(--text); }
.advisor-tool-spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  border-top-color: var(--accent);
  flex-shrink: 0;
  animation: advisor-spin .7s linear infinite;
}
@keyframes advisor-spin { to { transform: rotate(360deg); } }
.advisor-tool-check {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.advisor-tool-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Typing indicator ─────────────────────────────────────────── */
.advisor-typing { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.advisor-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: advisor-bounce 1.2s ease-in-out infinite;
}
.advisor-typing span:nth-child(2) { animation-delay: .15s; }
.advisor-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes advisor-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.advisor-caret {
  display: inline-block;
  width: 2px;
  height: 12px;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: advisor-caret-blink 0.9s step-end infinite;
}
@keyframes advisor-caret-blink { 50% { opacity: 0; } }

/* ── Loading skeleton (tab history fetch) ─────────────────────── */
.advisor-loading-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 0;
}

/* ── Empty state + suggestion chips ───────────────────────────── */
.advisor-empty-state {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px 4px;
}
.advisor-empty-icon {
  display: flex;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent-glow));
  margin-bottom: 2px;
}
.advisor-empty-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-hi);
}
.advisor-empty-sub {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 260px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.advisor-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.advisor-suggestion-chip {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.advisor-suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Daily digest — "Today's Briefing" card (empty-state only) ──── */
.advisor-digest-card {
  width: 100%;
  max-width: 320px;
  text-align: left;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.advisor-digest-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--muted);
  padding: 0 2px;
}
.advisor-digest-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.advisor-digest-dismiss:hover { color: var(--text); }

.advisor-digest-row.advisor-suggestion-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--border-hi);
}
.advisor-digest-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.advisor-digest-msg { font-size: 11.5px; line-height: 1.4; }

.advisor-digest-critical { border-left-color: var(--red); }
.advisor-digest-critical .advisor-digest-dot { background: var(--red); }
.advisor-digest-warning  { border-left-color: var(--orange); }
.advisor-digest-warning  .advisor-digest-dot { background: var(--orange); }
.advisor-digest-info     { border-left-color: var(--blue); }
.advisor-digest-info     .advisor-digest-dot { background: var(--blue); }

/* ── Input bar ─────────────────────────────────────────────────── */
.advisor-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.advisor-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 20px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.4;
  padding: 9px 12px;
  outline: none;
  transition: border-color .12s;
}
.advisor-input:focus { border-color: var(--accent); }
.advisor-input::placeholder { color: var(--muted); }

.advisor-send-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s, transform .12s;
}
.advisor-send-btn:hover  { opacity: .87; }
.advisor-send-btn:active { transform: scale(.93); }

/* ── Fullscreen toggle (desktop-or-mobile, on demand — see
   #advisor-fullscreen-btn in advisor.js) ─────────────────────── */
.advisor-panel.advisor-fullscreen {
  right: 0;
  bottom: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border: none;
}

/* ── Responsive: a compact panel under 768px, same as desktop just
   resized to fit — NOT a forced full-screen takeover. That used to apply
   unconditionally here, so opening the chat at all (even just the FAB tap,
   before ever touching the explicit fullscreen toggle) covered the entire
   screen on mobile — .advisor-panel.advisor-fullscreen (above, applies at
   every width already) is the only thing that should do that, triggered
   only by #advisor-fullscreen-btn. ────────────────────────────────── */
@media (max-width: 768px) {
  .advisor-panel:not(.advisor-fullscreen) {
    right: 8px;
    left: 8px;
    /* Clears the fixed 70px mobile footer bar (see 29_footer_feedback.css)
       the FAB itself is docked into — a flat offset, same pattern used
       elsewhere in this app for fixed elements that must sit above it. */
    bottom: 78px;
    width: auto;
    height: min(70vh, calc(100dvh - 190px));
    max-height: min(70vh, calc(100dvh - 190px));
  }
}

/* ── Hide advisor when any modal is open ─────────────────────── */
.overlay:not(.hidden) ~ .advisor-root,
.modal-overlay:not(.hidden) ~ .advisor-root,
.overlay:not(.hidden) ~ #advisor-widget-root,
.modal-overlay:not(.hidden) ~ #advisor-widget-root {
  display: none !important;
}

/* ── Phones (CA-102, absorbed from 40_fleet_mobile.css): panel never wider than the
   viewport. ── */
@media (max-width: 768px) {
  .advisor-panel { max-width: calc(100vw - 16px) !important; box-sizing: border-box; }
  .advisor-panel input, .advisor-panel textarea { font-size: 16px; }
}
/* --- css/components/28_translate.css --- */
/* ================================================================
   28_translate.css - language picker dropdown (core/lang_picker.js)
   ================================================================ */

.lang-dropdown {
    position: relative;
    display: inline-block;
    font-family: var(--sans);
}

/* Float in corner for login/register pages */
.lang-dropdown-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

/* Discreet, icon-btn-sized trigger — matches the other nav icon buttons
   (#theme-btn, #history-btn: 30x30, bordered, no fill). Only the flag shows;
   the language name/code lives in the open panel below, not the button. */
.lang-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-sm, 4px);
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.lang-dropdown-btn:hover {
    border-color: var(--border-hi);
}

.lang-dropdown-btn .lang-flag-svg {
    box-shadow: none;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

/* Text label next to the flag — only shown once relocated into the account
   menu on mobile (.lang-dropdown-mobile below); the top-nav trigger stays
   icon-only, matching #theme-btn/#history-btn. */
.lang-dropdown-label {
    display: none;
}

.lang-flag-svg {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

:root[data-theme="light"] .lang-flag-svg {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* Glassmorphism panel */
.lang-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: rgba(12, 16, 24, 0.85); /* fallback */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-hi);
    border-radius: var(--r-md, 6px);
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px var(--accent-glow);
    z-index: 10010;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Floating login position correction */
.lang-dropdown-floating .lang-dropdown-panel {
    right: 0;
}

/* Mobile: lang_picker.js relocates the whole dropdown into the account menu
   panel (see relocateLangDropdownForViewport) — restyle the trigger to read
   as a normal full-width account-menu-item row (icon + "Language" label)
   instead of the small square icon-only button meant for the top nav bar.
   The dropdown panel itself is untouched (still an absolute-positioned
   flyout, just now anchored to this row instead of the top-nav icon). */
.lang-dropdown-mobile {
    display: block;
    width: 100%;
}
.lang-dropdown-mobile .lang-dropdown-btn {
    /* Matches .account-menu-item (base/2_layout.css) exactly, so this reads
       as just another row in the same list. */
    width: 100%;
    height: auto;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--r-sm);
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--text);
}
.lang-dropdown-mobile .lang-dropdown-btn:hover {
    background: var(--surface);
    color: var(--text-hi);
    border-color: transparent;
}
.lang-dropdown-mobile .lang-dropdown-label {
    display: inline;
}

.lang-dropdown-panel.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
    pointer-events: none;
    display: none !important;
}

/* Dropdown show state animation class */
.lang-dropdown-panel:not(.hidden) {
    display: flex !important;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--r-sm, 4px);
    color: var(--text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-dropdown-item:hover {
    background: var(--surface-hi);
    color: var(--text-hi);
}

.lang-dropdown-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
}

/* Adjustments for light theme compatibility */
:root[data-theme="light"] .lang-dropdown-panel {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* --- css/components/29_footer_feedback.css --- */
/* ================================================================
   29_footer_feedback.css  —  Compact footer bar · FAB · Feedback modal
   ================================================================ */

/* ── Compact fixed footer bar ────────────────────────────────────
   Overrides the base .app-footer / .page-footer which are already
   position:fixed; bottom:0. We just re-style the interior.       */
.app-footer,
.page-footer {
  text-align: left !important;
  padding: 0 !important;
  height: 70px !important;
  margin: 0 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: var(--surface) !important;
  border: none !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0 !important;
  z-index: 1200 !important;
}

/* Hide footer when modals are open — .fullscreen-modal (the image preview's
   own fullscreen viewer, see modal_fullscreen_preview.html) is neither an
   .overlay nor a .modal-overlay, so it needs its own clause here too:
   without it, the footer's z-index (1200) sat above the fullscreen modal's
   own (300) and its fixed bottom:0 bar covered the fullscreen controls. */
/* .mm-closing = an overlay still playing its exit animation (7_modals.css);
   it already carries .hidden, so it must count as open here or the footer
   pops back in under the fading modal. */
body:has(.overlay:is(:not(.hidden), .mm-closing)) .app-footer,
body:has(.overlay:is(:not(.hidden), .mm-closing)) .page-footer,
body:has(.modal-overlay:is(:not(.hidden), .mm-closing)) .app-footer,
body:has(.modal-overlay:is(:not(.hidden), .mm-closing)) .page-footer,
body:has(.fullscreen-modal:not(.hidden)) .app-footer,
body:has(.fullscreen-modal:not(.hidden)) .page-footer {
  display: none !important;
}

/* ease the footer back in once the modal is fully gone */
@keyframes footerFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .app-footer, .page-footer { animation: footerFadeIn .2s ease-out; }
}





/* The single-line footer inner layout */
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 90px 0 18px;
  height: 36px;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  opacity: .85;
  transition: opacity .15s;
}
.footer-brand-logo:hover { opacity: 1; }
.footer-brand-logo img {
  height: 14px;
  width: auto;
}
.footer-brand-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-hi);
  text-transform: uppercase;
  display: none;
}
.footer-copyright {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .5px;
  color: var(--muted);
  white-space: nowrap;
}

.footer-center {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
.footer-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .5px;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
}
.footer-nav-link svg { flex-shrink: 0; opacity: .7; transition: opacity .15s; }
.footer-nav-link:hover {
  color: var(--text-hi);
  background: var(--surface-hi);
}
.footer-nav-link:hover svg { opacity: 1; color: var(--accent); }
/* Desktop shows the full label inline; .footer-nav-short is mobile-only
   (stacked under the icon instead — see the mobile breakpoint below). */
.footer-nav-short { display: none; }
.footer-nav-sep {
  color: var(--border-hi);
  font-size: 10px;
  user-select: none;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.footer-feedback-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-sm);
  padding: 3px 9px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.footer-feedback-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}
.footer-feedback-btn svg { flex-shrink: 0; }

/* ── Mobile Responsive Footer Bar (Sleek Icon Dock) ────────────────── */
@media (max-width: 768px) {
  .app-footer,
  .page-footer {
    padding-bottom: max(2px, env(safe-area-inset-bottom)) !important;
    background: var(--surface) !important;
    border-top: 1px solid var(--border-hi) !important;
  }

  .footer-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    /* Grown from 38px to fit the stacked icon+label tabs below (34px tall)
       — safe up to the outer .app-footer/.page-footer's own fixed 70px
       (unchanged, see the .fleet-jobs-bar comment in 23_vehicles_page.css
       for why that outer number must never drift out of sync here). */
    height: 52px !important;
    padding: 0 6px !important;
    gap: 6px !important;
  }

  .footer-left {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    background: var(--surface-hi) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 4px 7px !important;
  }

  .footer-brand-logo img {
    height: 13px !important;
    width: auto !important;
  }

  /* Hide copyright text on mobile to avoid duplication and save space */
  .footer-copyright {
    display: none !important;
  }

  .footer-center {
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    flex-shrink: 1 !important;
    flex-wrap: nowrap !important;
    gap: 2px !important;
    overflow: visible !important;
  }

  .footer-nav-sep {
    display: none !important;
  }

  /* Stacked icon-over-label tab, not icon-only — five bare icons in a row
     (Privacy/Terms/Data/Docs/Changelog) read as an unlabelled row of near-
     identical boxes on a small screen; a short word under each icon is what
     actually makes each one identifiable at a glance. .footer-nav-full is
     the desktop-only long label (see the non-mobile rule above); the
     changelog's small version tag has no room here either. */
  .footer-nav-full,
  .footer-changelog-version {
    display: none !important;
  }
  .footer-nav-short {
    display: block !important;
    /* Was 7px, single-line — sized for English's short words (Privacy,
       Terms, Data, Docs). Portuguese's equivalents (Privacidade,
       Documentação, Atualizações) are noticeably longer and simply
       overflowed the fixed-width box below at that size. Shrunk further
       and allowed to wrap onto a second line (normal, not nowrap) instead
       of forcing every language into English's box. */
    font-size: 6.3px !important;
    line-height: 1.15 !important;
    letter-spacing: 0.1px !important;
    white-space: normal !important;
    text-align: center !important;
    max-width: 100%;
  }

  .footer-nav-link {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    /* Both grown slightly (36→40, 34→40) to give the now-two-line label
       above room to wrap into instead of just clipping sooner. */
    width: 40px !important;
    height: 40px !important;
    padding: 2px 1px !important;
    border-radius: 8px !important;
    background: var(--surface-hi) !important;
    border: 1px solid var(--border) !important;
    flex-shrink: 0 !important;
    text-decoration: none !important;
    /* Safety net, not the primary fix — the size/wrap changes above are
       meant to make this unnecessary in practice, but a still-longer
       label in some other language should clip cleanly inside the box's
       own rounded corners rather than visually bleed into the icon next
       to it. */
    overflow: hidden !important;
  }

  .footer-nav-link svg {
    width: 13px !important;
    height: 13px !important;
    stroke: var(--accent) !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .footer-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .footer-feedback-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-family: var(--mono) !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: var(--accent) !important;
    background: var(--accent-glow) !important;
    border: 1px solid var(--accent-dim) !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
  }

  .footer-feedback-btn span {
    display: inline !important;
  }

  .footer-feedback-btn svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
  }
}






/* ── Feedback modal ──────────────────────────────────────────────── */
#feedback-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#feedback-modal-overlay.hidden { display: none; }

#feedback-modal {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  width: min(500px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  animation: fb-modal-in .22s ease;
}
@keyframes fb-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fb-modal-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-hi);
  text-transform: uppercase;
}
.fb-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
  line-height: 1;
}
.fb-modal-close:hover { color: var(--text-hi); border-color: var(--border-hi); }

.fb-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Step dots */
.fb-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
}
.fb-step-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border-hi);
  transition: background .2s, transform .2s;
}
.fb-step-dot.active  { background: var(--accent); transform: scale(1.5); }
.fb-step-dot.done    { background: var(--teal); }
.fb-step-line        { flex: 1; height: 1px; background: var(--border); }

/* Step 1 — type picker */
.fb-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fb-type-card {
  background: var(--surface-hi);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, transform .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.fb-type-card:hover { border-color: var(--border-hi); background: var(--surface); transform: translateY(-1px); }
.fb-type-card.selected { border-color: var(--accent); background: var(--accent-glow); }
.fb-type-card.selected .fb-type-icon { background: var(--accent-glow); border-color: var(--accent-dim); }
.fb-type-card:hover .fb-type-icon   { border-color: var(--border-hi); }

.fb-type-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background .15s, border-color .15s;
}
.fb-type-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-hi);
}
.fb-type-desc { font-size: 10.5px; color: var(--muted); line-height: 1.35; }

/* Step 2 — form */
.fb-field { margin-bottom: 12px; }
.fb-label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 4px;
}
.fb-label .fb-optional { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* Stars — plain <button>s (not <span>s) specifically so a tap actually
   fires onclick on the first touch: a non-form element with a :hover style
   gets treated by iOS Safari as needing one tap just to "reveal" :hover,
   with the real click only registering on a second tap — which is exactly
   what read as "only selects a star, then corrects itself on the next
   click". Buttons don't have that quirk. */
.fb-stars { display: flex; gap: 4px; margin-top: 3px; }
.fb-star {
  font-size: 20px;
  cursor: pointer;
  color: var(--border-hi);
  transition: color .1s, transform .1s;
  user-select: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}
.fb-star.active,
.fb-star.preview { color: var(--amber); transform: scale(1.15); }

/* Step 3 — success */
.fb-success { text-align: center; padding: 16px 10px 8px; }
.fb-success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(13,148,136,.1);
  border: 2px solid rgba(13,148,136,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  animation: fb-success-pop .45s ease;
}
@keyframes fb-success-pop {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}
.fb-success-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-hi);
  margin-bottom: 6px;
}
.fb-success-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }
.fb-success-email-note {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--teal);
  background: rgba(13,148,136,.08);
  border: 1px solid rgba(13,148,136,.22);
  border-radius: var(--r-sm);
  padding: 5px 10px;
}

.fb-modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fb-char-count { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.fb-char-count.over { color: var(--red); }

/* Email notice row */
.fb-email-notice {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 6px 9px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 10.5px;
  color: var(--muted);
}

/* ── Admin feedback tab ───────────────────────────────────────────── */
.fb-admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.fb-admin-stat {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: center;
}
.fb-admin-stat-val { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text-hi); }
.fb-admin-stat-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.fb-admin-stat.open .fb-admin-stat-val        { color: var(--amber); }
.fb-admin-stat.in-progress .fb-admin-stat-val  { color: var(--blue); }
.fb-admin-stat.resolved .fb-admin-stat-val     { color: var(--teal); }

.fb-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 20px;
  font-family: var(--mono); letter-spacing: .4px;
}
.fb-type-badge.bug        { background: rgba(220,38,38,.12); color: var(--red); }
.fb-type-badge.suggestion { background: rgba(59,130,246,.12); color: var(--blue); }
.fb-type-badge.feedback   { background: rgba(107,45,141,.12); color: #a855f7; }
.fb-type-badge.praise     { background: rgba(217,119,6,.12); color: var(--amber); }

.fb-status-badge {
  display: inline-block;
  font-size: 9px; font-family: var(--mono); font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase;
  padding: 2px 5px; border-radius: 3px;
}
.fb-status-badge.open        { background: rgba(217,119,6,.12); color: var(--amber); }
.fb-status-badge.in_progress { background: rgba(59,130,246,.12); color: var(--blue); }
.fb-status-badge.resolved    { background: rgba(13,148,136,.12); color: var(--teal); }
.fb-status-badge.wontfix     { background: var(--surface-hi); color: var(--muted); }

.fb-row {
  display: flex; gap: 8px; align-items: center;
  padding: 9px 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-hi);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 5px;
  text-align: left;
}
.fb-row:hover { border-color: var(--border-hi); background: var(--surface); }
.fb-row-main  { flex: 1; min-width: 0; }
.fb-row-subject { font-size: 12px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-row-meta  { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.fb-rating-stars { color: var(--amber); font-size: 10px; letter-spacing: -1px; }

.fb-detail-panel {
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  padding: 14px;
  margin-top: 10px;
  margin-bottom: 12px;
}
.fb-detail-body {
  font-size: 12.5px; color: var(--text); line-height: 1.65;
  white-space: pre-wrap;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin: 8px 0;
}

/* ── Feedback modal: bottom sheet on phones (CA-102) ─────────────── */
@media (max-width: 768px) {
  #feedback-modal-overlay { padding: 0; align-items: flex-end; }
  #feedback-modal {
    width: 100vw; max-width: 100vw; max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    animation: fb-sheet-in .25s ease;
  }
  .fb-modal-header { padding-top: 14px; }
  .fb-modal-close { min-width: 44px; min-height: 44px; }
  .fb-modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .fb-type-grid { grid-template-columns: 1fr; }
  .fb-type-card { min-height: 56px; }
  .fb-modal-body input, .fb-modal-body textarea, .fb-modal-body select { font-size: 16px; min-height: 44px; }
  .fb-star { min-width: 44px; min-height: 44px; }
  .fb-modal-footer { flex-wrap: wrap; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .fb-modal-footer button { min-height: 44px; }
  .fb-email-notice { font-size: 12px; }
}
@keyframes fb-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Phones (CA-102): footer dock controls get a 44px touch area ──── */
@media (max-width: 768px) {
  .footer-feedback-btn, .footer-nav-link { position: relative; min-height: 44px; }
  .footer-feedback-btn::after, .footer-nav-link::after { content: ""; position: absolute; inset: -4px; }
}
/* --- css/components/30_changelog.css --- */
/* ================================================================
   30_changelog.css  —  What's New / Release History modal
   ================================================================ */

.changelog-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.changelog-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Every version — including the current one — is a collapsed-by-default
   <details> the reviewer opens deliberately, so browsing old releases
   doesn't mean scrolling past a wall of already-expanded change lists (see
   changelog.js::_renderEntries). No JS toggle listeners needed — same
   pure-CSS details[open] arrow pattern as the report groups in
   9_report.css.

   Every entry — latest or not — shares the SAME horizontal inset, so the
   arrow/badge column lines up vertically all the way down the list. The
   latest entry only ADDS vertical padding + a background/border wrapped
   around that same inset (see .changelog-version-latest below) — it used
   to carry its own all-sides padding while every other entry had none,
   which shifted just its arrow/badge column inward relative to the rest
   of the list instead of highlighting it in place. */
.changelog-version-group {
  contain: layout style paint;
  padding: 0 10px;
  margin: 0 -10px;
}
.changelog-version-group + .changelog-version-group {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* The newest entry (always index 0 — entries arrive sorted newest-first,
   see get_all_entries in core/changelog.py) is set apart from the rest of
   the history with an accent-tinted card instead of the plain list styling
   every older entry gets. */
.changelog-version-latest {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-md);
}
.changelog-version-latest + .changelog-version-group {
  border-top: none;
  margin-top: -6px;
}

.changelog-version-hd {
  /* Explicit reset — <summary> carries its own UA-stylesheet defaults
     (list-item display, inline-start padding reserved for the native
     disclosure triangle) that vary enough across browsers to leave
     collapsed rows starting at slightly different x-positions from each
     other, or from the expanded change-list content below them, once the
     native marker is hidden without also zeroing out the box it sat in. */
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.changelog-version-hd::-webkit-details-marker,
.changelog-version-hd::marker {
  display: none;
  content: '';
}

/* details[open] pushes the change list down from the summary row — no gap
   at all while collapsed, since there's nothing below to separate from. */
.changelog-version-group[open] > .changelog-version-hd {
  margin-bottom: 10px;
}

/* Fixed-width box (not just a bare glyph) so every row's badge starts at
   the exact same x-position regardless of glyph rendering width, and the
   arrow itself is centered within it rather than sitting on its own
   baseline. */
.changelog-version-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  font-size: 9px;
  color: var(--accent);
  transition: transform .15s;
  flex-shrink: 0;
}
.changelog-version-arrow::before { content: '▸'; }
.changelog-version-group[open] > .changelog-version-hd .changelog-version-arrow {
  transform: rotate(90deg);
}

.changelog-version-badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.changelog-latest-badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 1px;
  color: #fff;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
}

.changelog-date {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.changelog-change-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changelog-change-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.changelog-change-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding-top: 1px;
}

/* Type chip — same bordered/tinted-background convention as .verdict-chip
   etc. in 8_chips_badges.css, one color per commit-message type this repo
   already uses (MASTER: <type> - <message>), so the /update-changelog
   skill maps one directly to the other with no extra taxonomy to learn. */
.changelog-type-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid;
  margin-top: 1px;
}

.changelog-type-add      { color: #16a34a; border-color: #16a34a44; background: #16a34a10; }
.changelog-type-fix      { color: #dc2626; border-color: #dc262644; background: #dc262610; }
.changelog-type-improve  { color: var(--blue); border-color: #3b82f644; background: #3b82f610; }
.changelog-type-refactor { color: #d97706; border-color: #d9770644; background: #d9770610; }
.changelog-type-remove   { color: var(--muted); border-color: var(--border-hi); }

/* Footer link's small version tag (see partials/footer.html + changelog.js) */
.footer-changelog-version {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  margin-left: 3px;
}

/* ── Phones (CA-102): full-screen sheet (sizing in 7_modals.css), 44px targets ─────────────────────────────── */
@media (max-width: 768px) {
  #changelog-overlay .icon-btn { min-width: 44px; min-height: 44px; }
  #changelog-body { padding: 14px !important; -webkit-overflow-scrolling: touch; }
  #changelog-overlay .modal-ft { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  #changelog-overlay .modal-ft .btn-primary { width: 100%; min-height: 48px; }
  .changelog-version-hd { min-height: 48px; flex-wrap: wrap; gap: 6px 8px; }
  .changelog-change-item { gap: 8px; align-items: flex-start; }
  .changelog-change-text { font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
  .changelog-date { font-size: 11px; }
}
/* --- css/components/31_notifications.css --- */
/* ── Notification bell + dropdown panel ──────────────────────────────
   Bell button reuses .icon-btn (base/2_layout.css) with a small unread
   badge overlay; dropdown reuses the same positioning recipe as
   .account-menu-panel (top-nav's account menu). */

.notif-btn-wrap { position: relative; display: inline-flex; }

@keyframes notifBadgePop {
  0%   { transform: scale(0.4); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  /* Replays every time the badge goes from hidden -> shown (unread count
     0 -> 1+), the same "animation restarts on display:none exit" behaviour
     the modals rely on — a quick "something arrived" pop rather than a
     silent number appearing. */
  animation: notifBadgePop var(--dur-base) var(--ease-out-back);
}
.notif-badge.hidden { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
  z-index: 300;
  transform-origin: top right;
  animation: dropdownIn var(--dur-base) var(--ease-out-soft);
}
.notif-panel.hidden { display: none; }

.analysis-started-toast {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid var(--accent, #e90052);
  border-radius: 7px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}
.analysis-started-toast.visible { opacity: 1; transform: translateY(0); }
.analysis-started-toast svg { width: 20px; flex: 0 0 20px; color: var(--accent, #e90052); }
.analysis-started-toast div { min-width: 0; display: grid; gap: 3px; }
.analysis-started-toast strong { font-size: 12px; letter-spacing: 0; }
.analysis-started-toast span { color: var(--muted, #667085); font-size: 11px; line-height: 1.35; }

.notif-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-hi, var(--text));
  text-transform: uppercase;
}
.notif-mark-all-read {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.notif-mark-all-read:hover { text-decoration: underline; }

.notif-panel-body {
  overflow-y: auto;
  flex: 1;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast), opacity var(--dur-base);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2, var(--surface-lo)); }
.notif-item:active { background: var(--border, var(--surface-lo)); }
.notif-item-read { opacity: .55; }

.notif-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--muted);
}
.notif-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.notif-sev-critical { border-left-color: var(--red); }
.notif-sev-warning   { border-left-color: var(--orange); }
.notif-sev-info      { border-left-color: var(--blue); }

.notif-item-main { flex: 1; min-width: 0; }

.notif-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-hi, var(--text));
  margin-bottom: 2px;
}
.notif-item-message {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.notif-item-time {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
}

.notif-item-mark-read {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out-soft);
}
.notif-item-mark-read:hover { color: var(--accent); border-color: var(--accent); }
.notif-item-mark-read:active { transform: scale(0.88); }

.notif-job-progress-container {
  display: block;
  width: calc(100% + 24px);
  margin-left: -12px;
  margin-right: -12px;
  height: 3px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
  margin-top: 8px;
}

.notif-job-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 2px;
  transition: width var(--dur-fast);
}

.notif-job-phase {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Mobile: full-screen sheet ─────────────────────────────────── */
.notif-panel-close { display: none; }
@media (max-width: 768px) {
  .notif-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: none;
    border-radius: 0;
    transform-origin: center bottom;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .notif-panel-hd {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    gap: 8px;
  }
  .notif-panel-title { flex: 1; font-size: 14px; }
  .notif-mark-all-read { min-height: 44px; padding: 0 10px; font-size: 13px; }
  .notif-panel-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
    color: var(--text-hi, var(--text)); font-size: 26px; line-height: 1; cursor: pointer;
  }
  .notif-item { padding: 14px 14px; min-height: 56px; overflow-wrap: anywhere; }
  .notif-item-title { font-size: 14px; }
  .notif-item-message { font-size: 13px; }
  .notif-item-mark-read { min-width: 44px; min-height: 44px; }
  .notif-job-phase { font-size: 12px; }
  .notif-job-progress-container { height: 5px; }
  .analysis-started-toast { left: 12px; right: 12px; width: auto; max-width: none; top: calc(64px + env(safe-area-inset-top, 0px)); }
}
/* --- css/pages/34_windshield.css --- */
/* 34_windshield.css - Glass analysis page (templates/windshield.html), the shared damage review
   (panel_windshield_review.html, also embedded in Glass Authorization) and the glass report
   (components/glass_report.js). CA-160: LAYOUT ONLY. Every colour, border, radius, font and shadow
   comes from the design system (css/ds/*), so nothing here styles a component. */

/* ── Page: input column + result area ─────────────────────────────── */
.ws-layout { display: grid; grid-template-columns: var(--fx-split, minmax(300px, 380px)) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.ws-layout.is-analysing { grid-template-columns: minmax(0, 1fr); }
.ws-layout.is-analysing .ws-input { display: none; }
.ws-input { position: relative; display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.ws-stack { display: grid; gap: var(--space-3); }
.ws-or { margin: 0; text-align: center; }
.ws-preview-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ws-preview-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-preview-actions { display: flex; flex: none; gap: var(--space-1); }

.ws-result { display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.ws-result-hd { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ws-results-wrap { display: grid; gap: var(--space-4); min-width: 0; }

/* ── Loading: quantified meter + stage list ───────────────────────── */
.ws-loading-state { width: 100%; max-width: 560px; margin: 0 auto; }
.ws-loading-body { display: grid; gap: var(--space-5); }
.ws-meter { display: grid; gap: var(--space-2); }
.ws-meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.ws-progress-steps { display: grid; gap: var(--space-4); }
.ws-stage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ws-stage-counters { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ── Damage review (page and Glass Authorization modal): the fx-viewer shell of the bodywork review ── */
.ws-review-panel { flex: 1; min-height: 0; }
.ws-review-nav { max-width: 100%; overflow-x: auto; }
.ws-review-panel .ws-view-switch { display: none; flex: 0 0 auto; }
.ws-view-switch .fx-tab { flex: 1 1 0; justify-content: center; min-width: 0; height: var(--touch-h); }
.ws-review-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; flex: 1; align-items: stretch; min-height: 0; overflow-y: auto; }
.ws-review-media { --annotate-max-h: 62vh; min-height: 0; }
.ws-review-stagebox { padding: var(--space-3); }
.ws-review-side { min-height: 0; overflow-y: auto; }
.ws-review-list-sec { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ws-review-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ws-review-item { gap: 0; padding: 0; }
.ws-review-row { padding: var(--space-3); cursor: pointer; }
.ws-review-row .fx-list-text { flex: 1; min-width: 0; }
.ws-review-panel .ws-card-top { display: none; }
.ws-review-side, .ws-review-list, .ws-review-item, .ws-card, .ws-card-body, .ws-card-grid { min-width: 0; }
.ws-card-top .fx-viewer-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-card-body { gap: var(--space-3); padding: var(--space-3); }
.ws-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--space-3); }
.ws-card-grid > * { min-width: 0; }
.ws-card-span { grid-column: 1 / -1; }
.ws-card-more > .fx-disclosure-bd { padding-top: var(--space-2); }
.ws-card-foot { flex-wrap: wrap; padding: var(--space-3); }
.ws-card-foot-tools, .ws-card-foot-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.ws-card-foot-main { flex: 1 1 100%; flex-wrap: nowrap; }
.ws-card-foot-main .fx-btn { flex: 1 1 0; min-width: 0; justify-content: center; }
.ws-review-ft { flex-wrap: wrap; align-items: center; justify-content: space-between; }
.ws-review-ft-btns { display: flex; gap: var(--space-2); }

/* ── CA-538: the review hosted in a dialog (Glass Authorization case modal, Admin inspection links) ──
   The dialog title is the one header (the viewer's own heading steps aside); the review fills the dialog body and
   scrolls inside it, so the footer stays at the bottom of the dialog and never covers the photo or the list. ── */
.glass-review-dialog.is-review > .fx-dialog-bd { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.glass-review-dialog.is-review .ws-review-panel { flex: 1 1 auto; min-height: 0; }
.glass-review-dialog.is-review .ws-review-panel .fx-viewer-heading { display: none; }
.glass-review-dialog.is-review .ws-review-panel .fx-viewer-bar { justify-content: flex-end; }

/* ── Glass report (components/glass_report.js) ────────────────────── */
.glass-report { min-width: 0; }   /* CA-542: the grid is the bodywork .arp layout (54_analysis_report.css) */
.glass-report .arp-tabs .fx-tab { flex: none; }
.gr-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-content: start; min-width: 0; }
.gr-panel[hidden] { display: none; }
.gr-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.gr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.gr-grade { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }
.gr-grade-text { display: grid; gap: var(--space-1); min-width: 200px; flex: 1; }
.gr-audit { display: grid; gap: var(--space-4); }
.gr-audit-phase { display: grid; gap: var(--space-2); }
.gr-stats { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; }
.gr-list { display: grid; gap: var(--space-1); margin: 0; padding-left: var(--space-5); }
.gr-tip-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.gr-row-name { display: flex; align-items: center; gap: var(--space-2); }

/* ── Glass Authorization lightbox (templates/glass.html keeps the older markup) ── */
.overlay > .ws-lightbox-inner { position: relative; display: flex; align-items: center; justify-content: center; width: min(92vw, 1400px); height: min(88vh, 1000px); }
.overlay > .ws-lightbox-inner img { max-width: 100%; max-height: 100%; object-fit: contain; }
.overlay > .ws-lightbox-inner .ws-lightbox-close { position: absolute; top: -44px; right: 0; }
.overlay > .ws-lightbox-inner .ws-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
.overlay > .ws-lightbox-inner .ws-lightbox-prev { left: -8px; }
.overlay > .ws-lightbox-inner .ws-lightbox-next { right: -8px; }
.overlay > .ws-lightbox-inner .ws-lightbox-caption { position: absolute; bottom: -34px; left: 0; right: 0; text-align: center; }

/* ── Tablet ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ws-layout { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); gap: var(--space-4); }
  .ws-layout.is-analysing { grid-template-columns: minmax(0, 1fr); }
  .ws-review-body { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* ── Phone: one column, steps first, one sticky primary action ────── */
@media (max-width: 768px) {
  .ws-layout { display: flex; flex-direction: column; gap: var(--space-4); }
  .ws-result { order: -1; }
  .ws-empty { display: none; }
  .ws-steps .fx-step:not([aria-current="step"]) > span { display: none; }
  .ws-input .fx-sticky-action { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); margin: 0 calc(-1 * var(--space-4)); }
  .ws-review-panel.fx-viewer { flex: 0 0 auto; overflow: visible; }
  .ws-review-panel .ws-view-switch { display: flex; }
  .ws-review-body { display: flex; flex-direction: column; flex: 0 0 auto; overflow-y: visible; }
  .ws-review-panel .ws-review-media { --annotate-max-h: 50vh; flex: 0 0 auto; overflow: visible; }
  .ws-review-panel .ws-review-stagebox { flex: 0 0 auto; }
  .ws-review-side { overflow-y: visible; }
  .ws-review-panel[data-ws-view="photo"] .ws-review-side,
  .ws-review-panel[data-ws-view="list"] .ws-review-media { display: none; }
  .ws-card-grid { grid-template-columns: minmax(0, 1fr); }
  .ws-review-row { min-height: var(--touch-h); }
  .ws-review-list:has(> .is-open) > .ws-review-item:not(.is-open),
  .ws-review-item.is-open > .ws-review-row,
  .ws-review-list-sec:has(.is-open) > .fx-viewer-side-hd,
  .ws-review-panel:has(.ws-review-item.is-open) .ws-review-hints,
  .ws-card-foot-tools { display: none; }
  .ws-review-panel .ws-card-top { display: flex; position: sticky; top: 0; z-index: 3; }
  .ws-card-foot { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 3; }
  .ws-card-foot-main .fx-btn { min-height: var(--touch-h); }
  .ws-review-panel:has(.ws-review-item.is-open) .ws-review-ft { display: none; }
  .ws-layout .ws-review-ft { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); flex-direction: column; align-items: stretch; }
  .ws-review-ft-btns { flex-direction: column-reverse; }
  .ws-review-ft-btns .fx-btn { width: 100%; }
  .ws-review-ft .fx-viewer-foot-note { display: none; }
  .glass-review-dialog.is-review { height: 100dvh; max-height: none; }
  .glass-review-dialog.is-review .ws-review-panel.fx-viewer { flex: 1 1 auto; overflow: hidden; }
  .glass-review-dialog.is-review .ws-review-panel .fx-viewer-bar { flex-wrap: nowrap; justify-content: space-between; }
  .glass-review-dialog.is-review .ws-review-nav { flex: 1 1 auto; min-width: 0; }
  .glass-review-dialog.is-review .ws-review-panel .fx-viewer-tools { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
  .glass-review-dialog.is-review .ws-review-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .glass-review-dialog.is-review .ws-review-panel .ws-review-media { flex: 0 0 auto; }
  .glass-review-dialog.is-review .ws-review-ft { position: static; flex: 0 0 auto; }
  .glass-review-dialog.is-review .ws-card-foot { bottom: 0; }
}
/* --- css/pages/35_glass_authorization.css --- */
/* analyst/static/css/pages/35_glass_authorization.css — Glass authorization page (/glass): LAYOUT ONLY.
   Every visual decision comes from the design system (ds/components.css, ds/components-glass.css).
   Breakpoints: 1024px (tablet) and 768px (phone). */

/* ── Restricted provider accounts: Glass is their only module (server-enforced), no history ── */
html.is-provider .fx-nav > a.fx-nav-item:not([data-area="glass"]),
html.is-provider .fx-nav-group,
html.is-provider #history-btn,
html.is-provider #profile-overlay [data-provider-hide] { display: none; }

/* ── Views ───────────────────────────────────────────────────────── */
.glass-body .glass-view-tabs, .glass-body .glass-crumb-back, .glass-body .glass-home-tiles, .glass-body .glass-stats-strip, .glass-body .glass-sticky-new { display: none; }
.glass-body .glass-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.glass-body .glass-cases-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-6); align-items: start; }
.glass-body .glass-cases-main, .glass-body .glass-cases-side { display: grid; gap: var(--space-4); min-width: 0; }
.glass-body .glass-kpi-company { max-width: 360px; }

/* ── Shared small layouts ────────────────────────────────────────── */
.glass-body .glass-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.glass-body .glass-form-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.glass-body .glass-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.glass-body .glass-badges .glass-report-btn { margin-left: auto; }
.glass-body .glass-grow { flex: 1; min-width: 0; }
.glass-body .glass-plain-list { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.glass-body .glass-breakdown-row { display: grid; gap: var(--space-1); }
.glass-body .glass-breakdown-label { display: flex; justify-content: space-between; gap: var(--space-2); }
.glass-body .glass-case-name { display: grid; gap: 2px; }
.glass-body .glass-row-link { cursor: pointer; }
.glass-body #glass-case-list td.fx-num, .glass-body .glass-badges .fx-badge { white-space: nowrap; }
.glass-body .glass-provider-cell { display: flex; align-items: center; gap: var(--space-3); }
.glass-body .glass-provider-cell-text { display: grid; gap: var(--space-1); min-width: 120px; }
.glass-body .glass-home-tiles .fx-tile > span { display: grid; gap: 2px; }
.glass-body .glass-autofill-status { display: flex; align-items: center; gap: var(--space-2); }
.glass-body .glass-draft-hd { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.glass-body .glass-comms-card .fx-card-hd, .glass-body .fx-dialog .fx-card-hd { flex-wrap: wrap; }
.glass-body .glass-lang-select { width: auto; }
.glass-body .glass-message-body { margin: 0; white-space: pre-wrap; }
.glass-body .glass-tab-panel { padding-top: var(--space-2); }
.glass-body .glass-steps { margin: var(--space-1) 0; }

/* ── Case detail: the dialog keeps one size whatever the active tab; header, badges, stepper and tab bar stay put, only the panel scrolls ── */
.glass-body .glass-detail-dialog { height: min(760px, calc(100vh - 64px)); }
.glass-body .glass-detail-dialog > .glass-detail-body { display: flex; flex-direction: column; gap: var(--space-4); flex: 1 1 auto; min-height: 0; overflow: hidden; }
.glass-body .glass-detail-body > * { flex: none; }
.glass-body .glass-detail-body > .glass-tab-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 768px) {
  .glass-body .glass-detail-dialog { height: 92vh; }
}

/* ── Dialogs: the legacy footer and the closed assistant button step aside while a glass dialog is open;
   legacy overlays opened from a glass dialog stay on top of it ── */
.glass-body:has(.glass-scrim:not(.hidden)) .app-footer,
.glass-body:has(.glass-scrim:not(.hidden)) #glass-advisor-widget-root:not(.glass-advisor-active),
.glass-body:has(#glass-filter-pop:not(.hidden)) #glass-advisor-widget-root:not(.glass-advisor-active),
.glass-body:has(#glass-lightbox:not(.hidden)) #glass-advisor-widget-root:not(.glass-advisor-active) { display: none; }
.glass-body #custom-confirm-overlay, .glass-body #custom-alert-overlay, .glass-body #history-overlay,
.glass-body .glass-review-dialog.is-review > .fx-dialog-bd { padding: 0; }

/* ── Decision map ────────────────────────────────────────────────── */
.glass-body .glass-map-kpis { margin-bottom: var(--space-4); }
.glass-body .glass-map-kpis .fx-kpi { min-width: 0; }
.glass-body .glass-map-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: var(--space-4); align-items: stretch; }
.glass-body .glass-map-card { display: flex; flex-direction: column; height: clamp(600px, calc(100vh - 200px), 960px); min-height: 0; }
.glass-body .glass-map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); }
.glass-body .glass-map-canvas { flex: 1; margin: 0 var(--space-5) var(--space-5); }
.glass-body #glass-real-map { width: 100%; height: 100%; }
.glass-body #glass-real-map img.leaflet-tile { max-width: none; max-height: none; }
.glass-body .glass-map-timeline { position: absolute; z-index: 800; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); width: auto; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); }
.glass-body .glass-map-tl-main { flex: 1; min-width: 0; display: grid; gap: var(--space-1); }
.glass-body .glass-map-tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.glass-body .glass-map-tl-range { width: 100%; margin: 0; }
.glass-body .glass-map-legends { position: absolute; z-index: 700; right: var(--space-2); bottom: var(--space-3); display: grid; justify-items: end; gap: var(--space-1); }
.glass-body .glass-map-replaying .glass-map-legends { bottom: 88px; }
.glass-body .glass-map-legend-bars { display: none; }
.glass-body .glass-map-show-bars .glass-map-legend-bars { display: flex; }
.glass-body .glass-map-no-heat .glass-map-legend-heat { display: none; }
.glass-body .glass-map-bar-icon { overflow: visible; }
.glass-body .glass-map-side { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; min-height: 0; contain: size; }
.glass-body .glass-map-ranking { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.glass-body .glass-map-ranking-bd { flex: 1; min-height: 0; overflow-y: auto; }
.glass-body .glass-rank-item .fx-list-text { gap: var(--space-1); }
.glass-body .glass-map-contact { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.glass-body .glass-map-contact-info { display: grid; gap: 2px; min-width: 0; }
.glass-body .glass-map-popup { display: grid; gap: var(--space-2); min-width: 220px; }
.glass-body .glass-map-card.is-pseudo-fullscreen { position: fixed; inset: 0; z-index: var(--z-dialog); height: 100vh; }
.glass-body .glass-map-card.is-fullscreen { height: 100vh; }
.glass-body .glass-map-card.is-fullscreen .glass-map-detail { position: absolute; z-index: 900; top: 72px; right: var(--space-4); width: min(360px, calc(100% - 32px)); max-height: calc(100% - 96px); overflow-y: auto; }
body.glass-map-pseudo-fs { overflow: hidden; }

/* ── Assistant (fx-fab / fx-chat): opened from inside glass dialogs, so it sits above them ── */
.glass-body #glass-advisor-panel, .glass-body #glass-advisor-widget-root.glass-advisor-active #glass-advisor-fab { z-index: calc(var(--z-dialog) + 10); }
.glass-body .glass-cases-side .fx-card-bd:has(.glass-attention-list) { padding: var(--space-2) var(--space-3) var(--space-3); }
.glass-body .glass-advisor-sources, .glass-body .glass-advisor-grounding, .glass-body .glass-advisor-msg-images { margin-top: var(--space-2); }
.glass-body .glass-chip-menu { position: fixed; }

/* ── Tablet ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .glass-body .glass-view-tabs { display: flex; }
  .glass-body .glass-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glass-body .glass-cases-layout { grid-template-columns: minmax(0, 1fr); }
  .glass-body .glass-map-workspace { grid-template-columns: minmax(0, 1fr); }
  .glass-body .glass-map-side { contain: none; }
}

/* ── Phone: area home (KPI strip + tiles + case cards), sections with a back button ── */
@media (max-width: 768px) {
  .glass-body .glass-view-tabs, .glass-body .glass-stats, .glass-body .glass-cases-side { display: none; }
  .glass-body .glass-stats-strip { display: grid; }
  .glass-body .glass-stats-strip:empty { display: none; }
  .glass-body .glass-home-tiles { display: grid; }
  /* one full-width primary action, fixed above the bottom tabs; the list keeps room for it */
  .glass-body .glass-sticky-new { display: block; position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: var(--z-nav); }
  .glass-body #glass-cases-view { padding-bottom: calc(var(--touch-h-lg) + var(--space-8)); }
  .glass-body .glass-crumb-back { display: inline-grid; margin-left: calc(-1 * var(--space-3)); }
  .glass-body .glass-crumb-current { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
  .glass-body .glass-map-card { height: 88vh; }
  /* the assistant button sits above the bottom tabs and the sticky New case action */
  .glass-body #glass-advisor-fab { bottom: calc(var(--tabbar-h) + var(--touch-h-lg) + var(--space-8) + env(safe-area-inset-bottom, 0px)); right: var(--space-4); }
  .glass-body:not([data-glass-view="cases"]) #glass-advisor-fab { bottom: calc(var(--tabbar-h) + var(--space-4) + env(safe-area-inset-bottom, 0px)); }
  .glass-body .glass-map-canvas { margin: 0 var(--space-3) var(--space-3); }
  .glass-body .glass-map-controls { padding: var(--space-3); }
  .glass-body .glass-map-timeline { flex-wrap: wrap; }
  .glass-body .glass-map-legends { display: none; }
  .glass-body .glass-form-actions .fx-btn { width: 100%; }
  .glass-body .glass-chip-menu { left: var(--space-2); right: var(--space-2); top: auto; bottom: calc(var(--tabbar-h) + var(--space-2)); }
}

/* ── Indicators: company filter and test-data tools on one row ─────── */
.glass-kpi-bar { align-items: flex-end; }
.glass-kpi-bar .glass-kpi-company { flex: 0 1 360px; min-width: 0; }
.glass-kpi-tools:empty { display: none; }
@media (max-width: 768px) {
  .glass-kpi-bar .glass-kpi-company, .glass-kpi-tools { flex: 1 1 100%; margin-left: 0; }
  .glass-kpi-tools .fx-cluster { justify-content: stretch; }
  .glass-kpi-tools .fx-btn { flex: 1 1 0; }
}
/* --- css/components/39_progress_meter.css --- */
/* ================================================================
   39_progress_meter.css — Shared quantified-progress component: LAYOUT ONLY
   ================================================================
   js/components/progress_meter.js renders the design-system progress block
   (fx-progress-block: label + percent line, fx-progress bar, stage line);
   this file only sizes and places it.
   ================================================================ */
.pm { width: 100%; max-width: 420px; margin: 0 auto; }
.pm-compact { max-width: none; }

/* Host element the meter is mounted into (e.g. the processing screen) */
.pm-host { width: 100%; max-width: 420px; margin-top: var(--space-4); }
.pm-host > .pm { max-width: none; }

@media (max-width: 768px) {
  .pm, .pm-host { max-width: 100%; min-width: 0; }
}
/* --- css/base/24_responsive.css --- */
/* ================================================================
   24_responsive.css  —  Global Mobile Responsiveness Overrides
   ================================================================ */

/* ── Hamburger button (hidden on desktop) ────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
  order: 3;
}
.nav-hamburger:hover {
  color: var(--text-hi);
  border-color: var(--border-hi);
}

/* Animated 3-line → ✕ icon */
.nav-hamburger .hbg-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .22s ease, opacity .15s ease;
  position: relative;
}
.nav-hamburger .hbg-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

/* Open state – animate to ✕ */
.top-nav.nav-open .nav-hamburger .hbg-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.top-nav.nav-open .nav-hamburger .hbg-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.top-nav.nav-open .nav-hamburger .hbg-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Tablets and smaller (max-width: 1024px) ─────────────────── */
@media (max-width: 1024px) {
  /* Allow top nav to stack or wrap more easily */
  .top-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    /* Was height:auto/min-height:58px — .top-nav-tabs is hidden and every
       remaining child (brand, hamburger, actions) fits one row at this
       breakpoint, so auto-sizing bought no real flexibility, just a risk of
       landing a px or two under --nav-h and leaving a sliver gap above
       .rp-tabs (9_report.css), which sits fixed right at top: var(--nav-h)
       expecting this box to end exactly there. */
    height: var(--nav-h);
    padding: 8px 16px;
    gap: 12px;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    /* 95 keeps it above ordinary scrolling page content and .sidebar-tabs (90), while remaining below modals (100+). */
    z-index: 95 !important;
    background: var(--surface);
  }
  
  .top-nav-tabs {
    display: none !important;
  }

  .sidebar-tabs {
    position: fixed !important;
    top: 58px !important;
    left: 0 !important;
    right: 0 !important;
    /* Same reasoning as .top-nav above — must stay below every modal/overlay
       (100+), not above it. This was 999, which (independently of .top-nav's
       own now-fixed z-index) is exactly why the VEHICLES/CLIENTS/CONTRACTS
       bar kept bleeding through the confirm dialog, the 3D damage review,
       and the guided-capture camera HUD even after .top-nav was fixed. */
    z-index: 90 !important;
  }

  /* html/partials/analyst_subnav.html's Bodywork/Windshield bar — same fix
     as .sidebar-tabs just above: .top-nav going position:fixed at this
     breakpoint pulls it out of flow, so .analyst-subnav (a plain in-flow
     sibling right after </nav>) would otherwise render at the very top of
     the page, hidden underneath the now-fixed nav instead of below it. Only
     ever present on index.html/windshield.html, so this is a no-op
     everywhere else. --subnav-h is measured live by
     core/nav-init.js::syncSubnavHeight (0 when the element is absent). */

  /* Page content that used to just flow below .analyst-subnav in normal
     flow now needs its own top clearance for BOTH fixed bars — .top-nav's
     (already handled per-page, see the .layout/.db-page/.admin-page rule
     and #app's own children below) plus .analyst-subnav's own height on
     top of that. Scoped via the sibling combinator so it only ever matches
     on the two pages that actually render the bar. */

  
  /* Once analysis-fullscreen hides .analyst-subnav entirely (2_layout.css),
     this reserved top padding must collapse too — otherwise a
     --subnav-h-tall blank gap is left at the top of #app where the bar
     used to be, on exactly the phone-width screens this matters most on. */

  .nav-tab {
    padding: 6px 12px;
    font-size: 10.5px;
  }
  
  .top-nav-brand {
    order: 1;
  }
  
  .top-nav-actions {
    order: 2;
  }

  /* Core layout flows vertically instead of side-by-side */
  html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* html's own base rule (1_variables.css) locks it to height:100dvh —
       exactly one viewport tall, never more — which was never reset here.
       overflow-y:auto only creates scroll when a child overflows that
       box, so leaving the box itself pinned at exactly the viewport's
       height left nothing to actually trigger it. */
    height: auto !important;
    /* html/body's own base rule (1_variables.css) sets
       overscroll-behavior:none on BOTH of them, to stop an inner
       scrollable's overscroll from chaining into whatever's behind it
       (a modal body dragging the backdrop with it). That's the right call
       when something ELSE is the real scroll root and these two are just
       passive ancestors — but here html itself IS the scroll root, and
       some mobile engines have been observed treating
       overscroll-behavior:none on the actual scrolling element itself as
       "nothing to chain to, so don't bother starting the gesture at all"
       rather than "chain nowhere, but still scroll me" — auto restores
       the ordinary rubber-band/chain behavior specifically where html is
       doing the real scrolling. */
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body,
.layout {
    flex-direction: column;
    height: auto !important;
    min-height: 100% !important;
    margin-bottom: 0 !important;
    min-width: 0;
  }
  /* Was overflow-y:visible — body's BASE rule (1_variables.css) sets the
     shorthand overflow:hidden (both axes) unconditionally; body's own
     overflow-x:hidden!important further down keeps that axis hidden at
     this breakpoint, and per spec a 'visible' value paired with a
     non-visible value on the other axis is supposed to compute as if it
     were 'auto' — but that's a rarely-exercised corner of the Overflow
     spec, not something to depend on for whether the page can scroll at
     all on a touch device. auto here says explicitly what's meant,
     instead of relying on every engine converting visible the same way.
     CA-160: body's x axis is now clip (below), which has no such pairing, so
     visible stays visible - and body is no scroll container, so the shell's
     position:sticky sidebar and top bar keep working (html scrolls). */
  body {
    overflow-y: visible !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* #app/.layout do NOT get the same auto (unlike body just above) — they
     have zero overflowing content of their own here (height:auto above
     means they're always exactly as tall as what's inside them, so
     nothing ever actually overflows THEM specifically; html is the real
     scroll root, per its own overflow-y:auto rule above). An element with
     overflow-y:auto still gets recognised as an independent touch-scroll
     target on some mobile browsers even with nothing to scroll inside it,
     silently swallowing the gesture instead of letting it bubble up to
     body/html — this is the actual cause of "can only scroll starting
     from the header/footer": .top-nav/the footer are position:fixed
     siblings of #app (not inside it), so touches there never pass through
     #app's overflow:auto claim, while every touch on the main content
     does. CA-46: this rule only ever reset overflow-y, leaving #app's/
     .layout's base overflow-x:hidden (2_layout.css) in place — that IS
     exactly the visible+non-visible corner case body's own comment above
     warns about (it applies per-axis-pair, not just to body's specific
     combination), so overflow-y:visible was silently recomputing to auto
     right back again on mobile. Resetting both axes explicitly to visible
     removes the pairing entirely instead of depending on which axis holds
     which value. */
  .layout {
    overflow: visible !important;
    overflow-y: visible !important;
  }

  /* Safety net: a page-specific fix (min-width:0 on some deeply-nested grid
     item, an overflow-x:auto scroller) can always be missed somewhere — a
     stray wide chart canvas or table shouldn't be able to drag the whole
     page into sideways scroll. Individual scrollable regions (.admin-tabs,
     .admin-tab-body, etc.) keep their own overflow-x:auto so THEY still
     scroll internally; this just stops that overflow from escaping to the
     viewport. clip, not hidden: hidden turns body into a scroll container that
     never scrolls, which breaks every position:sticky inside it (the CA-160
     shell sidebar and top bar at tablet widths). */
  body {
    min-height: 100dvh !important;
    overflow-x: clip !important;
  }

  /* .top-nav goes position:fixed at this breakpoint (out of normal flow) —
     on desktop it's a normal flow sibling that pushes everything below it
     down for free, so only .layout (vehicles.html) had this compensating
     padding-top. .db-page (dashboard.html), .admin-page (admin.html) and
     .home-page (home.html) are that same "first child after .top-nav" role
     for their own pages and needed the exact same fix — without it their
     own page header rendered top-first, right underneath the fixed nav
     (on .home-page this clipped .home-hero's eyebrow/title behind the bar).
     #app (index.html/knowledge.html) does NOT need it — #input-panel/
     #results-panel already carry enough of their own top spacing that
     adding this on top just doubled up into a large empty gap. */
  .layout, .db-page, .admin-page, .home-page {
    flex: 1 1 auto !important;
    padding-top: 104px !important;
  }

  /* .ws-page (windshield.html, 34_windshield.css) and .glass-page (glass.html,
     35_glass_authorization.css) are the exact same "page shell with its own
     unconditional overflow-y:auto" shape as .content/.db-page/etc above —
     both pages were built after this reset bucket was written and were
     simply never added to it, so they kept reproducing CA-46's "can only
     scroll from the header/footer" bug on mobile after it was already fixed
     everywhere else. Same fix, same reasoning as every other entry here. */
  .sidebar,
.sidebar-panel,
.content,
.db-page,
.admin-page,
.home-page,
.ws-page,
.glass-page {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto;
    flex: none;
    overflow: visible !important;
    overflow-y: visible !important;
    margin-bottom: 0 !important;
    padding-bottom: 70px !important;
  }

  /* Second-level containers NESTED inside the page shells just above —
     each one of these is the actual scrollable "body" of its page (the
     per-tab admin content, the analyst/KB sidebar's own scroll area, the
     fleet sidebar's vehicle list), with its own unconditional
     overflow-y:auto that survives the shells above going overflow:visible.
     Same root cause and same fix as #results-states-wrap's own dedicated
     rule below: an element with overflow-y:auto still gets recognised as
     an independent touch-scroll target on some mobile browsers even with
     nothing (or not much) of its own to scroll, silently swallowing the
     gesture instead of letting it bubble up to body/html — this is what
     made scrolling only work from the header/footer (position:fixed
     siblings that never pass through any of these containers) and not
     from the actual page content on admin/vehicles/the analyst sidebar. */
  .admin-tab-body,
  .panel-scroll-area,
  .vehicle-list {
    overflow: visible !important;
    overflow-y: visible !important;
    flex: none !important;
    height: auto !important;
    /* admin.js renders SEVERAL .admin-tab-body panes with an INLINE
       style="overflow-y:auto;max-height:calc(100% - 52px)" (view page
       source on /admin to see it — e.g. #admin-pane-activity). The
       overflow-y half is already beaten by this rule's own !important
       above, but max-height is a DIFFERENT property this rule wasn't
       touching — overflow:visible with a max-height still in force
       doesn't let the box grow to fit its content, it lets the content
       paint outside a box that's still capped at that height for LAYOUT
       purposes, so the page never actually gains the extra scroll room
       and a touch over the "spilled" content lands outside the box
       html/body still think needs scrolling. !important is required here
       specifically to beat that inline style (inline beats a plain
       stylesheet rule; only !important in the stylesheet outranks it). */
    max-height: none !important;
  }

  /* #results-states-wrap (9_report.css) is NOT in the shared bucket above —
     it's a child of .results-panel, already covered by that rule's own
     padding-bottom, and doesn't need width/max-width overrides of its own.
     But its BASE rule (9_report.css) carries an unconditional
     overflow-y:auto for the desktop "results-panel scrolls internally,
     tabs stay pinned via position:sticky" layout — never reset for
     mobile, where .results-panel itself (just above) already goes
     height:auto/overflow:visible so html is the one and only scroll root.
     Left alone, this becomes exactly the same "auto with nothing (or
     something) of its own to scroll still claims the touch gesture
     instead of letting it bubble to html" trap #app/.layout had further
     up in this file — and unlike #app, this one usually DOES have real
     overflowing content (the damage report, narration log, ...), making
     it the more likely of the two to actually reproduce "can't scroll
     from the main content area" on a real results screen.

     !important on every property here, not just the usual reason for it
     in this file (mobile overriding desktop) — 9_report.css's own
     .results-panel:has(#analyst-3d-wrap.automated-mode) #results-states-wrap
     rule (no media query, applies at every width) outweighs a plain
     #results-states-wrap selector on specificity alone (its :has() adds an
     ID+class), so without !important THAT rule would silently win back
     overflow-y:auto on mobile specifically during phase1/phase2's
     automated-mode — exactly the state a mobile user is most likely to be
     scrolling a report in. */

  /* .action-area's own positioning on this breakpoint range (tablet: fixed
     to the screen's right edge; phone: a circular FAB) lives in the two
     dedicated blocks below, outside this shared 1024px block — see those
     for why. index.html's own inline script still physically relocates
     .action-area's DOM node next to #upload-section at this width (kept
     for the "User feedback (João Alves)" scroll-into-view/attention-pulse
     behaviour in _drawAttentionToAnalyzeButton(), core/app.js), but that
     DOM position no longer drives where it renders once it's
     position:fixed below. */

  .content {
    /* Add some visual separation */
    border-top: 2px solid var(--border);
  }

  .content,
.db-page,
.admin-page {
    padding-bottom: 70px !important;
  }
  
  /* Hide the resize handle on touch devices/small screens */
  .resize-handle {
    display: none !important;
  }

  /* Admin page — with COMPANIES/TRAINING DATA unhidden (superadmin) there
     are up to 8 tabs, wider than any phone viewport; without wrapping the
     flex row just overflowed .admin-page, dragging the whole page into
     horizontal scroll (nav, header, table — everything shifted sideways
     together, reading as "the layout is broken"). A horizontally-scrolling
     tab strip is a worse mobile pattern than just wrapping onto more
     rows — nothing hints there's more to scroll to, so wrap instead. */
  .admin-tabs {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .admin-tab {
    white-space: nowrap;
  }

  /* .admin-toolbar defaults to justify-content:flex-end for its normal
     single-row desktop layout — once flex-wrap forces a filter/search row
     onto several lines on a phone, flex-end applies PER LINE, so each
     wrapped control (severity/status/date filters, etc.) hugs the right
     edge with empty space on the left instead of reading as a normal
     stacked form. Left-align once wrapping is actually happening. */
  .admin-toolbar {
    justify-content: flex-start;
  }
  /* Every filter control carries its own inline max-width (e.g. 140px) for
     desktop's single-row layout — on a phone that just leaves each one
     narrow and left-hugging instead of using the row it already wrapped
     onto. Buttons are deliberately left alone: several short buttons
     (CLEAR FILTERS / SAVE AS ALERT, ACTIVITY LOG / SESSION REPLAYS) read
     better as a compact row than each stretched full-width and alone.
     Some controls sit directly in the toolbar, others inside their own
     <label> (the FROM/TO date fields) or .admin-field-group (the company
     picker) — the direct child (whatever it is) gets the full-width row,
     the input/select inside it (however deep) just loses its own cap. */
  .admin-toolbar > .text-input,
  .admin-toolbar > .admin-select,
  .admin-toolbar > select,
  .admin-toolbar > input,
  .admin-toolbar > label,
  .admin-toolbar > .admin-field-group {
    max-width: none !important;
    flex: 1 1 100%;
  }
  .admin-toolbar .text-input,
  .admin-toolbar .admin-select,
  .admin-toolbar select,
  .admin-toolbar input {
    max-width: none !important;
  }
  .admin-toolbar label .text-input,
  .admin-toolbar label input {
    flex: 1;
  }

  /* Every admin table (Users, Companies, Tokens, Activity, …) has more
     columns than a phone can show side by side — one of them (Permissions)
     is a whole grid of chips on its own. A horizontally-scrolling table was
     the first fix, but scrolling sideways just to read the next column is
     still an annoying way to read a list. Standard responsive-table
     pattern instead: drop the header row and turn each <tr> into a
     self-labeled card, stacking every <td> with its own data-label (set
     per table in admin.js) above the value. No data-label means no header
     text renders for that cell — harmless for the handful of icon-only/
     action columns that never had a meaningful header to begin with. */
  .admin-table thead {
    display: none;
  }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .admin-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    /* !important: several rows (activity/error/session logs) set their own
       inline white-space:nowrap + max-width + text-overflow:ellipsis for
       desktop's single-line columns — inline styles otherwise always beat
       a class rule, which would keep every long message/path truncated to
       one clipped line even after the row becomes a stacked card here. */
    white-space: normal !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
  }
  .admin-table tr td:last-child {
    border-bottom: none;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
  }
  /* A row's action buttons (Edit/Delete/Reset/…) otherwise stay on one
     nowrap line — several of them together are wider than a phone's own
     card width, clipping the last one or forcing this one cell back into
     horizontal scroll even though the rest of the table no longer needs
     it. Buttons themselves are unaffected (.btn/.icon-btn keep their own
     fixed sizing), they just flow onto a second line instead of clipping. */
  .admin-actions {
    flex-wrap: wrap;
  }
  .admin-table td button,
  .admin-table td .btn {
    max-width: 100%;
  }

  /* Modal responsive behavior */
  .modal-content, .modal {
    width: 95% !important;
    max-width: 95% !important;
    margin: 16px auto !important;
    max-height: 90vh !important;
  }
  
  /* Ensure grids in panels wrap */

  
  /* Parts selector panel should stack nicely */

}

/* ── Mobile Phones — Hamburger nav (max-width: 768px) ─────────── */
@media (max-width: 768px) {
  .brand-sub {
    display: none;
  }

  /* Helper to hide text on mobile buttons while keeping icons */
  .hide-on-mobile {
    display: none !important;
  }

  /* Switch nav to hamburger layout */
  .top-nav {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
  }

  /* Show the hamburger button */
  .nav-hamburger {
    display: flex;
  }

  /* Hide the tab row by default; it will slide down when open */
  .top-nav-tabs {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    padding: 8px 12px 12px;
    gap: 6px;
    order: 4;
    width: 100%;
    /* Collapsed: hidden above with clip + opacity */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height .28s ease, opacity .22s ease, padding .22s ease;
    z-index: 100;
    box-sizing: border-box;
  }

  /* Expanded state */
  .top-nav.nav-open .top-nav-tabs {
    max-height: 400px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
    font-size: 11px;
    gap: 10px;
    border-radius: var(--r-sm);
  }

  /* Brand stays left, hamburger and account trigger stay right (hamburger
     immediately left of the account button, account rightmost) — the
     hamburger's own order:3 (set once, unconditionally, in the non-mobile
     rule above) is what it's ordered against here. */
  .top-nav-brand {
    order: 1;
    flex: 1 1 0;
    min-width: 0;          /* allow it to shrink below content size */
    overflow: hidden;
  }
  .top-nav-brand .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-nav-actions {
    order: 4;               /* after .nav-hamburger's order:3 */
    flex-shrink: 0;        /* never squeeze action icons */
    gap: 4px;
  }
  /* Hide dividers inside the top nav action bar on mobile */
  .top-nav .header-divider {
    display: none;
  }

  /* Standalone theme/history/simple-mode/language icons crowd the bar next
     to the hamburger and the account trigger on a narrow screen — fold them
     into the account menu instead (see the matching .mobile-only-item
     buttons added right after #account-menu-username in every page's
     account-menu-panel; each just forwards a click to these same buttons,
     so the one real click handler on each never needs duplicating). The
     language dropdown is the one exception — lang_picker.js physically
     relocates that whole widget into the account panel on mobile instead
     (its popup panel is positioned relative to its own button, so a
     forwarded click from a differently-placed button wouldn't open it in
     the right place) — see relocateLangDropdownForViewport there. */

  .account-menu-item.mobile-only-item {
    display: flex;
  }

  /* Adjust panel headers */
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  
  
  
  .header-divider {
    display: none;
  }
  
  /* Modals take up full screen. Height is pinned to 100dvh (not 100%) so it
     tracks the actual visible viewport instead of chaining through
     position:fixed ancestors — that percentage chain is exactly what let the
     header (with the close button) and footer (with the action button) end
     up pushed off-screen with no way to reach them once the on-screen
     keyboard opened (tapping the date/time fields) or the mobile browser's
     address bar collapsed/expanded. */
  .modal-content, .modal {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  /* .modal-compact opts a simple confirm-style dialog (title + a line or
     two + Cancel/Confirm — e.g. #confirmModal, #cancelContractModal,
     #reasonModal) OUT of the edge-to-edge treatment above, which was built
     for actual forms (date pickers, multi-field inputs) that need the
     keyboard/address-bar safety it provides. A confirm dialog has no such
     field to push off-screen, so forcing it to fill the whole viewport just
     left a small message stranded at the top of a mostly-empty screen. */
  .modal.modal-compact {
    width: 92% !important;
    max-width: 420px !important;
    height: auto !important;
    max-height: 85vh !important;
    margin: auto !important;
    border-radius: var(--r-md) !important;
  }
  /* Safety net: if a modal ever ends up taller than the visible viewport
     anyway, the overlay itself scrolls instead of silently clipping the
     header/footer with no way to reach them. */
  .modal-overlay {
    overflow-y: auto;
  }

  .toast {
    max-width: 90vw !important;
    right: 5vw !important;
    font-size: 11px !important;
  }

  /* ── Timeline legend & controls responsiveness ── */
  .timeline-legend {
    padding: 0 16px 4px !important;
    gap: 8px 12px !important;
  }
  .timeline-controls {
    padding: 8px 16px 4px !important;
    gap: 8px !important;
  }
  .timeline-filter-group {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .timeline-axis-labels {
    padding: 0 16px !important;
  }

  
  
  .db-grid {
    grid-template-columns: 1fr;
  }
  
  
  
  .app-footer {
    padding: 16px;
    position: fixed !important;
    bottom: 0 !important;
  }

  /* Results summary hero: the fixed 3-column grid (verdict | divider | cost)
     plus 32px side padding and 36–38px font sizes is wider than a phone
     viewport with nothing to shrink it — it doesn't wrap, it just overflows,
     forcing the ENTIRE results panel wider than 100vw so everything below
     (damage cards, vehicle-inferred section, …) reads as "clipped" too even
     though their own CSS wraps fine. Stack it into a single column instead. */

  
  
  
  
}

/* ── Very small screens (max-width: 480px) ───────────────────── */
@media (max-width: 480px) {
  .top-nav {
    padding: 8px;
  }
  
  .brand-name {
    font-size: 12px;
  }
  
  
}

/* ── On-screen keyboard (FluxeDevice.installKeyboardAssist sets --kb-h) ──
   Lift centered modals and bottom sheets above the keyboard so their primary
   action stays reachable. 0 when no keyboard / when the browser already
   resizes the layout viewport. */
@media (max-width: 768px) {
  html.kb-open .modal-overlay,
  html.kb-open body.fm-page .fm-picker { padding-bottom: var(--kb-h, 0px); box-sizing: border-box; }
  html.kb-open .ar-sheet { bottom: var(--kb-h, 0px); }
}
/* --- css/components/40_mobile_sheets.css --- */
/* ================================================================
   40_mobile_sheets.css — global phone modal system (CA-102)
   Turns the app's shared dialog primitives into bottom sheets on
   <=768px for EVERY page:
     .overlay / .modal-overlay  >  .modal-content | .settings-panel | .modal
       header: .modal-hd | .modal-header     body: .modal-bd | .modal-body
       footer: .modal-ft | .modal-footer
   Confirm/alert-style dialogs (.confirm-panel, .modal-compact) become a
   compact centred card instead. Excluded (keep their own full-screen
   layout): Damage3D overlay, Live Capture, fullscreen previews, the legal
   doc reader / consent gate. Loaded after 7_modals.css, whose <=1024px
   "edge-to-edge" !important rules this deliberately supersedes.
   ================================================================ */
@media (max-width: 768px) {
  /* ── Overlay: dock the sheet to the bottom ─────────────────────── */
  :is(.overlay, .modal-overlay):has(:is(.modal-hd, .modal-header)):not(:has(.d3-panel, .lc-modal, .confirm-panel, .modal-compact, .fullscreen-container)):not(#doc-reader-overlay):not(#consent-enforcement-overlay) {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  /* Glass case detail switches between tabs with very different content
     lengths. Keep the sheet shell fixed; only its body scrolls. */
  #glass-detail-overlay > .glass-detail-panel {
    height: 94dvh !important;
    min-height: 94dvh !important;
    max-height: 94dvh !important;
  }
  #glass-detail-overlay > .glass-detail-panel > .glass-detail-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  .modal-overlay:has(.modal-wrapper) .modal-wrapper { align-items: flex-end !important; }

  /* ── The sheet ─────────────────────────────────────────────────── */
  :is(.overlay, .modal-overlay):not(:has(.d3-panel, .lc-modal, .confirm-panel, .modal-compact, .fullscreen-container)):not(#doc-reader-overlay):not(#consent-enforcement-overlay) > :is(.modal-content, .settings-panel, .modal, .modal-wrapper > .modal-content, :has(> :is(.modal-hd, .modal-header))),
  :is(.overlay, .modal-overlay):not(:has(.d3-panel, .lc-modal, .confirm-panel, .modal-compact, .fullscreen-container)):not(#doc-reader-overlay):not(#consent-enforcement-overlay) > .modal-wrapper > .modal-content {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 94dvh !important;
    margin: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--border-hi) !important;
    border-radius: 20px 20px 0 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .35);
    animation: mSheetIn .26s var(--ease-out-soft, ease-out);
  }
  /* grabber handle */
  :is(.overlay, .modal-overlay) > :is(.modal-content, .settings-panel, .modal, :has(> :is(.modal-hd, .modal-header)))::before,
  :is(.overlay, .modal-overlay) > .modal-wrapper > .modal-content::before {
    content: "";
    flex: 0 0 auto;
    width: 40px; height: 4px; margin: 8px auto 0;
    border-radius: 2px;
    background: var(--border-hi);
  }
  :is(.overlay, .modal-overlay):has(.d3-panel, .lc-modal, .confirm-panel, .modal-compact, .fullscreen-container, .fullscreen-modal) > *::before { content: none; }

  /* ── Sticky header with a 44px close ───────────────────────────── */
  :is(.overlay, .modal-overlay) :is(.modal-hd, .modal-header) {
    flex: 0 0 auto;
    position: sticky; top: 0; z-index: 2;
    min-height: 56px;
    padding: 10px 12px 10px 16px;
    background: var(--surface-hi);
    gap: 8px;
  }
  :is(.overlay, .modal-overlay) :is(.modal-hd, .modal-header) :is(.modal-close, .modal-close-btn, .icon-btn, [aria-label="Close"], [onclick*="close"]:not(.btn-primary):not(.btn-ghost):not(.btn)) {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }

  /* ── Scrollable body ───────────────────────────────────────────── */
  :is(.overlay, .modal-overlay) :is(.modal-bd, .modal-body) {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 14px 16px;
    overflow-wrap: anywhere;
  }
  :is(.overlay, .modal-overlay) :is(.modal-bd, .modal-body) :is(img, canvas, video) { max-width: 100%; height: auto; }

  /* ── Sticky footer, full-width stacked buttons (primary on top) ── */
  :is(.overlay, .modal-overlay) :is(.modal-ft, .modal-footer) {
    flex: 0 0 auto;
    position: sticky; bottom: 0; z-index: 2;
    display: flex; flex-direction: column-reverse; align-items: stretch;
    gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-hi);
    border-top: 1px solid var(--border);
  }
  :is(.overlay, .modal-overlay) :is(.modal-ft, .modal-footer) :is(button, .btn, a.btn) {
    flex: 0 0 auto;
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }

  /* ── Forms: single column, 16px inputs (no iOS zoom), 44px targets ─ */
  :is(.overlay, .modal-overlay) :is(.form-row, .form-grid, [style*="grid-template-columns"]) {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  :is(.overlay, .modal-overlay) :is(.form-group, .form-row > *) { width: 100% !important; min-width: 0; box-sizing: border-box; }
  :is(.overlay, .modal-overlay) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select, textarea, .modal-input) {
    font-size: 16px !important;
    min-height: 44px;
    max-width: 100%;
    box-sizing: border-box;
  }
  :is(.overlay, .modal-overlay) textarea { min-height: 88px; }
  :is(.overlay, .modal-overlay) :is(.modal-bd, .modal-body) :is(button, .btn):not(.icon-btn):not(.d3-f-check) { min-height: 44px; }
  :is(.overlay, .modal-overlay) :is(.modal-bd, .modal-body) :is(input[type="checkbox"], input[type="radio"]) { width: 22px; height: 22px; }

  /* wide tables inside a dialog scroll instead of pushing the sheet wider */
  :is(.overlay, .modal-overlay) :is(.modal-bd, .modal-body) table:not([data-stack]) { max-width: 100%; }
  :is(.overlay, .modal-overlay) :is(.modal-bd, .modal-body) .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Compact centred dialogs: confirm / alert / reason ─────────── */
  :is(.overlay, .modal-overlay):has(:is(.confirm-panel, .modal-compact)) {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
  .confirm-panel, .modal.modal-compact {
    width: 100% !important;
    max-width: 420px !important;
    max-height: 88dvh !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px) * 0);
    border-radius: 20px !important;
    box-sizing: border-box;
    overflow-y: auto;
  }
  .modal.modal-compact { display: flex; flex-direction: column; padding: 0; }
  :is(.confirm-ft, .modal-compact .modal-footer) {
    display: flex; flex-direction: column-reverse; align-items: stretch; gap: 10px;
    position: static;
  }
  :is(.confirm-ft, .modal-compact .modal-footer) :is(button, .btn) { width: 100%; min-height: 48px; justify-content: center; }
  .confirm-panel :is(input, textarea, select) { font-size: 16px; min-height: 44px; }
}

@keyframes mSheetIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  @media (max-width: 768px) { :is(.overlay, .modal-overlay) > * { animation: none !important; } }
}
/* --- css/components/41_ui_icons.css --- */
/* components/41_ui_icons.css — shared inline SVG line icons (see js/core/ui_icons.js).
   No emoji glyphs in the UI: they render as colour emoji on iOS/Android. */
.ui-icon { display: inline-block; vertical-align: -0.15em; flex: none; }

/* Icon-only placeholder used by CSS pseudo-elements (mask = currentColor-tinted). */
.ui-icon-mask {
  display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; flex: none;
  background-color: currentColor;
  -webkit-mask: var(--ui-icon-url) center / contain no-repeat;
          mask: var(--ui-icon-url) center / contain no-repeat;
}
/* --- css/components/42_collapse.css --- */
/* components/42_collapse.css — shared smooth collapse/expand (see js/core/ui_collapse.js).
   Markup: <div class="ui-collapse"><div class="ui-collapse-inner">…</div></div>
   Open state: add .is-open. UiCollapse wraps arbitrary elements automatically. */
.ui-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .26s cubic-bezier(.2,.7,.2,1), opacity .2s;
}
.ui-collapse > .ui-collapse-inner { overflow: hidden; min-height: 0; }
.ui-collapse.is-open { grid-template-rows: 1fr; opacity: 1; }
.ui-collapse:not(.is-open) { pointer-events: none; }

.ui-chevron.is-open { transform: rotate(180deg); }
.ui-chevron { transition: transform .26s cubic-bezier(.2,.7,.2,1); }
.is-open > .ui-chevron, .is-open .ui-chevron,
[aria-expanded="true"] > .ui-chevron, [aria-expanded="true"] .ui-chevron { transform: rotate(180deg); }

/* Native <details>: animate content height where the browser supports it. */
@supports (interpolate-size: allow-keywords) {
  details.ui-details { interpolate-size: allow-keywords; }
  details.ui-details::details-content {
    block-size: 0; opacity: 0; overflow: hidden;
    transition: block-size .26s cubic-bezier(.2,.7,.2,1), opacity .2s, content-visibility .26s allow-discrete;
  }
  details.ui-details[open]::details-content { block-size: auto; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-collapse, .ui-chevron.is-open { transform: rotate(180deg); }
.ui-chevron { transition: none; }
  details.ui-details::details-content { transition: none; }
}
/* --- css/components/43_ui_tabs.css --- */
/* components/43_ui_tabs.css — mobile segmented tab strips (see js/core/ui_tabs.js).
   <=900px: equal segments that fit the width (no horizontal scroll), icon above a
   short label, 44px min height, a sliding pink indicator, sticky where asked.
   !important is deliberate: every legacy strip (rp-tabs, rpt-nav, admin, kb, glass,
   parts vtabs, d3 toggle...) has its own id/class-specific desktop rules. */

.ui-tabs-ind { display: none; }
.ui-tab-short { display: none; }

@media (max-width: 900px) {
  .ui-tabs {
    display: grid !important;
    grid-template-columns: repeat(var(--ui-lead, 0), 44px) repeat(var(--ui-cols, 4), minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(44px, auto);
    gap: 2px !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    box-sizing: border-box;
    width: auto !important;
    max-width: 100%;
    margin: 8px 10px !important;
    padding: 3px !important;
    background: var(--surface-lo) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    max-height: none !important;
    position: relative;
  }
  .ui-tabs--sticky {
    position: sticky !important;
    top: var(--ui-tabs-top, 0px) !important;
    z-index: 20;
    margin: 0 !important;
    border-width: 0 0 1px !important;
    border-radius: 0 !important;
    padding: 4px 6px !important;
    background: var(--surface) !important;
  }
  .ui-tabs-ind {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 9px;
    background: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow, rgba(255, 27, 109, .35));
  }
  .ui-tabs.ui-tabs-ready .ui-tabs-ind { transition: transform .18s ease, opacity .12s; }

  .ui-tabs > .ui-tab {
    position: relative;
    z-index: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0 !important;
    min-height: 44px;
    width: auto !important;
    margin: 0 !important;
    padding: 5px 2px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1;
    color: var(--muted) !important;
    font-family: var(--mono);
    font-size: 9.5px !important;
    font-weight: 700 !important;
    line-height: 1.12;
    letter-spacing: .02em !important;
    text-align: center;
    text-transform: uppercase;
    white-space: normal !important;
    overflow-wrap: anywhere;
    flex-shrink: 1 !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .ui-tabs > .ui-tab.active,
  .ui-tabs > .ui-tab[aria-selected="true"] { color: #fff !important; }
  .ui-tabs.ui-tabs-ready > .ui-tab { transition: color .15s; }
  .ui-tabs > .ui-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .ui-tabs > .ui-tab.disabled { opacity: .4 !important; }

  .ui-tabs > .ui-tab > .ui-tab-ic {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    font-size: 16px;
    line-height: 1;
  }
  .ui-tabs > .ui-tab > .ui-tab-ic svg { width: 17px; height: 17px; }
  
  .ui-tabs--noicon > .ui-tab > .ui-tab-ic--added { display: none !important; }
  .ui-tabs > .ui-tab > .ui-tab-label,
  .ui-tabs > .ui-tab > .ui-tab-short { display: block; max-width: 100%; }
  .ui-tabs > .ui-tab.has-short > .ui-tab-label { display: none !important; }
  .ui-tabs > .ui-tab.has-short > .ui-tab-short { display: block; }
  .ui-tabs .ui-tab-label:empty { display: none; }

  /* count badges (e.g. parts groups) stay small, on the label line */

  
  

  /* ── Analyst wizard strip: fixed under the top nav, 44px, peek/back squares */

  
  
  
  
  
  
  

  /* Report navigation is deliberately a single horizontal strip. There can
     be eight sections, so equal-width grid segments either become illegibly
     narrow or wrap into the tall vertical-looking rail seen on phones. Keep
     every tab at a readable width and let this one control scroll sideways. */

  
  
  
  

  /* ── Live report rail: full-width strip under the wizard steps */

  

  /* ── 3D/2D + mode toggles: compact 2-segment control, still >=44px tall */
  .d3-toggle-wrap.ui-tabs {
    display: inline-grid !important;
    grid-template-columns: repeat(var(--ui-cols, 2), minmax(44px, auto)) !important;
    margin: 0 4px 0 0 !important;
    padding: 2px !important;
    border-radius: 10px !important;
  }
  .d3-toggle-wrap.ui-tabs > .d3-toggle-btn { min-height: 40px; flex-direction: row; gap: 5px; padding: 0 12px !important; font-size: 11px !important; }
  .d3-toggle-wrap.ui-tabs > .d3-toggle-btn.active { background: transparent !important; }

  /* ── Review views bar inside the 3D panel */
  .a3d-mobile-review-nav.ui-tabs {
    flex: 0 0 auto !important;
    margin: 0 !important;
    border-width: 0 0 1px !important;
    border-radius: 0 !important;
    padding: 3px 6px !important;
    background: var(--surface) !important;
  }
  .a3d-mobile-review-nav.ui-tabs > .ui-tab { border-radius: 9px !important; }

  /* ── Admin: groups row + sub-tab rows */

  /* ── Knowledge base modal + page */
  .tab-nav.ui-tabs { margin: 0 -20px 16px !important; top: -20px !important; }
  .kb-tabbar #kb-tabs.ui-tabs { flex: 1 1 100%; margin: 6px 0 !important; min-width: 0; }
  .kb-tabbar { flex-wrap: wrap; }
  .kb-tabbar-hd { display: none; }
  .kb-tab-btn.ui-tab, .tab-btn.ui-tab { border-bottom: 0 !important; }
  .tab-btn.editing.ui-tab::after { display: none; }

  /* ── Glass case detail */
  .glass-tabs.ui-tabs { margin: 12px 0 !important; }

  /* ── Parts groups inside a report */
  .parts-vtab-list.ui-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }
  .parts-vtab-list.ui-tabs::-webkit-scrollbar { display: none; }
  .parts-vtab-list.ui-tabs > .ui-tabs-ind { display: none !important; }
  .parts-vtab-list.ui-tabs > .ui-tab { flex-direction: row; gap: 6px; }
  .parts-vtab-list.ui-tabs > .parts-vtab.ui-tab {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    padding: 7px 10px !important;
    white-space: nowrap !important;
  }
  .parts-vtab-list.ui-tabs > .parts-vtab.ui-tab.active {
    color: var(--accent) !important;
    background: var(--accent-glow) !important;
    border: 1px solid var(--accent) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-tabs.ui-tabs-ready .ui-tabs-ind,
  .ui-tabs.ui-tabs-ready > .ui-tab { transition: none !important; }
}
/* --- css/components/44_narrated_capture.css --- */
/* components/44_narrated_capture.css - LAYOUT ONLY for narrated capture (CA-160).
   Paint comes from the design system (ds/components.css + ds/components-capture.css):
   fx-cam-hud / fx-cam-bare / fx-meter in Guided Capture, fx-dialog for the prompt,
   fx-card / fx-list / fx-badge / fx-disclosure for the read-only history viewer.
   Markup: js/components/narrated_capture.js. */

/* ── Guided Capture HUD: voice-level meter + record toggle ───────── */
.nc-control-group { display: inline-flex; flex: none; align-items: center; gap: var(--space-2); height: var(--touch-h); padding: 0 var(--space-3); }
.nc-toggle, .nc-intensity { min-height: 0; }
.nc-toggle-icon { display: inline-flex; }
.nc-toggle-dot { display: none; }
.nc-toggle.has-audio .nc-toggle-icon { display: none; }
.nc-toggle.has-audio .nc-toggle-dot { display: inline-block; }
.nc-toggle.saving { opacity: 0.75; pointer-events: none; }
.nc-toggle.saving #ncToggleLabel { display: inline; }
.lc-modal.is-immersive .nc-toggle:not(.saving) #ncToggleLabel { display: none; }
.nc-bars { align-items: flex-end; }

/* ── Prompt dialog ───────────────────────────────────────────────── */
.nc-prompt .fx-dialog-bd { gap: var(--space-4); }

/* ── History viewer (read-only voice evidence under a result) ────── */
.nc-history-section { width: 100%; min-width: 0; margin-top: var(--space-4); }
.nc-section-heading { display: flex; align-items: center; gap: var(--space-3); }
.nc-section-heading .fx-list-text { flex: 1 1 auto; }
.nc-history-card { width: 100%; overflow: hidden; }
.nc-history-card + .nc-history-card { margin-top: var(--space-3); }
.nc-history-head { padding-bottom: var(--space-3); }
.nc-history-title { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.nc-history-meta { display: flex; align-items: center; gap: var(--space-2); }
@media (max-width: 768px) {
  /* phone: the title and date keep the full width, the language badge and actions go on their own line */
  .nc-history-head { flex-wrap: wrap; gap: var(--space-2); }
  .nc-history-title { flex: 1 1 100%; }
}
.nc-player { padding-top: 0; padding-bottom: var(--space-3); }
.nc-history-card audio { display: block; width: 100%; }
.nc-player-list { display: flex; flex-direction: column; gap: var(--space-3); }
.nc-player-part { display: flex; flex-direction: column; gap: var(--space-1); }
.nc-transcript { white-space: pre-wrap; }
.nc-evidence-list { margin: 0; }
.nc-trace-body { display: grid; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); }
.nc-trace-action { align-items: flex-start; }
.nc-trace-action q { display: block; }

/* ── Evidence block: voice notes under the photos + mic markers (CA-442) ── */
.arp-voice { min-width: 0; }
.nc-note-marker { position: absolute; }
.fx-thumb-item > .nc-note-marker { right: 2px; bottom: 2px; width: 24px; height: 24px; }
.fx-photo > .nc-note-marker { top: var(--space-1); left: var(--space-1); }

/* ── Capture video viewer (CA-442 phase 2): player + good-range timeline ── */
.cv-section { min-width: 0; margin-top: var(--space-4); }
.cv-part { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.cv-video { display: block; width: 100%; max-height: 60vh; }
.cv-timeline { position: relative; cursor: pointer; }
.cv-bar { position: relative; }
.cv-bar > .cv-seg { position: absolute; top: 0; left: var(--cv-start, 0%); }
.cv-ticks { position: relative; height: var(--control-h-sm); }
.cv-tick { position: absolute; top: 0; left: var(--cv-at, 0%); transform: translateX(-50%); }
/* --- css/pages/45_fleet_ar.css --- */
/* analyst/static/css/pages/45_fleet_ar.css — Fleet "Scan" camera tool (CA-135, CA-160).
 *
 * Full-screen camera overlay #fmAr built by js/pages/fleet_ar.js. Layout only: every visual comes
 * from the design system (fx-screen--camera, fx-icon-btn, fx-overlay-chip, fx-reticle, fx-card,
 * fx-dialog, fx-toast, fx-btn, fx-badge, fx-signature). Portrait phone first; honours safe areas.
 */

/* ── Overlay shell ────────────────────────────────────────────────────── */
.ar.fx-screen { --ar-top: env(safe-area-inset-top, 0px); --ar-bot: env(safe-area-inset-bottom, 0px); display: none; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.ar.fx-screen.on { display: block; }
.ar.fx-screen.on.lc-away { display: none; }
.ar [hidden] { display: none; }
.ar .hidden { display: none; }
.ar-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-shade { position: absolute; inset: 0; pointer-events: none; }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.ar-top { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: calc(var(--ar-top) + var(--space-3)) var(--space-3) 0; }
.ar-top-r { display: flex; gap: var(--space-2); }

/* ── Reticle and hint ─────────────────────────────────────────────────── */
.ar-stage { position: absolute; inset: 0; pointer-events: none; }
.ar .ar-reticle { position: absolute; left: 7%; right: 7%; top: calc(var(--ar-top) + 18%); aspect-ratio: 3.4 / 1; }
.ar .ar-hint { position: absolute; height: auto; min-height: 32px; padding-top: var(--space-1); padding-bottom: var(--space-1); text-align: center; left: 50%; top: calc(var(--ar-top) + 18% + 25.3vw + 16px); transform: translateX(-50%); max-width: calc(100% - 32px); }

/* ── Toasts ───────────────────────────────────────────────────────────── */
.ar-toasts { position: absolute; left: var(--space-4); right: var(--space-4); top: calc(var(--ar-top) + 64px); z-index: 6; display: grid; justify-items: center; gap: var(--space-2); pointer-events: none; }
.ar-toast.out { opacity: 0; }

/* ── Dock: identified prompt + tray ───────────────────────────────────── */
.ar-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; gap: var(--space-3); padding: 0 var(--space-3) calc(var(--ar-bot) + var(--space-3)); pointer-events: none; }
.ar-dock > * { pointer-events: auto; }
.ar-pr { display: grid; gap: var(--space-2); }
.ar-pr-top { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.ar-pr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-card-acts { display: flex; gap: var(--space-2); }
.ar-card-acts .fx-btn { flex: 1 1 0; }
.ar-tray-hd { padding-bottom: var(--space-2); }
.ar-tray-sum { min-width: 0; flex: 1 1 auto; justify-content: flex-start; }
.ar-tray-sum span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ar-tray-act { display: inline-flex; align-items: center; gap: var(--space-2); }
.ar-items { display: grid; gap: var(--space-2); max-height: 26vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: 0; }
.ar-item { gap: var(--space-1); padding: var(--space-2) var(--space-3); }
.ar-item-main { display: flex; align-items: center; gap: var(--space-2); }
.ar-item-st { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); }
.ar-item-sub { display: flex; align-items: center; gap: var(--space-2); }
.ar-badge { position: absolute; z-index: 5; right: var(--space-4); bottom: calc(var(--ar-bot) + var(--space-4)); cursor: pointer; }

/* Hidden overlays (eye toggle) */
.ar-prompt, .ar-tray, .ar-hint, .ar-toasts { transition: opacity .15s ease-out; }
.ar.ov-off .ar-prompt, .ar.ov-off .ar-tray, .ar.ov-off .ar-hint, .ar.ov-off .ar-toasts { opacity: 0; visibility: hidden; pointer-events: none; }

/* ── No camera (permission / HTTPS) ───────────────────────────────────── */
.ar-err { position: absolute; inset: 0; z-index: 3; align-content: center; }
.ar-err-act { display: flex; gap: var(--space-2); width: 100%; max-width: 320px; }
.ar-err-act .fx-btn { flex: 1 1 0; }

/* ── Bottom sheets ────────────────────────────────────────────────────── */
.ar-scrim { position: absolute; inset: 0; z-index: 8; opacity: 0; transition: opacity .18s ease-out; }
.ar-scrim.on { opacity: 1; }
.ar-sheet.fx-dialog { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; width: 100%; max-height: 88dvh; padding-bottom: var(--ar-bot); transform: translateY(100%); transition: transform .18s ease-out; user-select: text; -webkit-user-select: text; }
.ar-sheet.fx-dialog.on { transform: none; }
.ar-sig-l { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ar-cars { margin: 0; }
.ar-car { gap: var(--space-2); }
.ar-car .ar-km { margin-left: auto; width: 110px; }

/* ── AR <-> guided capture crossfade ──────────────────────────────────── */
.ar-top, .ar-stage, .ar-shade, .ar-dock, .ar-badge, .ar-toasts { transition: opacity .2s ease-out; }
.ar.ar-fade .ar-top, .ar.ar-fade .ar-stage, .ar.ar-fade .ar-shade, .ar.ar-fade .ar-dock, .ar.ar-fade .ar-badge, .ar.ar-fade .ar-toasts { opacity: 0; pointer-events: none; }
.ar-freeze { position: fixed; inset: 0; z-index: var(--z-toast); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ar-freeze canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-freeze .ar-spin { position: relative; width: 32px; height: 32px; }

/* ── Back button inside the shared LiveCapture (only when opened with backLabel) ── */
.lc-back-btn.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ar-sheet.fx-dialog, .ar-prompt, .ar-tray, .ar-hint, .ar-toasts, .ar-top, .ar-stage, .ar-shade, .ar-dock, .ar-badge { transition: none; }
}

/* ── Tour demo (CA-425) ───────────────────────────────────────────────── */
/* fleet_tutorial.js plays the Scan screen with a still photo (#arDemoFrame) for the camera. On a
   desktop it draws the screen inside the phone frame (26_fleet_tutorial.css .fl-tour-phone). */
/* the tour's still photos hold the plate at 52% of the height: the reticle and the hint follow it */
.ar.ar-demo .ar-reticle { top: calc(52% - 50px); }
.ar.ar-demo .ar-hint { top: calc(52% - 100px); }
/* the still photo moves like a hand-held camera feed (same drift as components/demo_camera.js) */
@media (prefers-reduced-motion: no-preference) {
  .ar.ar-demo #arDemoFrame { animation: ar-demo-handheld 6.3s ease-in-out infinite; }
}
@keyframes ar-demo-handheld {
  0%   { transform: scale(1.04) translate(0, 0.5%); }
  25%  { transform: scale(1.045) translate(-0.6%, 0); }
  50%  { transform: scale(1.05) translate(0, -0.5%); }
  75%  { transform: scale(1.045) translate(0.6%, 0); }
  100% { transform: scale(1.04) translate(0, 0.5%); }
}
/* --- css/components/54_analysis_report.css --- */
/* analyst/static/css/components/54_analysis_report.css - layout of the analysis report
   (components/analysis_report.js), live on /analyst and in the History detail on every page.
   Layout only: every visual comes from the design system (ds/components*.css). */

/* ── Report: tabs + panel, photos in a side column on wide screens ── */
.arp { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main aside"; gap: var(--space-6); align-items: start; min-width: 0; }
.arp--no-photos { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
.arp-main { grid-area: main; display: grid; gap: var(--space-4); min-width: 0; }
.arp-aside { grid-area: aside; position: sticky; top: var(--space-4); min-width: 0; }
.arp--no-photos .arp-aside { display: none; }
.arp-head { display: flex; align-items: flex-end; gap: var(--space-2); min-width: 0; }
.arp-tabs { flex: 1; min-width: 0; }
.arp-actions { display: flex; align-items: center; gap: var(--space-1); padding-bottom: var(--space-1); }
.arp-actions:empty { display: none; }
.arp-panel { display: grid; gap: var(--space-4); min-width: 0; }
.arp-panel > *, .arp-stack > * { min-width: 0; }
.arp-stack { display: grid; gap: var(--space-4); min-width: 0; }
.arp-stack:empty { display: none; }
.arp-toolbar { display: flex; justify-content: flex-end; gap: var(--space-2); }
.arp-toolbar:empty { display: none; }
.arp-grade { display: flex; align-items: center; gap: var(--space-4); }
.arp-parts-tabs .fx-tab .fx-icon { flex: none; }

/* Simple view hides the advanced blocks (techniques, value impact, quality tab). */
body.view-simple .js-adv { display: none; }

/* ── History overlay: list + detail ── */
.hl-body { align-content: start; }
.hl-view { display: grid; gap: var(--space-4); min-width: 0; }
.hl-entries { display: grid; gap: var(--space-2); }
.hl-entries:empty { display: none; }
.hl-row { gap: var(--space-2); padding-left: var(--space-3); }
.hl-sel { flex: none; }
.hl-open { padding: var(--space-1) 0; }
.hl-thumb { --thumb-w: 56px; --thumb-h: 42px; flex: none; }
.hl-actions { display: flex; gap: var(--space-1); flex: none; }
.hl-actions:empty { display: none; }
@media (max-width: 768px) {
  /* Phone: checkbox and entry on the first line, the row actions under it; the text wraps instead of truncating.
     .fx-list prefix: the design-system list item (loaded later) must not put the row back on one line. */
  .fx-list .hl-row { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "sel open" ". actions"; align-items: start; }
  .fx-list .hl-sel { grid-area: sel; padding-top: var(--space-3); }
  .fx-list .hl-open { grid-area: open; min-width: 0; }
  .fx-list .hl-open .fx-list-text { flex: 1 1 auto; min-width: 0; }
  .fx-list .hl-open .fx-list-title, .fx-list .hl-open .fx-list-sub { white-space: normal; overflow-wrap: break-word; }
  .fx-list .hl-actions { grid-area: actions; justify-content: flex-end; }
}
.hd-context { margin-bottom: var(--space-4); }
.hd-glass { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.hd-glass-doc { width: 200px; height: 200px; }

@media (max-width: 1024px) {
  .arp { grid-template-columns: minmax(0, 1fr); grid-template-areas: "aside" "main"; gap: var(--space-4); }
  .arp-aside { position: static; }
  .arp-aside .fx-media-stage { aspect-ratio: auto; height: 280px; }
}

@media (max-width: 768px) {
  .arp-head { flex-wrap: wrap; }
  .arp-tabs { flex-basis: 100%; order: 2; }
  .arp-actions { order: 1; margin-left: auto; padding-bottom: 0; }
  .arp-aside .fx-media-stage { height: 220px; }
  .arp-grade { align-items: flex-start; }
  .hd-glass { grid-template-columns: minmax(0, 1fr); }
  .hd-glass-doc { width: 100%; height: 200px; }
}

/* Repair plan grouped by phase */
.ar-phases { display: grid; gap: var(--space-2); }
.ar-step-no { min-width: 28px; justify-content: center; }
.ar-step > .fx-disclosure-bd { padding-left: calc(var(--space-4) + 28px + var(--space-3)); }
@media (max-width: 768px) {
  .ar-step > .fx-disclosure-bd { padding-left: var(--space-4); }
  .ar-step > summary > .fx-disclosure-meta { padding-left: calc(28px + var(--space-3)); }   /* under the step text, not the number */
}


/* ── Vehicle alerts: tab badge, cards, photo pins (CA-95) ──
   Layout only: the visuals are design-system components (fx-marker, fx-region,
   fx-accent, fx-corner-dot, fx-badge-btn in ds/components-report.css). */
.arp-tab-count { margin-inline-start: var(--space-1); }
.arp-alert-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.arp-alert-chips, .arp-alert-photos { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.arp-alert-action { margin-top: var(--space-3); }
.arp-alert-card .fx-item-title { margin: var(--space-2) 0 var(--space-1); }

/* Photo overlay: the layer is sized to the displayed photo; only pins take the pointer. */
.arp-alert-layer, #hd-fs-alert-layer { position: absolute; pointer-events: none; }
.arp-alert-box { position: absolute; }
.arp-alert-layer .arp-alert-box, #hd-fs-alert-layer .arp-alert-box { pointer-events: none; } /* the windshield .fx-region rule (pointer-events: all) would swallow clicks on the damage masks under the box */
.arp-alert-layer .arp-alert-pin { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; padding: 0; }
.arp-alert-tip { z-index: var(--z-sticky); }
.arp-alert-chip { gap: var(--space-1); }
.arp-thumb-alert { position: absolute; top: 3px; right: 3px; pointer-events: none; }

/* ── Driver's statement tab (CA-479): answers card + impact-sides card (diagram beside declared vs AI sides) ── */
.hd-declared-bd { display: grid; gap: var(--space-4); }
.hd-declared-kv { grid-template-columns: minmax(160px, 35%) minmax(0, 1fr); }
.hd-declared-sides { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
@media (max-width: 768px) {
  .hd-declared-kv { grid-template-columns: fit-content(45%) minmax(0, 1fr); }
  .hd-declared-sides { grid-template-columns: minmax(0, 1fr); }
}
/* --- css/pages/55_analyst.css --- */
/* analyst/static/css/pages/55_analyst.css - layout of the Analyst page (/analyst): input panel, the
   4-step wizard, the live 3D stage of steps 1-2 and the result states. Layout only: every visual comes
   from the design system (ds/components*.css). Replaces components/36_live_stage.css. */

/* ── Page: input panel + results ── */
.an-page { display: grid; grid-template-columns: var(--fx-split, 360px) minmax(0, 1fr); gap: var(--space-6); align-items: start; width: 100%; max-width: var(--page-max); margin: 0 auto; padding: var(--space-6) var(--space-8) var(--space-12); }   /* same width and gutter as .fx-page */
.an-input { position: sticky; top: calc(var(--appbar-h) + var(--space-4)); display: flex; flex-direction: column; max-height: calc(100vh - var(--appbar-h) - 120px); overflow: hidden; }
.an-input-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.an-input > .action-area { position: static; }
.an-section-hd .fx-panel-toggle-title { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.an-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.an-preview { display: grid; gap: var(--space-2); }
.an-preview-stage { position: relative; }
.an-preview-stage > img { cursor: default; }
.an-preview-stage > canvas { inset: 0; width: 100%; height: 100%; }
.an-preview-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-preview-tools { display: flex; gap: var(--space-1); flex: none; }
.an-parts-cats { display: grid; gap: var(--space-4); }

/* While an analysis runs the input panel steps aside; "show input" brings it back beside the results. */
.an-page.analysis-fullscreen { grid-template-columns: minmax(0, 1fr); }
.an-page.analysis-fullscreen > .an-input { display: none; }
.an-page.analysis-fullscreen.panel-peek { grid-template-columns: var(--fx-split, 360px) minmax(0, 1fr); }
.an-page.analysis-fullscreen.panel-peek > .an-input { display: flex; }

/* ── Results: wizard bar, stage, states ── */
.an-results { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "wiz" "stage" "states"; gap: var(--space-4); align-content: start; min-width: 0; }
.an-wizard { grid-area: wiz; display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.an-steps { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.an-peek { flex: none; }
.an-page:not(.analysis-fullscreen) .an-peek { display: none; }
.an-states { grid-area: states; display: grid; gap: var(--space-4); min-width: 0; }
.an-empty { min-height: 360px; align-content: center; }
.an-progress { min-width: 0; }
.an-progress > .fx-card-hd { justify-content: flex-start; }
.an-progress-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; }
.an-progress-text { min-width: 0; }
.an-progress-bd { display: grid; gap: var(--space-4); }
.an-feed { display: grid; gap: var(--space-3); }
.an-feed-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.an-feed .live-narration-toggle { justify-self: start; }
.an-feed .fx-feed, .an-progress .fx-feed { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }   /* the live narration never grows the page */
.live-feed-item-text { display: block; }   /* sentence and its tags flow inline (the tags are inline badges, not rows) */
#state-phase1.narration-collapsed .fx-feed { display: none; }
#state-phase1.narration-collapsed .live-narration-toggle .fx-icon { transform: rotate(180deg); }

/* 3D stage (steps 1-2). The "estimating vehicle shape" veil covers the panel until the class is known. */
#analyst-3d-wrap { grid-area: stage; position: relative; display: flex; flex-direction: column; min-width: 0; height: calc(100vh - var(--appbar-h) - 128px); min-height: 480px; }
#analyst-3d-wrap > .d3-panel { flex: 1; min-height: 0; }
#analyst-3d-wrap #a3d-placeholder { display: none; }
#analyst-3d-wrap.is-pending #a3d-placeholder { position: absolute; inset: 0; z-index: var(--z-sticky); display: grid; place-items: center; }
#analyst-3d-wrap.is-pending > .d3-panel { visibility: hidden; }

/* Step 1: narration beside the live model. */
.an-results.is-stage { grid-template-columns: 380px minmax(0, 1fr); grid-template-areas: "wiz wiz" "states stage"; align-items: start; }
.an-results.is-stage > .an-states { position: sticky; top: calc(var(--appbar-h) + var(--space-4)); }
.an-results.is-stage .an-feed .fx-feed { max-height: calc(100vh - var(--appbar-h) - 420px); min-height: 160px; }

/* Step 2 (damage confirmation): the editor takes the whole results area. */
#analyst-3d-wrap.review-confirmation-mode { height: calc(100vh - var(--appbar-h) - 120px); }

@media (max-width: 1024px) {
  .an-page { grid-template-columns: minmax(0, 1fr); padding: var(--space-6); }
  .an-input { position: static; max-height: none; overflow: visible; }
  .an-input-scroll { overflow: visible; }
  .an-page.analysis-fullscreen.panel-peek { grid-template-columns: minmax(0, 1fr); }
  .an-results.is-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "wiz" "stage" "states"; }
  .an-results.is-stage > .an-states { position: static; }
  .an-results.is-stage #analyst-3d-wrap { height: 50vh; min-height: 320px; }
  .an-results.is-stage .an-feed .fx-feed { max-height: 360px; }
  /* Before an analysis starts, phones and tablets show the step bar (Input current) above the input only. */
  .an-page:not(.analysis-fullscreen) > .an-results { order: -1; }
  .an-page:not(.analysis-fullscreen) > .an-results > :not(.an-wizard) { display: none; }
}

@media (max-width: 768px) {
  .an-page { gap: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-6); }
  .an-page { padding-bottom: calc(var(--space-6) + 80px); }
  .an-input > .action-area { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: var(--z-sticky); }
  .an-page.analysis-fullscreen > .an-input > .action-area { display: none; }
  .an-two { grid-template-columns: minmax(0, 1fr); }
  .an-wizard { flex-wrap: wrap; }
  .an-steps { order: 3; flex-basis: 100%; }
  .an-steps .fx-step-label { display: none; }
  .an-steps .fx-step[aria-current="step"] .fx-step-label { display: inline; }
  .an-steps { justify-content: space-between; }
  .an-steps .fx-step:not(:last-child)::after { width: 12px; }
  .an-feed .fx-feed, .an-progress .fx-feed, .an-results.is-stage .an-feed .fx-feed { max-height: 45vh; }
  #analyst-3d-wrap, #analyst-3d-wrap.review-confirmation-mode { height: calc(100vh - var(--appbar-h) - var(--tabbar-h) - 120px); min-height: 360px; }
  .an-empty { min-height: 0; }
}
#preview-box.draw-mode canvas { cursor: crosshair; }

/* ── History page (/analyst?view=history): the history panel as page content, not a dialog ── */
#history-overlay.is-page #close-history, #history-overlay.is-page #history-fullscreen-btn { display: none; }

/* --- css/pages/56_appraisals.css --- */
/* analyst/static/css/pages/56_appraisals.css — Appraisals page (/appraisals): LAYOUT ONLY.
   Every visual decision comes from the design system (ds/components*.css).
   Breakpoints: 1024px (tablet) and 768px (phone). */

/* ── Account chrome: restricted accounts have no analysis history ── */
.per-body #history-btn { display: none; }

/* ── List ────────────────────────────────────────────────────────── */
.per-body .per-page { display: grid; gap: var(--space-4); align-content: start; }
.per-body .per-row-link { cursor: pointer; }
.per-body .per-sticky-new { display: none; }
.per-body #per-list td.fx-num, .per-body .fx-badge { white-space: nowrap; }

/* ── Send state (estimates): chip, rejection reason and send action on one line ── */
.per-body .per-send-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.per-body .per-send-error { flex-basis: 100%; }
/* Estimate list (CA-303): narrow tick column; the tick never stretches the row */
.per-body .fx-table th.is-check, .per-body .fx-table td.is-check { width: var(--space-6); white-space: nowrap; }

/* ── List: quick filters, count and sort ──────────────────────────── */
.per-body .per-quick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.per-body .per-quick .fx-seg { max-width: 100%; overflow-x: auto; }
.per-body .per-sort-select { flex: none; }

/* ── Case screen: sections on the left, key facts on the right ────── */
.per-body .per-case-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); padding: var(--space-4) var(--space-5); }
.per-body .per-case-head-main { display: flex; align-items: center; gap: var(--space-3); min-width: 0; flex: 1 1 320px; }
.per-body .per-case-head-text { display: grid; gap: var(--space-1); min-width: 0; }
.per-body .per-case-head-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.per-body .per-case-head-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.per-body .per-case-call { display: flex; }
.per-body .per-case-call:empty { display: none; }
.per-body .per-call-btn { position: relative; }
.per-body .per-call-dot { position: absolute; top: var(--space-1); right: var(--space-1); }
.per-body .per-menu { position: relative; }
.per-body .per-menu .fx-menu { position: absolute; top: 100%; right: 0; margin-top: var(--space-1); }
.per-body .per-steps-count { display: none; margin: var(--space-2) 0 0; }
.per-body .per-steps-card { padding: var(--space-3) var(--space-5); }
.per-body .per-steps { gap: var(--space-2) var(--space-3); }
.per-body .per-groups { display: grid; gap: var(--space-6); }
.per-body .per-group { display: grid; gap: var(--space-3); }
.per-body .per-ro-kv { grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); }
.per-body .per-est-kpis { flex: 1; min-width: 260px; max-width: 520px; }
.per-body .per-vehicle-details { margin-top: var(--space-4); }
.per-body .per-vehicle-details > summary { cursor: pointer; }
.per-body .per-case { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-6); align-items: start; }
.per-body .per-case-side { grid-column: 2; grid-row: 1; position: sticky; top: var(--space-4); }
.per-body .per-case-main { grid-column: 1; grid-row: 1; }
.per-body .per-case-side-bd { display: grid; gap: var(--space-4); }
.per-body .per-case-main { min-width: 0; }
.per-body .per-tab-panel { padding-top: var(--space-2); }
.per-body .per-panel-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.per-body .per-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.per-body .per-vehicle-kv { flex: 1; min-width: 240px; grid-template-columns: repeat(2, minmax(0, max-content) minmax(0, 1fr)); }
.per-body .per-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.per-body .per-span-all { grid-column: 1 / -1; }
.per-body .per-form-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.per-body .per-badges { display: flex; gap: var(--space-1); margin-right: auto; margin-left: var(--space-3); }
.per-body .per-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.per-body .per-docs-grid { margin-top: var(--space-3); }
/* tile caption: the name truncates on one line, the perspective / index chips keep their full width */
.per-body .per-docs-grid .fx-photo-cap > span:first-child { flex: 1 1 auto; min-width: 0; }
.per-body .per-docs-grid .fx-photo-cap > .fx-badge { flex: none; overflow: visible; }

/* ── Estimate dialog: lines on the left, attributes on the right ── */
.per-body .per-est-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: var(--space-6); align-items: start; }
.per-body .per-est-lines { display: grid; gap: var(--space-4); min-width: 0; }
.per-body .per-est-layout.is-single { grid-template-columns: minmax(0, 1fr); }
.per-body .per-est-attrs { display: grid; gap: var(--space-4); }
.per-body .per-est-side { display: grid; gap: var(--space-4); position: sticky; top: 0; align-content: start; min-width: 0; }
.per-body .per-est-summary-bd { display: grid; gap: var(--space-4); }
.per-body .per-est-attr-grid { display: grid; gap: var(--space-3); }
.per-body .per-est-group th { text-align: left; }
.per-body .per-est-table .per-in { width: 88px; text-align: right; }
.per-body .per-est-totals .per-in { width: 96px; }
.per-body .per-est-violations { display: grid; gap: var(--space-1); margin: var(--space-4) 0 0; padding-left: var(--space-5); }

/* ── Total loss tab and salvage lots (phase 5) ───────────────────── */
.per-body .per-tl-body { gap: var(--space-4); }
.per-body .per-ratio-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }
.per-body .per-tl-link { flex-wrap: wrap; }
.per-body .per-tl-link .fx-input { flex: 1 1 200px; min-width: 0; }
.per-body .per-lot-card { margin-top: var(--space-3); }
.per-body .per-lot-body { display: grid; gap: var(--space-3); }
.per-body .per-lot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.per-body .per-lot-tile { min-width: 0; }
.per-body #per-lot-body { max-width: 720px; }
.per-body #per-tl-alert .fx-btn { margin-left: auto; }

@media (max-width: 1024px) {
  .per-body .per-case { grid-template-columns: minmax(0, 1fr); }
  .per-body .per-case-side, .per-body .per-case-main { grid-column: 1; grid-row: auto; position: static; }
  .per-body .per-est-side { position: static; }
  .per-body .per-est-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .per-body .per-case-head { padding: var(--space-3) var(--space-4); }
  .per-body .per-case-head-actions { position: relative; justify-content: flex-start; width: 100%; }
  .per-body .per-menu { position: static; }
  .per-body .per-menu .fx-menu { left: 0; right: 0; min-width: 0; }
  .per-body #per-case-primary { flex: 1 1 auto; min-width: 0; margin-left: auto; height: auto; min-height: var(--touch-h); padding-block: var(--space-2); white-space: normal; text-align: center; }
  .per-body .per-steps-card { padding: var(--space-3) var(--space-4); }
  .per-body .per-steps-count { display: block; }
  .per-body .per-sticky-new { display: block; }
  .per-body .per-form-grid { grid-template-columns: minmax(0, 1fr); }
  .per-body .per-vehicle-kv { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
  .per-body .per-est-table .per-in, .per-body .per-est-totals .per-in { width: 72px; }
  .per-body .per-panel-actions { width: 100%; }
  .per-body .per-lot-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Estimate review step and workshop networks (CA-112) ───────────── */
.per-body .per-est-block { display: grid; gap: var(--space-3); }
.per-body .per-est-rounds { display: grid; gap: var(--space-1); }
.per-body .per-est-table:not(.has-quote) .per-est-quote { display: none; }
.per-body .per-est-quote-cell { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.per-body .per-adj-in { width: 110px; text-align: right; }
.per-body .per-adj-reason { min-width: 160px; }
.per-body .per-nw-row { display: flex; align-items: center; gap: var(--space-2); }
.per-body .per-nw-row .fx-input { flex: 1 1 auto; min-width: 0; }
.per-body .per-nw-picker { flex: 1 1 auto; min-width: 0; }
.per-body .per-nw-capture { margin-top: var(--space-4); max-width: 640px; }
.per-body .per-nw-capture-fields { display: grid; gap: var(--space-3); }

/* ── KPIs, insurer map and KPI reports (CA-112) ─────────────────────── */
.per-body .per-export { position: relative; }
.per-body .per-export .fx-menu { position: absolute; top: 100%; right: 0; margin-top: var(--space-1); }
.per-body .per-kf { padding: var(--space-4) var(--space-5); }
.per-body .per-kf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); align-items: end; }
.per-body .per-kp-body { display: grid; gap: var(--space-6); }
.per-body .per-kp-group { display: grid; gap: var(--space-3); min-width: 0; }
.per-body .per-kp-hero { grid-column: span 2; }
.per-body .per-kp-body .fx-kpi-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* the change chip wraps inside its tile (long pt / de / fr text), never past the card edge */
.per-body .per-kp-body .fx-kpi { min-width: 0; }
.per-body .per-kp-body .fx-kpi-meta .fx-badge { white-space: normal; max-width: 100%; height: auto; overflow-wrap: anywhere; }
.per-body .per-mp-body { display: grid; gap: var(--space-3); }
.per-body .per-mp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.per-body .per-mp-overlays { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.per-body .per-mp-map { height: clamp(420px, 62vh, 760px); }
.per-body .per-mp-kpis .fx-kpi { min-width: 0; }
.per-body .per-mp-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: var(--space-4); align-items: start; }
.per-body .per-mp-main { display: grid; gap: var(--space-2); min-width: 0; }
.per-body .per-mp-side { display: grid; gap: var(--space-4); min-width: 0; }
.per-body .per-mp-bar-icon { overflow: visible; }
.per-body .per-mp-timelapse { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); }
.per-body .per-mp-timelapse .fx-tl-main { flex: 1; min-width: 0; display: grid; gap: var(--space-1); }
.per-body .per-mp-timelapse .fx-tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.per-body .per-mp-timelapse .fx-range { width: 100%; }
.per-body .per-mpc-grid { max-height: 50vh; overflow: auto; }
.per-body .per-mpc-layers { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.per-body #per-map-canvas { width: 100%; height: 100%; }
.per-body #per-map-canvas img.leaflet-tile { max-width: none; max-height: none; }
.per-body .per-rep-detail { display: grid; gap: var(--space-4); }
.per-body .per-rep-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.per-body .per-row-actions { white-space: nowrap; text-align: right; }
.per-body .per-rp-sections { display: grid; gap: var(--space-3); margin: var(--space-3) 0; }
.per-body .per-rp-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; }
.per-body .per-rp-opts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.per-body .per-rp-top { width: 72px; text-align: right; }
.per-body .per-rp-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }

@media (max-width: 1024px) {
  .per-body .per-mp-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .per-body .per-kp-hero { grid-column: auto; }
  .per-body .per-mp-map { height: 55vh; }
  .per-body .per-mp-bar-icon { display: none; }
  .per-body .per-mp-bars-switch { display: none; }
  .per-body .per-mp-timelapse { flex-wrap: wrap; }
  .per-body .per-mp-timelapse .fx-tl-main { flex-basis: 100%; order: 3; }
  .per-body .per-mp-timelapse .fx-icon-btn { min-width: 44px; min-height: 44px; }
  .per-body .per-mp-timelapse .fx-range { height: 32px; }
  .per-body .per-row-actions { text-align: left; }
}
.per-body .per-status-cell { display: grid; gap: var(--space-1); justify-items: start; }

/* ── AI-assisted path: workshop capture, plate history, delivery (CA-112) ── */
.per-body #per-ai-stage .fx-btn { margin-left: auto; }
.per-body .per-ph { display: grid; gap: var(--space-3); margin-top: var(--space-6); }
.per-body .per-cap-body { display: grid; gap: var(--space-4); max-width: 640px; }
.per-body .per-cap-card, .per-body .per-cap-fields, .per-body .per-cap-intro { display: grid; gap: var(--space-4); }
.per-body .per-cap-intro { gap: var(--space-1); }
.per-body .per-cap-sticky { display: none; }
.per-body .per-cap-tags { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
.per-body .per-dv-grid, .per-body .per-dv-form { display: grid; gap: var(--space-4); max-width: 720px; }
.per-body .per-dv-fields, .per-body .per-dv-emails, .per-body .per-dv-events-list { display: grid; gap: var(--space-3); }
.per-body .per-dv-insurer { max-width: 360px; }
.per-body .per-dv-email-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) auto; gap: var(--space-2); align-items: center; }
.per-body .per-dv-secret-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.per-body .per-dv-secret-copy { flex-basis: 100%; }
.per-body .per-dv-secret-copy .fx-input { flex: 1 1 200px; min-width: 0; }
.per-body .per-dl-body { display: grid; gap: var(--space-4); }
.per-body .per-dl-totals { width: 100%; max-width: 360px; margin-left: auto; }

@media (max-width: 768px) {
  .per-body .per-cap-desk { display: none; }
  .per-body .per-cap-sticky { display: grid; gap: var(--space-2); }
  .per-body .per-cap-tags { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .per-body .per-dv-email-row { grid-template-columns: minmax(0, 1fr) auto; }
  .per-body .per-dv-email-row .fx-select-wrap { grid-column: 1; }
  .per-body .per-dl-totals { max-width: none; }
}

/* ── Live video call (CA-112): remote video whole in the frame, local preview in a corner ── */
.per-body .per-call > .per-call-remote { object-fit: contain; }
.per-body .per-call-local { position: absolute; top: calc(var(--space-12) + var(--space-8) + env(safe-area-inset-top, 0px)); right: var(--space-4); width: 200px; }
.per-body .per-call-bar { gap: var(--space-4); flex-wrap: wrap; }
.per-body .per-call-warn { position: absolute; left: var(--space-4); bottom: calc(var(--space-12) * 2 + var(--space-8) + env(safe-area-inset-bottom, 0px)); z-index: 1; }

@media (max-width: 768px) {
  .per-body .per-call-local { width: 112px; }
  .per-body .per-call-bar { gap: var(--space-3); }
}

/* ── Live call copilot (CA-305): staff-only panel beside the remote video (phones: the shared fx-sheet bottom sheet) ── */
.per-body .per-copilot-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.per-body .per-copilot-bd { display: grid; gap: var(--space-4); }
@media (max-width: 768px) { .per-body .per-copilot-bd { padding: 0; } }
.per-body .per-copilot-sec { display: grid; gap: var(--space-2); min-width: 0; }
.per-body .per-copilot-transcript { display: grid; gap: var(--space-1); max-height: 22vh; overflow-y: auto; }
.per-body .per-copilot-lines { max-height: 30vh; overflow-y: auto; }
.per-body .per-copilot-card { align-items: flex-start; gap: var(--space-2); }
.per-body .per-call-notice { position: absolute; top: calc(var(--space-12) + var(--space-2) + env(safe-area-inset-top, 0px)); right: var(--space-4); z-index: 1; }
@media (min-width: 769px) {
  .per-body .per-call-copilot { position: absolute; left: var(--space-4); top: calc(var(--space-12) + var(--space-8) + env(safe-area-inset-top, 0px)); bottom: calc(var(--space-12) * 2 + var(--space-8) + env(safe-area-inset-bottom, 0px)); z-index: 1; width: min(380px, 38vw); overflow-y: auto; align-content: start; }
}

/* ── Vehicles and pre-inspections (CA-289) ── */
.per-body .per-vh-body, .per-body .per-vh-timeline, .per-body .per-vh-card { display: grid; gap: var(--space-4); }
.per-body .per-vh-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.per-body .per-vh-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.per-body .per-vh-value { max-width: 280px; }
.per-body .per-vh-value-row { display: flex; align-items: center; gap: var(--space-2); }
.per-body .per-vh-value-row .fx-input { flex: 1 1 auto; min-width: 0; }
.per-body .per-vh-facts { max-width: 420px; }

@media (max-width: 768px) {
  .per-body .per-vh-actions .fx-btn { flex: 1 1 100%; }
  .per-body .per-vh-value { max-width: none; }
}

/* ── Call recordings (CA-296): recording indicator in the call panel, Calls section with player + transcript ── */
.per-body .per-call-rec { position: absolute; top: calc(var(--space-12) + var(--space-2) + env(safe-area-inset-top, 0px)); left: var(--space-4); z-index: 1; }
.per-body .per-calls-search { flex: 1 1 280px; max-width: 520px; }
.per-body .per-calls-player { margin-top: var(--space-4); }
.per-body .per-calls-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.per-body .per-calls-video { width: 100%; max-height: 60vh; }
.per-body .per-calls-transcript { display: grid; gap: var(--space-2); min-width: 0; }
.per-body .per-calls-segments { max-height: 60vh; overflow-y: auto; }
.per-body .per-calls-seg, .per-body .per-calls-hit { align-items: flex-start; }
.per-body .per-calls-time { flex: none; min-width: 48px; }
.per-body .per-calls-text { min-width: 0; overflow-wrap: anywhere; }
.per-body .per-calls-hit-head { margin: var(--space-2) var(--space-4) 0; }

@media (max-width: 1024px) {
  .per-body .per-calls-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .per-body .per-calls-search { max-width: none; flex-basis: 100%; }
  .per-body .per-calls-video, .per-body .per-calls-segments { max-height: 40vh; }
}

/* CA-310: the assistant panel has no floating button, so on desktop it sits in the corner (phones: the shared bottom sheet) */
@media (min-width: 769px) {
  .per-body #per-assistant-panel { bottom: var(--space-6); }
}
.per-body .per-assistant-sources, .per-body .per-assistant-grounding, .per-body .per-assistant-actions { margin-top: var(--space-2); }

/* Ask the driver for photos (CA-309): the link and its copy button on one row */
.per-body .per-cl-url-row { display: flex; gap: var(--space-2); align-items: center; }
.per-body .per-cl-url-row .fx-input { flex: 1 1 auto; min-width: 0; }
.per-body .per-cl-facts { margin-bottom: var(--space-3); }

/* Insurer data files (CA-528): the reports card, the management view and the case report fields (layout only) */
.per-body .per-df-card { margin-bottom: var(--space-4); }
.per-body .per-df-body, .per-body .per-dfm-body, .per-body .per-dfm-panel, .per-body .per-rf-grid { display: grid; gap: var(--space-4); }
.per-body .per-df-body .per-panel-actions, .per-body .per-dfm-panel .per-panel-actions { justify-content: flex-start; }
.per-body .per-dfm-insurer, .per-body .per-dfm-filter { max-width: 360px; }
.per-body .per-dfm-panel .per-form-actions { margin-top: 0; }
.per-body .per-rf { display: grid; gap: var(--space-3); margin-top: var(--space-6); }
.per-body .per-nw-ar { max-width: 360px; }
/*# sourceMappingURL=style.css.9a58591c2f8e.css.map */
