/* theme_30.css — the v30 look. Loaded AFTER style.css and only adds or
   overrides; every v28 screen keeps working underneath.
   Colours: green = up, red = down, everywhere. */
:root {
  --bg: #0b0f17; --bg-elev: #121826; --bg-card: #151c2b; --border: #243049;
  --text: #e8edf6; --text-dim: #8e9ab1; --accent: #5b9cff;
  --green: #22c55e; --red: #ef4444; --amber: #f59e0b;
  --radius: 14px;
}
body { background: var(--bg); }
.card { border-radius: var(--radius); background: var(--bg-card); }

/* ── navigation: grouped sidebar on wide screens, 5 slots on phones ───── */
.tab-sec { display: none; }
@media (orientation: landscape) and (min-width: 700px) and (min-height: 500px) {
  .tabbar .tab-sec {
    display: block; font-size: 11px; letter-spacing: .7px; text-transform: uppercase;
    color: var(--text-dim); padding: 14px 14px 4px; opacity: .8;
  }
  .tabbar .tab { padding: 9px 14px; font-size: 14px; }
  .tabbar .tab.sub { padding-left: 40px; font-size: 13px; }
  .tabbar .tab.sub .ico { display: none; }
  .tabbar .brand30 { display: block; }
}
.brand30 { display: none; font-weight: 750; font-size: 16px; padding: 6px 14px 10px; }
.brand30 small { display: block; color: var(--text-dim); font-weight: 400; font-size: 11px; }

/* sub-navigation under the title: the other screens of the same group */
#subnav30 { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px 0; scrollbar-width: none; }
#subnav30::-webkit-scrollbar { display: none; }
#subnav30:empty { display: none; }
@media (orientation: landscape) and (min-width: 700px) and (min-height: 500px) {
  #subnav30 { grid-area: content; display: none; }
}

.chip30 {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.chip30.on { border-color: var(--accent); color: var(--accent); background: rgba(91,156,255,.1); }
.chip30.sm { padding: 3px 9px; font-size: 12px; }

/* topbar actions */
.top30 { display: flex; gap: 6px; align-items: center; }
.cmdbtn30 {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 10px; padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.cmdbtn30 kbd { font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
@media (max-width: 767px) { .cmdbtn30 .lbl, .cmdbtn30 kbd { display: none; } }

/* floating assistant button: one tap from every screen */
.fab30 {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  width: 54px; height: 54px; border-radius: 27px; font-size: 24px; z-index: 30;
  background: linear-gradient(135deg, #5b9cff, #7c5cff); color: #fff; border: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); cursor: pointer;
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 500px) {
  .fab30 { bottom: 24px; right: 24px; }
}
body.on-assistant .fab30 { display: none; }

/* command palette */
.cmdk30 { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk30.hidden { display: none; }
.cmdk30 .box { width: min(560px, 94vw); background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.cmdk30 input { margin: 0; }
.cmdk30 .it { padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; gap: 10px; }
.cmdk30 .it:hover, .cmdk30 .it.sel { background: rgba(91,156,255,.12); }
.cmdk30 .it .k { color: var(--text-dim); margin-left: auto; font-size: 12px; }

/* ── page building blocks ─────────────────────────────────────────────── */
.g30 { display: grid; gap: 12px; }
.g30.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g30.tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tile30 { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tile30 .k { color: var(--text-dim); font-size: 12px; }
.tile30 .v { font-size: 21px; font-weight: 700; margin-top: 2px; }
.tile30 .s { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.h30 { font-size: 15px; font-weight: 700; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.h30 .sp { flex: 1; }
.pill30 { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-dim); white-space: nowrap; }
.pill30.pos { color: var(--green); border-color: rgba(34,197,94,.4); }
.pill30.neg { color: var(--red); border-color: rgba(239,68,68,.4); }
.pill30.warn { color: var(--amber); border-color: rgba(245,158,11,.4); }
.up30 { color: var(--green); } .dn30 { color: var(--red); } .dim30 { color: var(--text-dim); }
.note30 { font-size: 12px; color: var(--text-dim); margin: 8px 0 0; line-height: 1.45; }
.plain30 { display: none; font-size: 12px; color: #b9c6dd; background: rgba(91,156,255,.07);
  border-left: 3px solid var(--accent); padding: 6px 9px; border-radius: 6px; margin: 6px 0; }
body.plain-on .plain30 { display: block; }
.btn30 { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 9px;
  padding: 6px 11px; font-size: 13px; cursor: pointer; }
.btn30.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn30:disabled { opacity: .5; }
.list30 { margin: 0; padding-left: 18px; } .list30 li { margin: 5px 0; line-height: 1.45; }
.assist30 { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 10px; cursor: pointer; }
.assist30:hover { background: var(--bg-elev); }
.assist30 .ic { font-size: 20px; } .assist30 b { display: block; font-size: 14px; } .assist30 span { font-size: 12px; color: var(--text-dim); }
.tbl30 { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl30 th, .tbl30 td { padding: 6px 7px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tbl30 th:first-child, .tbl30 td:first-child { text-align: left; }
.tbl30 th { color: var(--text-dim); font-weight: 600; font-size: 12px; }
.scroll30 { overflow-x: auto; }
.hm30 { display: inline-block; min-width: 50px; border-radius: 5px; padding: 1px 5px; }
.bar30 { display: inline-block; width: 64px; height: 7px; background: #26324b; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.bar30 i { display: block; height: 7px; border-radius: 4px; }
.ev30 td { text-align: left !important; white-space: normal !important; vertical-align: top; }
.ev30 td:first-child { width: 120px; color: var(--text-dim); }
.zone30 { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; margin: 5px 0; font-size: 13px; }
.zone30.acc { background: rgba(34,197,94,.12); } .zone30.trim { background: rgba(239,68,68,.12); }
.zone30.rev { background: rgba(255,255,255,.05); } .zone30.now { background: rgba(91,156,255,.12); }
.zone30 small { color: var(--text-dim); display: block; font-size: 11px; }
svg.c30 text { fill: var(--text-dim); font-size: 11px; }
.empty30 { color: var(--text-dim); padding: 18px 4px; text-align: center; font-size: 14px; }

/* explain-anything: numbers that can be explained get a dotted underline */
[data-explain] { cursor: help; text-decoration: underline dotted rgba(142,154,177,.6); text-underline-offset: 3px; }

/* assistant */
.chat30 { display: flex; flex-direction: column; gap: 10px; }
.msg30 { padding: 10px 12px; border-radius: 12px; max-width: 820px; line-height: 1.5; font-size: 14px; word-wrap: break-word; }
.msg30.me { background: #1b3358; align-self: flex-end; }
.msg30.ai { background: var(--bg-card); border: 1px solid var(--border); }
.msg30 .tools { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--text-dim); margin-bottom: 6px; }
.msg30 .src { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.msg30 .src a { color: var(--accent); }
.msg30 .foot { font-size: 11px; color: var(--text-dim); margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 5px; }
.composer30 { display: flex; gap: 8px; margin-top: 10px; position: sticky; bottom: 0; }
.composer30 textarea { flex: 1; min-height: 44px; max-height: 140px; resize: vertical; margin: 0;
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font: inherit; }
.news30 { padding: 9px 0; border-bottom: 1px solid var(--border); }
.news30 a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.news30 .meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
