/* Valtire Admin — v8 "Finnova" theme (2026-09-12)
   Rounded white shell, soft grey cards, dark pill top-nav, electric-purple
   accent. LIGHT and DARK modes via tokens: light lives on :root, dark is
   stamped as html[data-theme="dark"] (the head script sets it from
   localStorage 'vt-theme' or the OS preference; a no-JS fallback follows
   prefers-color-scheme). Every class name from v7 is kept so all 17 pages
   that extend base.html keep working without edits.
   Previous theme: style-v7-nova-dark-backup.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #e6e8f0;
  --bg-glow-1: rgba(106, 92, 240, .10);
  --bg-glow-2: rgba(43, 143, 224, .06);
  --shell: #ffffff;
  --surface: #f4f5fa;
  --surface-2: #ffffff;
  --surface-3: #eceef6;
  --border: rgba(18, 18, 42, .10);
  --border-soft: rgba(18, 18, 42, .06);
  --title: #12122a;
  --ink: #2a2a47;
  --muted: #71768f;
  --faint: rgba(18, 18, 42, .34);
  --brand: #6a5cf0;
  --brand-2: #8577ff;
  --brand-ink: #5546d6;
  --blue: #2b8fe0;
  --violet: #7c6cf5;
  --magenta: #b86ce0;
  --green: #159e66;
  --red: #e0474f;
  --gold: #c98a10;
  --dark: #14142a;            /* the dark list block + nav pill */
  --dark-2: #1f1f38;
  --dark-ink: #ffffff;
  --dark-muted: rgba(255, 255, 255, .58);
  --shadow: 0 12px 34px rgba(20, 20, 60, .07);
  --shadow-lg: 0 24px 60px rgba(20, 20, 60, .12);
  --glow: 0 8px 22px rgba(106, 92, 240, .30);
  --grad: linear-gradient(135deg, #7b6cf6, #5b4ce0);
  --grad-blue: linear-gradient(135deg, #7b6cf6, #5b4ce0);
  --grad-panel: linear-gradient(160deg, #6f61f2 0%, #5546d6 100%);
  --radius: 20px;
  --radius-sm: 14px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06060c;
  --bg-glow-1: rgba(124, 108, 255, .14);
  --bg-glow-2: rgba(33, 150, 214, .07);
  --shell: #0e0e18;
  --surface: #161624;
  --surface-2: #1c1c2e;
  --surface-3: #22223a;
  --border: rgba(139, 123, 255, .16);
  --border-soft: rgba(139, 123, 255, .09);
  --title: #ffffff;
  --ink: rgba(236, 236, 248, .92);
  --muted: rgba(236, 236, 248, .56);
  --faint: rgba(236, 236, 248, .32);
  --brand: #7c6cff;
  --brand-2: #9b8cff;
  --brand-ink: #b3a6ff;
  --blue: #4aa8e8;
  --violet: #8a79ff;
  --magenta: #c884f0;
  --green: #45d483;
  --red: #ff5c7a;
  --gold: #e8b33a;
  --dark: #1a1a2e;
  --dark-2: #25253f;
  --dark-ink: #ffffff;
  --dark-muted: rgba(255, 255, 255, .58);
  --shadow: 0 16px 40px rgba(0, 0, 0, .40);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .55);
  --glow: 0 8px 26px rgba(124, 108, 255, .35);
  --grad: linear-gradient(135deg, #8b7bff, #6a5ae8);
  --grad-blue: linear-gradient(135deg, #8b7bff, #6a5ae8);
  --grad-panel: linear-gradient(160deg, #6f61f2 0%, #4d3ec9 100%);
}

/* no-JS fallback: follow the OS when nothing is stamped */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #06060c; --bg-glow-1: rgba(124, 108, 255, .14); --bg-glow-2: rgba(33, 150, 214, .07);
    --shell: #0e0e18; --surface: #161624; --surface-2: #1c1c2e; --surface-3: #22223a;
    --border: rgba(139, 123, 255, .16); --border-soft: rgba(139, 123, 255, .09);
    --title: #ffffff; --ink: rgba(236, 236, 248, .92); --muted: rgba(236, 236, 248, .56);
    --faint: rgba(236, 236, 248, .32); --brand: #7c6cff; --brand-2: #9b8cff; --brand-ink: #b3a6ff;
    --blue: #4aa8e8; --violet: #8a79ff; --magenta: #c884f0; --green: #45d483; --red: #ff5c7a; --gold: #e8b33a;
    --dark: #1a1a2e; --dark-2: #25253f;
    --shadow: 0 16px 40px rgba(0, 0, 0, .40); --shadow-lg: 0 28px 70px rgba(0, 0, 0, .55);
    --glow: 0 8px 26px rgba(124, 108, 255, .35);
    --grad: linear-gradient(135deg, #8b7bff, #6a5ae8); --grad-blue: linear-gradient(135deg, #8b7bff, #6a5ae8);
    --grad-panel: linear-gradient(160deg, #6f61f2 0%, #4d3ec9 100%);
  }
}

html { -webkit-font-smoothing: antialiased; }

a { color: var(--title); }
a:hover { color: var(--brand); }

body {
  font-family: "Plus Jakarta Sans", "Roboto", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 55% 30% at 75% -6%, var(--bg-glow-1), transparent 60%),
    radial-gradient(ellipse 40% 26% at 8% 108%, var(--bg-glow-2), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}

/* ------------------------------------------------------------- shell */
.app {
  max-width: 1480px;
  margin: 18px auto;
  padding: 22px 30px 40px;
  background: var(--shell);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  min-height: calc(100vh - 36px);
}

/* ----------------------------------------------------------- top bar */
.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
}

.side-brand img { width: 40px; height: 40px; filter: drop-shadow(0 4px 10px rgba(106, 92, 240, .35)); }

.nav-wordmark {
  color: var(--title);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2em;
  line-height: 1;
  display: inline-block;
}

.nav-tagline {
  font-family: "Roboto Slab", Georgia, serif;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .04em;
}

.pillnav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--dark);
  border-radius: 999px;
  padding: 6px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.pillnav::-webkit-scrollbar { display: none; }

.pillnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--dark-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.pillnav a:hover { color: var(--dark-ink); background: rgba(255, 255, 255, .07); }
.pillnav a.active { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.pillnav a.active::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.topnav-icons { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-3); color: var(--brand); transform: translateY(-1px); }
.icon-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--shell);
}

.icon-btn .ico-sun, .icon-btn .ico-moon { display: none; }
html[data-theme="dark"] .icon-btn .ico-sun { display: block; }
html:not([data-theme="dark"]) .icon-btn .ico-moon { display: block; }

.side-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: var(--glow);
}

.user-menu { position: relative; }
.user-menu > button { background: none; border: none; cursor: pointer; padding: 0; display: block; }
.user-pop {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 190px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 60;
  display: none;
}
.user-menu.open .user-pop { display: block; }
.user-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.user-pop .who .admin-chip { display: block; font-weight: 700; color: var(--title); font-size: 13.5px; }
.user-pop .who .side-role { font-size: 11.5px; color: var(--muted); }
.user-pop a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.user-pop a:hover { background: var(--surface); color: var(--brand); }
.user-pop a.logout:hover { color: var(--red); }
.user-pop svg { width: 15px; height: 15px; }

/* -------------------------------------------------------- page header */
.main-inner { max-width: 1420px; margin: 0 auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
  padding: 0 4px;
}

.topbar h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--title);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.topbar .page-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.topbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ card tags */
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--brand-ink);
  border: 1px solid rgba(106, 92, 240, .35);
  border-radius: 999px;
  padding: 3.5px 12px;
  background: rgba(106, 92, 240, .08);
  white-space: nowrap;
}
.card-tag::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.card-tag.t-green { color: var(--green); border-color: rgba(21, 158, 102, .38); background: rgba(21, 158, 102, .07); }
.card-tag.t-gold  { color: var(--gold);  border-color: rgba(201, 138, 16, .38); background: rgba(201, 138, 16, .07); }
.card-tag.t-cyan  { color: var(--blue);  border-color: rgba(43, 143, 224, .38); background: rgba(43, 143, 224, .07); }
.card-tag.t-red   { color: var(--red);   border-color: rgba(224, 71, 79, .38);  background: rgba(224, 71, 79, .07); }

/* ---------------------------------------------------------------- cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card, .panel, .agent-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .18s ease, transform .18s ease, background .25s ease;
}

.stat-card { padding: 18px 20px; overflow: hidden; }
.stat-card:hover, .agent-card:hover { border-color: rgba(106, 92, 240, .35); transform: translateY(-2px); }

.stat-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.stat-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.i-violet  { background: rgba(124, 108, 245, .14); color: var(--violet); }
.stat-icon.i-magenta { background: rgba(184, 108, 224, .14); color: var(--magenta); }
.stat-icon.i-blue    { background: rgba(43, 143, 224, .13);  color: var(--blue); }
.stat-icon.i-green   { background: rgba(21, 158, 102, .13);  color: var(--green); }
.stat-icon.i-gold    { background: rgba(201, 138, 16, .14);  color: var(--gold); }
.stat-icon.i-red     { background: rgba(224, 71, 79, .12);   color: var(--red); }

.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-value {
  font-size: 27px;
  font-weight: 800;
  color: var(--title);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-bubble {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--grad);
  box-shadow: var(--glow);
}
.stat-bubble svg { width: 17px; height: 17px; }
.stat-bubble.b-green { background: linear-gradient(135deg, #3ecf86, #1a9d62); }
.stat-bubble.b-cyan  { background: linear-gradient(135deg, #46b4f0, #1f83c8); }
.stat-bubble.b-gold  { background: linear-gradient(135deg, #f0c04c, #cf8c14); }
.stat-bubble.b-red   { background: linear-gradient(135deg, #ff7590, #e83a5f); }

.delta { font-size: 11px; font-weight: 700; padding: 2.5px 9px; border-radius: 999px; letter-spacing: .02em; }
.delta.up   { background: rgba(21, 158, 102, .13); color: var(--green); }
.delta.down { background: rgba(224, 71, 79, .12);  color: var(--red); }
.delta.flat { background: var(--surface-3);        color: var(--muted); }

.panel { padding: 22px 24px; margin-bottom: 22px; }
.panel h2 { font-size: 17px; font-weight: 800; color: var(--title); letter-spacing: -.01em; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2 { margin-bottom: 0; }
.panel-sub { color: var(--muted); font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-charts { display: grid; grid-template-columns: 2fr 3fr; gap: 22px; }
@media (max-width: 1000px) { .grid-2, .grid-charts { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- donut/breakdown */
.donut-wrap { position: relative; width: min(230px, 100%); margin: 6px auto 18px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center .big { font-size: 32px; font-weight: 800; color: var(--title); line-height: 1.1; letter-spacing: -.02em; }
.donut-center .small { font-size: 12px; color: var(--muted); }
.breakdown { display: flex; flex-direction: column; gap: 9px; }
.breakdown-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.breakdown-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.breakdown-row .bd-label { color: var(--ink); }
.breakdown-row .bd-value { margin-left: auto; font-weight: 700; color: var(--title); }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(106, 92, 240, .06); }

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }

.avatar-chip {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
}
.idx-chip {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(106, 92, 240, .12);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
}

/* ----------------------------------------------------------------- tags */
.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
}
.tag-forex   { background: rgba(124, 108, 245, .14); color: var(--brand-ink); }
.tag-gold    { background: rgba(201, 138, 16, .14);  color: var(--gold); }
.tag-crypto  { background: rgba(43, 143, 224, .14);  color: var(--blue); }
.tag-buy     { background: rgba(21, 158, 102, .14);  color: var(--green); }
.tag-sell    { background: rgba(224, 71, 79, .13);   color: var(--red); }
.tag-open    { background: rgba(124, 108, 245, .14); color: var(--brand-ink); }
.tag-closed  { background: var(--surface-3);         color: var(--muted); }
.tag-active  { background: rgba(21, 158, 102, .14);  color: var(--green); }
.tag-suspended, .tag-rejected, .tag-revoked { background: rgba(224, 71, 79, .13); color: var(--red); }
.tag-pending  { background: rgba(201, 138, 16, .14); color: var(--gold); }
.tag-approved { background: rgba(21, 158, 102, .14); color: var(--green); }

/* 2026-08-19: unified results table (When/Signal/Engine/Pair/Direction/
   Entry/TPs hit/Result) used panel-wide - colour swatch + dot, not pills */
.mx-dir-sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.mx-dir-sq.buy  { background: var(--green); }
.mx-dir-sq.sell { background: var(--red); }
.mx-res-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.mx-res-dot.win  { background: var(--green); }
.mx-res-dot.loss { background: var(--red); }
.mx-res-dot.live { background: var(--blue); }
.mx-res-dot.muted { background: var(--faint); }

/* 2026-08-19: Insights session cards - tighter table so it never needs
   the .table-wrap horizontal scroll inside a ~360px card */
.mx-insight-table td, .mx-insight-table th { padding: 7px 8px; font-size: .85em; }
.mx-insight-table table { white-space: normal; }

/* 2026-10-07: Signals period / this-week boxes - tighter cells and a
   wrapping first column so the 5 columns fit the card with no scrollbar */
.mx-period-table th, .mx-period-table td { padding-left: 6px; padding-right: 6px; }
.mx-period-table th:first-child, .mx-period-table td:first-child { padding-left: 2px; white-space: normal; }
.mx-period-table th:last-child, .mx-period-table td:last-child { padding-right: 2px; }
.mx-period-table .mono { font-size: 12.5px; }

/* ---------------------------------------------------------------- forms */
input, select, button, textarea { font: inherit; color: var(--ink); }
input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(106, 92, 240, .18); }
input::placeholder { color: var(--muted); }
select option { background: var(--surface-2); color: var(--ink); }

.row-form { display: flex; flex-wrap: wrap; gap: 10px; }
.row-form input, .row-form select { flex: 1 1 160px; }
.row-form button { flex: 0 0 auto; }
.stack-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.input-sm { width: 112px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.actions-cell { display: flex; gap: 8px; align-items: center; }
.actions-cell form { display: inline-flex; gap: 6px; }

.btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 9px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--title);
  text-decoration: none;
  display: inline-block;
  transition: background .18s ease, box-shadow .18s ease, filter .18s ease, color .18s ease;
}
.btn:hover { background: var(--surface-3); color: var(--brand); }
.btn-sm { padding: 5px 15px; font-size: 12.5px; border-radius: 11px; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.08); color: #fff; box-shadow: 0 10px 30px rgba(106, 92, 240, .42); }
.btn-ok { background: rgba(21, 158, 102, .12); border-color: rgba(21, 158, 102, .35); color: var(--green); }
.btn-ok:hover { background: rgba(21, 158, 102, .2); color: var(--green); }
.btn-danger { background: rgba(224, 71, 79, .11); border-color: rgba(224, 71, 79, .35); color: var(--red); }
.btn-danger:hover { background: rgba(224, 71, 79, .19); color: var(--red); }

/* ------------------------------------------------------------ pill tabs */
.tabs-wrap { overflow-x: auto; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; white-space: nowrap; background: var(--surface); border-radius: 999px; padding: 5px; width: max-content; max-width: 100%; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}
.tab:hover { background: var(--surface-3); color: var(--title); }
.tab.active { background: var(--grad); color: #fff; font-weight: 700; box-shadow: var(--glow); }

/* ---------------------------------------------------------------- flash */
.flash { padding: 12px 20px; border-radius: 14px; margin-bottom: 18px; font-weight: 500; font-size: 13.5px; }
.flash-ok    { background: rgba(21, 158, 102, .09); color: var(--green); border: 1px solid rgba(21, 158, 102, .35); }
.flash-error { background: rgba(224, 71, 79, .08);  color: var(--red);   border: 1px solid rgba(224, 71, 79, .35); }

/* ---------------------------------------------------------------- login */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 16px;
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, var(--bg-glow-1), transparent 70%),
    radial-gradient(ellipse 40% 35% at 85% 95%, var(--bg-glow-2), transparent 70%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--shell);
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 26px; }
.login-brand img { width: 74px; height: 74px; filter: drop-shadow(0 8px 18px rgba(106, 92, 240, .4)); }
.login-brand .nav-wordmark { font-size: 19px; }
.login-brand .nav-tagline { font-size: 12.5px; }
.login-card form { display: flex; flex-direction: column; gap: 15px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.login-card input { background: var(--surface); }
.login-card .btn { margin-top: 8px; padding: 12px; font-size: 15px; border-radius: 14px; }
.login-note { font-family: "Roboto Slab", Georgia, serif; text-align: center; margin-top: 24px; color: var(--muted); font-size: 13.5px; letter-spacing: .08em; }
.login-theme { position: absolute; top: 16px; right: 16px; }

/* -------------------------------------------------------- agent cards */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; margin-bottom: 22px; }
.agent-card { padding: 16px 18px; text-decoration: none; display: block; overflow: hidden; }
.agent-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agent-emoji { font-size: 17px; line-height: 1; }
.agent-name { color: var(--title); font-weight: 700; font-size: 13.5px; flex: 1; }
.agent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.agent-dot.ok  { background: var(--green); box-shadow: 0 0 7px rgba(21, 158, 102, .7); }
.agent-dot.err { background: var(--red);   box-shadow: 0 0 7px rgba(224, 71, 79, .7); }
.agent-stat { font-size: 23px; font-weight: 800; color: var(--title); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 6px; }
.agent-stat-label { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.agent-sub { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.agent-sub .pos { color: var(--green); font-weight: 600; }
.agent-sub .neg { color: var(--red); font-weight: 600; }

/* ============================================================ DASHBOARD */
/* KPI row */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.kpi:hover { transform: translateY(-2px); border-color: rgba(106, 92, 240, .3); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.kpi-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.kpi-ico svg { width: 14px; height: 14px; }
.kpi-ico.red    { background: rgba(224, 71, 79, .12);   color: var(--red); }
.kpi-ico.violet { background: rgba(124, 108, 245, .14); color: var(--violet); }
.kpi-ico.blue   { background: rgba(43, 143, 224, .13);  color: var(--blue); }
.kpi-ico.green  { background: rgba(21, 158, 102, .13);  color: var(--green); }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--title); letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; }
.kpi-value small { font-size: 15px; font-weight: 700; color: var(--muted); margin-right: 4px; letter-spacing: 0; }
.kpi-value .unit { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-delta { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-viz { margin-top: auto; padding-top: 12px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.bars .bar { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); min-height: 4px; opacity: .55; transition: opacity .15s; }
.bars .bar.hot { opacity: 1; }
.bars .bar.neg { background: linear-gradient(180deg, #ff8a9e, var(--red)); }
.bars .bar:hover { opacity: 1; }
.bars-x { display: flex; gap: 6px; margin-top: 5px; }
.bars-x span { flex: 1; text-align: center; font-size: 9.5px; color: var(--faint); font-weight: 600; }

.spark { width: 100%; height: 74px; display: block; overflow: visible; }
.spark .area { fill: url(#sparkFill); }
.spark .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .pt { fill: var(--surface); stroke: var(--brand); stroke-width: 1.6; }

.feed-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.feed-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 9px 10px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feed-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feed-card.hot { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.feed-card .fc-n { font-size: 15px; font-weight: 800; color: var(--title); letter-spacing: -.01em; }
.feed-card.hot .fc-n { color: #fff; }
.feed-card .fc-l { font-size: 10.5px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.feed-card.hot .fc-l { color: rgba(255, 255, 255, .8); }
.feed-card .fc-s { font-size: 10.5px; margin-top: 3px; font-weight: 700; }
.feed-card.hot .fc-s, .feed-card.hot .fc-s .pos, .feed-card.hot .fc-s .neg { color: #fff; }
.kpi-cta { display: flex; justify-content: flex-end; margin-top: 10px; }
.btn-dark { background: var(--dark); color: #fff; border: none; border-radius: 999px; padding: 8px 16px; font-size: 12.5px; font-weight: 700; text-decoration: none; }
.btn-dark:hover { color: #fff; filter: brightness(1.25); }

/* agents band (replaces the reference's filter strip) */
.agent-strip { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.strip-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--title); white-space: nowrap; margin-right: 4px; }
.strip-label .count { background: var(--dark); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.agent-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 9px 14px 9px 10px;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.agent-chip:hover { transform: translateY(-2px); border-color: rgba(106, 92, 240, .35); box-shadow: var(--shadow); }
.agent-chip .ac-emoji { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 17px; }
.agent-chip .ac-name { font-size: 12.5px; font-weight: 700; color: var(--title); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.agent-chip .ac-stat { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.agent-chip .ac-stat b { color: var(--title); font-weight: 800; font-size: 13px; }

/* split: dark list + purple detail */
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 0; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 22px; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

.dark-panel { background: var(--dark); color: var(--dark-ink); padding: 22px 20px 20px; }
.dark-panel h2 { font-size: 16px; font-weight: 800; color: #fff; margin: 0; }
.dark-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 4px; }
.seg button {
  background: none;
  border: none;
  color: var(--dark-muted);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button .n { background: rgba(255, 255, 255, .15); border-radius: 999px; padding: 0 6px; font-size: 10.5px; }
.seg button.active { background: #fff; color: var(--dark); }
.seg button.active .n { background: var(--brand); color: #fff; }

.list-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background .15s ease;
  border: 1px solid transparent;
}
.list-row:hover { background: rgba(255, 255, 255, .06); }
.list-row.sel { background: var(--grad); box-shadow: var(--glow); }
.list-row .lr-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--dark-2); border: 2px solid rgba(255, 255, 255, .12); }
.list-row.sel .lr-av { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }
.list-row .lr-name { font-size: 13.5px; font-weight: 800; color: #fff; }
.list-row .lr-sub { font-size: 11px; color: var(--dark-muted); }
.list-row.sel .lr-sub { color: rgba(255, 255, 255, .8); }
.list-row .lr-pill { font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--dark-muted); white-space: nowrap; }
.list-row .lr-pill.live { background: rgba(69, 212, 131, .18); color: #62e6a0; }
.list-row.sel .lr-pill { background: #fff; color: var(--dark); }
.list-row.sel .lr-pill.live { color: var(--green); }
.list-row .lr-amt { font-size: 14px; font-weight: 800; color: #fff; min-width: 64px; text-align: right; }
.list-row .lr-amt.pos { color: #62e6a0; }
.list-row .lr-amt.neg { color: #ff8a9e; }
.list-row.sel .lr-amt, .list-row.sel .lr-amt.pos, .list-row.sel .lr-amt.neg { color: #fff; }
.list-empty { color: var(--dark-muted); font-size: 12.5px; padding: 14px 12px; }

.violet-panel { background: var(--grad-panel); color: #fff; padding: 24px 24px 22px; display: flex; flex-direction: column; }
.vp-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 18px; }
@media (max-width: 620px) { .vp-head { grid-template-columns: 1fr; } }
.vp-k { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .7); letter-spacing: .02em; margin-bottom: 4px; }
.vp-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vp-v.md { font-size: 17px; }
.vp-v .vp-tag { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); letter-spacing: .02em; }
.vp-v .vp-tag.live { background: #fff; color: var(--green); }
.vp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 620px) { .vp-grid { grid-template-columns: repeat(2, 1fr); } }
.mini-card { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 14px 14px 12px; min-height: 92px; position: relative; backdrop-filter: blur(4px); }
.mini-card .mc-v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.mini-card .mc-l { font-size: 11px; color: rgba(255, 255, 255, .78); margin-top: 8px; font-weight: 600; }
.mini-card .mc-arrow { position: absolute; top: 12px; right: 12px; color: rgba(255, 255, 255, .7); font-size: 12px; }
.vp-stats { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 16px; font-size: 12px; color: rgba(255, 255, 255, .8); }
.vp-stats b { color: #fff; font-weight: 800; }
.vp-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.vp-days span { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .12); }
.vp-days span.pos { color: #b6ffd6; }
.vp-days span.neg { color: #ffc2cc; }
.vp-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .18); display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.vp-foot .ft { display: flex; gap: 22px; flex-wrap: wrap; }
.vp-foot .ft-k { font-size: 11px; color: rgba(255, 255, 255, .7); font-weight: 600; }
.vp-foot .ft-v { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.vp-foot .acts { display: flex; gap: 8px; align-items: center; }
.vp-icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); display: grid; place-items: center; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .08); }
.vp-icon svg { width: 15px; height: 15px; }
.vp-icon:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.btn-white { background: #fff; color: var(--brand-ink); border: none; border-radius: 999px; padding: 9px 18px; font-size: 12.5px; font-weight: 800; text-decoration: none; }
.btn-white:hover { color: var(--brand-ink); filter: brightness(.96); }

/* signals summary strip under the split */
.sig-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.sig-tile { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 8px; text-align: center; }
.sig-tile .st-l { font-size: .76em; color: var(--muted); }
.sig-tile .st-v { font-size: 1.3em; font-weight: 800; margin-top: 2px; color: var(--title); }
.sig-tile .st-s { font-size: .72em; color: var(--muted); margin-top: 2px; }

/* ------------------------------------- Copy Trading: connected accounts */
.acct-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.acct-row { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 16px; overflow: hidden; }
.acct-row[open] { border-color: rgba(106, 92, 240, .35); box-shadow: var(--shadow); }
.acct-row > summary {
  list-style: none; cursor: pointer; display: grid; align-items: center; gap: 12px;
  grid-template-columns: 10px minmax(120px, 1.2fr) minmax(160px, 1.4fr) minmax(180px, 1.6fr) auto 16px;
  padding: 12px 16px; font-size: 13px;
}
.acct-row > summary::-webkit-details-marker { display: none; }
.acct-row > summary:hover { background: var(--surface); }
.acct-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.acct-dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(21, 158, 102, .6); }
.acct-dot.err { background: var(--red); }
.acct-dot.pause { background: var(--gold); }
.acct-dot.wait { background: var(--blue); }
.acct-name { font-weight: 800; color: var(--title); display: flex; align-items: center; gap: 8px; min-width: 0; }
.acct-kind { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; background: rgba(224, 71, 79, .12); color: var(--red); }
.k-local .acct-kind { background: rgba(43, 143, 224, .13); color: var(--blue); }
.acct-login { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-bal { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-bal b { color: var(--title); font-weight: 700; }
.acct-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.acct-badges .tag { white-space: nowrap; }
.acct-st.ok { background: rgba(21, 158, 102, .14); color: var(--green); }
.acct-st.err { background: rgba(224, 71, 79, .13); color: var(--red); }
.acct-st.pause { background: rgba(201, 138, 16, .16); color: var(--gold); }
.acct-st.wait { background: rgba(43, 143, 224, .13); color: var(--blue); }
.acct-chev { color: var(--muted); transition: transform .18s ease; text-align: center; }
.acct-row[open] > summary .acct-chev { transform: rotate(180deg); }
.acct-body { padding: 4px 16px 16px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 12px; }
.acct-note { font-size: 13px; color: var(--muted); padding-top: 10px; }
.acct-note.err { color: var(--red); }
.acct-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding-top: 12px; }
.acct-meta > div { background: var(--surface); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.acct-meta .k { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.acct-meta .v { font-size: 13px; font-weight: 700; color: var(--title); }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-actions form { margin: 0; }
.acct-sub { border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.acct-sub > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--brand-ink); display: flex; align-items: center; gap: 8px; }
.acct-sub > summary::-webkit-details-marker { display: none; }
.acct-sub > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .18s ease; }
.acct-sub[open] > summary::after { transform: rotate(180deg); }
.acct-sub.inner { background: var(--surface-2); }
.acct-form { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.acct-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--title); }
.acct-grid label small { font-weight: 500; color: var(--muted); font-size: 11px; line-height: 1.45; }
.acct-grid select, .acct-grid input { width: 100%; font-size: 13px; font-weight: 500; }
.acct-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; padding: 4px 14px 14px; }
.acct-pairs label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; cursor: pointer; }
.acct-form > .btn { align-self: flex-start; }
@media (max-width: 900px) {
  .acct-row > summary { grid-template-columns: 10px 1fr 16px; row-gap: 4px; }
  .acct-login, .acct-bal { grid-column: 2; }
  .acct-badges { grid-column: 2; justify-content: flex-start; }
  .acct-chev { grid-row: 1; grid-column: 3; }
}

/* ============================================== MOBILE APP SHELL (≤900px)
   Phone = app: sticky compact header (logo · theme · avatar), bottom tab
   bar (Overview / Signals / Trades / Agents / More), "More" bottom sheet
   for the rest, safe-area padding for notched phones, nothing scrolls
   sideways except tables / strips inside their own containers. Desktop
   keeps the pill nav; the tab bar + sheet are display:none there. */
.tabbar, .sheet { display: none; }
img, svg, canvas, video { max-width: 100%; }
.main-inner, .panel, .stat-card, .kpi, .agent-card, .split > *, .grid-2 > *, .grid-charts > * { min-width: 0; }

@media (max-width: 900px) {
  html { scroll-padding-top: 70px; }
  body { overflow-x: hidden; font-size: 14px; }
  .app { margin: 0; border-radius: 0; padding: 0 14px calc(86px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; box-shadow: none; max-width: 100%; }

  /* compact sticky header */
  .topnav {
    position: sticky; top: 0; z-index: 40;
    margin: 0 -14px 16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: var(--shell); border-bottom: 1px solid var(--border-soft);
    gap: 10px; flex-wrap: nowrap;
  }
  .side-brand img { width: 34px; height: 34px; }
  .nav-wordmark { font-size: 14px; }
  .pillnav { display: none; }
  .topnav-icons { margin-left: auto; gap: 6px; }
  .topnav-icons > a.icon-btn { display: none; }     /* those live in the More sheet */
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .side-avatar { width: 38px; height: 38px; }
  .user-pop { top: 46px; }

  .topbar { margin-bottom: 18px; align-items: flex-start; }
  .topbar h1 { font-size: 26px; }
  .topbar .page-sub { font-size: 13px; margin-top: 4px; }
  .topbar-right { width: 100%; }
  .topbar-right .btn { flex: 1 1 auto; text-align: center; }

  /* touch targets */
  .btn { padding: 10px 18px; min-height: 40px; }
  .btn-sm { min-height: 34px; padding: 6px 14px; }
  input, select, textarea { font-size: 16px; }   /* stops iOS zoom-on-focus */
  .tab { padding: 9px 16px; }

  .panel { padding: 16px 16px; border-radius: 18px; margin-bottom: 16px; }
  .stat-grid, .agent-grid { gap: 12px; margin-bottom: 16px; }

  /* Agents page sub-tabs: one scrollable row instead of three wrapped */
  .subtabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 14px !important; padding: 0 14px 6px; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs .btn { flex: 0 0 auto; white-space: nowrap; }

  /* dashboard */
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
  .kpi { min-height: 0; padding: 16px 16px 14px; }
  .kpi-viz { padding-top: 10px; }
  .bars { height: 54px; }
  .spark { height: 64px; }
  .feed-card .fc-l { white-space: normal; }
  .agent-strip { margin: 0 -14px 16px; padding: 4px 14px 8px; gap: 8px; }
  .strip-label { flex: 0 0 auto; }
  .split { grid-template-columns: 1fr; border-radius: 22px; margin-bottom: 16px; }
  .dark-panel { padding: 18px 14px 14px; }
  .dark-head { margin-bottom: 10px; }
  .seg button { padding: 6px 10px; font-size: 11.5px; }
  .list-row { padding: 10px 10px; gap: 10px; grid-template-columns: 36px 1fr auto auto; }
  .list-row .lr-av { width: 36px; height: 36px; font-size: 13px; }
  .list-row .lr-amt { min-width: 0; font-size: 13.5px; }
  .violet-panel { padding: 18px 16px 16px; }
  .vp-head { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
  .vp-head > div:first-child { grid-column: 1 / -1; }
  .vp-v { font-size: 24px; }
  .vp-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mini-card { min-height: 80px; padding: 12px 12px 10px; }
  .vp-foot .ft { gap: 14px; }
  .sig-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* bottom tab bar */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--shell); border-top: 1px solid var(--border-soft);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(20, 20, 60, .08);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 2px 4px; border-radius: 14px; border: none; background: none; cursor: pointer;
    color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
    min-height: 52px; -webkit-tap-highlight-color: transparent;
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .active { color: #fff; background: var(--grad); box-shadow: var(--glow); }

  /* More sheet */
  .sheet { display: block; position: fixed; inset: 0; z-index: 60; }
  .sheet[hidden] { display: none; }
  .sheet-bg { position: absolute; inset: 0; background: rgba(10, 10, 25, .45); opacity: 0; transition: opacity .2s ease; }
  .sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--shell); border-radius: 26px 26px 0 0;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto;
  }
  .sheet.open .sheet-bg { opacity: 1; }
  .sheet.open .sheet-panel { transform: translateY(0); }
  .sheet-grip { width: 42px; height: 5px; border-radius: 999px; background: var(--border); margin: 2px auto 14px; }
  .sheet-head { display: flex; align-items: center; gap: 12px; padding: 0 2px 14px; border-bottom: 1px solid var(--border-soft); margin-bottom: 14px; }
  .sheet-head .admin-chip { font-weight: 800; color: var(--title); font-size: 14px; }
  .sheet-head .side-role { font-size: 11.5px; color: var(--muted); }
  .sheet-head .sheet-theme { margin-left: auto; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sheet-grid a {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px;
    padding: 14px 6px 12px; text-decoration: none; font-size: 12px; font-weight: 700; color: var(--title); text-align: center;
  }
  .sheet-grid a:active { background: var(--surface-3); }
  .sheet-grid .sg-ico { font-size: 22px; line-height: 1; }
  .sheet-foot { display: flex; gap: 8px; margin-top: 14px; }
  .sheet-foot .btn { flex: 1; text-align: center; }
  body.sheet-open { overflow: hidden; }
}

/* installed app (standalone): lift the header under the status bar */
@media (display-mode: standalone) and (max-width: 900px) {
  .topnav { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}
