/* ============================================================
   LENNY OS — Design System  (ported from The Retail Investor
   Report platform, with the cyan-blue accent swapped to mint.)
   Dark theme. Mint primary, gold secondary, on RIR's GitHub-dark bg.
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg:          #0D1117;
  --bg-elevated: #161B22;
  --card:        #1E293B;
  --card-2:      #18212f;
  --card-hover:  #243044;
  --border:      #30363d;
  --border-light:#3d4550;
  --text:        #FFFFFF;
  --text-muted:  #C9D1D9;
  --text-faint:  #8B949E;

  /* MINT — the house accent (replaces RIR's --teal blue everywhere). */
  --teal:        #5FB089;   /* kept the variable name so ported components work unchanged */
  --teal-dim:    #43906a;
  --teal-glow:   rgba(95, 176, 137, 0.12);
  --mint:        #5FB089;
  --mint-deep:   #347c5c;
  --forest:      #0f3d31;

  --gold:        #F5B842;   /* secondary accent */
  --gold-dim:    rgba(245, 184, 66, 0.15);

  --green:       #00C805;   /* financial up */
  --green-dim:   rgba(0, 200, 5, 0.15);
  --red:         #FF4B4B;   /* financial down / errors */
  --red-dim:     rgba(255, 75, 75, 0.15);
  --amber:       #F59E0B;
  --amber-dim:   rgba(245, 158, 11, 0.15);
  --violet:      #9a8fd0;

  --navbar-bg:   rgba(13, 17, 23, 0.95);
  --shadow:      rgba(0,0,0,0.4);

  /* legacy aliases so the preserved Recordings + EPG markup keeps its vars */
  --surface:     #161B22;
  --surface-2:   #1E293B;
  --text2:       #C9D1D9;

  --font-display: 'Chakra Petch', 'Syne', sans-serif;
  --font-ui:      'Chakra Petch', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'DM Mono', monospace;

  --navbar-h:    56px;
  --radius:      8px;
  --radius-sm:   5px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fast:   cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* subtle mint aura behind the whole app, like RIR */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 82% -8%, rgba(95,176,137,0.06), transparent 60%),
    radial-gradient(800px 500px at 8% 108%, rgba(245,184,66,0.04), transparent 60%);
}

/* ══════════════════════════════════════════════════════════════
   NAVBAR + dropdowns
══════════════════════════════════════════════════════════════ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--navbar-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 12px; z-index: 1000;
}
#navbar .nav-links { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: flex-start; padding-right: 200px; }
#navbar .nav-right { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; padding-left: 200px; }

#navbar .nav-logo {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  flex-shrink: 0; z-index: 2;
}
.nav-logo-mark {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #123e33, #0c1b16);
  border: 1px solid rgba(95,176,137,0.4);
  box-shadow: 0 0 18px -4px rgba(95,176,137,0.5), inset 0 0 0 1px rgba(95,176,137,0.08);
  font-family: var(--font-display); font-weight: 700; color: var(--mint); font-size: 15px;
}
.nav-logo-text {
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  color: var(--text); letter-spacing: 0.04em; white-space: nowrap;
}
.nav-logo-text span { color: var(--mint); }

#navbar .nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 500; color: var(--text-muted);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  background: none; border: none; font-family: var(--font-body);
  transition: color 0.15s, background 0.15s;
}
#navbar .nav-link:hover { color: var(--text); background: var(--card); }
#navbar .nav-link.active { color: var(--mint); background: var(--teal-glow); }

.nav-icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: none; border: 1px solid transparent;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.nav-icon-btn:hover { color: var(--mint); border-color: var(--border-light); background: var(--card); }

#hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--text-muted); }
#hamburger:hover { color: var(--text); }

#navbar .nav-dropdown { position: relative; }
#navbar .nav-dropdown-btn { display: flex; align-items: center; gap: 6px; }
#navbar .nav-dropdown-btn .chev { width: 10px; height: 10px; transition: transform .2s; }
#navbar .nav-dropdown.open .nav-dropdown-btn .chev { transform: rotate(180deg); }
#navbar .nav-dropdown.open .nav-dropdown-btn { color: var(--mint); background: var(--teal-glow); }
#navbar .nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 320px;
  background: #0f141b; border: 1px solid #1f3b34; border-radius: 12px; padding: 6px;
  box-shadow: 0 0 0 1px rgba(95,176,137,0.08) inset, 0 18px 50px -16px rgba(0,0,0,0.75),
              0 0 80px -30px rgba(95,176,137,0.35);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 1001;
}
#navbar .nav-right .nav-dropdown-menu { left: auto; right: 0; }
#navbar .nav-dropdown.open .nav-dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
#navbar .nav-dropdown-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; background: none; border: 0; width: 100%;
  text-align: left; font-family: inherit; color: inherit; text-decoration: none;
  transition: background .12s;
}
#navbar .nav-dropdown-item:hover { background: rgba(95,176,137,0.07); }
#navbar .nav-dropdown-item.active { background: rgba(95,176,137,0.11); }
.nav-dropdown-item-icon {
  width: 34px; height: 34px; border-radius: 8px; background: #151b25;
  border: 1px solid #243b35; display: grid; place-items: center; flex-shrink: 0; color: var(--mint);
}
.nav-dropdown-item-text { flex: 1; min-width: 0; }
.nav-dropdown-item-name { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: #e6edf5; letter-spacing: 0.02em; }
#navbar .nav-dropdown-item.active .nav-dropdown-item-name { color: var(--mint); }
.nav-dropdown-item-desc { font-size: 11px; color: #6b7889; margin-top: 2px; }
.nav-dropdown-item-badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; padding: 2px 6px;
  border-radius: 4px; background: var(--gold-dim); border: 1px solid rgba(245,184,66,0.3);
  color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-dropdown-item-badge.mint { background: var(--teal-glow); border-color: rgba(95,176,137,0.3); color: var(--mint); }

/* ── Mobile drawer ──────────────────────────────────────────── */
#nav-drawer {
  display: none; position: fixed; top: var(--navbar-h); left: 0; right: 0;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
  z-index: 999; padding: 8px 0; max-height: calc(100vh - var(--navbar-h)); overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#nav-drawer.open { display: block; }
#nav-drawer .drawer-group-header {
  padding: 12px 20px 6px; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; color: #6b7889; text-transform: uppercase;
}
#nav-drawer .drawer-link {
  display: flex; align-items: center; gap: 8px; padding: 11px 20px;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  background: none; border: none; width: 100%; text-align: left; cursor: pointer; text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
#nav-drawer .drawer-link.drawer-sub { padding-left: 34px; font-size: 0.84rem; }
#nav-drawer .drawer-link:hover { color: var(--text); background: var(--card); }
#nav-drawer .drawer-link.active { color: var(--mint); background: var(--teal-glow); }

/* ══════════════════════════════════════════════════════════════
   APP SHELL + views
══════════════════════════════════════════════════════════════ */
#app { padding-top: var(--navbar-h); min-height: 100vh; position: relative; z-index: 1; }
.view { display: none; }
.view.active { display: block; animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page { max-width: 1180px; margin: 0 auto; padding: 38px 28px 90px; }
.page-wide { max-width: 1320px; }

/* ── Page header — CENTERED (like the RIR report page). The pages used to
   drop cross-link action buttons in here; those are removed globally so every
   header is a clean centered title block. Navigation lives in the top nav. ── */
.page-header { margin-bottom: 30px; text-align: center; }
.page-header-row { flex-direction: column; align-items: center; justify-content: center; }
.page-header-row > div { width: 100%; }
.page-header .btn { display: none; }            /* kill the stray header buttons */
.page-header .row { justify-content: center; }
.page-eyebrow {
  font-family: var(--font-mono); color: var(--mint); font-size: 11px;
  letter-spacing: 2.6px; font-weight: 700; text-transform: uppercase; margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
}
.page-title {
  font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1.05;
  color: var(--text); letter-spacing: 0.01em; margin-bottom: 12px;
}
.page-title span { color: var(--mint); }
.page-subtitle { color: var(--text-muted); font-size: 1.02rem; line-height: 1.6; max-width: 680px; margin: 0 auto; }
.page-header-row { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* section heading inside a page */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 34px 0 16px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 1.28rem; color: var(--text); letter-spacing: .01em; }
.section-title span { color: var(--mint); }
.section-sub { color: var(--text-faint); font-size: .85rem; }

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════════════════════ */
/* Panel / card */
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel.glow { box-shadow: 0 0 0 1px rgba(95,176,137,0.06), 0 0 34px -8px rgba(95,176,137,0.14); border-color: rgba(95,176,137,0.3); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--text); display: flex; align-items: center; gap: 9px; }
.panel-title .ic { color: var(--mint); display: inline-flex; }
.panel-body { padding: 20px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card.hover:hover, .card-hover:hover { transform: translateY(-3px); border-color: rgba(95,176,137,0.4); box-shadow: 0 12px 30px -16px rgba(0,0,0,.8); }

/* Grids */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 920px){ .grid-4{grid-template-columns:repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 620px){ .grid-2,.grid-3,.grid-4{grid-template-columns:1fr;} }

/* Stat cards */
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 16px; }
.stat-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); display: flex; align-items: center; gap: 7px; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: var(--text); margin-top: 8px; line-height: 1; letter-spacing: .01em; }
.stat-value.mint { color: var(--mint); }
.stat-sub { margin-top: 8px; font-size: .8rem; color: var(--text-faint); }
.stat-delta { font-size: .8rem; font-weight: 600; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer;
  font-family: var(--font-body); border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--border-light); background: var(--card-hover); }
.btn-primary { background: var(--mint); color: #06231b; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); background: var(--mint); }
.btn-ghost { background: transparent; border-color: var(--teal-dim); color: var(--mint); }
.btn-ghost:hover { background: var(--teal-glow); border-color: var(--mint); }
.btn-gold { background: var(--gold); color: #1a1406; border-color: transparent; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Badges + tags */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); background: rgba(255,255,255,.04);
}
.badge.mint { color: var(--mint); border-color: rgba(95,176,137,0.35); background: var(--teal-glow); }
.badge.gold { color: var(--gold); border-color: rgba(245,184,66,0.35); background: var(--gold-dim); }
.badge.green { color: var(--green); border-color: rgba(0,200,5,.35); background: var(--green-dim); }
.badge.red { color: var(--red); border-color: rgba(255,75,75,.35); background: var(--red-dim); }
.badge.amber { color: var(--amber); border-color: rgba(245,158,11,.35); background: var(--amber-dim); }
.badge.violet { color: var(--violet); border-color: rgba(154,143,208,.35); background: rgba(154,143,208,.12); }
.badge.solid-mint { background: var(--mint); color: #06231b; border-color: transparent; }

.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); font-family: var(--font-mono); }

/* Filter pills */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); transition: all .15s; white-space: nowrap;
}
.pill:hover { color: var(--text); border-color: var(--border-light); }
.pill.active { background: var(--teal-glow); border-color: var(--teal-dim); color: var(--mint); }

/* Segmented toggle (e.g. Rico X ↔ Newsletter) */
.toggle-group { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 10px; padding: 4px; gap: 4px; }
.toggle-btn { padding: 8px 18px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); background: none; border: 1px solid transparent; cursor: pointer; transition: all .15s; }
.toggle-btn:hover { color: var(--text); }
.toggle-btn.active { background: var(--card); color: var(--mint); border-color: var(--teal-dim); }

/* Status dots */
.health-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.health-dot.live { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); animation: pulse 2.4s infinite; }
.health-dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.health-dot.down { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.health-dot.idle { background: var(--text-faint); box-shadow: 0 0 0 3px rgba(139,148,158,.15); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.45;} }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.input, .select, textarea.input {
  width: 100%; background: #0d1219; border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font-family: var(--font-body); font-size: 14px; padding: 10px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px var(--teal-glow); }
.select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238B949E' stroke-width='2'%3E%3Cpolyline points='3,5 6,8 9,5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }

/* Data table (RIR style) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table thead th {
  text-align: left; padding: 12px 16px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint); font-weight: 600; background: var(--bg-elevated);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
table.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr { transition: background .12s; }
table.table tbody tr:hover { background: var(--card-hover); }
table.table .num { font-family: var(--font-mono); text-align: right; }
table.table .t-ticker { font-family: var(--font-display); font-weight: 600; color: var(--text); }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; padding-top: 4px; }
.feed-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--mint); flex-shrink: 0; }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-size: 13.5px; color: var(--text); font-weight: 500; }
.feed-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); }
.feed-time { color: var(--text-faint); font-size: 11.5px; font-family: var(--font-mono); white-space: nowrap; }

/* progress bar */
.bar { height: 7px; border-radius: 99px; background: var(--bg-elevated); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint-deep), var(--mint)); border-radius: 99px; }

/* Empty / loading states */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-faint); }
.empty-state .ic { color: var(--border-light); margin-bottom: 12px; display: inline-flex; }
.empty-state h4 { color: var(--text-muted); font-weight: 600; margin-bottom: 6px; font-size: 1rem; }
.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* Expandable rows (Build Pipeline) */
.xrow { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 10px; overflow: hidden; background: var(--card); transition: border-color .15s; }
.xrow:hover { border-color: var(--border-light); }
.xrow.open { border-color: rgba(95,176,137,0.4); }
.xrow-head { display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; }
.xrow-head .chev { transition: transform .2s; color: var(--text-faint); flex-shrink: 0; }
.xrow.open .xrow-head .chev { transform: rotate(90deg); color: var(--mint); }
.xrow-body { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.xrow.open .xrow-body { max-height: 1200px; }
.xrow-body-inner { padding: 4px 18px 20px 50px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* misc helpers */
.muted { color: var(--text-faint); }
.mint-text { color: var(--mint); }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 22px 0; border: none; }
hr.divider { width: 100%; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

@media (max-width: 760px){
  #navbar .nav-links { padding-right: 0; }
  #navbar .nav-right { padding-left: 0; }
  #navbar .nav-links, #navbar .nav-right > .nav-link, #navbar .nav-right > .nav-dropdown { display: none; }
  #hamburger { display: block; }
  #navbar .nav-logo { left: auto; right: 14px; transform: none; }
  .page { padding: 26px 18px 80px; }
  .page-title { font-size: 2rem; }
}

/* ── Help marker: a "?" chip that reveals an explainer on hover ─────────── */
.help { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px;
  border-radius:50%; border:1px solid var(--border-light); color:var(--text-faint);
  font-size:10px; font-weight:700; font-family:var(--font-mono); cursor:help; margin-left:7px;
  position:relative; vertical-align:middle; flex-shrink:0; transition:color .15s,border-color .15s; }
.help:hover { color:var(--mint); border-color:var(--mint); }
.help[data-tip]:hover::after {
  content: attr(data-tip); position:absolute; bottom:150%; left:50%; transform:translateX(-50%);
  width:250px; background:#0f141b; border:1px solid var(--border-light); border-radius:9px; padding:10px 12px;
  font-size:12px; line-height:1.55; color:var(--text-muted); text-transform:none; letter-spacing:normal;
  font-weight:400; box-shadow:0 14px 36px -12px rgba(0,0,0,.85); z-index:60; white-space:normal; text-align:left; pointer-events:none; }
.help[data-tip]:hover::before {
  content:''; position:absolute; bottom:150%; left:50%; transform:translateX(-50%) translateY(99%);
  border:6px solid transparent; border-top-color:var(--border-light); z-index:60; }

/* ── Sub-app logo identities (RIR Platform = its blue; Trading = green) ──── */
.nav-logo-mark.logo-rir { background: linear-gradient(145deg,#10314d,#0a1a2b); border-color: rgba(125,200,232,0.5); color: #7DC8E8; box-shadow: 0 0 18px -4px rgba(125,200,232,0.55); }
.nav-logo-text.logo-rir span { color: #7DC8E8; }
.nav-logo-mark.logo-trading { background: linear-gradient(145deg,#123e33,#0c1b16); border-color: rgba(95,176,137,0.55); color: var(--mint); }
.nav-logo-text.logo-trading span { color: var(--mint); }
#navbar .nav-link.nav-rir { color: #7DC8E8; }
#navbar .nav-link.nav-rir:hover, #navbar .nav-link.nav-rir.active { background: rgba(125,200,232,0.12); color: #7DC8E8; }
#navbar .nav-link.nav-trading.active { color: var(--mint); background: var(--teal-glow); }

/* ── Help tooltip: clamp to the viewport on mobile so it never gets cut off.
   On small screens, render it fixed + centered with a safe max-width. ────── */
@media (max-width: 760px) {
  .help[data-tip]:hover::after, .help[data-tip]:active::after, .help[data-tip]:focus::after {
    position: fixed; left: 50%; right: auto; bottom: 16px; top: auto;
    transform: translateX(-50%); width: min(92vw, 420px); z-index: 4000;
  }
  .help[data-tip]:hover::before, .help[data-tip]:active::before, .help[data-tip]:focus::before { display: none; }
}
/* make "?" chips tappable (not just hover) on touch */
.help { -webkit-tap-highlight-color: transparent; }
.help[tabindex] { outline: none; }

/* ── Watchdog container (vault-sync guardian) ───────────────────────────── */
.watchdog.is-stale { border-color: rgba(255,75,75,0.45); box-shadow: 0 0 0 1px rgba(255,75,75,0.08), 0 0 26px -10px rgba(255,75,75,0.4); }
.watchdog-row { display: flex; align-items: center; gap: 11px; padding: 11px 4px; }
.watchdog-row + .watchdog-row { border-top: 1px solid var(--border); }
.watchdog-row-main { flex: 1; min-width: 0; }
.watchdog-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.watchdog-note { font-size: 11.5px; line-height: 1.45; margin-top: 2px; }
.watchdog-age { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; }
.watchdog-meta { font-size: 10.5px; margin-top: 10px; letter-spacing: .02em; word-break: break-word; }
.watchdog-compact { cursor: pointer; transition: border-color .15s, transform .15s; }
.watchdog-compact:hover { border-color: var(--border-light); transform: translateY(-2px); }
.watchdog-compact .watchdog-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; margin-top: 9px; }
