/* Mandate-All — institutional cabinet UI
   Tokens first; no ad-hoc palette drift. */

:root {
  /* Surfaces — ink & slate */
  --bg: #090a0c;
  --bg-elev: #0e1014;
  --surface: #13161c;
  --surface-2: #1a1e27;
  --surface-3: #232833;
  --surface-hover: #1f2430;

  /* Lines */
  --border: #2a303c;
  --border-strong: #3d4656;
  --border-soft: rgba(255, 255, 255, 0.06);

  /* Type */
  --fg: #eceef2;
  --muted: #9aa3b5;
  --faint: #6b7386;
  --faint-2: #525a6a;

  /* Brass authority accent (primary actions) */
  --primary: #c4a35a;
  --primary-hover: #d4b56a;
  --primary-fg: #12100a;
  --primary-dim: rgba(196, 163, 90, 0.14);
  --primary-ring: rgba(196, 163, 90, 0.35);

  /* Cool secondary (info / chrome) */
  --accent: #9eb0c8;
  --accent-dim: rgba(158, 176, 200, 0.12);

  /* Semantic */
  --success: #6ba87a;
  --success-dim: rgba(107, 168, 122, 0.15);
  --danger: #c67a7a;
  --danger-dim: rgba(198, 122, 122, 0.14);
  --warn: #c4a46a;
  --warn-dim: rgba(196, 164, 106, 0.14);

  /* Press / paper */
  --paper: #1c1814;
  --paper-border: #4a3e34;
  --paper-ink: #e8dcc8;
  --paper-muted: #b0a090;

  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);

  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --display: "IBM Plex Serif", Georgia, "Times New Roman", serif;

  --space-1: 0.35rem;
  --space-2: 0.75rem;
  --space-3: 1.15rem;
  --space-4: 1.5rem;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient vignette + subtle grain (no blob gradients) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(196, 163, 90, 0.06), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(80, 100, 140, 0.05), transparent 45%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.tab:focus-visible,
.menu-card:focus-visible,
.choice:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }

#app {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
}

/* —— Layout —— */
.screen {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem 6.5rem;
}
.screen.menu-hero {
  padding-top: 2.75rem;
  padding-bottom: 3.5rem;
  max-width: 720px;
}

.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row.between { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.row.wrap { flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.gap-1 { gap: 0.35rem; }
.gap-2 { gap: var(--space-2); }

.grid-2 { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
.grid-stats {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .grid-stats { grid-template-columns: repeat(7, 1fr); }
}

/* —— Type —— */
.h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  color: var(--fg);
}
.h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin: 0 0 0.65rem;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.success { color: var(--success); }
.danger { color: var(--danger); }
.warn { color: var(--warn); }
.small { font-size: 0.875rem; }
.xs { font-size: 0.75rem; }
.tabular { font-variant-numeric: tabular-nums; }

/* —— Surfaces —— */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.panel-inset {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary) 100%);
  color: var(--primary-fg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 2px 8px rgba(196, 163, 90, 0.25);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 14px rgba(196, 163, 90, 0.35);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--fg);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.btn-danger {
  border: 1px solid #5a3030;
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-dim);
}
.btn-block { width: 100%; }
.btn-lg {
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
}

/* —— Pills —— */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.7rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 500;
}
.pill-demo {
  background: var(--warn-dim);
  color: var(--warn);
  border-color: #5a4030;
}
.pill-full {
  background: var(--success-dim);
  color: var(--success);
  border-color: #2a4a38;
}

/* —— Forms —— */
.field { display: block; margin-bottom: 0.75rem; }
.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.field textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.45;
}

/* —— Meters —— */
.meter {
  height: 7px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #8a9bb0, var(--accent));
  transition: width 0.3s ease;
}
.meter.good > span { background: linear-gradient(90deg, #4a8a5a, var(--success)); }
.meter.bad > span { background: linear-gradient(90deg, #8a4a4a, var(--danger)); }
.meter.warn > span { background: linear-gradient(90deg, #8a7a4a, var(--warn)); }

/* —— Flag —— */
.flag {
  display: flex;
  width: 48px;
  height: 32px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.flag.lg { width: 80px; height: 52px; }
.flag > i { flex: 1; }

/* —— Topbar (game) —— */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(19, 22, 28, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.topbar .country-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.topbar-meta .pill {
  background: var(--surface-2);
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  text-transform: none;
  padding: 0.35rem 0.65rem;
}

/* Fear / Respect topbar pills (permanent chrome) */
.topbar-meta .pill.pill-fear {
  background: rgba(198, 122, 122, 0.14);
  border: 1px solid rgba(198, 122, 122, 0.35);
  color: #e8b0b0;
}
.topbar-meta .pill.pill-fear.is-hot {
  background: rgba(198, 122, 122, 0.28);
  border-color: rgba(198, 122, 122, 0.55);
  color: #f0c4c4;
  box-shadow: 0 0 0 1px rgba(198, 122, 122, 0.15);
}
.topbar-meta .pill.pill-respect {
  background: rgba(120, 150, 200, 0.14);
  border: 1px solid rgba(120, 150, 200, 0.35);
  color: #b8cce8;
}
.topbar-meta .pill.pill-respect.is-hot {
  background: rgba(120, 150, 200, 0.28);
  border-color: rgba(120, 150, 200, 0.55);
  color: #d0e0f5;
  box-shadow: 0 0 0 1px rgba(120, 150, 200, 0.15);
}
.topbar-meta .pill.pill-regime {
  background: var(--primary-dim);
  border: 1px solid rgba(196, 163, 90, 0.4);
  color: var(--primary);
}

/* Regime physics strip under topbar */
.regime-strip {
  margin: -0.35rem 0 1rem;
  padding: 0.7rem 0.9rem 0.75rem;
  background: linear-gradient(180deg, rgba(26, 30, 39, 0.95), rgba(19, 22, 28, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.regime-strip-main {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(7rem, 0.7fr);
  gap: 0.65rem 0.85rem;
  align-items: end;
}
.regime-meter {
  min-width: 0;
  cursor: help;
}
.regime-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.28rem;
}
.regime-meter-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--faint);
}
.regime-meter.fear .regime-meter-label { color: #d09090; }
.regime-meter.respect .regime-meter-label { color: #9eb4d4; }
.regime-meter-val {
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.regime-bar {
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.regime-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}
.regime-meter.fear .regime-bar > span {
  background: linear-gradient(90deg, #8a4545, #c67a7a);
}
.regime-meter.respect .regime-bar > span {
  background: linear-gradient(90deg, #4a6a8a, #8aacc8);
}
.regime-mode {
  min-width: 0;
  padding: 0.15rem 0 0.1rem;
  cursor: help;
}
.regime-mode-kicker {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 700;
}
.regime-mode-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  margin-top: 0.12rem;
  line-height: 1.25;
  max-width: 18rem;
}
@media (max-width: 720px) {
  .regime-mode-label {
    font-size: 0.8rem;
    max-width: none;
  }
}
.regime-strip-hint {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Chip / meter tooltips — permanent UI chrome */
.tip-host {
  position: relative;
  cursor: help;
}
/* In-host absolute tips (legacy path) — portal tips use fixed on body */
.ui-tip {
  position: absolute;
  z-index: 80;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(16.5rem, 72vw);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #1a1e28;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  font-size: 0.72rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  text-transform: none;
}
/* Body-portal tips escape topbar backdrop-filter stacking (was covering / under regime strip) */
.ui-tip.ui-tip-portal {
  position: fixed;
  left: 0;
  top: 0;
  transform: none;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.ui-tip.ui-tip-portal.is-open {
  opacity: 1;
  visibility: visible;
}
.ui-tip-up {
  bottom: calc(100% + 0.4rem);
}
.ui-tip-down {
  top: calc(100% + 0.4rem);
}
.ui-tip-lead {
  font-weight: 550;
  margin-bottom: 0.35rem;
  color: var(--fg);
}
.ui-tip-drivers {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.35rem;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}
.ui-tip-driver {
  color: var(--muted);
  line-height: 1.35;
}
.ui-tip-driver.pos { color: #c8d8e8; }
.ui-tip-driver.neg { color: #d0a0a0; }
.regime-meter .ui-tip {
  max-width: min(18rem, 78vw);
  text-align: left;
}
/* Host-local open (non-portal fallback) */
.tip-host.is-tip-open > .ui-tip:not(.ui-tip-portal),
.tip-host:hover > .ui-tip:not(.ui-tip-portal),
.tip-host:focus-visible > .ui-tip:not(.ui-tip-portal) {
  opacity: 1;
  visibility: visible;
}
/* On mobile, only show when explicitly opened (no sticky hover) */
html.is-mobile .tip-host:hover > .ui-tip:not(.ui-tip-portal) {
  opacity: 0;
  visibility: hidden;
}
html.is-mobile .tip-host.is-tip-open > .ui-tip:not(.ui-tip-portal) {
  opacity: 1;
  visibility: visible;
}

html.is-mobile .regime-strip-main {
  grid-template-columns: 1fr 1fr;
}
html.is-mobile .regime-mode {
  grid-column: 1 / -1;
}
html.is-mobile .topbar-meta .pill.pill-fear,
html.is-mobile .topbar-meta .pill.pill-respect {
  font-size: 0.7rem;
}

/* —— Stat chips —— */
.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  transition: border-color 0.15s;
}
.stat-chip:hover { border-color: var(--border-strong); }
.stat-chip .label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  font-weight: 600;
}
.stat-chip .value {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.2rem;
  letter-spacing: -0.02em;
}

/* —— Newspaper / press —— */
.headline-strip {
  position: relative;
  background:
    linear-gradient(180deg, rgba(40, 32, 26, 0.5) 0%, transparent 40%),
    var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.05rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.headline-strip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), transparent 80%);
  opacity: 0.85;
}
.headline-strip.tone-bad {
  border-color: #5a3838;
  background: linear-gradient(180deg, rgba(50, 20, 24, 0.45) 0%, transparent 50%), var(--paper);
}
.headline-strip.tone-good {
  border-color: #3a5040;
  background: linear-gradient(180deg, rgba(20, 40, 28, 0.4) 0%, transparent 50%), var(--paper);
}
.headline-strip.tone-mixed { border-color: #4a4030; }
.headline-strip .kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-muted);
  font-weight: 600;
}
.headline-strip .title {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  margin-top: 0.35rem;
  line-height: 1.3;
  color: var(--paper-ink);
  letter-spacing: -0.015em;
  font-weight: 600;
}
.headline-strip .why {
  margin-top: 0.5rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--paper-muted);
  max-width: 52rem;
}
.headline-strip .heat-pill {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid #6a4848;
  color: #e0b0b0;
  background: rgba(80, 40, 40, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  font-weight: 600;
}
.headline-strip.tone-good .heat-pill {
  border-color: #3a5a48;
  color: #90c0a0;
  background: rgba(40, 70, 55, 0.35);
}
.paper-actions .danger-outline {
  border-color: #6a3a3a !important;
  color: #e0b0b0 !important;
}
.paper-btn {
  font-size: 0.85rem !important;
}

/* —— Scars —— */
.scar-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.scar {
  font-size: 0.72rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--primary);
  border-radius: var(--radius-xs);
  padding: 0.28rem 0.55rem;
  font-weight: 500;
}
button.scar-btn {
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.6rem;
  min-height: 32px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: left;
  line-height: 1.25;
}
button.scar-btn:hover {
  border-color: rgba(196, 163, 90, 0.55);
  background: var(--primary-dim);
}
button.scar-btn.on {
  border-color: rgba(196, 163, 90, 0.65);
  background: var(--primary-dim);
  box-shadow: 0 0 0 2px var(--primary-ring);
  color: var(--primary-hover);
}
.scar-dossier { display: flex; flex-direction: column; gap: 0.35rem; }
.scar-detail {
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: scarIn 0.18s ease;
}
.scar-detail.is-empty {
  display: none;
}
@keyframes scarIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.scar-detail-kicker {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.scar-detail-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-hover);
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}
.scar-detail-summary {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.scar-detail-how {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.scar-effects { margin-top: 0.5rem; }
html.is-mobile button.scar-btn { min-height: 40px; padding: 0.45rem 0.7rem; }

/* —— Coalition —— */
.coalition-bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.coalition-bar > span { height: 100%; transition: width 0.35s ease; }
.coalition-bar .gov { background: linear-gradient(90deg, #4a7a58, #6ba87a); }
.coalition-bar .opp { background: linear-gradient(90deg, #7a4a4a, #c67a7a); }
.coalition-bar .soft { background: linear-gradient(90deg, #6a6248, #a89868); }

/* —— Blocs —— */
.bloc-card {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.bloc-card:hover { border-color: var(--border-strong); }
.bloc-card.in-gov {
  border-color: #3a5a42;
  background: linear-gradient(135deg, rgba(40, 70, 50, 0.2), var(--surface-2));
}
.bloc-card.demanding {
  border-color: #6a5050;
  box-shadow: inset 0 0 0 1px #4a3030;
}
.bloc-card .name { font-weight: 600; font-size: 0.9rem; }
.bloc-card .leader { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.bloc-card .agenda {
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* —— Policy rows —— */
.policy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.85rem 0.35rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.policy-row:last-child { border-bottom: none; }
.policy-row:hover { background: rgba(255, 255, 255, 0.02); }
.policy-row input[type="range"] {
  width: 100%;
  height: 28px;
  accent-color: var(--primary);
  cursor: pointer;
}
.policy-row.dirty {
  background: var(--primary-dim);
  border-radius: var(--radius-sm);
  margin: 0 -0.35rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  border-bottom-color: transparent;
}
.policy-story {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.policy-cancel-btn {
  flex-shrink: 0;
  min-height: 40px;
  min-width: 5.5rem;
  padding: 0.4rem 0.65rem !important;
  font-size: 0.75rem !important;
  border-color: var(--border-strong) !important;
}
.policy-cancel-btn:disabled { opacity: 0.45; }
.policy-meters .impact-chip { opacity: 0.95; }
.policy-nudge { margin-top: 0.4rem; }
.policy-nudge .impact-chip {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
}

/* —— Rival —— */
.rival-card {
  background: linear-gradient(145deg, #1c1418 0%, var(--surface) 100%);
  border: 1px solid #3a3038;
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.rival-card .name {
  font-weight: 600;
  font-family: var(--display);
  font-size: 1.05rem;
}
.rival-card .role {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b09090;
  font-weight: 600;
}

/* —— Modal —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 40;
  animation: fadeIn 0.18s ease;
}
.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 1.35rem;
  max-height: 90dvh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: riseIn 0.22s ease;
}
.choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-top: 0.55rem;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.choice:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}
.choice:active { transform: translateY(1px); }
.choice .label { font-weight: 600; }
.choice .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* —— Footer bar —— */
.footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 10, 12, 0.92);
  backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  z-index: 20;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* —— Log —— */
.log-list { max-height: 260px; overflow: auto; }
.log-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.45;
}
.log-item .kind {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

/* —— Legacy / end —— */
.legacy-card {
  background: linear-gradient(165deg, #1a1e28 0%, #0e1016 70%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}
.legacy-card .big {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

/* —— Menu —— */
.menu-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}
.menu-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background:
    radial-gradient(circle at 40% 35%, rgba(196, 163, 90, 0.25), transparent 55%),
    var(--surface-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--primary-dim), var(--shadow-sm);
}
.menu-seal span {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.menu-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.menu-lead {
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0.85rem 0 0;
}
.menu-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.75rem;
}
@media (min-width: 560px) {
  .menu-actions { grid-template-columns: 1fr 1fr; }
}
.menu-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.menu-card::after {
  content: "→";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 1rem;
  transition: color 0.15s, transform 0.15s;
}
.menu-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.menu-card:hover::after {
  color: var(--primary);
  transform: translateY(-50%) translateX(3px);
}
.menu-card:active { transform: translateY(0); }
.menu-card .title {
  font-weight: 600;
  font-size: 1rem;
  padding-right: 1.5rem;
}
.menu-card .desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.45;
  padding-right: 1.25rem;
}
.menu-card.primary-card {
  border-color: rgba(196, 163, 90, 0.45);
  background: linear-gradient(145deg, rgba(196, 163, 90, 0.1), var(--surface));
}
.menu-card.primary-card .title { color: var(--primary-hover); }
.menu-card.primary-card::after { color: var(--primary); }

.menu-unlock {
  margin-top: 1.5rem;
  max-width: 28rem;
  border-color: var(--border);
}
.menu-footer-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--faint);
  line-height: 1.6;
}

/* —— Nation select cards —— */
.nation-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.nation-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* —— Tabs —— */
.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  width: fit-content;
  max-width: 100%;
}
.tab {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--fg); }
.tab.on {
  background: var(--primary-dim);
  color: var(--primary-hover);
  border-color: rgba(196, 163, 90, 0.35);
}

/* —— Toast —— */
.toast {
  position: fixed;
  bottom: 5.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.15rem;
  font-size: 0.875rem;
  z-index: 50;
  max-width: 90vw;
  box-shadow: var(--shadow-md);
  animation: riseIn 0.2s ease;
}

/* —— Flag pick —— */
.flag-pick { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.flag-pick button {
  padding: 3px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.flag-pick button:hover { border-color: var(--border-strong); }
.flag-pick button.on {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dim);
}

/* —— Build / strategy —— */
.build-strip {
  background: linear-gradient(135deg, rgba(40, 48, 62, 0.95), rgba(22, 26, 34, 0.98));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}
.build-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.build-title {
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.2rem;
  color: var(--primary-hover);
  font-family: var(--display);
  letter-spacing: -0.01em;
}
.build-body {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 0.3rem;
}
.impact-block { margin-top: 0.4rem; }
.impact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.impact-chip {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.impact-chip.good {
  color: var(--success);
  border-color: #2a4a38;
  background: var(--success-dim);
}
.impact-chip.bad {
  color: var(--danger);
  border-color: #5a3038;
  background: var(--danger-dim);
}
.impact-chip.voter { font-weight: 500; }
.impact-chip.warn {
  color: #d4a574;
  border-color: #5a4530;
  background: rgba(180, 120, 50, 0.12);
}
.impact-chip.neutral {
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface-3);
}

.delta { font-variant-numeric: tabular-nums; font-weight: 600; }
.delta.success, .success { color: var(--success); }
.delta.danger, .danger { color: var(--danger); }
.delta.faint { color: var(--faint); }

.path-card.path-locked { opacity: 0.72; }
.path-card.path-done {
  box-shadow: inset 0 0 0 1px rgba(107, 168, 122, 0.3);
  border-color: #3a5a42;
}
.path-card.path-defending {
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.35);
}
.path-card.path-collapsed {
  opacity: 0.85;
  box-shadow: inset 0 0 0 1px rgba(164, 90, 90, 0.35);
}
.path-card.path-entrenched {
  box-shadow: inset 0 0 0 1px rgba(107, 168, 122, 0.45);
}
.path-card.path-pressured {
  box-shadow: inset 0 0 0 1px rgba(196, 120, 72, 0.35);
}
.legacy-goals-panel {
  border-color: rgba(107, 168, 122, 0.35);
  background: linear-gradient(180deg, rgba(107, 168, 122, 0.07), var(--surface));
}
.legacy-goal-row {
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}
.legacy-goal-row:first-of-type {
  border-top: none;
  padding-top: 0;
}
.legacy-goal-row.done .settlement-title {
  color: var(--success, #6ba87a);
}
.term-banner {
  margin: 0.5rem 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.term-banner-fatigue {
  border-color: rgba(196, 150, 72, 0.45);
  background: linear-gradient(180deg, rgba(196, 150, 72, 0.1), var(--surface));
}
.term-banner-final {
  border-color: rgba(196, 100, 80, 0.5);
  background: linear-gradient(180deg, rgba(196, 100, 80, 0.12), var(--surface));
}
.term-banner-exempt {
  border-color: rgba(120, 100, 160, 0.45);
  background: linear-gradient(180deg, rgba(120, 100, 160, 0.1), var(--surface));
}
.discover-beat {
  margin: 0.5rem 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.discover-info {
  border-color: rgba(90, 140, 190, 0.45);
  background: linear-gradient(180deg, rgba(90, 140, 190, 0.1), var(--surface));
}
.discover-warn {
  border-color: rgba(196, 120, 72, 0.5);
  background: linear-gradient(180deg, rgba(196, 120, 72, 0.12), var(--surface));
}
.discover-success {
  border-color: rgba(107, 168, 122, 0.5);
  background: linear-gradient(180deg, rgba(107, 168, 122, 0.12), var(--surface));
}
.discover-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.discover-title {
  font-weight: 650;
  margin-top: 0.2rem;
  color: var(--fg);
  line-height: 1.3;
}
.discover-body {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}
.settlement-banner {
  border-color: rgba(196, 163, 90, 0.4);
  background: linear-gradient(180deg, rgba(196, 163, 90, 0.08), var(--surface));
}
.settlement-kicker {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.settlement-row {
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
}
.settlement-row:first-of-type { border-top: none; padding-top: 0; }
.settlement-title { font-weight: 600; font-size: 0.88rem; }
.settlement-row.strained .settlement-title { color: var(--danger); }
.settlement-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.65rem;
}
.settlement-meter-block .meter {
  height: 0.42rem;
  margin-top: 0.15rem;
}
.settlement-meter-label {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.settlement-meter-label.danger { color: var(--danger); }
.settlement-row.dual {
  border-left: 2px solid rgba(196, 163, 90, 0.55);
  padding-left: 0.45rem;
}
@media (max-width: 420px) {
  .settlement-meters { grid-template-columns: 1fr; }
}
.path-step.strain-step .path-step-need { color: var(--danger); font-weight: 600; }
.path-steps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--border);
}
.path-step {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.35rem 0.15rem;
}
.path-step-mark {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.path-step.met .path-step-mark {
  background: var(--success-dim);
  border-color: #2a4a38;
  color: var(--success);
}
.path-step.next .path-step-mark {
  border-color: rgba(196, 163, 90, 0.55);
  color: var(--primary-hover);
  box-shadow: 0 0 0 2px var(--primary-ring);
}
.path-step-body { min-width: 0; flex: 1; }
.path-step-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}
.path-step-statute {
  font-weight: 500;
  color: var(--muted);
}
.path-step-need {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 0.15rem;
}
.path-step.met .path-step-need { color: var(--success); }
.path-step.next .path-step-need { color: var(--primary-hover); }

/* —— Animations —— */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Mobile —— */
html.is-mobile body {
  -webkit-tap-highlight-color: rgba(196, 163, 90, 0.18);
}
html.is-mobile button,
html.is-mobile .btn {
  min-height: 44px;
  padding: 0.7rem 1rem;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
html.is-mobile .btn.xs,
html.is-mobile .paper-btn {
  min-height: 44px;
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
}
html.is-mobile .paper-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
html.is-mobile .paper-btn-row .paper-btn {
  width: 100%;
  justify-content: center;
}
html.is-mobile .footer-bar .btn {
  min-height: 48px;
  font-size: 0.95rem;
}
html.is-mobile .footer-bar {
  padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
}
html.is-mobile .screen {
  padding-bottom: 7.5rem;
  padding-left: max(0.85rem, env(safe-area-inset-left));
  padding-right: max(0.85rem, env(safe-area-inset-right));
}
html.is-mobile .tab {
  min-height: 40px;
  padding: 0.45rem 0.85rem;
}
html.is-mobile .toast {
  bottom: 6rem;
  font-size: 0.9rem;
  padding: 0.75rem 1.1rem;
}
html.is-mobile .tabs {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
html.is-mobile .tabs::-webkit-scrollbar { display: none; }
html.is-mobile .menu-hero {
  padding-top: 1.75rem;
}
html.is-mobile .h1 {
  font-size: clamp(1.85rem, 8vw, 2.4rem);
}
html.is-desktop .paper-btn-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.is-mobile .topbar-meta .pill { font-size: 0.72rem; }
.is-mobile .bloc-card .tabular .xs {
  font-size: 0.7rem;
  margin-top: 2px;
}
.is-mobile .topbar {
  padding: 0.7rem 0.75rem;
}
.is-mobile .grid-stats {
  grid-template-columns: repeat(2, 1fr);
}

/* Scrollbar (desktop) */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
    border: 2px solid var(--bg);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--faint); }
}

/* Mobile topbar: horizontal scroll for chips */
html.is-mobile .topbar-meta {
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
html.is-mobile .topbar-meta::-webkit-scrollbar { display: none; }
html.is-mobile .topbar-meta .pill {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Density / hierarchy polish (pass 2) ── */
.panel-compact {
  padding: 0.75rem 0.9rem;
}
.panel-compact .h3 { margin-bottom: 0.45rem; }

.portfolio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.portfolio-cost {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.portfolio-cost.pending {
  color: var(--primary-fg);
  background: linear-gradient(180deg, var(--primary-hover), var(--primary));
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(196, 163, 90, 0.25);
}
.portfolio-count {
  margin-top: 0.35rem !important;
  margin-bottom: 0.65rem !important;
}
.build-hint { line-height: 1.4; max-width: 36rem; }
.build-strip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}
.build-face .build-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}
.build-face .build-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 0.15rem;
  letter-spacing: -0.015em;
}
.build-face .build-body {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 0.25rem;
}

/* Policy density */
.policy-row {
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 0.7rem 0.25rem;
}
.policy-row input[type="range"] {
  height: 32px;
  margin-top: 0.15rem;
}
.story-block { margin-top: 0.35rem; }
.policy-story {
  -webkit-line-clamp: 2;
  max-width: 48rem;
  font-size: 0.8rem;
}
.policy-story.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.story-toggle {
  display: inline-flex;
  margin-top: 0.25rem;
  padding: 0.15rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: none;
  border: none;
  min-height: 32px;
  align-items: center;
}
.story-toggle:hover { color: var(--primary-hover); text-decoration: underline; }

/* Catalog */
.catalog-head { margin-bottom: 0.15rem; }
.catalog-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.catalog-search {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 2.4rem 0.7rem 0.9rem;
  outline: none;
  font-size: 16px; /* iOS: avoid zoom on focus */
  -webkit-appearance: none;
  appearance: none;
}
.catalog-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.catalog-search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.catalog-search-clear:hover { color: var(--fg); background: rgba(255,255,255,0.06); }
.catalog-card {
  padding: 0.85rem 1rem;
  transition: border-color 0.15s, background 0.15s;
}
.catalog-card:hover { border-color: var(--border-strong); }
.catalog-name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.filter-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.filter-row-label {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.filter-chips-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
  margin-right: -0.25rem;
}
.filter-chips-scroll::-webkit-scrollbar { display: none; }
.filter-chips-scroll .filter-chip { flex-shrink: 0; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-chip:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}
.filter-chip.on {
  background: var(--primary-dim);
  border-color: rgba(196, 163, 90, 0.45);
  color: var(--primary-hover);
}
html.is-mobile .catalog-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  box-shadow: 0 8px 16px rgba(0,0,0,0.18);
}
html.is-mobile .filter-chip { min-height: 40px; padding: 0.4rem 0.85rem; }
html.is-mobile .catalog-search { min-height: 44px; }
.btn-compact {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.8rem !important;
  white-space: nowrap;
}

/* Empty / locked */
.empty-state {
  text-align: center;
  padding: 1.5rem 1.25rem !important;
  border-style: dashed;
}
.empty-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.empty-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 28rem;
  margin: 0 auto;
}
.empty-hint {
  font-size: 0.78rem;
  color: var(--faint);
  line-height: 1.4;
}
.empty-hint.warn { color: var(--warn); }

/* Rival compact */
.rival-compact {
  padding: 0.75rem 0.95rem;
}
.rival-compact .name {
  font-size: 0.98rem;
  margin-top: 0.1rem;
}
.rival-strength {
  text-align: right;
  flex-shrink: 0;
}
.rival-strength > div:last-child {
  font-weight: 600;
  font-size: 1.05rem;
}
.rival-line {
  font-size: 0.82rem;
  color: #c4a0a0;
  font-style: italic;
  line-height: 1.4;
}

/* Stats tighter */
.stat-chip {
  padding: 0.5rem 0.65rem;
}
.stat-chip .value { font-size: 0.95rem; }

/* Footer hierarchy */
.btn-footer-primary {
  min-height: 44px;
  font-weight: 600;
}
.btn-footer-enact.has-cost {
  border-color: rgba(196, 163, 90, 0.5) !important;
  color: var(--primary-hover) !important;
  background: var(--primary-dim) !important;
}
.btn-footer-enact:disabled { opacity: 0.4; }

/* Tabs slightly denser */
.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.85rem;
  padding-bottom: 0.15rem;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 36px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--fg); background: var(--surface-2); }
.tab.on {
  color: var(--primary-fg);
  background: linear-gradient(180deg, var(--primary-hover), var(--primary));
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(196, 163, 90, 0.22);
}

/* Mobile density */
html.is-mobile .policy-story { -webkit-line-clamp: 2; }
html.is-mobile .portfolio-toolbar { gap: 0.5rem; }
html.is-mobile .btn-footer-secondary { padding-left: 0.65rem; padding-right: 0.65rem; }
html.is-mobile .status-pair { gap: 0.55rem; }
html.is-mobile .rival-compact { margin-bottom: 0.65rem; }
html.is-mobile .grid-stats { gap: 0.4rem; }
html.is-mobile .headline-strip { padding: 0.85rem 0.95rem; margin-bottom: 0.75rem; }
html.is-mobile .catalog-card { padding: 0.75rem 0.85rem; }

@media (min-width: 720px) {
  .policy-row {
    padding: 0.75rem 0.4rem;
  }
  .portfolio-panel {
    padding-top: 1rem;
  }
}

/* ── Quarter brief (pass 3 feedback loop) ── */
.quarter-brief {
  position: relative;
  background:
    linear-gradient(135deg, rgba(196, 163, 90, 0.1) 0%, transparent 42%),
    var(--surface);
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem 1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-md);
  animation: riseIn 0.22s ease;
}
.quarter-brief::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.qb-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}
.qb-headline {
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 0.25rem;
  max-width: 40rem;
}
.qb-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .qb-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .qb-grid { grid-template-columns: repeat(4, 1fr); }
}
.qb-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}
.qb-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.qb-text {
  font-size: 0.82rem;
  line-height: 1.4;
}
.qb-text.strong {
  font-weight: 600;
  font-size: 0.9rem;
}
.qb-text.muted { color: var(--muted); margin-top: 0.15rem; }
.qb-stories {
  margin: 0.65rem 0 0;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.qb-stories li { margin-bottom: 0.25rem; }
.qb-stories li::marker { color: var(--primary); }
html.is-mobile .quarter-brief { padding: 0.8rem 0.9rem; }
html.is-mobile .qb-grid { grid-template-columns: 1fr; }

/* ── First-session coach (pass 6) ── */
.coach-panel {
  position: relative;
  background:
    linear-gradient(135deg, rgba(196, 163, 90, 0.14) 0%, transparent 50%),
    var(--surface);
  border: 1px solid rgba(196, 163, 90, 0.45);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 0.95rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-md);
  animation: riseIn 0.22s ease;
}
.coach-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--primary);
}
.coach-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.coach-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}
.coach-dots { display: flex; gap: 0.28rem; }
.coach-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--border);
}
.coach-dot.done { background: rgba(196, 163, 90, 0.45); }
.coach-dot.on { background: var(--primary); box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.2); }
.coach-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.coach-body {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 40rem;
}
.coach-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.pill.coach-pulse,
.btn.coach-pulse {
  animation: coachPulse 1.4s ease-in-out infinite;
  outline: 2px solid rgba(196, 163, 90, 0.55);
  outline-offset: 2px;
}
@keyframes coachPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 163, 90, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(196, 163, 90, 0); }
}
html.is-mobile .coach-panel { padding: 0.8rem 0.85rem; }
html.is-mobile .coach-actions { justify-content: stretch; }
html.is-mobile .coach-actions .btn { flex: 1; }

/* ── Treasury Books tab (v1.7.8) ── */
.books-panel { gap: 0.75rem; }
.books-hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(196, 163, 90, 0.1) 0%, transparent 55%),
    var(--surface);
  border: 1px solid rgba(196, 163, 90, 0.28);
}
.books-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--primary);
}
.books-stock {
  text-align: right;
  min-width: 7rem;
}
.books-stock-val {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 0.15rem;
}
.books-balance-bar {
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}
.books-balance-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.books-balance-num {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.books-balance-num.good { color: var(--good, #6fbf8a); }
.books-balance-num.bad { color: var(--bad, #d08080); }
.books-balance-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .books-grid { grid-template-columns: 1fr 1fr; }
}
.books-col { margin: 0; padding: 0.85rem 0.95rem; }
.books-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.books-total {
  font-weight: 600;
  font-size: 0.95rem;
}
.books-draft-delta {
  font-size: 0.72rem;
  font-weight: 500;
  margin-left: 0.25rem;
  opacity: 0.9;
}
.books-rows { display: flex; flex-direction: column; gap: 0.28rem; }
.books-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.28rem 0.2rem;
  border-radius: 6px;
}
.books-row:hover { background: rgba(255,255,255,0.03); }
.books-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
  flex: 1;
}
.books-label {
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--text);
}
.books-kind {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-weight: 600;
}
.books-row.saving .books-kind,
.books-row.good .books-kind { border-color: rgba(111, 191, 138, 0.35); color: var(--good, #6fbf8a); }
.books-row.bad .books-kind,
.books-row.cut .books-kind { border-color: rgba(208, 128, 128, 0.35); color: var(--bad, #d08080); }
.books-amt {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.books-amt.good { color: var(--good, #6fbf8a); }
.books-amt.bad { color: var(--bad, #d08080); }
.books-empty { padding: 0.5rem 0; }
.books-footnote { padding: 0.75rem 0.95rem; }
html.is-mobile .books-stock { text-align: left; width: 100%; }
html.is-mobile .books-stock-val { font-size: 1.4rem; }
html.is-mobile .books-balance-num { font-size: 1.2rem; }

/* ── External desk / currency (FX step 1–2) ── */
.topbar-meta .pill.pill-capital {
  font-weight: 700;
  background: var(--primary-dim);
  border: 1px solid rgba(196, 163, 90, 0.4);
  color: var(--primary-hover);
  opacity: 1;
}
.topbar-meta .pill.pill-treasury {
  font-weight: 650;
  opacity: 1;
  background: rgba(158, 176, 200, 0.12);
  border: 1px solid rgba(158, 176, 200, 0.35);
  color: var(--accent);
}
.topbar-meta .pill.pill-poll {
  opacity: 0.95;
}
.topbar-meta .pill.pill-reserves {
  font-weight: 600;
  opacity: 0.95;
  background: rgba(90, 140, 120, 0.12);
  border: 1px solid rgba(90, 140, 120, 0.35);
  color: #8fc4a8;
}
.topbar-meta .pill.pill-inflation {
  font-weight: 600;
  opacity: 0.95;
  letter-spacing: 0.02em;
}
.topbar-meta .pill.pill-inflation.is-hot {
  border: 1px solid rgba(198, 122, 122, 0.5);
  color: var(--danger);
  background: var(--danger-dim);
}
.fx-desk {
  border-color: rgba(158, 176, 200, 0.25);
  background:
    linear-gradient(135deg, rgba(36, 60, 72, 0.14) 0%, transparent 50%),
    var(--surface);
}
.fx-desk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  max-width: 22rem;
}
html.is-mobile .topbar-meta .pill.pill-treasury,
html.is-mobile .topbar-meta .pill.pill-reserves {
  font-size: 0.7rem;
}
html.is-mobile .fx-desk-chips {
  justify-content: flex-start;
  max-width: none;
}

/* FX strain + hot desk */
.fx-desk-hot {
  border-color: rgba(196, 164, 106, 0.45);
}
.fx-desk-critical {
  border-color: rgba(198, 122, 122, 0.55);
  box-shadow: 0 0 0 1px rgba(198, 122, 122, 0.15);
}
.fx-strain-row { margin-top: 0.55rem; }
.fx-strain-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.25rem;
}
.fx-strain-track {
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.fx-strain-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3a6a7a, #6ab0c8);
  transition: width 0.35s ease;
}
.fx-strain-fill.is-hot {
  background: linear-gradient(90deg, #8a6a30, #c4a46a);
}
.fx-strain-fill.is-crisis {
  background: linear-gradient(90deg, #8a3038, #d06060);
}
.topbar-meta .pill.pill-reserves.is-hot {
  border-color: rgba(198, 122, 122, 0.55);
  color: var(--danger);
  background: var(--danger-dim);
}


/* External desk depth — peg pressure + mode badge */
.fx-mode-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem; }
.fx-mode-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(158, 176, 200, 0.35);
  background: rgba(158, 176, 200, 0.1);
}
.fx-mode-badge.fx-mode-hard {
  border-color: rgba(196, 163, 90, 0.55);
  color: var(--primary-hover);
  background: rgba(196, 163, 90, 0.12);
}
.fx-mode-badge.fx-mode-soft {
  border-color: rgba(106, 176, 200, 0.5);
  color: #8fc4d8;
  background: rgba(60, 120, 140, 0.15);
}
.fx-mode-badge.fx-mode-float {
  border-color: rgba(140, 150, 160, 0.4);
  color: var(--muted);
}
.fx-peg-row { margin-top: 0.45rem; }
.fx-peg-track {
  height: 0.34rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.fx-peg-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4a7a6a, #8fc4a8);
  transition: width 0.35s ease;
}
.fx-peg-fill.is-hot {
  background: linear-gradient(90deg, #8a6a30, #c4a46a);
}
.fx-peg-fill.is-crisis {
  background: linear-gradient(90deg, #8a3038, #d06060);
}
.fx-strain-track { position: relative; }
.fx-strain-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.fx-strain-mark {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: rgba(255,255,255,0.18);
  transform: translateX(-50%);
}
.fx-strain-mark.is-crisis-mark {
  background: rgba(208, 96, 96, 0.55);
}
.fx-desk-peg-burn {
  border-color: rgba(198, 122, 122, 0.45);
  box-shadow: 0 0 0 1px rgba(198, 122, 122, 0.12), inset 0 0 24px rgba(120, 40, 40, 0.08);
}
.fx-desk-note.is-alert {
  color: var(--primary-hover);
  font-weight: 600;
}

/* Price desk — economy as a type */
.price-desk {
  border-color: rgba(212, 160, 106, 0.28);
  background:
    linear-gradient(135deg, rgba(72, 48, 28, 0.14) 0%, transparent 52%),
    var(--surface);
}
.price-desk.is-typed {
  border-color: rgba(196, 163, 90, 0.38);
}
.price-desk.is-shock {
  border-color: rgba(198, 122, 122, 0.55);
  box-shadow: 0 0 0 1px rgba(198, 122, 122, 0.14);
}
.price-face-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem;
  font-size: 1.05rem;
}
.price-face-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background: rgba(196, 163, 90, 0.1);
  color: var(--primary-hover);
}
.price-face-badge.is-hot {
  border-color: rgba(198, 122, 122, 0.55);
  color: var(--danger);
  background: rgba(198, 122, 122, 0.12);
}
.price-face-badge.is-cold {
  border-color: rgba(106, 176, 200, 0.5);
  color: #8fc4d8;
  background: rgba(60, 120, 140, 0.15);
}
.price-face-badge.is-open {
  border-color: rgba(140, 150, 160, 0.4);
  color: var(--muted);
}
.price-face-badge.is-set {
  border-color: rgba(196, 163, 90, 0.5);
}
.price-desk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  max-width: 22rem;
}
html.is-mobile .price-desk-chips {
  justify-content: flex-start;
  max-width: none;
}
.price-basket {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.price-basket-row {
  display: grid;
  grid-template-columns: 4.4rem 1fr 5.4rem;
  gap: 0.45rem;
  align-items: center;
}
.price-basket-lab {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.price-basket-track {
  height: 0.34rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.price-basket-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6a5a3a, #c4a46a);
  transition: width 0.35s ease;
}
.price-basket-fill.is-hot {
  background: linear-gradient(90deg, #8a3038, #d06060);
}
.price-basket-fill.is-cold {
  background: linear-gradient(90deg, #3a6a7a, #6ab0c8);
}
.price-basket-val {
  font-size: 0.72rem;
  text-align: right;
}
.price-desk-note.is-alert {
  color: var(--primary-hover);
  font-weight: 600;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .price-basket-row {
    grid-template-columns: 3.6rem 1fr 4.6rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   StateOS — cabinet terminal shell (v1.30 · craft pass)
   Authored OS chrome: brand lockup, glass dock, causality spine,
   registry instrument, motion. Screenshot-first.
   ═══════════════════════════════════════════════════════════ */

.stateos-body {
  --os-bar: rgba(8, 10, 14, 0.88);
  --os-bar-solid: #080a0e;
  --os-bar-border: rgba(196, 163, 90, 0.12);
  --os-window: rgba(14, 17, 24, 0.94);
  --os-window-solid: #0e1118;
  --os-title: linear-gradient(180deg, #141821 0%, #0f1219 100%);
  --os-dock: rgba(8, 10, 14, 0.82);
  --os-accent: var(--primary);
  --os-mono: "IBM Plex Mono", ui-monospace, monospace;
  --os-glow: 0 0 40px rgba(196, 163, 90, 0.08);
  --os-scan: rgba(255, 255, 255, 0.015);
}

.stateos-root,
.stateos-body {
  background: #040508;
}

/* Wallpaper — ministry night + brass horizon */
.stateos.screen {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(196, 163, 90, 0.11), transparent 52%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(60, 90, 140, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 35% at 100% 60%, rgba(100, 60, 80, 0.06), transparent 45%),
    linear-gradient(168deg, #05070b 0%, #0a0d14 42%, #07090e 100%);
  position: relative;
  animation: os-boot-in 0.45s ease-out;
}
@keyframes os-boot-in {
  from { opacity: 0.4; filter: brightness(0.7); }
  to { opacity: 1; filter: none; }
}
/* subtle scanline */
.stateos.screen::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--os-scan) 2px,
    var(--os-scan) 3px
  );
  mix-blend-mode: soft-light;
}
.stateos.screen > * { position: relative; z-index: 1; }

/* ── Menubar ── */
.os-menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: var(--os-bar);
  border-bottom: 1px solid var(--os-bar-border);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 2.85rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.os-menubar-left,
.os-menubar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.os-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 0;
  color: var(--fg);
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  font-family: var(--os-mono);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.os-brand:hover {
  background: rgba(196, 163, 90, 0.1);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.2);
}
.os-brand-mark {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-size: 0.95rem;
  text-shadow: 0 0 18px rgba(196, 163, 90, 0.35);
}
.os-brand-ver {
  font-size: 0.62rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.12rem 0.35rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
}
.os-status-led {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(107, 168, 122, 0.7);
  flex-shrink: 0;
}
.os-status-led.is-warn {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(196, 164, 106, 0.7);
}
.os-status-led.is-hot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(198, 122, 122, 0.85);
  animation: os-pulse 1.4s ease-in-out infinite;
}
.os-country {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding-left: 0.55rem;
  border-left: 1px solid rgba(255,255,255,0.07);
}
.os-country .flag {
  width: 1.55rem;
  height: 1.05rem;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}
.os-country-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
  letter-spacing: -0.01em;
}
.os-country-term {
  font-family: var(--os-mono);
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.os-clock {
  font-family: var(--os-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
  display: none;
}
@media (min-width: 720px) {
  .os-clock { display: inline-block; }
}
.os-alert-chip {
  border: 1px solid rgba(198, 122, 122, 0.5);
  background: linear-gradient(180deg, rgba(198, 122, 122, 0.18), rgba(198, 122, 122, 0.08));
  color: #f0c4c4;
  font-size: 0.7rem;
  font-family: var(--os-mono);
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.os-alert-chip:hover { transform: translateY(-1px); }
.os-alert-chip.is-hot { animation: os-pulse 1.8s ease-in-out infinite; }
@keyframes os-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}
.os-notify-btn {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(30, 34, 44, 0.9), rgba(18, 21, 28, 0.95));
  color: var(--fg);
  font-size: 0.76rem;
  font-family: var(--os-mono);
  padding: 0.32rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.os-notify-btn.on,
.os-notify-btn:hover {
  border-color: rgba(196, 163, 90, 0.55);
  background: var(--primary-dim);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.15), var(--os-glow);
}
.os-badge {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #e09090, #c45a5a);
  color: #1a0808;
  font-size: 0.62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(198, 80, 80, 0.5);
}

/* ── Stage + window ── */
.os-stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  position: relative;
  padding: 0.7rem 0.85rem 0.4rem;
  gap: 0.65rem;
  overflow: hidden;
}
.os-window {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--os-window);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(196, 163, 90, 0.04),
    var(--os-glow);
  overflow: hidden;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  animation: os-window-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(8px);
}
@keyframes os-window-in {
  from { opacity: 0; transform: translateY(6px) scale(0.992); }
  to { opacity: 1; transform: none; }
}
.os-window.is-desktop {
  background:
    linear-gradient(165deg, rgba(20, 24, 32, 0.97) 0%, rgba(12, 14, 20, 0.98) 100%);
  border-color: rgba(196, 163, 90, 0.14);
}
.os-titlebar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  background: var(--os-title);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 2.55rem;
}
.os-titlebar-dots {
  display: flex;
  gap: 0.32rem;
}
.os-titlebar-dots .dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: #3a4050;
  display: block;
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.35);
}
.os-titlebar-dots .dot:nth-child(1) { background: linear-gradient(180deg, #c47a7a, #8a4a4a); }
.os-titlebar-dots .dot:nth-child(2) { background: linear-gradient(180deg, #c4a46a, #8a6a3a); }
.os-titlebar-dots .dot:nth-child(3) { background: linear-gradient(180deg, #6ba87a, #3a6a48); }
.os-titlebar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.os-titlebar-glyph {
  color: var(--primary);
  font-family: var(--os-mono);
  font-size: 1rem;
  text-shadow: 0 0 12px rgba(196, 163, 90, 0.35);
}
.os-titlebar-blurb {
  font-weight: 400;
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted) !important;
}
.os-titlebar-home {
  font-size: 0.72rem !important;
  font-family: var(--os-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.os-window-content {
  flex: 1;
  overflow: auto;
  padding: 0.9rem 1rem 1.2rem;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── Dock ── */
.os-dock {
  position: relative;
  z-index: 35;
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem 0.25rem;
  pointer-events: none;
}
.os-dock-inner {
  pointer-events: auto;
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.4rem;
  background: var(--os-dock);
  border: 1px solid rgba(196, 163, 90, 0.16);
  border-radius: 18px;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 30px rgba(196, 163, 90, 0.06);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.os-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  min-width: 3.55rem;
  padding: 0.4rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 13px;
  cursor: pointer;
  font-size: 0.64rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.14s cubic-bezier(0.22,1,0.36,1), box-shadow 0.15s;
}
.os-dock-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--fg);
  transform: translateY(-3px);
}
.os-dock-item.on {
  background: linear-gradient(180deg, rgba(196, 163, 90, 0.22), rgba(196, 163, 90, 0.1));
  color: var(--primary-hover);
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.35), 0 4px 14px rgba(196, 163, 90, 0.12);
}
.os-dock-glyph {
  font-size: 1.15rem;
  font-family: var(--os-mono);
  line-height: 1;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.os-dock-item.on .os-dock-glyph {
  background: rgba(196, 163, 90, 0.15);
  border-color: rgba(196, 163, 90, 0.3);
}
.os-dock-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Taskbar ── */
.os-taskbar {
  position: relative;
  z-index: 36;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: var(--os-bar);
  border-top: 1px solid var(--os-bar-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.25);
}
.os-taskbar-meters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.38rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
.os-taskbar-meters::-webkit-scrollbar { display: none; }
.os-meter {
  display: inline-flex;
  flex-direction: column;
  gap: 0.06rem;
  padding: 0.28rem 0.55rem;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(28, 32, 42, 0.95), rgba(16, 18, 24, 0.98));
  min-width: 4.35rem;
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.os-meter:hover {
  border-color: rgba(196, 163, 90, 0.35);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.08);
}
.os-meter-k {
  color: var(--faint);
  font-family: var(--os-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.os-meter-v { font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; }
.os-meter .delta { font-size: 0.65rem; margin-left: 0.2rem; }
.os-meter.is-hot,
.os-meter.pill-reserves.is-hot,
.os-meter.pill-strain.is-hot,
.os-meter.pill-inflation.is-hot {
  border-color: rgba(198, 122, 122, 0.55);
  background: linear-gradient(180deg, rgba(80, 30, 30, 0.35), rgba(40, 16, 16, 0.5));
  box-shadow: 0 0 12px rgba(198, 80, 80, 0.12);
}
.os-taskbar-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}
.os-end-q {
  min-width: 7.6rem;
  font-weight: 650;
  box-shadow: 0 0 20px rgba(196, 163, 90, 0.18);
}

/* ── Notifications ── */
.os-notify {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: min(23rem, calc(100% - 1.5rem));
  max-height: min(72dvh, 30rem);
  background: linear-gradient(180deg, #12161f, #0c0f15);
  border: 1px solid rgba(196, 163, 90, 0.22);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(196, 163, 90, 0.08);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: os-window-in 0.22s ease-out;
}
.os-notify-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(180deg, #161b25, #10141c);
}
.os-notify-title {
  font-weight: 650;
  font-family: var(--os-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.os-notify-body {
  overflow: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.os-notify-item {
  padding: 0.6rem 0.7rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  transition: border-color 0.15s;
}
.os-notify-item:hover { border-color: rgba(196, 163, 90, 0.3); }
.os-notify-item-t { font-weight: 600; font-size: 0.86rem; }
.os-notify-item-d { font-size: 0.78rem; color: var(--muted); margin-top: 0.18rem; line-height: 1.45; }
.os-cause-warn { border-color: rgba(196, 164, 106, 0.45); background: rgba(196, 164, 106, 0.06); }
.os-cause-bad { border-color: rgba(198, 122, 122, 0.5); background: rgba(198, 122, 122, 0.07); }
.os-cause-good { border-color: rgba(107, 168, 122, 0.45); background: rgba(107, 168, 122, 0.06); }

/* ── Home / launcher ── */
.os-launcher {
  margin-top: 0.35rem;
  border-color: rgba(196, 163, 90, 0.14) !important;
  background: linear-gradient(165deg, rgba(24, 28, 38, 0.9), rgba(14, 16, 22, 0.95)) !important;
}
.os-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.8rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.65rem;
}
.os-launch-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(160deg, rgba(30, 34, 44, 0.95), rgba(18, 20, 28, 0.98));
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.16s cubic-bezier(0.22,1,0.36,1), background 0.15s ease, box-shadow 0.15s;
  min-height: 5.5rem;
}
.os-launch-tile:hover {
  border-color: rgba(196, 163, 90, 0.5);
  background: linear-gradient(160deg, rgba(40, 36, 28, 0.5), rgba(22, 24, 32, 0.98));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(196, 163, 90, 0.12);
}
.os-launch-glyph {
  font-size: 1.3rem;
  color: var(--primary);
  font-family: var(--os-mono);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(196, 163, 90, 0.1);
  border: 1px solid rgba(196, 163, 90, 0.2);
  margin-bottom: 0.15rem;
}
.os-launch-label { font-weight: 650; font-size: 0.92rem; letter-spacing: -0.01em; }
.os-launch-blurb { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }

/* ── Causality spine ── */
.os-causes {
  margin-bottom: 0.75rem;
  border-color: rgba(196, 163, 90, 0.18) !important;
  background: linear-gradient(180deg, rgba(28, 24, 18, 0.35), rgba(14, 16, 22, 0.6)) !important;
  position: relative;
  overflow: hidden;
}
.os-causes::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), transparent);
}
.os-causes-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.os-causes-kicker {
  font-family: var(--os-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}
.os-causes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.os-cause {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.2);
  font-size: 0.84rem;
  cursor: default;
  transition: border-color 0.15s, transform 0.12s;
}
.os-cause.is-actionable { cursor: pointer; }
.os-cause.is-actionable:hover {
  border-color: rgba(196, 163, 90, 0.4);
  transform: translateX(2px);
}
.os-cause-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  margin-top: 0.4rem;
  background: var(--accent);
  flex-shrink: 0;
}
.os-cause-bad .os-cause-dot { background: var(--danger); box-shadow: 0 0 8px rgba(198,122,122,0.6); }
.os-cause-warn .os-cause-dot { background: var(--warn); box-shadow: 0 0 8px rgba(196,164,106,0.5); }
.os-cause-good .os-cause-dot { background: var(--success); }
.os-cause-body { min-width: 0; }
.os-cause-t { font-weight: 650; display: block; }
.os-cause-d { color: var(--muted); font-size: 0.78rem; line-height: 1.4; display: block; margin-top: 0.1rem; }
.os-cause-go {
  font-family: var(--os-mono);
  font-size: 0.65rem;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: center;
  opacity: 0.85;
}

.os-wire-teaser {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--paper-border);
  background: linear-gradient(120deg, #1c1814, #161410);
  color: var(--paper-ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.os-wire-teaser:hover {
  border-color: rgba(196, 163, 90, 0.4);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.1);
}
.os-wire-teaser.is-hot {
  border-color: rgba(198, 122, 122, 0.55);
  box-shadow: 0 0 0 1px rgba(198, 122, 122, 0.15), 0 0 20px rgba(120, 40, 40, 0.15);
}
.os-wire-teaser-k {
  font-family: var(--os-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  flex-shrink: 0;
  font-weight: 600;
}
.os-wire-teaser-t {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Registry instrument ── */
.catalog-stack .catalog-head {
  border-color: rgba(196, 163, 90, 0.16);
  background: linear-gradient(165deg, rgba(26, 28, 36, 0.95), rgba(14, 16, 22, 0.98));
}
.registry-rails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.registry-rail {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.25);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s ease;
}
.registry-rail:hover {
  border-color: rgba(196, 163, 90, 0.4);
  color: var(--fg);
}
.registry-rail.on {
  border-color: rgba(196, 163, 90, 0.55);
  background: linear-gradient(180deg, rgba(196, 163, 90, 0.2), rgba(196, 163, 90, 0.08));
  color: var(--primary-hover);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.12);
}
.registry-rail-count {
  font-family: var(--os-mono);
  font-size: 0.68rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--faint);
}
.registry-rail.on .registry-rail-count {
  background: rgba(196, 163, 90, 0.2);
  color: var(--primary);
}
.registry-hint {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px dashed rgba(196, 163, 90, 0.25);
  background: rgba(196, 163, 90, 0.05);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.registry-hint strong { color: var(--primary-hover); font-weight: 600; }
.catalog-card {
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.catalog-card:hover {
  border-color: rgba(196, 163, 90, 0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.catalog-card.is-aligned {
  border-color: rgba(107, 168, 122, 0.4);
  box-shadow: inset 3px 0 0 var(--success);
}
.catalog-card.is-hostile {
  border-color: rgba(198, 122, 122, 0.4);
  box-shadow: inset 3px 0 0 var(--danger);
}
.catalog-card.is-issue {
  border-color: rgba(196, 163, 90, 0.45);
  box-shadow: inset 3px 0 0 var(--primary);
}
.catalog-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.catalog-badge {
  font-family: var(--os-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
}
.catalog-badge.aligned { color: #9ecaaa; border-color: rgba(107,168,122,0.4); background: rgba(107,168,122,0.1); }
.catalog-badge.hostile { color: #e0a8a8; border-color: rgba(198,122,122,0.4); background: rgba(198,122,122,0.1); }
.catalog-badge.issue { color: var(--primary-hover); border-color: rgba(196,163,90,0.4); background: rgba(196,163,90,0.1); }
.catalog-badge.path { color: #a8c0e0; border-color: rgba(120,150,200,0.4); background: rgba(120,150,200,0.1); }

/* ── Empty states product polish ── */
.empty-state {
  text-align: center;
  padding: 1.75rem 1.25rem !important;
  border-style: dashed !important;
  border-color: rgba(196, 163, 90, 0.2) !important;
  background: rgba(196, 163, 90, 0.03) !important;
}
.empty-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.empty-body {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 28rem;
  margin: 0 auto;
}
.empty-glyph {
  font-size: 1.75rem;
  color: var(--primary);
  opacity: 0.7;
  margin-bottom: 0.5rem;
  font-family: var(--os-mono);
}

/* Journal causality */
.journal-causes {
  margin-bottom: 0.85rem;
}
.log-list .log-item {
  border-left: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  padding-left: 0.65rem;
  margin-left: 0.1rem;
}
.log-list .log-item:hover {
  border-left-color: var(--primary);
  background: rgba(255,255,255,0.02);
}

/* Hide legacy footer/tabs */
.stateos .footer-bar,
.stateos .tabs { display: none !important; }

/* Status strip under menubar on desktop */
.os-status-strip {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 1rem;
  font-family: var(--os-mono);
  font-size: 0.68rem;
  color: var(--faint);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.25);
  letter-spacing: 0.03em;
  overflow-x: auto;
  white-space: nowrap;
}
.is-desktop-os .os-status-strip { display: flex; }
.os-status-strip .sep { opacity: 0.35; }
.os-status-strip .hot { color: #e0a8a8; }
.os-status-strip .good { color: #9ecaaa; }
.os-status-strip .brass { color: var(--primary); }

/* Mobile OS */
html.is-mobile .os-menubar {
  padding: 0.3rem 0.5rem;
  flex-shrink: 0;
}
html.is-mobile .os-country-name { max-width: 6.5rem; font-size: 0.8rem; }
html.is-mobile .os-brand-ver { display: none; }
html.is-mobile .os-titlebar-blurb { display: none; }
html.is-mobile .os-status-led { display: none; }
html.is-mobile .os-stage {
  padding: 0.35rem 0.4rem 0.15rem;
  flex: 1 1 auto;
  min-height: 0;
}
html.is-mobile .os-window {
  border-radius: 14px;
  max-height: 100%;
}
html.is-mobile .os-window-content {
  padding: 0.6rem 0.6rem 0.85rem;
  max-height: 100%;
}
html.is-mobile .os-dock {
  padding: 0.15rem 0.35rem 0.1rem;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 8, 0.6));
}
html.is-mobile .os-dock-inner {
  justify-content: space-between;
  max-width: none;
  border-radius: 16px;
  gap: 0;
  padding: 0.3rem 0.22rem;
  width: 100%;
}
html.is-mobile .os-dock-item {
  min-width: 0;
  flex: 1 1 0;
  padding: 0.35rem 0.08rem;
  gap: 0.12rem;
}
html.is-mobile .os-dock-item:hover { transform: none; }
html.is-mobile .os-dock-glyph {
  font-size: 0.95rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
}
html.is-mobile .os-dock-label {
  font-size: 0.56rem;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.is-mobile .os-taskbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}
html.is-mobile .os-taskbar-meters { order: 1; }
html.is-mobile .os-taskbar-actions { width: 100%; order: 2; }
html.is-mobile .os-taskbar-actions .btn {
  flex: 1;
  min-height: 44px;
}
html.is-mobile .os-end-q { flex: 1.5 !important; }
html.is-mobile .os-notify {
  right: 0.4rem;
  left: 0.4rem;
  width: auto;
  top: 0.35rem;
}
html.is-mobile .os-launcher-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html.is-mobile .os-meter {
  min-width: 3.35rem;
  padding: 0.18rem 0.35rem;
}
html.is-mobile .os-alert-chip { display: none; }
html.is-mobile .os-cause {
  grid-template-columns: auto 1fr;
}
html.is-mobile .os-cause-go { display: none; }
html.is-mobile .registry-rails {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
}
html.is-mobile .registry-rail { flex-shrink: 0; }

html.is-mobile .stateos .coach-panel {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
}
html.is-mobile .stateos .coach-body {
  font-size: 0.88rem;
  line-height: 1.4;
  max-height: 6.5rem;
  overflow: auto;
}
html.is-mobile .stateos .coach-title { font-size: 1rem; }

.is-desktop-os .os-dock { position: relative; padding-bottom: 0.3rem; }
.is-desktop-os .os-stage { padding-bottom: 0.4rem; }
.is-desktop-os .os-menubar { flex-shrink: 0; }
.is-desktop-os .os-taskbar { flex-shrink: 0; }

@media (min-width: 900px) {
  .os-stage { padding: 0.9rem 1.1rem 0.55rem; }
  .os-window-content { padding: 1.05rem 1.2rem 1.35rem; }
  .os-window { max-width: 1140px; }
}

@media (prefers-reduced-motion: reduce) {
  .stateos.screen,
  .os-window,
  .os-notify { animation: none; }
  .os-alert-chip.is-hot,
  .os-status-led.is-hot { animation: none; }
  .os-launch-tile:hover,
  .os-dock-item:hover { transform: none; }
}

/* Menu brand lift when entering product */
.menu-hero .h1 {
  background: linear-gradient(120deg, #f0e6d0 0%, var(--primary) 45%, #e8d5a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.menu-hero .os-boot-line {
  font-family: var(--os-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.85;
  margin-bottom: 0.65rem;
}

/* ═══════════════════════════════════════════════════════════
   StateOS v1.31 — multi-window, open strip, starter pack, boot
   ═══════════════════════════════════════════════════════════ */

.os-open-strip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.85rem;
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.os-open-strip::-webkit-scrollbar { display: none; }
.os-open-label {
  font-family: var(--os-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.os-open-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 550;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.os-open-chip:hover { border-color: rgba(196,163,90,0.35); color: var(--fg); }
.os-open-chip.on {
  border-color: rgba(196,163,90,0.5);
  background: rgba(196,163,90,0.14);
  color: var(--primary-hover);
}
.os-open-chip.is-pinned {
  border-style: dashed;
  border-color: rgba(158,176,200,0.45);
}
.os-open-glyph { font-family: var(--os-mono); color: var(--primary); }

.os-stage.is-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.65fr);
  gap: 0.65rem;
  align-items: stretch;
}
.os-window.is-secondary {
  max-width: none;
  border-color: rgba(158, 176, 200, 0.22);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(158,176,200,0.08);
}
.os-window.is-mini .os-window-content {
  padding: 0.7rem 0.75rem;
}
.os-mini-meters {
  display: grid;
  gap: 0.35rem;
  font-family: var(--os-mono);
  font-size: 0.78rem;
}
.os-mini-meters .danger { color: #e0a8a8; }
.os-mini-meters .success { color: #9ecaaa; }

.catalog-starter-why {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 0.3rem 0 0.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

/* Boot splash */
.os-boot-splash {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(12,14,20,0.92), rgba(4,5,8,0.96));
  animation: os-boot-fade 1.6s ease-out forwards;
  pointer-events: none;
}
.os-boot-splash-inner { text-align: center; }
.os-boot-splash-mark {
  font-family: var(--os-mono);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--primary);
  text-shadow: 0 0 28px rgba(196,163,90,0.45);
}
.os-boot-splash-sub {
  margin-top: 0.55rem;
  font-family: var(--os-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes os-boot-fade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

html.is-mobile .os-open-strip { padding: 0.22rem 0.45rem; }
html.is-mobile .os-open-label { display: none; }
html.is-mobile .os-stage.is-split {
  grid-template-columns: 1fr;
}
html.is-mobile .os-window.is-secondary { display: none; }

@media (prefers-reduced-motion: reduce) {
  .os-boot-splash { display: none; }
}

/* Opening spine agenda (Q1–Q6) */
.os-agenda {
  border-color: rgba(196, 163, 90, 0.28) !important;
  background:
    linear-gradient(135deg, rgba(196, 163, 90, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(28, 24, 18, 0.45), rgba(14, 16, 22, 0.7)) !important;
  position: relative;
  overflow: hidden;
}
.os-agenda::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), rgba(196,163,90,0.2));
}
.os-agenda-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.os-agenda-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.os-agenda-line {
  font-family: var(--os-mono);
  font-size: 0.78rem;
  color: var(--primary-hover);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}
.os-agenda-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.os-agenda-check {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.os-agenda-check.is-done {
  color: #9ecaaa;
}
.os-agenda-mark {
  font-family: var(--os-mono);
  color: var(--primary);
  flex-shrink: 0;
  width: 1rem;
}
.os-agenda-check.is-done .os-agenda-mark { color: #9ecaaa; }

/* Full dual-app secondary */
.os-stage.is-split {
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
}
.os-window.is-secondary:not(.is-mini) {
  max-width: none;
}
.os-window.is-secondary:not(.is-mini) .os-window-content {
  padding: 0.65rem 0.7rem 0.9rem;
}
.os-sec-banner {
  font-family: var(--os-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px dashed rgba(158,176,200,0.35);
  background: rgba(158,176,200,0.06);
  margin-bottom: 0.45rem;
}

/* Residual law banners on project cards */
.path-residual {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.22);
  line-height: 1.4;
}
.path-residual-k {
  font-family: var(--os-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
  margin-bottom: 0.2rem;
}
.path-residual-d {
  font-size: 0.8rem;
  color: var(--muted);
}
.path-residual.is-ok {
  border-color: rgba(107,168,122,0.45);
  background: rgba(107,168,122,0.08);
}
.path-residual.is-ok .path-residual-k { color: #9ecaaa; }
.path-residual.is-warn {
  border-color: rgba(196,163,90,0.45);
  background: rgba(196,163,90,0.08);
}
.path-residual.is-warn .path-residual-k { color: var(--primary-hover); }
.path-residual.is-fail {
  border-color: rgba(198,122,122,0.55);
  background: rgba(198,122,122,0.1);
  box-shadow: 0 0 16px rgba(120,40,40,0.12);
}
.path-residual.is-fail .path-residual-k { color: #e0a8a8; }

@media (max-width: 900px) {
  .os-stage.is-split {
    grid-template-columns: 1fr;
  }
  .os-window.is-secondary:not(.is-mini) {
    max-height: 42dvh;
  }
}

/* Registry campaigns */
.campaign-board {
  padding: 0.55rem 0.6rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(196,163,90,0.22);
  background:
    linear-gradient(135deg, rgba(196,163,90,0.08), transparent 50%),
    rgba(0,0,0,0.2);
}
.campaign-board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.campaign-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.campaign-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.campaign-chip:hover { border-color: rgba(196,163,90,0.4); color: var(--fg); }
.campaign-chip.on {
  border-color: rgba(196,163,90,0.55);
  background: rgba(196,163,90,0.14);
  color: var(--primary-hover);
}
.campaign-chip.is-done {
  border-color: rgba(107,168,122,0.4);
  color: #9ecaaa;
}
.campaign-chip-prog {
  font-family: var(--os-mono);
  font-size: 0.62rem;
  opacity: 0.85;
}
.campaign-active-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
}
.campaign-next {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  line-height: 1.4;
}
.campaign-raise {
  padding: 0.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  align-items: center;
  gap: 0.5rem;
}
.panel-inset {
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Campaign chain flash */
.campaign-chain-flash {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(107,168,122,0.4);
  background: rgba(107,168,122,0.1);
}
.campaign-chain-k {
  font-family: var(--os-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ecaaa;
  font-weight: 650;
}
.campaign-chain-d {
  flex: 1;
  min-width: 10rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--fg);
}

/* ── Mobile density kill pass (StateOS) ── */
html.is-mobile .stateos,
.stateos.is-mobile-os {
  --os-chrome-pad: 0.35rem;
}
.stateos.is-mobile-os .os-menubar {
  padding: 0.28rem 0.45rem;
  gap: 0.35rem;
  min-height: 0;
}
.stateos.is-mobile-os .os-brand-ver,
.stateos.is-mobile-os .os-titlebar-blurb,
.stateos.is-mobile-os .os-open-label {
  display: none !important;
}
.stateos.is-mobile-os .os-country-term {
  font-size: 0.62rem;
}
.stateos.is-mobile-os .os-status-strip {
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  gap: 0.35rem;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.stateos.is-mobile-os .os-open-strip {
  padding: 0.2rem 0.4rem;
  gap: 0.25rem;
}
.stateos.is-mobile-os .os-open-chip {
  padding: 0.22rem 0.45rem;
  font-size: 0.68rem;
}
.stateos.is-mobile-os .os-titlebar {
  padding: 0.35rem 0.45rem;
  gap: 0.3rem;
}
.stateos.is-mobile-os .os-titlebar-title {
  font-size: 0.82rem;
}
.stateos.is-mobile-os .os-window-content {
  padding: 0.45rem 0.5rem 0.7rem !important;
}
.stateos.is-mobile-os .os-window {
  border-radius: 12px;
  margin: 0 0.3rem;
}
.stateos.is-mobile-os .panel {
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.45rem;
}
.stateos.is-mobile-os .h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
/* Regime strip compress */
.stateos.is-mobile-os .regime-strip,
.stateos.is-mobile-os .os-regime {
  padding: 0.45rem 0.55rem !important;
}
.stateos.is-mobile-os .regime-strip .muted,
.stateos.is-mobile-os .regime-strip .xs {
  font-size: 0.68rem !important;
  line-height: 1.3 !important;
}
/* Agenda denser */
.stateos.is-mobile-os .os-agenda {
  padding: 0.55rem 0.6rem 0.55rem 0.75rem !important;
}
.stateos.is-mobile-os .os-agenda-title {
  font-size: 0.92rem !important;
}
.stateos.is-mobile-os .os-agenda-line {
  font-size: 0.7rem !important;
}
.stateos.is-mobile-os .os-agenda .xs.muted {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stateos.is-mobile-os .os-agenda-checks {
  gap: 0.2rem !important;
}
/* Causality — fewer visual weight */
.stateos.is-mobile-os .os-causes-list .os-cause-row:nth-child(n+4) {
  display: none;
}
/* Wire / paper clamp */
.stateos.is-mobile-os .headline-strip .small,
.stateos.is-mobile-os .paper-lede {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Registry rails + campaigns */
.stateos.is-mobile-os .registry-rails {
  gap: 0.28rem;
  padding-bottom: 0.15rem;
}
.stateos.is-mobile-os .registry-rail {
  padding: 0.28rem 0.5rem;
  font-size: 0.68rem;
  min-height: 34px;
}
.stateos.is-mobile-os .registry-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stateos.is-mobile-os .campaign-board {
  padding: 0.4rem 0.45rem 0.5rem !important;
}
.stateos.is-mobile-os .campaign-chip {
  padding: 0.22rem 0.42rem;
  font-size: 0.66rem;
}
.stateos.is-mobile-os .campaign-active-title {
  font-size: 0.88rem !important;
}
.stateos.is-mobile-os .catalog-domain-row,
.stateos.is-mobile-os .cat-chips {
  display: none !important; /* campaign/first-cabinet first; domains via search */
}
.stateos.is-mobile-os .catalog-card {
  padding: 0.55rem 0.6rem !important;
}
.stateos.is-mobile-os .policy-story {
  -webkit-line-clamp: 2 !important;
}
.stateos.is-mobile-os .catalog-starter-why {
  font-size: 0.72rem;
  line-height: 1.3;
}
/* Dock + taskbar stack tighter */
.stateos.is-mobile-os .os-dock {
  padding: 0.2rem 0.25rem calc(0.15rem + env(safe-area-inset-bottom, 0px));
  gap: 0.05rem;
}
.stateos.is-mobile-os .os-dock-item {
  min-width: 0;
  padding: 0.28rem 0.15rem 0.2rem;
  flex: 1 1 0;
}
.stateos.is-mobile-os .os-dock-glyph {
  font-size: 1rem;
}
.stateos.is-mobile-os .os-dock-label {
  font-size: 0.55rem;
  letter-spacing: 0;
}
.stateos.is-mobile-os .os-taskbar {
  padding: 0.28rem 0.4rem calc(0.28rem + env(safe-area-inset-bottom, 0px));
  gap: 0.3rem;
  flex-wrap: wrap;
}
.stateos.is-mobile-os .os-task-meters {
  gap: 0.25rem;
  overflow-x: auto;
  flex: 1 1 100%;
  max-width: 100%;
  padding-bottom: 0.1rem;
}
.stateos.is-mobile-os .os-meter-chip {
  padding: 0.2rem 0.35rem;
  font-size: 0.62rem;
  min-height: 32px;
}
.stateos.is-mobile-os .os-meter-chip .os-meter-label {
  font-size: 0.52rem;
}
.stateos.is-mobile-os .os-task-actions {
  width: 100%;
  display: flex;
  gap: 0.35rem;
  justify-content: stretch;
}
.stateos.is-mobile-os .os-task-actions .btn {
  flex: 1;
  min-height: 42px;
}
/* Coach tighter */
.stateos.is-mobile-os .coach-panel {
  left: 0.4rem;
  right: 0.4rem;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  padding: 0.65rem 0.75rem;
  max-height: 38dvh;
  overflow: auto;
}
.stateos.is-mobile-os .coach-body {
  font-size: 0.8rem;
  line-height: 1.4;
  -webkit-line-clamp: 4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Books / external denser */
.stateos.is-mobile-os .books-fx-grid,
.stateos.is-mobile-os .fx-desk-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 0.35rem !important;
}
/* Desktop apps launcher */
.stateos.is-mobile-os .os-launch-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 0.4rem !important;
}
.stateos.is-mobile-os .os-launch-tile {
  padding: 0.55rem 0.5rem !important;
  min-height: 0;
}
/* Hide secondary pin chrome entirely on phone (already no dual) */
.stateos.is-mobile-os .os-sec-banner {
  display: none;
}
/* Path residual denser */
.stateos.is-mobile-os .path-residual {
  padding: 0.4rem 0.5rem !important;
}
.stateos.is-mobile-os .path-residual-d {
  font-size: 0.74rem !important;
}
/* Stage fills without extra chrome scroll traps */
.stateos.is-mobile-os .os-stage {
  padding: 0.3rem 0 0;
  min-height: 0;
}
.stateos.is-mobile-os .os-home.stack > .panel:not(.os-agenda):not(.os-causes) {
  /* keep structure */
}
/* Discover beat compact */
.stateos.is-mobile-os .discover-beat,
.stateos.is-mobile-os .os-discover {
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
}

/* ── 1.36 Mobile long-premiership pleasure ── */
.stateos.is-mobile-os .os-launch-grid {
  display: none !important; /* dock is enough */
}
.stateos.is-mobile-os .os-home > .panel.os-causes .os-cause-row:nth-child(n+3) {
  display: none;
}
.stateos.is-mobile-os .os-agenda-checks .os-agenda-check:nth-child(n+3) {
  display: none;
}
.stateos.is-mobile-os .os-task-actions .btn-ghost:first-child {
  /* Resign less dominant */
  flex: 0 0 auto;
  min-width: 4.5rem;
  opacity: 0.75;
  font-size: 0.72rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}
.stateos.is-mobile-os .os-task-actions .os-end-q,
.stateos.is-mobile-os .os-task-actions .btn-primary {
  flex: 1.4 1 auto;
}
.stateos.is-mobile-os .os-task-actions .btn-footer-secondary,
.stateos.is-mobile-os .os-task-actions .btn:nth-child(2) {
  flex: 0.9 1 auto;
}
/* Status strip single line scroll */
.stateos.is-mobile-os .os-status-strip {
  font-size: 0.62rem;
  padding: 0.12rem 0.4rem;
}
/* Hide regime character essay on mobile — keep meters */
.stateos.is-mobile-os .regime-strip .regime-hint,
.stateos.is-mobile-os .regime-strip p,
.stateos.is-mobile-os .os-regime .muted.xs {
  display: none !important;
}
.stateos.is-mobile-os .regime-strip,
.stateos.is-mobile-os .os-regime {
  padding: 0.4rem 0.5rem !important;
}
/* Discover / paper less wall */
.stateos.is-mobile-os .discover-beat .discover-body,
.stateos.is-mobile-os .os-discover .muted {
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Path cards denser */
.stateos.is-mobile-os .path-card .small.muted {
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stateos.is-mobile-os .path-steps .path-step:not(.next):not(.met) {
  display: none;
}
/* Portfolio list denser */
.stateos.is-mobile-os .portfolio-panel .policy-row {
  padding: 0.4rem 0;
}
/* Books compact */
.stateos.is-mobile-os .books-column .books-row:nth-child(n+6) {
  display: none;
}
/* Bottom chrome: dock above task without huge gap */
.stateos.is-mobile-os .os-dock {
  border-radius: 14px 14px 0 0;
  margin: 0;
}
.stateos.is-mobile-os .os-taskbar {
  border-top: 1px solid rgba(255,255,255,0.06);
}
/* Focus mode: less open-strip weight */
.stateos.is-mobile-os .os-open-strip {
  max-height: 2rem;
  overflow-x: auto;
}

/* 1.36: sticky catalog head was intercepting Introduce taps on mobile
   once Campaigns board made the head taller than the viewport gap. */
html.is-mobile .catalog-head,
.stateos.is-mobile-os .catalog-head {
  position: static !important;
  top: auto !important;
  box-shadow: none !important;
  z-index: auto !important;
}
/* Keep rails usable without covering the card stack */
.stateos.is-mobile-os .registry-rails {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(14, 16, 22, 0.94);
  padding: 0.25rem 0;
  margin-top: 0.35rem;
  backdrop-filter: blur(8px);
}


/* ═══════════════════════════════════════════════════════════
   1.38 — Product A pass: wound banner, autopsy, authored brand
   ═══════════════════════════════════════════════════════════ */

/* Brand seal on menubar — poster-readable half-second */
.os-brand-mark {
  letter-spacing: 0.14em;
  font-weight: 700;
  background: linear-gradient(180deg, #f0e0b0 0%, var(--primary) 55%, #8a7040 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(196, 163, 90, 0.25);
}
.os-brand-ver {
  opacity: 0.55;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.58rem;
}
.os-status-led {
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 10px rgba(196, 163, 90, 0.35);
}
.os-status-led.is-hot {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 14px rgba(198, 122, 122, 0.55);
  animation: os-pulse 1.1s ease-in-out infinite;
}
.os-status-led.is-warn {
  background: var(--warn);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 12px rgba(196, 164, 106, 0.45);
}

/* Window title bar — authored chrome */
.os-titlebar {
  border-bottom: 1px solid rgba(196, 163, 90, 0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.os-titlebar-glyph {
  color: var(--primary);
  filter: drop-shadow(0 0 6px rgba(196, 163, 90, 0.35));
}

/* Dock glass + brass hover */
.os-dock-item.on {
  background: linear-gradient(180deg, rgba(196,163,90,0.22), rgba(196,163,90,0.08));
  box-shadow: 0 0 0 1px rgba(196,163,90,0.35), 0 0 18px rgba(196,163,90,0.12);
}
.os-dock-item:hover {
  background: rgba(255,255,255,0.06);
}

/* Wound banner — "what just hurt me" without dig-work */
.wound-banner {
  border: 1px solid rgba(198, 122, 122, 0.35);
  background:
    linear-gradient(135deg, rgba(198,122,122,0.14), rgba(14,16,22,0.4) 60%),
    var(--surface);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3) inset, 0 8px 24px rgba(0,0,0,0.25);
}
.wound-banner-k {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 0.4rem;
}
.wound-banner-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.wound-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.wound-chip:hover {
  border-color: rgba(196,163,90,0.45);
  background: rgba(196,163,90,0.08);
  transform: translateX(2px);
}
.wound-chip.wound-bad {
  border-color: rgba(198,122,122,0.4);
}
.wound-chip.wound-warn {
  border-color: rgba(196,164,106,0.35);
}
.wound-chip-t {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
}
.wound-chip-go {
  flex-shrink: 0;
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  color: var(--primary);
  letter-spacing: 0.04em;
}

/* Premiership autopsy on end screen */
.autopsy-panel {
  border: 1px solid rgba(196,163,90,0.18);
  background: rgba(0,0,0,0.22);
}
.autopsy-kicker {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}
.autopsy-headline {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 0.25rem;
  line-height: 1.35;
  color: var(--fg);
}
.autopsy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.autopsy-row {
  border-left: 3px solid var(--border);
  padding: 0.4rem 0.55rem;
  background: rgba(255,255,255,0.02);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.autopsy-row.autopsy-bad { border-left-color: var(--danger); }
.autopsy-row.autopsy-warn { border-left-color: var(--warn); }
.autopsy-row.autopsy-good { border-left-color: var(--success); }
.autopsy-row-t {
  font-weight: 600;
  font-size: 0.88rem;
}
.autopsy-row-d {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}
.autopsy-row-go {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  color: var(--accent);
  margin-top: 0.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Registry instrument — archive rail muted */
.registry-rail:last-child {
  opacity: 0.72;
}
.registry-rail:last-child .registry-rail-count {
  opacity: 0.8;
}
.registry-hint strong {
  color: var(--primary);
}

/* Coach — denser authority card */
.coach-panel {
  border: 1px solid rgba(196,163,90,0.28);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4) inset, 0 12px 32px rgba(0,0,0,0.35);
  background:
    linear-gradient(160deg, rgba(196,163,90,0.1), transparent 50%),
    var(--surface);
}
.coach-kicker {
  letter-spacing: 0.14em;
}

/* Desktop launcher tiles — more authored */
.os-launch-tile {
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.15));
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.os-launch-tile:hover {
  border-color: rgba(196,163,90,0.4);
  box-shadow: 0 0 20px rgba(196,163,90,0.1);
  transform: translateY(-1px);
}
.os-launch-glyph {
  color: var(--primary);
}

/* Mobile: wound banner compact */
.stateos.is-mobile-os .wound-banner {
  padding: 0.5rem 0.6rem;
}
.stateos.is-mobile-os .wound-chip-t {
  font-size: 0.8rem;
}
.stateos.is-mobile-os .autopsy-headline {
  font-size: 0.95rem;
}
/* Mobile: hide archive rail label density */
.stateos.is-mobile-os .registry-rails {
  gap: 0.25rem;
}
.stateos.is-mobile-os .os-launch-blurb {
  display: none;
}

/* Legacy card — death poster */
.legacy-card {
  border: 1px solid rgba(196,163,90,0.22);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(196,163,90,0.06);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(196,163,90,0.08), transparent 60%),
    var(--surface);
}



/* ═══════════════════════════════════════════════════════════
   1.38 — Grade A pass: onboarding gates · registry next · primers
   ═══════════════════════════════════════════════════════════ */

.coach-gate {
  margin-top: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(196, 163, 90, 0.45);
  background: rgba(196, 163, 90, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.coach-gate.is-met {
  border-style: solid;
  border-color: rgba(95, 154, 120, 0.45);
  background: rgba(95, 154, 120, 0.1);
}
.coach-gate-k {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.coach-gate.is-met .coach-gate-k { color: var(--success); }
.coach-gate-d {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--fg);
}

.ledger-primer {
  border: 1px solid rgba(196, 163, 90, 0.22);
  background:
    linear-gradient(135deg, rgba(196,163,90,0.08), transparent 55%),
    var(--surface);
}
.ledger-primer-k,
.residual-law-k {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.ledger-primer-grid,
.residual-law-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 560px) {
  .ledger-primer-grid,
  .residual-law-grid { grid-template-columns: 1fr; }
}
.ledger-primer-col,
.residual-law-col {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.05);
}
.ledger-primer-col.marks { border-left: 3px solid #7eb8a0; }
.ledger-primer-col.crowns { border-left: 3px solid #c4a35a; }
.ledger-primer-label,
.residual-law-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.2rem;
}
.ledger-primer-val {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0.15rem 0 0.35rem;
}
.ledger-primer-d,
.residual-law-d {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}
.ledger-primer-foot { margin-top: 0.55rem; line-height: 1.4; }

.residual-law {
  border: 1px solid rgba(196, 163, 90, 0.2);
  background: rgba(0,0,0,0.18);
}

.catalog-next {
  border: 1px solid rgba(196, 163, 90, 0.4);
  background:
    linear-gradient(120deg, rgba(196,163,90,0.14), transparent 60%),
    var(--surface);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset, 0 10px 28px rgba(0,0,0,0.28);
  position: sticky;
  top: 0;
  z-index: 3;
}
.catalog-next-k {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.catalog-next-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}
.catalog-next-why {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.2rem;
}

.os-nation {
  padding: 0.35rem 0.65rem 0.55rem;
}
.os-nation-sum {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.15rem;
}
.os-nation-sum::-webkit-details-marker { display: none; }
.os-nation-body { margin-top: 0.5rem; }

.qb-wounds {
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(198, 122, 122, 0.1);
  border: 1px solid rgba(198, 122, 122, 0.28);
}
.qb-wound-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.qb-wound-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.28);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.qb-wound-chip:hover {
  border-color: rgba(196,163,90,0.45);
}

.autopsy-root {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
  background: rgba(198, 122, 122, 0.1);
}
.autopsy-root-tag {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--danger);
}
.autopsy-root-body {
  font-size: 0.88rem;
  line-height: 1.45;
  margin-top: 0.25rem;
  color: var(--fg);
}
.autopsy-root-tip {
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 0.4rem;
  color: var(--muted);
}

html.is-mobile .catalog-next,
.stateos.is-mobile-os .catalog-next {
  position: sticky;
  top: 0;
  z-index: 5;
}
html.is-mobile .ledger-primer-val {
  font-size: 1.1rem;
}

/* ── 1.39 morph / feel ── */
.os-taskbar.is-live-tick .pill,
.os-taskbar.is-live-tick .os-task-pill {
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.catalog-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
.os-window-content {
  /* scroll container identity for morph restore */
  overflow-anchor: none;
}
/* Avoid flash during morph of status LEDs */
.os-status-led,
.pill,
.os-dock-item.on {
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* ── 1.40 first-hour progressive disclosure ── */
.archive-lock-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  margin: 0.55rem 0 0.35rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 163, 90, 0.35);
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.12), rgba(40, 44, 52, 0.4));
}
.archive-lock-k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4a35a;
}
.archive-lock-d {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  flex: 1;
  min-width: 12rem;
}
.registry-rail.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}
.registry-rail.is-locked:disabled {
  pointer-events: auto;
}
.os-meter.pill-reserves.is-character {
  border: 1px solid rgba(196, 163, 90, 0.55);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.12), 0 0 12px rgba(196, 163, 90, 0.12);
  background: linear-gradient(180deg, rgba(196, 163, 90, 0.14), rgba(30, 34, 42, 0.55));
}
.os-meter.pill-reserves.is-character .os-meter-k {
  color: #c4a35a;
  font-weight: 700;
}
.os-dock-item.is-teach:not(.on) {
  box-shadow: inset 0 -2px 0 rgba(126, 184, 160, 0.55);
}
.os-dock-item.is-secondary-desk {
  opacity: 0.72;
}
.os-agenda.is-gated {
  border-color: rgba(196, 163, 90, 0.4);
}
.os-agenda.is-clear {
  border-color: rgba(95, 154, 120, 0.35);
}
.os-agenda-gate {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: rgba(196, 163, 90, 0.1);
}
.os-agenda-gate-k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c4a35a;
}
.os-agenda-gate-d {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  flex: 1;
  min-width: 10rem;
}
.quarter-brief.is-wound-first {
  border-color: rgba(164, 90, 90, 0.45);
  box-shadow: 0 0 0 1px rgba(164, 90, 90, 0.12);
}
.qb-wounds-hero {
  margin-top: 0.65rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  background: rgba(164, 90, 90, 0.1);
  border: 1px solid rgba(164, 90, 90, 0.28);
}
.qb-wounds-hero .qb-label {
  color: #e0a8a8;
  font-weight: 700;
}
.os-launcher-hint {
  border-style: dashed;
}
.stateos.is-mobile-os .archive-lock-banner {
  flex-direction: column;
  gap: 0.2rem;
}
.stateos.is-mobile-os .os-meter.pill-reserves.is-character .os-meter-k {
  font-size: 0.62rem;
}

/* ═══════════════════════════════════════════════════════════
   1.41 — Mobile cut-chrome · one-wound focus · dual signature
   Same sim. Less metal. Govern on a phone.
   ═══════════════════════════════════════════════════════════ */

/* Dual-ledger signature chip (menubar) */
.os-dual-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background: linear-gradient(135deg, rgba(126, 184, 160, 0.12), rgba(196, 163, 90, 0.14));
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--fg);
  cursor: pointer;
  line-height: 1;
  min-height: 28px;
}
.os-dual-chip:hover {
  border-color: rgba(196, 163, 90, 0.65);
  background: linear-gradient(135deg, rgba(126, 184, 160, 0.18), rgba(196, 163, 90, 0.2));
}
.os-dual-chip.is-hot {
  border-color: rgba(224, 168, 168, 0.55);
  box-shadow: 0 0 10px rgba(164, 90, 90, 0.2);
}
.os-dual-m { color: #7eb8a0; }
.os-dual-c { color: #c4a35a; }
.os-dual-sep { opacity: 0.45; font-weight: 500; }

/* Residual dual-law signature */
.residual-law.is-signature {
  border: 1px solid rgba(196, 163, 90, 0.35);
  background:
    linear-gradient(135deg, rgba(126, 184, 160, 0.08), transparent 45%),
    linear-gradient(225deg, rgba(196, 163, 90, 0.1), transparent 50%),
    rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.08), inset 0 1px 0 rgba(255,255,255,0.04);
}
.residual-law-col.residual-steps { border-left-color: #7eb8a0; }
.residual-law-col.residual-crowns { border-left-color: #c4a35a; }
.residual-law.is-signature .residual-law-k {
  color: #c4a35a;
  letter-spacing: 0.08em;
}

/* Soft archive banner (post-Q6 instrument discipline) */
.archive-soft-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
  margin: 0.45rem 0 0.3rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px dashed rgba(158, 176, 200, 0.35);
  background: rgba(158, 176, 200, 0.06);
}
.archive-soft-banner .archive-lock-k { color: var(--accent, #9eb0c8); }

/* Wound banner touch */
.wound-banner {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(164, 90, 90, 0.4);
  background: linear-gradient(135deg, rgba(164, 90, 90, 0.14), rgba(0,0,0,0.25));
  margin-bottom: 0.45rem;
}
.wound-banner-k {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0a8a8;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.wound-banner-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.wound-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.3);
  color: var(--fg);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  min-height: 44px;
}
.wound-chip:hover { border-color: rgba(196, 163, 90, 0.5); }
.wound-chip.wound-bad { border-left: 3px solid #c67a7a; }
.wound-chip.wound-warn { border-left: 3px solid #c4a35a; }
.wound-chip-t { font-weight: 600; font-size: 0.88rem; line-height: 1.3; }
.wound-chip-go {
  font-family: var(--os-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Mobile OS layout (1.41 cut chrome) ── */
.stateos.is-mobile-os {
  --os-chrome-pad: 0.3rem;
}
/* Stage owns the scroll; chrome is fixed height */
.stateos.is-mobile-os .os-stage.is-mobile-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0.25rem 0 0;
  display: flex;
  flex-direction: column;
}
.stateos.is-mobile-os .os-window {
  margin: 0 0.25rem;
  border-radius: 14px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.stateos.is-mobile-os .os-window-content {
  padding: 0.45rem 0.5rem 0.85rem !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}
/* Menubar slim */
.stateos.is-mobile-os .os-menubar,
.stateos.is-mobile-os .os-menubar.is-mobile-bar {
  padding: 0.28rem 0.4rem;
  gap: 0.3rem;
  min-height: 0;
  flex-shrink: 0;
}
.stateos.is-mobile-os .os-brand-mark { font-size: 0.82rem; }
.stateos.is-mobile-os .os-country-name {
  max-width: 5.5rem;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stateos.is-mobile-os .os-country-term { font-size: 0.58rem !important; }
.stateos.is-mobile-os .os-status-led { display: none !important; }
.stateos.is-mobile-os .os-clock { display: none !important; }
.stateos.is-mobile-os .os-alert-chip { display: none !important; }
.stateos.is-mobile-os .os-dual-chip {
  font-size: 0.68rem;
  padding: 0.2rem 0.4rem;
  min-height: 26px;
}
.stateos.is-mobile-os .os-notify-btn {
  min-width: 2rem;
  min-height: 32px;
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
}
/* Titlebar compact */
.stateos.is-mobile-os .os-titlebar {
  padding: 0.32rem 0.45rem;
  flex-shrink: 0;
}
.stateos.is-mobile-os .os-titlebar-blurb,
.stateos.is-mobile-os .os-titlebar-dots { display: none !important; }
.stateos.is-mobile-os .os-titlebar-title { font-size: 0.84rem; }
.stateos.is-mobile-os .os-titlebar-home {
  min-height: 32px;
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
}
/* Dock — fixed bottom, safe area */
.stateos.is-mobile-os .os-dock {
  flex-shrink: 0;
  padding: 0.12rem 0.2rem 0;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 8, 0.85));
}
.stateos.is-mobile-os .os-dock-inner {
  width: 100%;
  max-width: none;
  border-radius: 16px 16px 12px 12px;
  gap: 0;
  padding: 0.28rem 0.15rem 0.22rem;
  justify-content: space-between;
}
.stateos.is-mobile-os .os-dock-item {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 0.28rem 0.05rem 0.18rem;
  gap: 0.1rem;
}
.stateos.is-mobile-os .os-dock-glyph {
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.95rem;
  border-radius: 9px;
}
.stateos.is-mobile-os .os-dock-label {
  font-size: 0.52rem;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Taskbar — meters scroll, actions full width, safe area */
.stateos.is-mobile-os .os-taskbar,
.stateos.is-mobile-os .os-taskbar.is-mobile-taskbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0.3rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.06);
}
.stateos.is-mobile-os .os-taskbar-meters {
  order: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.28rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.05rem;
}
.stateos.is-mobile-os .os-taskbar-meters::-webkit-scrollbar { display: none; }
.stateos.is-mobile-os .os-taskbar-meters .os-meter,
.stateos.is-mobile-os .os-taskbar-meters .pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.22rem 0.4rem;
  font-size: 0.68rem;
}
.stateos.is-mobile-os .os-meter-k,
.stateos.is-mobile-os .os-taskbar-meters .os-meter-k {
  font-size: 0.52rem !important;
}
.stateos.is-mobile-os .os-meter.pill-reserves.is-character {
  border-width: 1.5px;
}
.stateos.is-mobile-os .os-taskbar-actions {
  order: 2;
  width: 100%;
  display: flex;
  gap: 0.35rem;
}
.stateos.is-mobile-os .os-taskbar-actions .btn {
  min-height: 46px;
  font-size: 0.82rem;
}
.stateos.is-mobile-os .os-taskbar-actions .is-resign-compact,
.stateos.is-mobile-os .os-taskbar-actions .btn-footer-secondary {
  flex: 0 0 auto;
  min-width: 4.2rem;
  max-width: 5.2rem;
  opacity: 0.8;
  font-size: 0.72rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.stateos.is-mobile-os .os-taskbar-actions .btn-footer-enact {
  flex: 0.95 1 auto;
}
.stateos.is-mobile-os .os-taskbar-actions .os-end-q {
  flex: 1.5 1 auto !important;
  font-weight: 700;
}

/* Home: fewer panels, one wound */
.stateos.is-mobile-os .os-home.is-mobile-home {
  gap: 0.4rem;
}
.stateos.is-mobile-os .os-home .panel {
  padding: 0.5rem 0.55rem;
  margin-bottom: 0;
}
.stateos.is-mobile-os .os-causes.is-empty-mobile {
  display: none;
}
.stateos.is-mobile-os .os-causes.is-mobile-causes .os-cause-d {
  display: none;
}
.stateos.is-mobile-os .os-cause {
  min-height: 44px;
  padding: 0.45rem 0.4rem;
}
.stateos.is-mobile-os .os-agenda.is-mobile-agenda {
  padding: 0.5rem 0.55rem 0.5rem 0.7rem !important;
}
.stateos.is-mobile-os .os-agenda-title { font-size: 0.9rem !important; }
.stateos.is-mobile-os .os-agenda-line { font-size: 0.72rem !important; }
.stateos.is-mobile-os .wound-banner.is-mobile-wound {
  padding: 0.5rem 0.55rem;
}
.stateos.is-mobile-os .wound-chip {
  min-height: 48px;
  padding: 0.6rem 0.7rem;
}
.stateos.is-mobile-os .wound-chip-t { font-size: 0.92rem; }
/* Regime strip: meters only */
.stateos.is-mobile-os .regime-strip p,
.stateos.is-mobile-os .regime-strip .regime-hint,
.stateos.is-mobile-os .regime-strip .muted.xs,
.stateos.is-mobile-os .os-regime .muted.xs {
  display: none !important;
}
.stateos.is-mobile-os .regime-strip,
.stateos.is-mobile-os .os-regime {
  padding: 0.4rem 0.5rem !important;
}
/* Nation status: summary only until expand */
.stateos.is-mobile-os .os-nation {
  margin-bottom: 0.25rem !important;
}
.stateos.is-mobile-os .os-nation-sum {
  min-height: 40px;
}
/* Launcher never on mobile */
.stateos.is-mobile-os .os-launcher,
.stateos.is-mobile-os .os-launcher-grid,
.stateos.is-mobile-os .os-launcher-hint {
  display: none !important;
}

/* Registry mobile */
.stateos.is-mobile-os .registry-rails {
  gap: 0.25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
}
.stateos.is-mobile-os .registry-rails::-webkit-scrollbar { display: none; }
.stateos.is-mobile-os .registry-rail {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  white-space: nowrap;
}
.stateos.is-mobile-os .registry-hint {
  font-size: 0.7rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stateos.is-mobile-os .catalog-next {
  position: sticky;
  top: 0;
  z-index: 6;
  margin-bottom: 0.4rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.stateos.is-mobile-os .catalog-next .btn {
  min-height: 44px;
}
.stateos.is-mobile-os .catalog-card {
  padding: 0.55rem 0.6rem !important;
}
.stateos.is-mobile-os .catalog-name { font-size: 0.92rem; }
.stateos.is-mobile-os .catalog-card .btn-primary {
  min-height: 40px;
  white-space: nowrap;
}
.stateos.is-mobile-os .campaign-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stateos.is-mobile-os .campaign-chips::-webkit-scrollbar { display: none; }
.stateos.is-mobile-os .campaign-chip {
  flex: 0 0 auto;
  min-height: 34px;
}
.stateos.is-mobile-os .catalog-search {
  min-height: 44px;
  font-size: 16px; /* prevent iOS zoom */
}
.stateos.is-mobile-os .filter-row { display: none !important; }
.stateos.is-mobile-os .archive-lock-banner,
.stateos.is-mobile-os .archive-soft-banner {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

/* Paths / residual mobile */
.stateos.is-mobile-os .residual-law.is-signature {
  padding: 0.55rem 0.6rem;
}
.stateos.is-mobile-os .residual-law-grid {
  grid-template-columns: 1fr !important;
  gap: 0.4rem;
}
.stateos.is-mobile-os .path-card .small.muted {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stateos.is-mobile-os .legacy-goals-panel {
  /* keep but denser */
  padding: 0.5rem 0.55rem;
}

/* Books dual primer */
.stateos.is-mobile-os .ledger-primer-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 0.4rem;
}
.stateos.is-mobile-os .ledger-primer-val { font-size: 1.05rem; }
.stateos.is-mobile-os .ledger-primer-d {
  font-size: 0.68rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Alerts / coach / brief mobile */
.stateos.is-mobile-os .coach-panel {
  left: 0.35rem !important;
  right: 0.35rem !important;
  bottom: calc(6.2rem + env(safe-area-inset-bottom, 0px)) !important;
  max-height: 36dvh;
  overflow: auto;
  padding: 0.65rem 0.7rem;
  z-index: 40;
}
.stateos.is-mobile-os .coach-body {
  font-size: 0.8rem;
  line-height: 1.4;
}
.stateos.is-mobile-os .coach-actions .btn {
  min-height: 42px;
  flex: 1;
}
.stateos.is-mobile-os .quarter-brief {
  padding: 0.65rem 0.7rem;
}
.stateos.is-mobile-os .qb-wounds-hero .qb-wound-chip,
.stateos.is-mobile-os .qb-wound-chip {
  min-height: 44px;
}
.stateos.is-mobile-os .qb-grid {
  grid-template-columns: 1fr !important;
}
.stateos.is-mobile-os .discover-beat {
  padding: 0.55rem 0.6rem;
}
.stateos.is-mobile-os .discover-body {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8rem;
}

/* Notify drawer full-bleed mobile */
.stateos.is-mobile-os .os-notify {
  left: 0.35rem;
  right: 0.35rem;
  top: 3.2rem;
  max-height: 55dvh;
}

/* Touch: kill hover lift */
.stateos.is-mobile-os .os-dock-item:hover { transform: none; }
.stateos.is-mobile-os button:active {
  transform: scale(0.98);
}

/* Horizontal overflow guard */
.stateos.is-mobile-os,
.stateos.is-mobile-os .os-window-content,
.stateos.is-mobile-os .os-home {
  max-width: 100vw;
  overflow-x: hidden;
}
.stateos.is-mobile-os .panel,
.stateos.is-mobile-os .catalog-card,
.stateos.is-mobile-os .path-card {
  max-width: 100%;
  box-sizing: border-box;
}

/* Menu screens mobile */
html.is-mobile .menu-hero { padding: 1.2rem 1rem; }
html.is-mobile .h1 { font-size: 1.55rem; }

/* Status / open strip already desktop-only via TS — belt + suspenders */
.stateos.is-mobile-os .os-status-strip,
.stateos.is-mobile-os .os-open-strip {
  display: none !important;
}

/* Keep cause desk jump visible (older mobile rule hid it) */
.stateos.is-mobile-os .os-cause-go {
  display: inline !important;
  font-size: 0.62rem;
  opacity: 0.85;
}

/* Media fallback: narrow viewport always cuts chrome even before JS */
@media (max-width: 767px) {
  .os-status-strip,
  .os-open-strip {
    display: none !important;
  }
  .os-launcher,
  .os-launcher-grid {
    display: none !important;
  }
  .os-titlebar-blurb,
  .os-titlebar-dots {
    display: none !important;
  }
  .stateos .os-taskbar {
    flex-direction: column;
    align-items: stretch;
  }
  .os-dock-item {
    min-height: 48px;
  }
  .os-taskbar-actions .btn {
    min-height: 46px;
  }
  /* Touch targets */
  .catalog-search {
    font-size: 16px;
    min-height: 44px;
  }
  .wound-chip,
  .os-cause {
    min-height: 44px;
  }
}

/* 1.42 — Cabinet Inbox (email desk, real stamps) */
.inbox-app {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 18rem;
  border: 1px solid var(--line, #2a3344);
  background: var(--panel, #121820);
}
.inbox-list {
  border-right: 0;
  border-bottom: 1px solid var(--line, #2a3344);
  display: flex;
  flex-direction: column;
  max-height: 11rem;
  overflow: auto;
}
.inbox-list-head,
.inbox-letter-head {
  padding: 0.7rem 0.85rem 0.5rem;
}
.inbox-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #8b93a2);
}
.inbox-count { font-size: 0.72rem; margin-top: 0.15rem; }
.inbox-row {
  display: grid;
  grid-template-columns: 0.55rem 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.45rem;
  row-gap: 0.05rem;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  color: inherit;
  cursor: pointer;
  width: 100%;
}
.inbox-row .inbox-dot {
  grid-row: 1 / span 2;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: transparent;
}
.inbox-row.is-unread .inbox-dot { background: #d4a017; }
.inbox-row.is-open { background: rgba(212, 160, 23, 0.08); }
.inbox-row.is-stamped { opacity: 0.72; }
.inbox-row.is-deferred { opacity: 0.62; }
.inbox-row-from { font-size: 0.72rem; font-weight: 600; }
.inbox-row-sub { grid-column: 2; font-size: 0.78rem; }
.inbox-row-q { grid-column: 3; grid-row: 1; font-size: 0.62rem; }
.inbox-letter { padding: 0.85rem 1rem 1.2rem; min-width: 0; }
.inbox-subject {
  font-family: "IBM Plex Serif", serif;
  font-size: 1.25rem;
  margin: 0.25rem 0 0.15rem;
  font-weight: 600;
}
.inbox-body {
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 40rem;
  margin: 0.7rem 0 1rem;
}
.inbox-stamps { display: flex; flex-direction: column; gap: 0.45rem; max-width: 36rem; }
.inbox-stamp {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line, #3a4458);
  background: #1a2230;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
}
.inbox-stamp:hover { border-color: #d4a017; }
.inbox-stamp.is-defer { border-style: dashed; opacity: 0.92; }
.inbox-stamp-label { font-weight: 600; font-size: 0.88rem; }
.inbox-stamp-note { font-size: 0.72rem; line-height: 1.35; }
.inbox-closed-note {
  font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid #d4a017;
  background: rgba(212,160,23,0.08);
}
.inbox-empty { padding: 1rem 0.85rem; font-size: 0.85rem; }
.inbox-teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}
.inbox-teaser-sub { flex: 1 1 12rem; font-size: 0.85rem; }
.os-dock-item { position: relative; }
.os-dock-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.2rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #c45a2a;
  color: #fff8ee;
  font-size: 0.58rem;
  line-height: 1rem;
  text-align: center;
  font-weight: 700;
}
.stateos.is-mobile-os .inbox-app {
  grid-template-columns: 1fr;
}
.stateos.is-mobile-os .inbox-list {
  max-height: 11rem;
  border-right: 0;
  border-bottom: 1px solid var(--line, #2a3344);
}
@media (max-width: 767px) {
  .inbox-app { grid-template-columns: 1fr; }
  .inbox-list {
    max-height: 11rem;
    border-right: 0;
    border-bottom: 1px solid var(--line, #2a3344);
  }
}

/* 1.43 — correspondence: folders, later, rot */
.inbox-folders {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.inbox-folder {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line, #3a4458);
  background: transparent;
  color: inherit;
  cursor: pointer;
  min-height: 32px;
}
.inbox-folder.on {
  border-color: #d4a017;
  background: rgba(212, 160, 23, 0.12);
}
.inbox-row.is-later .inbox-dot { background: #6a8fad; }
.inbox-row.is-rotting { box-shadow: inset 3px 0 0 #c45a2a; }
.inbox-stamp.is-later { border-style: dotted; }
.inbox-rot-banner {
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.5rem 0.65rem;
  margin: 0 0 0.7rem;
  border-left: 3px solid #c45a2a;
  background: rgba(196, 90, 42, 0.12);
}
.inbox-body { white-space: pre-wrap; }
.inbox-letter .inbox-body + .inbox-body { margin-top: 0.15rem; }

.inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem 0;
}
.inbox-tool {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem;
  min-height: 32px;
  border: 1px solid var(--line, #3a4458);
  background: #1a2230;
  color: inherit;
  cursor: pointer;
}
.inbox-tool.is-done {
  border-style: dashed;
  opacity: 0.7;
  cursor: default;
}
.inbox-tool.is-quiet { opacity: 0.85; }
.inbox-tool-hint {
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0.35rem 1rem 0;
  padding: 0.45rem 0.6rem;
  border-left: 3px solid #6a8fad;
  background: rgba(106, 143, 173, 0.12);
  max-width: 36rem;
}

/* 1.46 — wallpaper desktop + traffic lights + new desks */
.os-titlebar-dots .dot {
  width: 0.72rem;
  height: 0.72rem;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.os-titlebar-dots button.dot:hover { filter: brightness(1.18); transform: scale(1.08); }
.os-titlebar-dots button.dot:focus-visible { outline: 2px solid var(--primary, #c4a35a); outline-offset: 2px; }
.os-window.is-max { max-width: none; border-radius: 10px; }
.os-stage.is-max { padding: 0.28rem 0.35rem 0.2rem; }
.os-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-content: center;
  place-items: center;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, #0c1016 0%, #050608 72%, #030304 100%);
}
.os-wallpaper-mark {
  font-family: var(--os-mono, "IBM Plex Mono", monospace);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #c4a35a;
  text-shadow: 0 0 40px rgba(196, 163, 90, 0.28);
}
.os-wallpaper-sub {
  margin-top: 0.55rem;
  font-family: var(--os-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6a7280;
  text-align: center;
}
.os-wallpaper-tut {
  position: absolute;
  right: 1.1rem;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: auto;
  border: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(8, 10, 14, 0.72);
  color: inherit;
  border-radius: 999px;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.os-wallpaper-tut:hover {
  border-color: rgba(196, 163, 90, 0.55);
  background: rgba(16, 18, 24, 0.88);
}
.os-wallpaper-tut-glyph {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(196, 163, 90, 0.16);
  color: #c4a35a;
  font-family: var(--os-mono, "IBM Plex Mono", monospace);
  font-weight: 700;
}
.os-wallpaper-tut-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.os-wallpaper-tut-k { font-size: 0.78rem; font-weight: 650; }
.os-wallpaper-tut-d { font-size: 0.66rem; color: #8a93a3; }
@media (max-width: 767px) {
  .os-wallpaper-tut { right: 0.7rem; bottom: 0.7rem; padding-right: 0.7rem; }
  .os-wallpaper-tut-d { display: none; }
}
.os-stage > .os-window,
.os-stage > .os-notify,
.os-stage > .os-boot-splash,
.os-stage > .os-wallpaper-alerts { position: relative; z-index: 1; }
.os-wallpaper-alerts {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 1rem;
  max-width: 36rem;
  z-index: 2;
}
.os-open-chip.is-min { opacity: 0.55; }
.os-dock-inner { flex-wrap: wrap; justify-content: center; }
.press-app { max-width: 44rem; }
.rival-app { max-width: 40rem; }
.rival-app-head { margin-bottom: 0.85rem; }
.rival-strength-row { display: grid; gap: 0.4rem; margin: 0.6rem 0 0.8rem; }
.rival-strength-num { font-size: 1.6rem; font-weight: 700; }
.rival-strength-num.is-hot { color: #c45a2a; }
.rival-bar { height: 0.45rem; background: #1a2230; border-radius: 99px; overflow: hidden; }
.rival-bar span { display: block; height: 100%; background: #c45a2a; }
.rival-slogan {
  margin: 0.4rem 0 0.8rem;
  font-family: "IBM Plex Serif", serif;
  font-size: 1.05rem;
}
.rival-plays { margin: 0.35rem 0 0; padding-left: 1.1rem; line-height: 1.45; }
.regime-app { max-width: 48rem; }
.regime-app-chrome { margin: 0.85rem 0; }
.regime-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}
.regime-driver-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.84rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
@media (max-width: 767px) {
  .regime-app-grid { grid-template-columns: 1fr; }
  .os-wallpaper-mark { letter-spacing: 0.16em; }
}

/* 1.47 — practice room */
.tut-app { max-width: 44rem; }
.tut-banner {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.tut-trust { font-size: 0.82rem; color: var(--muted, #8a93a3); margin-top: 0.2rem; }
.tut-lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.tut-lesson {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.22rem 0.55rem 0.22rem 0.35rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.tut-lesson span { font-size: 0.72rem; }
.tut-lesson.on { border-color: #c4a35a; background: rgba(196,163,90,0.12); }
.tut-lesson.done { opacity: 0.75; }
.tut-copy { margin-bottom: 0.85rem; }
.tut-copy p { line-height: 1.45; margin: 0.35rem 0 0; }
.tut-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.tut-meter {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
}
.tut-meter-v { font-size: 1.05rem; font-weight: 650; }
.tut-block { margin: 0.7rem 0; }
.tut-laws { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.4rem; }
.tut-laws .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.tut-cost { font-size: 0.7rem; opacity: 0.7; font-weight: 400; }
.tut-cause, .tut-mail {
  border-left: 3px solid #c4a35a;
  padding: 0.35rem 0.6rem;
  margin-top: 0.4rem;
}
.tut-log {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted, #8a93a3);
  font-size: 0.8rem;
  line-height: 1.4;
}
@media (max-width: 767px) {
  .tut-meters { grid-template-columns: 1fr 1fr; }
}

/* ── Alerts clear + sit-down leak (1.50) ── */
.os-notify-head-actions { display: flex; gap: 0.3rem; align-items: center; }
.os-notify-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.os-notify-x {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  background: transparent;
  color: #8a93a3;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
}
.os-notify-x:hover { background: rgba(255,255,255,0.08); color: #e8e6e0; }
.os-notify-empty { padding: 0.35rem 0.2rem; }

.os-sit {
  margin-top: 1.6rem;
  width: min(22rem, 86vw);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(8, 10, 14, 0.72);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.os-sit-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.os-sit-row:last-child { border-bottom: 0; }
.os-sit-row:hover { background: rgba(196, 163, 90, 0.08); }
.os-sit-k {
  font-family: var(--os-mono, "IBM Plex Mono", monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a93a3;
}
.os-sit-t {
  font-size: 1.05rem;
  font-weight: 650;
  color: #e8e6e0;
}
.os-sit-row.is-leak .os-sit-t { color: #c4a35a; }
.os-sit-row.is-crowns .os-sit-t { color: #8eb4c8; }
.os-sit-row.is-prices.is-hot .os-sit-t { color: #d09090; }
.os-sit-row.is-prices.is-cold .os-sit-t { color: #8eb4c8; }
.os-sit-row.is-room .os-sit-t { color: #c9b8d4; font-size: 0.92rem; }
.os-sit-row.is-room.is-soft .os-sit-t { color: #d4b06a; }
.os-sit-row.is-room.is-walk .os-sit-t { color: #d09090; }
.os-sit-d { font-size: 0.72rem; color: #8a93a3; }

.books-leak {
  border-color: rgba(196, 163, 90, 0.32) !important;
  background: linear-gradient(165deg, rgba(36, 28, 16, 0.45), rgba(14, 16, 22, 0.95)) !important;
}
.books-leak-k {
  font-family: var(--os-mono, "IBM Plex Mono", monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c4a35a;
  margin-bottom: 0.55rem;
}
.books-leak-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
}
.books-leak-label {
  font-size: 0.72rem;
  color: #8a93a3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.books-leak-val {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0.15rem 0;
  color: #e8e6e0;
}
.books-leak-col.is-crowns .books-leak-val { color: #c4a35a; }
.books-leak-d { font-size: 0.78rem; color: #9aa3b2; line-height: 1.4; }
@media (max-width: 640px) {
  .books-leak-grid { grid-template-columns: 1fr; }
}
.books-leak-col.is-prices .books-leak-val { color: #d4a06a; }

.cabinet-strip {
  border: 1px solid rgba(196, 163, 90, 0.28);
  background: linear-gradient(165deg, rgba(36, 28, 16, 0.4), rgba(14, 16, 22, 0.95));
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}
.cabinet-strip-k {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4a35a;
}
.cabinet-strip-d {
  font-size: 0.75rem;
  color: #8a93a3;
  margin: 0.2rem 0 0.55rem;
}
.cabinet-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cabinet-strip-btn {
  flex: 1 1 8rem;
  text-align: left;
  border: 1px solid rgba(232, 230, 224, 0.12);
  background: rgba(10, 12, 16, 0.55);
  color: #e8e6e0;
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  min-height: 44px;
  cursor: pointer;
}
.cabinet-strip-btn:hover { border-color: rgba(196, 163, 90, 0.45); }
.cabinet-strip-btn.is-missing { border-style: dashed; }
.cabinet-strip-name { display: block; font-size: 0.82rem; font-weight: 600; }
.cabinet-strip-meta { display: block; font-size: 0.68rem; color: #8a93a3; margin-top: 0.15rem; }







