/* ==========================================================================
   COMPONENTS — Ledger v1.0.  Consumes tokens.css only.
   Order: controls → surfaces → chips/badges → signature elements →
          overlays → nav/footer → table → terminal/code → misc.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  height: var(--control-h-md); padding-inline: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: var(--font-weight-medium);
  border: 1px solid transparent;
  white-space: nowrap; user-select: none;
  transition: background var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out);
}
.btn:active { transform: translateY(0.5px); }
.btn .icon { width: 16px; height: 16px; }

.btn-sm { height: var(--control-h-sm); padding-inline: var(--space-3); font-size: 0.8125rem; }
.btn-lg { height: var(--control-h-lg); padding-inline: var(--space-5); font-size: 0.9375rem; }

.btn-primary { background: var(--color-brand); color: var(--color-on-brand); }
.btn-primary:hover { background: var(--color-brand-hover); color: var(--color-on-brand); box-shadow: var(--glow-brand); transform: translateY(-1px); }
.btn-primary:active { background: var(--color-brand-active); transform: translateY(0.5px); box-shadow: none; }

.btn-secondary { background: var(--color-bg-raised); border-color: var(--color-border-default); color: var(--color-text-primary); }
.btn-secondary:hover { background: var(--color-bg-highlight); border-color: var(--color-border-strong); color: var(--color-text-primary); }

.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-bg-highlight); color: var(--color-text-primary); }
.btn-ghost.text-danger { color: var(--color-danger-text); }
.btn-ghost.text-danger:hover { background: var(--color-danger-tint); color: var(--color-danger-text); }

.btn-danger { background: var(--color-danger-solid); color: #fff; }
.btn-danger:hover { background: var(--color-danger); color: #fff; }

.btn-icon { width: var(--control-h-sm); height: var(--control-h-sm); padding: 0; border-radius: var(--radius-md); }
.btn-icon.btn-md { width: var(--control-h-md); height: var(--control-h-md); }

.btn[disabled], .btn.is-disabled {
  background: var(--color-bg-inset); color: var(--color-text-disabled);
  border-color: var(--color-border-subtle);
  box-shadow: none; transform: none; cursor: not-allowed;
}
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid var(--color-border-strong); border-top-color: var(--color-accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.btn-primary.is-loading::after { border-color: rgba(5,43,30,.3); border-top-color: var(--color-on-brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Inputs / selects / fields
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--text-body-sm); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); }
.field-help { font-size: var(--text-caption); color: var(--color-text-tertiary); }
.field-error { display: flex; align-items: center; gap: 6px; font-size: var(--text-caption); color: var(--color-danger-text); }

.input, .select, .textarea {
  width: 100%; height: var(--control-h-md);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding-inline: var(--space-3);
  color: var(--color-text-primary);
  font-size: var(--text-body);
  transition: border-color var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out);
}
[data-theme="light"] .input, [data-theme="light"] .select, [data-theme="light"] .textarea { background: #FFFFFF; }
.textarea { height: auto; min-height: 96px; padding-block: var(--space-2); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--color-text-tertiary); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-border-strong); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--color-accent); box-shadow: var(--focus-ring); border-radius: var(--radius-md);
}
.input.is-error { border-color: var(--color-danger); }
.input.is-valid { border-color: var(--color-border-brand); }
.input-mono { font-family: var(--font-mono); font-size: var(--text-data); }
.input-sm { height: var(--control-h-sm); font-size: var(--text-body-sm); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237E8CA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 34px;
}
.select-sm { height: var(--control-h-sm); font-size: var(--text-body-sm); }

/* Search input (lens icon left) */
.input-search-wrap { position: relative; }
.input-search-wrap .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-tertiary); pointer-events: none;
}
.input-search-wrap .input { padding-left: 38px; }

/* Checkbox */
.checkbox {
  appearance: none; width: 16px; height: 16px; flex: none;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-xs);
  background: var(--color-bg-inset);
  display: inline-grid; place-content: center;
  transition: background var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
  cursor: pointer;
}
.checkbox:checked { background: var(--color-brand); border-color: var(--color-brand); }
.checkbox:checked::before {
  content: ""; width: 9px; height: 9px;
  background: var(--color-on-brand);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
[data-theme="light"] .checkbox:checked::before { background: #fff; }
.checkbox:indeterminate { background: var(--color-brand); border-color: var(--color-brand); }
.checkbox:indeterminate::before { content: ""; width: 8px; height: 2px; background: var(--color-on-brand); clip-path: none; }

/* kbd hint */
.kbd {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--color-text-tertiary);
  background: var(--color-bg-highlight);
  border: 1px solid var(--color-border-subtle); border-radius: var(--radius-xs);
  padding: 1px 5px;
}

/* --------------------------------------------------------------------------
   Cards & stat tiles
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-edge), var(--shadow-1);
  padding: var(--space-6);
}
.card-interactive { transition: border-color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out); }
.card-interactive:hover { border-color: var(--color-border-default); transform: translateY(-1px); box-shadow: var(--shadow-edge), var(--shadow-2); }

/* Flagship gradient-border card — max ONE per screen */
.card-flagship { position: relative; background: var(--color-bg-raised); border: 1px solid transparent; border-radius: var(--radius-xl); background-clip: padding-box; box-shadow: var(--shadow-edge), var(--shadow-2); }
.card-flagship::before {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(43,200,232,.4), rgba(44,226,162,.4) 55%, rgba(43,200,232,.15));
}
[data-theme="light"] .card-flagship::before { background: linear-gradient(120deg, rgba(8,145,178,.35), rgba(15,157,107,.35) 55%, rgba(8,145,178,.12)); }

.stat-tile {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-edge), var(--shadow-1);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  position: relative; overflow: hidden;
}
.stat-tile-headline::after {
  content: ""; position: absolute; top: 0; left: var(--space-5); right: var(--space-5);
  height: 2px; border-radius: 0 0 2px 2px; background: var(--gradient-band);
}
.stat-tile .stat-label { font-size: var(--text-overline); line-height: var(--leading-overline); font-weight: 600; letter-spacing: var(--tracking-overline); text-transform: uppercase; color: var(--color-text-tertiary); display: flex; align-items: center; gap: 6px; }
.stat-tile .stat-value { font-family: var(--font-mono); font-size: var(--text-data-xl); line-height: var(--leading-data-xl); font-weight: 600; letter-spacing: -0.01em; color: var(--color-text-primary); }
.stat-tile .stat-context { font-size: var(--text-body-sm); color: var(--color-text-secondary); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: var(--text-data-sm); font-weight: 500; border-radius: var(--radius-full); padding: 1px 8px; }
.delta-up { color: var(--color-success-text); background: var(--color-success-tint); }
.delta-down { color: var(--color-danger-text); background: var(--color-danger-tint); }

/* --------------------------------------------------------------------------
   Badges, grade chips, citation chips, evidence-class chips
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding-inline: var(--space-2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: var(--text-overline); font-weight: 600;
  letter-spacing: var(--tracking-overline); text-transform: uppercase;
  background: var(--color-bg-inset); border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge-brand   { background: var(--color-brand-tint); border-color: var(--color-success-border); color: var(--color-brand-text); }
.badge-accent  { background: var(--color-accent-tint); border-color: rgba(43,200,232,.35); color: var(--color-accent-text); }
.badge-success { background: var(--color-success-tint); border-color: var(--color-success-border); color: var(--color-success-text); }
.badge-warning { background: var(--color-warning-tint); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.badge-danger  { background: var(--color-danger-tint); border-color: var(--color-danger-border); color: var(--color-danger-text); }
.badge-info    { background: var(--color-info-tint); border-color: var(--color-info-border); color: var(--color-info-text); }

/* Grade chips — facts, not buttons (no hover) */
.grade-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 20px; min-width: 30px; padding-inline: 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-weight: 600; font-size: var(--text-data-sm);
}
.grade-chip-md { height: 24px; min-width: 36px; font-size: var(--text-data); }
.grade-chip-lg { height: 40px; min-width: 56px; font-size: var(--text-data-lg); font-weight: 700; }
.grade-a { background: var(--grade-a-tint); color: var(--grade-a-text); border: 1px solid color-mix(in srgb, var(--grade-a-fill) 35%, transparent); }
.grade-b { background: var(--grade-b-tint); color: var(--grade-b-text); border: 1px solid color-mix(in srgb, var(--grade-b-fill) 35%, transparent); }
.grade-c { background: var(--grade-c-tint); color: var(--grade-c-text); border: 1px solid color-mix(in srgb, var(--grade-c-fill) 35%, transparent); }
.grade-d { background: var(--grade-d-tint); color: var(--grade-d-text); border: 1px solid color-mix(in srgb, var(--grade-d-fill) 35%, transparent); }
.grade-f { background: var(--grade-f-tint); color: var(--grade-f-text); border: 1px solid color-mix(in srgb, var(--grade-f-fill) 35%, transparent); }
/* lg = hero weight: solid grade fill + ink label (DS §6.2) */
.grade-chip-lg.grade-a { background: var(--grade-a-fill); color: var(--color-brand, #052B1E); color: #052B1E; border: none; }
.grade-chip-lg.grade-b { background: var(--grade-b-fill); color: #052B1E; border: none; }
.grade-chip-lg.grade-c { background: var(--grade-c-fill); color: #231A04; border: none; }
.grade-chip-lg.grade-d { background: var(--grade-d-fill); color: #2B1204; border: none; }
.grade-chip-lg.grade-f { background: var(--grade-f-fill); color: #fff; border: none; }
[data-theme="light"] .grade-chip-lg.grade-a, [data-theme="light"] .grade-chip-lg.grade-b { color: #fff; }
[data-theme="light"] .grade-chip-lg.grade-c { color: #0C141D; }
[data-theme="light"] .grade-chip-lg.grade-d, [data-theme="light"] .grade-chip-lg.grade-f { color: #fff; }

/* Citation / source chip — the proof-of-work */
.cite-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding-inline: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-bg-inset); border: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono); font-size: var(--text-data-sm); font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: border-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.cite-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--color-accent); flex: none; }
.cite-chip .icon { width: 10px; height: 10px; color: var(--color-text-tertiary); }
a.cite-chip:hover { border-color: rgba(43,200,232,.45); color: var(--color-accent-text); }
a.cite-chip:hover .icon { color: var(--color-accent-text); }

/* Evidence-class chips: MEASURED / SOURCED / HEURISTIC / ARITHMETIC */
.evidence-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-overline); font-weight: 600;
  letter-spacing: var(--tracking-overline); text-transform: uppercase;
  border: 1px solid;
}
.evidence-measured   { color: var(--color-brand-text); background: var(--color-brand-tint); border-color: var(--color-success-border); }
.evidence-sourced    { color: var(--color-accent-text); background: var(--color-accent-tint); border-color: rgba(43,200,232,.35); }
/* Heuristic = violet (chart series-3), NOT amber: amber is reserved for user
   risk, never for describing our own product (DS §1.6). */
.evidence-heuristic  { color: #B9A9FF; background: rgba(160,143,255,.14); border-color: rgba(160,143,255,.35); }
[data-theme="light"] .evidence-heuristic { color: #5847B8; background: rgba(109,91,208,.12); border-color: rgba(109,91,208,.35); }
.evidence-arithmetic { color: var(--color-text-secondary); background: var(--color-bg-inset); border-color: var(--color-border-default); }

/* --------------------------------------------------------------------------
   SIGNATURE — Valuation band
   -------------------------------------------------------------------------- */
.band { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.band-track {
  position: relative; width: 100%;
  height: var(--band-h-md);
  background: var(--color-band-track);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
}
.band-sm .band-track { height: var(--band-h-sm); border: none; }
.band-lg .band-track { height: var(--band-h-lg); }
.band-fill {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--gradient-band);
  transform-origin: left center;
  animation: band-fill var(--motion-deliberate) var(--ease-spring) both;
}
@keyframes band-fill { from { transform: scaleX(0); } }
.band-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 2px; height: calc(100% + 6px);
  background: var(--color-band-marker); border-radius: 1px;
}
.band-lg .band-marker::after {
  content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 6px; height: 6px; background: var(--color-band-marker); border-radius: 1px;
}
.band-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--chart-6); opacity: 0.6;
}
/* On the report hero the dots are the evidence — each one a cited sale that
   landed inside this band — so they have to be legible against the fill.
   At the inline size (3px, 60% opacity) they were invisible on the taller
   lg track; measured on a real report before fixing. */
.band-lg .band-dot {
  width: 7px; height: 7px; opacity: 1;
  background: var(--color-bg-base);
  box-shadow: 0 0 0 2px var(--chart-6);
}
.band-labels { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.band-inline { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.band-inline .band-track { width: 96px; flex: none; height: 5px; }
.band-inline .band-fill { min-width: 8px; }

/* --------------------------------------------------------------------------
   SIGNATURE — Evidence strip (honest-metrics row)
   -------------------------------------------------------------------------- */
.evidence-strip {
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}
.evidence-strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.evidence-stat { padding: var(--space-6) var(--space-6); border-left: 1px solid var(--color-border-subtle); }
.evidence-stat:first-child { border-left: none; }
.evidence-stat .ev-value { font-family: var(--font-mono); font-size: var(--text-data-lg); line-height: var(--leading-data-lg); font-weight: 600; color: var(--color-text-primary); }
.evidence-stat .ev-label { margin-top: var(--space-1); font-size: var(--text-overline); font-weight: 600; letter-spacing: var(--tracking-overline); text-transform: uppercase; color: var(--color-text-tertiary); }
@media (max-width: 920px) { .evidence-strip-grid { grid-template-columns: repeat(2, 1fr); } .evidence-stat:nth-child(3) { border-left: none; } .evidence-stat { padding: var(--space-4); } }

/* --------------------------------------------------------------------------
   SIGNATURE — Methodology / trust strip (replaces the beta warning wall)
   -------------------------------------------------------------------------- */
.trust-strip {
  position: relative;
  background: var(--color-bg-inset);
  border-bottom: 1px solid var(--color-border-subtle);
}
.trust-strip::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gradient-band);
}
.trust-strip-inner {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 40px; padding: var(--space-2) var(--space-6);
  max-width: var(--container-app); margin-inline: auto;
  flex-wrap: wrap;
}
.trust-strip .trust-text { font-size: var(--text-body-sm); color: var(--color-text-secondary); }
.trust-strip .trust-text .mono { color: var(--color-text-primary); font-size: var(--text-data-sm); }
.trust-strip a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-body-sm); font-weight: 500; white-space: nowrap; }
@media (max-width: 720px) { .trust-strip .trust-text .trust-detail { display: none; } }
/* Mobile: collapse to badge + link only (IA §1.5) */
@media (max-width: 560px) {
  .trust-strip .trust-text { display: none; }
  .trust-strip-inner { justify-content: space-between; min-height: 36px; }
}

/* --------------------------------------------------------------------------
   Tabs & segmented controls
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--color-border-subtle); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 560px) { .tab { padding-inline: var(--space-3); font-size: var(--text-body-sm); } }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 40px; padding-inline: var(--space-4);
  font-size: var(--text-body); font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--motion-fast) var(--ease-out);
  white-space: nowrap;
}
.tab:hover { color: var(--color-text-primary); }
.tab.active { color: var(--color-text-primary); }
.tab.active::after {
  content: ""; position: absolute; left: var(--space-2); right: var(--space-2); bottom: -1px;
  height: 2px; background: var(--color-brand); border-radius: 1px;
}
[data-theme="light"] .tab.active::after { background: var(--color-brand); }

.segmented {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  padding: 3px; height: 32px;
}
.segmented button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 24px; padding-inline: 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-body-sm); font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.segmented button:hover { color: var(--color-text-primary); }
.segmented button.active {
  background: var(--color-bg-raised); color: var(--color-text-primary);
  border: 1px solid var(--color-border-subtle); box-shadow: var(--shadow-1);
}

/* --------------------------------------------------------------------------
   Dropdown menu
   -------------------------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-dropdown);
  min-width: 200px; padding: 6px;
  background: var(--color-bg-overlay);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity var(--motion-base) var(--ease-out), transform var(--motion-base) var(--ease-out);
}
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%; height: 36px; padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-body-sm); color: var(--color-text-primary);
  text-align: left;
}
.dropdown-item .icon { color: var(--color-text-tertiary); }
.dropdown-item:hover { background: var(--color-bg-highlight); color: var(--color-text-primary); }
.dropdown-item.danger { color: var(--color-danger-text); }
.dropdown-item.danger .icon { color: var(--color-danger-text); }
.dropdown-sep { height: 1px; background: var(--color-border-subtle); margin: 6px var(--space-2); }
.dropdown-header { padding: var(--space-2); }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: none; align-items: flex-start; justify-content: center;
  padding: var(--space-16) var(--space-4) var(--space-8);
  background: var(--color-scrim);
  backdrop-filter: var(--glass-scrim-blur); -webkit-backdrop-filter: var(--glass-scrim-blur);
  overflow-y: auto;
}
.modal-overlay.open { display: flex; animation: fade-in var(--motion-slow) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 440px;
  background: var(--color-bg-overlay);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-4);
  animation: modal-in var(--motion-slow) var(--ease-spring);
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.98) translateY(8px); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-6) var(--space-6) var(--space-4); }
.modal-body { padding: 0 var(--space-6) var(--space-6); }
.modal-footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-border-subtle); }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2); max-width: 400px;
}
@media (max-width: 720px) { .toast-container { left: var(--space-4); right: var(--space-4); bottom: 84px; } }
.toast {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  font-size: var(--text-body-sm); font-weight: var(--font-weight-medium);
  animation: toast-in var(--motion-slow) var(--ease-spring);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.toast.leaving { opacity: 0; transition: opacity var(--motion-fast) var(--ease-in); }
.toast .icon { margin-top: 1px; }
.toast-close { margin-left: auto; opacity: 0.7; display: inline-flex; }
.toast-close:hover { opacity: 1; }
.toast-success { background: var(--toast-success-bg); color: var(--toast-success-fg); }
.toast-warning { background: var(--toast-warning-bg); color: var(--toast-warning-fg); }
.toast-danger  { background: var(--toast-danger-bg); color: var(--toast-danger-fg); }
.toast-info    { background: var(--toast-info-bg); color: var(--toast-info-fg); }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination { display: flex; align-items: center; gap: var(--space-1); }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding-inline: 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-data-sm);
  color: var(--color-text-secondary);
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.page-btn:hover { background: var(--color-bg-highlight); color: var(--color-text-primary); }
.page-btn.current { background: var(--color-bg-highlight); border: 1px solid var(--color-border-default); color: var(--color-text-primary); }
.page-btn[disabled] { color: var(--color-text-disabled); pointer-events: none; }

/* --------------------------------------------------------------------------
   Progress & score bars
   -------------------------------------------------------------------------- */
.progress { position: relative; height: 6px; background: var(--color-bg-inset); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { position: absolute; inset: 0; background: var(--gradient-band); border-radius: inherit; transform-origin: left; transition: transform var(--motion-deliberate) var(--ease-spring); }
.score-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-3); }
.score-bar .score-track { grid-column: 1; height: 4px; background: var(--color-bg-inset); border-radius: var(--radius-full); overflow: hidden; position: relative; }
.score-bar .score-fill { position: absolute; inset: 0; background: var(--gradient-band); transform-origin: left; animation: band-fill var(--motion-deliberate) var(--ease-spring) both; border-radius: inherit; }
.score-bar .score-value { font-family: var(--font-mono); font-size: var(--text-data-sm); font-weight: 500; color: var(--color-text-primary); }
.score-bar .score-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }

/* --------------------------------------------------------------------------
   Skeleton
   -------------------------------------------------------------------------- */
.skeleton { position: relative; overflow: hidden; background: var(--color-bg-highlight); border-radius: var(--radius-sm); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(160,178,196,.06), transparent);
  animation: shimmer 1.6s linear infinite;
}
[data-theme="light"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* --------------------------------------------------------------------------
   Tooltip (data + UI)
   -------------------------------------------------------------------------- */
.tooltip {
  position: absolute; z-index: var(--z-tooltip);
  padding: 6px 10px; max-width: 240px;
  background: var(--color-bg-overlay);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  font-size: var(--text-caption); color: var(--color-text-primary);
  pointer-events: none;
}
[data-theme="light"] .tooltip { background: #0C141D; border-color: #0C141D; color: #EAF1F7; }

/* --------------------------------------------------------------------------
   Nav header
   -------------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  height: var(--nav-h);
  background: var(--glass-nav-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-border-subtle);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  height: 100%; max-width: var(--container-app); margin-inline: auto; padding-inline: var(--space-6);
}
.nav-brand { display: flex; align-items: center; gap: var(--space-2); flex: none; }
/* The nav logo carries index.css's .official-logo-img as well, which swaps the
   asset per theme via `content: url()` — logo-dark.png has light lettering for
   dark surfaces, logo.png dark lettering for light ones. Without that class the
   wordmark is near-black on a near-black nav: only the mint checkmark and ".ai"
   stay legible, which is exactly how it looked in the first 3c screenshot.
   This rule is more specific than .official-logo-img, so the 26px height here
   still wins over that rule's 32px. */
.nav-brand img { height: 26px; width: auto; max-width: none; }
.nav-rail {
  display: flex; align-items: center; gap: 2px;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
}
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding-inline: 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-body-sm); font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-link .icon { width: 15px; height: 15px; }
.nav-link:hover { background: var(--color-bg-highlight); color: var(--color-text-primary); }
.nav-link.active { background: var(--color-brand-tint); color: var(--color-brand-text); }
.nav-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-content: center;
  background: var(--color-brand-tint); color: var(--color-brand-text);
  border: 1px solid var(--color-success-border);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.account-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-2) 0 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-raised);
  transition: border-color var(--motion-fast) var(--ease-out);
}
.account-chip:hover { border-color: var(--color-border-default); }
.account-chip .who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.account-chip .who .name { font-size: var(--text-body-sm); font-weight: 500; color: var(--color-text-primary); }
.account-chip .who .tier { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--color-brand-text); }

.hamburger { display: none; }

/* Mobile nav sheet */
.nav-sheet-overlay { position: fixed; inset: 0; z-index: calc(var(--z-nav) + 1); background: var(--color-scrim); display: none; }
.nav-sheet-overlay.open { display: block; animation: fade-in var(--motion-slow) var(--ease-out); }
.nav-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-nav) + 2);
  width: min(320px, 88vw);
  background: var(--color-bg-overlay);
  border-left: 1px solid var(--color-border-default);
  box-shadow: var(--shadow-4);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--motion-slow) var(--ease-spring), visibility 0s var(--motion-slow);
  display: flex; flex-direction: column;
}
.nav-sheet.open { transform: none; visibility: visible; transition: transform var(--motion-slow) var(--ease-spring); }
.nav-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border-subtle); }
.nav-sheet-body { flex: 1; overflow-y: auto; padding: var(--space-3); }
.nav-sheet-link {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; height: 48px; padding-inline: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-body); font-weight: 500; color: var(--color-text-secondary);
  border-left: 2px solid transparent; text-align: left;
}
/* ia-content 1.5 groups the free tools under "Product" in the sheet, where the
   desktop rail uses a dropdown. A heading rather than a nested disclosure: the
   sheet is already a scrollable list, and a second layer of open/close inside
   it buys nothing on a phone. */
.nav-sheet-group {
  padding: var(--space-4) var(--space-3) var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-overline); font-weight: 600;
  letter-spacing: var(--tracking-overline); text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.nav-sheet-link .icon { color: var(--color-text-tertiary); }
.nav-sheet-link:hover { background: var(--color-bg-highlight); color: var(--color-text-primary); }
.nav-sheet-link.active { background: var(--color-brand-tint); color: var(--color-brand-text); border-left-color: var(--color-brand); }
.nav-sheet-link.active .icon { color: var(--color-brand-text); }
.nav-sheet-foot { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-border-subtle); }

@media (max-width: 920px) {
  .nav-rail, .nav .account-chip .who, .nav .theme-toggle-desktop { display: none; }
  .hamburger { display: inline-flex; }
  .nav-inner { padding-inline: var(--space-4); }
}
@media (max-width: 600px) {
  .nav .nav-auth-cta { display: none; } /* Log in + CTA live in the menu sheet */
}

/* App bottom tab bar (mobile, logged-in app screens) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: none;
  background: var(--glass-nav-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--color-border-subtle);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* auto-fit, not repeat(4, 1fr): the Appraise slot carries .nav-item, so app.js
   hides it for signed-out visitors (who still browse the demo portfolio, report
   and history). A fixed four-column grid would leave a dead cell; this reflows
   to three. minmax(0, …) so a long label cannot push the row wider than the
   viewport — the min-width:auto trap that cost 118px on Settings in phase 3a. */
.tabbar-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 10px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--color-text-tertiary);
}
.tabbar-item .icon { width: 20px; height: 20px; }
.tabbar-item.active { color: var(--color-brand-text); }
@media (max-width: 920px) {
  body.app-mode .tabbar { display: block; }
  body.app-mode main { padding-bottom: 76px; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--color-border-subtle); padding: var(--space-16) 0 var(--space-8); margin-top: var(--space-24); }
body.app-mode .footer { margin-top: var(--space-16); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: var(--space-8); }
@media (max-width: 920px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: var(--text-overline); font-weight: 600; letter-spacing: var(--tracking-overline); text-transform: uppercase; color: var(--color-text-tertiary); margin-bottom: var(--space-3); }
.footer-col a { display: flex; align-items: center; min-height: 32px; font-size: var(--text-body-sm); color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-text-primary); }
.footer-brand img { height: 24px; margin-bottom: var(--space-3); }
.footer-brand p { font-size: var(--text-body-sm); color: var(--color-text-secondary); max-width: 30ch; }
.footer-brand .ev-figures { margin-top: var(--space-3); font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--color-text-tertiary); line-height: 1.7; }
.footer-bottom {
  margin-top: var(--space-12); padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: center; justify-content: space-between;
}
.footer-bottom .legal { font-size: var(--text-caption); color: var(--color-text-tertiary); max-width: 72ch; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--color-text-secondary); white-space: nowrap; }
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--color-brand); animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --------------------------------------------------------------------------
   THE TABLE (flagship)
   -------------------------------------------------------------------------- */
.vtable-shell {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-edge), var(--shadow-1);
  overflow: hidden;
}
.vtable-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  flex-wrap: wrap;
}
.vtable-toolbar .toolbar-left { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.vtable-toolbar .toolbar-right { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.vtable-toolbar .input-search-wrap { width: 230px; max-width: 100%; }

.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding-inline: 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-inset);
  font-size: var(--text-body-sm); font-weight: 500; color: var(--color-text-secondary);
  transition: border-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out);
}
.filter-chip:hover { color: var(--color-text-primary); border-color: var(--color-border-strong); }
.filter-chip.active { background: var(--color-accent-tint); border-color: rgba(43,200,232,.45); color: var(--color-accent-text); }
.filter-chip .icon { width: 12px; height: 12px; }

/* Bulk-selection morph bar */
.vtable-bulkbar {
  display: none; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-brand-tint);
  border-top: 1px solid var(--color-success-border);
  border-bottom: 1px solid var(--color-success-border);
}
.vtable-bulkbar.visible { display: flex; flex-wrap: wrap; }
.vtable-bulkbar .count { font-family: var(--font-mono); font-size: var(--text-data-sm); font-weight: 600; color: var(--color-brand-text); }

.vtable-scroll { overflow-x: auto; }
.vtable { width: 100%; border-collapse: collapse; }
.vtable th {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: 40px; padding: 0 var(--space-4);
  background: var(--color-bg-inset);
  border-bottom: 1px solid var(--color-border-default);
  font-family: var(--font-mono); font-size: var(--text-overline); font-weight: 600;
  letter-spacing: var(--tracking-overline); text-transform: uppercase;
  color: var(--color-text-tertiary);
  text-align: left; white-space: nowrap;
}
.vtable th.num, .vtable td.num { text-align: right; }
.vtable th.sortable { cursor: pointer; user-select: none; }
.vtable th.sortable:hover { color: var(--color-text-secondary); }
.vtable th .sort-arrow { display: inline-block; width: 12px; color: var(--color-text-disabled); margin-left: 4px; }
.vtable th.sorted { color: var(--color-text-primary); box-shadow: inset 0 -2px 0 var(--color-brand); }
.vtable th.sorted .sort-arrow { color: var(--color-brand-text); }

.vtable td {
  height: var(--row-h-standard); padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--text-body); color: var(--color-text-secondary);
  vertical-align: middle;
}
.vtable-shell[data-density="compact"] .vtable td { height: var(--row-h-compact); padding-block: var(--space-1); }
.vtable-shell[data-density="relaxed"] .vtable td { height: var(--row-h-relaxed); }
.vtable tbody tr { transition: background var(--motion-instant) var(--ease-out); }
.vtable tbody tr:hover { background: var(--color-bg-highlight); }
.vtable tbody tr:last-child td { border-bottom: none; }
.vtable tbody tr.selected { background: var(--color-brand-tint); box-shadow: inset 2px 0 0 var(--color-brand); }
.vtable tbody tr.clickable { cursor: pointer; }
.vtable td.cell-domain { font-family: var(--font-mono); font-size: var(--text-data); font-weight: 500; color: var(--color-text-primary); white-space: nowrap; }
.vtable td.cell-num { font-family: var(--font-mono); font-size: var(--text-data); white-space: nowrap; }
.vtable td.cell-date { font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--color-text-tertiary); white-space: nowrap; }
.vtable .row-actions { display: flex; gap: var(--space-1); justify-content: flex-end; opacity: 0; transition: opacity var(--motion-fast) var(--ease-out); }
.vtable tbody tr:hover .row-actions, .vtable tbody tr:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .vtable .row-actions { opacity: 1; } }

.vtable-footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border-subtle);
  flex-wrap: wrap;
}
.vtable-footer .range { font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--color-text-tertiary); }

/* Card-collapse responsive mode */
.vtable-cards { display: none; padding: var(--space-3); gap: var(--space-3); flex-direction: column; }
.vtable-card {
  border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg);
  background: var(--color-bg-raised); box-shadow: var(--shadow-edge);
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.vtable-card .vc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.vtable-card .vc-domain { font-family: var(--font-mono); font-size: var(--text-data-md); font-weight: 500; color: var(--color-text-primary); }
.vtable-card .vc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); }
.vtable-card .vc-meta .m-label { font-size: var(--text-overline); font-weight: 600; letter-spacing: var(--tracking-overline); text-transform: uppercase; color: var(--color-text-tertiary); }
.vtable-card .vc-meta .m-value { font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--color-text-secondary); margin-top: 2px; }
@media (max-width: 720px) {
  .vtable-shell[data-responsive="cards"] .vtable-scroll { display: none; }
  .vtable-shell[data-responsive="cards"] .vtable-cards { display: flex; }
  .vtable-toolbar .input-search-wrap { width: 100%; }
}

/* Horizontal-scroll mode keeps first column sticky */
.vtable-shell[data-responsive="scroll"] .vtable td:first-child,
.vtable-shell[data-responsive="scroll"] .vtable th:first-child { position: sticky; left: 0; background: var(--color-bg-raised); z-index: 1; }
.vtable-shell[data-responsive="scroll"] .vtable th:first-child { background: var(--color-bg-inset); z-index: calc(var(--z-sticky) + 1); }
/* Shadow cue only when the table actually overflows (.is-scrollable set by JS) */
.vtable-shell[data-responsive="scroll"] .is-scrollable .vtable td:first-child::after,
.vtable-shell[data-responsive="scroll"] .is-scrollable .vtable th:first-child::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -12px; width: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,.18), transparent);
  pointer-events: none;
}
[data-theme="light"] .vtable-shell[data-responsive="scroll"] .is-scrollable .vtable td:first-child::after,
[data-theme="light"] .vtable-shell[data-responsive="scroll"] .is-scrollable .vtable th:first-child::after {
  background: linear-gradient(90deg, rgba(12,20,29,.08), transparent);
}

/* --------------------------------------------------------------------------
   Terminal / console
   -------------------------------------------------------------------------- */
.terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.terminal-head {
  display: flex; align-items: center; gap: var(--space-3);
  height: 40px; padding-inline: var(--space-4);
  background: rgba(160, 178, 196, 0.04);
  border-bottom: 1px solid var(--color-border-subtle);
}
.terminal-head .led { width: 7px; height: 7px; border-radius: 50%; background: var(--terminal-prompt); animation: pulse 2s var(--ease-out) infinite; }
.terminal-head .t-title { font-family: var(--font-mono); font-size: var(--text-data-sm); color: #A9B6C4; }
.terminal-head .t-meta { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--terminal-dim); }
.terminal-body { padding: var(--space-4); font-family: var(--font-mono); font-size: var(--text-code); line-height: var(--leading-code); max-height: 280px; overflow-y: auto; }
.terminal-line { display: flex; gap: var(--space-3); white-space: nowrap; }
.terminal-line .ts { color: var(--terminal-dim); flex: none; }
.terminal-line .t-domain { color: var(--terminal-fg); }
.terminal-line .t-status-queued { color: #8B9DB0; }
.terminal-line .t-status-run { color: #38CDF2; }
.terminal-line .t-status-done { color: var(--terminal-prompt); }
.terminal-line .t-status-fail { color: #FF8296; }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--terminal-prompt); vertical-align: text-bottom; animation: caret 1.1s steps(2, start) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* --------------------------------------------------------------------------
   Code blocks
   -------------------------------------------------------------------------- */
.code-block { background: var(--code-bg); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); overflow: hidden; min-width: 0; max-width: 100%; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}
.code-head .lang { font-family: var(--font-mono); font-size: var(--text-overline); font-weight: 600; letter-spacing: var(--tracking-overline); text-transform: uppercase; color: #94A3B8; }
.code-head .btn-ghost { color: #94A3B8; }
.code-head .btn-ghost:hover { background: rgba(160,178,196,.09); color: #E2E8F0; }
.code-block pre { margin: 0; padding: var(--space-4); overflow-x: auto; }
.code-block code { font-family: var(--font-mono); font-size: var(--text-code); line-height: var(--leading-code); color: var(--code-fg); }
.code-block .c-dim { color: var(--code-dim); }
.code-block .c-accent { color: var(--code-accent); }
.code-block .c-str { color: var(--code-accent-2); }
.inline-code { font-family: var(--font-mono); font-size: var(--text-data-sm); color: var(--color-text-primary); background: var(--color-bg-inset); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-xs); padding: 1px 6px; }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-3); max-width: 380px; margin: var(--space-16) auto; padding: 0 var(--space-4);
}
.empty-state .es-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--color-bg-inset); border: 1px solid var(--color-border-subtle);
  display: grid; place-content: center; color: var(--color-text-tertiary);
}
.empty-state .es-icon .icon { width: 32px; height: 32px; stroke-width: 1.5; }
.empty-state h3 { font-size: var(--text-heading-md); font-weight: 600; color: var(--color-text-primary); }
.empty-state p { font-size: var(--text-body-sm); color: var(--color-text-secondary); }
.empty-state .es-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */
.faq-item { border-bottom: 1px solid var(--color-border-subtle); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-5) 0; cursor: pointer; list-style: none;
  font-size: var(--text-heading-md); font-weight: 600; color: var(--color-text-primary);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { color: var(--color-text-tertiary); transition: transform var(--motion-base) var(--ease-out); flex: none; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 0 var(--space-5); color: var(--color-text-secondary); max-width: 68ch; }

/* --------------------------------------------------------------------------
   Section scaffolding (marketing)
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1) var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-overline); font-weight: 600;
  letter-spacing: var(--tracking-overline); text-transform: uppercase;
  color: var(--color-brand-text);
  max-width: 100%;
}
.section-head { max-width: 720px; margin-bottom: var(--space-10); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-top: var(--space-3); }
.section-head .lede { margin-top: var(--space-3); font-size: var(--text-body-lg); line-height: var(--leading-body-lg); color: var(--color-text-secondary); }

/* Notice / banner inline */
.notice {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-inset);
  font-size: var(--text-body-sm); color: var(--color-text-secondary);
}
.notice .icon { flex: none; margin-top: 2px; color: var(--color-text-tertiary); }
.notice-danger { border-color: var(--color-danger-border); background: var(--color-danger-tint); color: var(--color-danger-text); }
.notice-danger .icon { color: var(--color-danger-text); }
.notice-warning { border-color: var(--color-warning-border); background: var(--color-warning-tint); color: var(--color-warning-text); }
.notice-warning .icon { color: var(--color-warning-text); }

/* --------------------------------------------------------------------------
   <v-dropdown> (public/js/ui.js) — phase 3b.

   The element toggles an `open` ATTRIBUTE on itself rather than an `.open`
   class on a wrapper, so it needs its own visibility rule alongside
   `.dropdown.open .dropdown-menu` above. Both are kept: the class form is what
   the DataTable column menu uses, since that markup is re-rendered by innerHTML
   on every draw and re-upgrading a custom element per keystroke buys nothing.

   Visibility is opacity + pointer-events, never `display`, so the panel can
   transition and so a focusable item is never left tabbable while invisible.
   -------------------------------------------------------------------------- */
v-dropdown { position: relative; display: inline-block; }
v-dropdown[open] .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }

/* <v-modal> keys off an `open` attribute for the same reason, so it needs the
   attribute twin of `.modal-overlay.open`. Both forms are kept: the class form
   still serves any overlay not wrapped in the element. */
v-modal.modal-overlay[open] { display: flex; animation: fade-in var(--motion-slow) var(--ease-out); }

/* --------------------------------------------------------------------------
   Report market-band — phase 3b bug fix, retired in phase 5.

   #report-market-band is populated only when the SERVER engine returns a
   marketBand. Client-engine reports (every logged-out demo domain) left it
   empty, and once the Ledger card styling landed that empty element rendered as
   a bare bordered box between the report header and section 1 — visible in the
   phase 3a screenshots.

   Hiding it was the right fix while it was an unnumbered card of its own. In
   phase 5 it became the body of §1, so hiding the body would leave a numbered,
   titled section containing nothing. renderAppraisalReport now writes an
   explicit "not included in this report, and here is why" state instead, which
   is never empty — so this rule has nothing left to match and the reader is
   told which part is missing rather than shown a gap.
   -------------------------------------------------------------------------- */
