/* ============================================================
   MERIDIAN — Components · shell, glass, controls, overlays
   Every surface derives from tokens; both themes share this file.
   ============================================================ */

/* ============ App shell ============ */

#app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: var(--glass);
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(26px) saturate(1.5);
  z-index: 40;
  transition: background 600ms var(--e-out);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-grad);
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  box-shadow: var(--glow-accent);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  line-height: 1;
}

.brand-tag { font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

.nav-section { padding: 16px 10px 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: 550;
  border: 1px solid transparent;
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-med);
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

.nav-item:hover { color: var(--text-hi); background: var(--glass-soft); }

.nav-item.active {
  color: var(--accent-ink);
  background: var(--accent-grad);
  box-shadow: var(--glow-accent);
  font-weight: 620;
}

.nav-item.active svg { opacity: 1; }

.sidebar-foot {
  border-top: 1px solid var(--stroke);
  padding-top: 12px;
  margin-top: 10px;
}

/* ---- Main column ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--glass-soft);
  backdrop-filter: blur(22px) saturate(1.4);
  border-bottom: 1px solid var(--stroke);
  transition: background 600ms var(--e-out);
}

.topbar-title {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--stroke);
  background: var(--field-bg);
  color: var(--text-dim);
  font-size: 12.5px;
  transition: border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-med);
  min-width: 190px;
}

.search-btn:hover { border-color: var(--stroke-hi); color: var(--text-mid); box-shadow: var(--shadow-1); }
.search-btn svg { width: 14px; height: 14px; }
.search-btn .kbd { margin-left: auto; }

/* theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  border: 1px solid var(--stroke);
  background: var(--field-bg);
  display: grid;
  place-items: center;
  color: var(--text-mid);
  transition: transform var(--t-med), color var(--t-fast), box-shadow var(--t-med);
}
.theme-toggle:hover { color: var(--text-hi); box-shadow: var(--shadow-1); transform: rotate(12deg); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ---- Ticker tape ---- */
.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--stroke);
  background: var(--glass-soft);
  backdrop-filter: blur(14px);
  height: 32px;
  display: flex;
  align-items: center;
  position: relative;
}

.ticker::before, .ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 70px;
  z-index: 2;
  pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--bg-solid), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--bg-solid), transparent); }

.ticker-track {
  display: flex;
  gap: 34px;
  padding-right: 34px;
  white-space: nowrap;
  animation: marquee 52s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.tick {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12px;
}

.tick .sym { color: var(--text-mid); font-weight: 620; letter-spacing: 0.04em; }
.tick .px { font-family: var(--f-mono); color: var(--text-hi); }
.tick .chg { font-family: var(--f-mono); font-size: 11px; }

/* ---- Content ---- */
.content {
  flex: 1;
  padding: 22px;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  animation: fadeUp 420ms var(--e-out);
}

/* ============ Panels — frosted glass v2 with spotlight ============ */

.panel {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(26px) saturate(1.5);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  transition: background 600ms var(--e-out), border-color var(--t-med), box-shadow var(--t-med);
}

/* top edge light — the glass catches the sky */
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 6%; right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--edge-light), transparent);
  pointer-events: none;
  z-index: 1;
}

/* cursor spotlight — set via --px/--py from JS */
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(340px circle at var(--px, 50%) var(--py, 0%), var(--spot), transparent 70%);
  opacity: 0;
  transition: opacity 500ms var(--e-out);
  pointer-events: none;
}

.panel.lit::after { opacity: 1; }

.panel-pad { padding: 18px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
  position: relative;
  z-index: 2;
}

.panel-head + .panel-body { padding-top: 12px; }
.panel-body { padding: 18px; position: relative; z-index: 2; }
.panel-title { font-size: 14px; font-weight: 640; letter-spacing: -0.015em; }
.panel-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.panel.hoverable { transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med), background 600ms; }
.panel.hoverable:hover {
  transform: translateY(-3px);
  border-color: var(--stroke-hi);
  box-shadow: var(--shadow-2);
}

.panel.accent-edge { border-color: var(--stroke-accent); }

/* ============ Stat cards ============ */

.stat {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(26px) saturate(1.5);
  padding: 15px 17px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med), background 600ms;
}

.stat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--px, 50%) var(--py, 0%), var(--spot), transparent 70%);
  opacity: 0;
  transition: opacity 500ms var(--e-out);
  pointer-events: none;
}
.stat.lit::after { opacity: 1; }

.stat:hover { transform: translateY(-3px); border-color: var(--stroke-hi); box-shadow: var(--shadow-2); }

.stat-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-family: var(--f-mono);
  font-feature-settings: 'tnum' 1;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-top: 7px;
  line-height: 1;
}

.stat-value.serif { font-family: var(--f-display); font-weight: 640; font-size: 30px; }

.stat-delta { font-size: 11.5px; margin-top: 7px; display: flex; align-items: center; gap: 5px; font-family: var(--f-mono); }

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--stroke-hi);
  background: var(--glass-hi);
  color: var(--text-hi);
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-med);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:hover { border-color: var(--text-faint); box-shadow: var(--shadow-1); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; }

.btn-accent {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: var(--glow-accent);
}

.btn-accent::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-130%) skewX(-18deg);
  pointer-events: none;
}

:root[data-theme="dusk"] .btn-accent::after {
  background: linear-gradient(90deg, transparent, rgba(120, 140, 220, 0.25), transparent);
}

.btn-accent:hover { border-color: transparent; box-shadow: 0 8px 30px var(--accent-glow); }
.btn-accent:hover::after { animation: shine 800ms var(--e-out); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-mid); box-shadow: none; }
.btn-ghost:hover { background: var(--glass-soft); color: var(--text-hi); border-color: transparent; box-shadow: none; }

.btn-danger { background: var(--loss-soft); border-color: var(--loss-stroke); color: var(--loss); }
.btn-danger:hover { background: var(--loss-soft); border-color: var(--loss); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.btn-icon {
  padding: 7px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  display: inline-flex;
  transition: color var(--t-fast), background var(--t-fast);
}
.btn-icon:hover { color: var(--text-hi); background: var(--glass-hi); }
.btn-icon svg { width: 16px; height: 16px; }

/* ============ Forms ============ */

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.input, .select, .textarea {
  background: var(--field-bg);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-hi);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background 600ms;
  width: 100%;
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.input.num, .input.mono { font-family: var(--f-mono); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23848fa8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.select option { background: var(--bg-solid); color: var(--text-hi); }

.textarea { resize: vertical; min-height: 74px; line-height: 1.55; }

/* Segmented control */
.seg {
  display: inline-flex;
  background: var(--track);
  border: 1px solid var(--stroke);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
}

.seg button {
  padding: 6px 13px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-dim);
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.seg button:hover { color: var(--text-mid); }
.seg button.on { background: var(--glass-hi); color: var(--text-hi); box-shadow: var(--shadow-1); }
.seg button.on.long { color: var(--profit); }
.seg button.on.short { color: var(--loss); }

/* ============ Chips & badges ============ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 620;
  border: 1px solid var(--stroke);
  background: var(--glass-hi);
  color: var(--text-mid);
  white-space: nowrap;
}

.chip.accent { background: var(--accent-soft); border-color: var(--stroke-accent); color: var(--accent); }
:root[data-theme="dusk"] .chip.accent { color: var(--accent-deep); }
.chip.pos { background: var(--profit-soft); border-color: var(--profit-stroke); color: var(--profit); }
.chip.neg { background: var(--loss-soft); border-color: var(--loss-stroke); color: var(--loss); }
.chip.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.chip.info { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip .dot.pulse { animation: pulseDot 1.6s infinite; }

.dir {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dir.long { background: var(--profit-soft); color: var(--profit); }
.dir.short { background: var(--loss-soft); color: var(--loss); }
.dir svg { width: 11px; height: 11px; }

.grade {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
}
.grade.a { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--stroke-accent); }
:root[data-theme="dusk"] .grade.a { color: var(--accent-deep); }
.grade.b { background: var(--info-soft); color: var(--info); border: 1px solid var(--stroke); }
.grade.c { background: var(--glass-hi); color: var(--text-dim); border: 1px solid var(--stroke); }

/* Impact dots (econ calendar) */
.impact { display: inline-flex; gap: 3px; }
.impact i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
.impact.high i { background: var(--loss); }
.impact.med i:nth-child(-n+2) { background: var(--warn); }
.impact.low i:first-child { background: var(--text-mid); }

/* ============ Tables ============ */

.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); }

.tbl { width: 100%; font-size: 13px; }

.tbl th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 9px 12px;
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--thead);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
  vertical-align: middle;
}

.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--glass-soft); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num-cell { font-family: var(--f-mono); font-feature-settings: 'tnum' 1; }
.tbl th.r, .tbl td.r { text-align: right; }

/* ============ Progress ============ */

.bar {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--track);
  overflow: hidden;
  position: relative;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--accent-grad);
  transition: width 900ms var(--e-out);
  position: relative;
}

.bar > i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  background-size: 300px 100%;
  animation: shimmer 2.6s infinite;
}

.bar.pos > i { background: var(--m-profit); }
.bar.neg > i { background: var(--m-loss); }
.bar.warn > i { background: var(--warn); }
.bar.thin { height: 4px; }

/* ============ Avatars — calm gradient duos ============ */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6b7fb8, #46567e);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.avatar.alt-1 { background: linear-gradient(135deg, #5fb8a4, #3a8a77); }
.avatar.alt-2 { background: linear-gradient(135deg, #7d92e0, #5266b4); }
.avatar.alt-3 { background: linear-gradient(135deg, #a88be0, #7a5cb8); }
.avatar.alt-4 { background: linear-gradient(135deg, #e09aa8, #b86a7e); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

/* ============ kbd ============ */

.kbd {
  font-family: var(--f-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--stroke-hi);
  border-bottom-width: 2px;
  background: var(--glass-hi);
  color: var(--text-dim);
}

/* ============ Tabs ============ */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--stroke); }

.tab {
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 620;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.tab:hover { color: var(--text-mid); }
.tab.on { color: var(--text-hi); border-bottom-color: var(--accent); }

/* ============ Overlays: modal / drawer / toast / palette ============ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 200ms var(--e-out);
}

.overlay.closing { animation: fadeIn 180ms var(--e-out) reverse forwards; }

.modal {
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--overlay-bg);
  border: 1px solid var(--stroke-hi);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(30px) saturate(1.5);
  animation: popIn 320ms var(--e-spring);
}

.modal.wide { width: 780px; }
.modal.narrow { width: 420px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 0;
}

.modal-title { font-family: var(--f-display); font-size: 20px; font-weight: 660; letter-spacing: -0.025em; }
.modal-body { padding: 18px 22px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 20px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  backdrop-filter: blur(5px);
  animation: fadeIn 200ms var(--e-out);
}

.drawer {
  position: fixed;
  top: 10px; right: 10px; bottom: 10px;
  z-index: 101;
  width: 460px;
  max-width: 92vw;
  background: var(--overlay-bg);
  border: 1px solid var(--stroke-hi);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(30px) saturate(1.5);
  overflow-y: auto;
  animation: drawerIn 400ms var(--e-out);
}

@keyframes drawerIn {
  from { transform: translateX(70px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke);
  position: sticky;
  top: 0;
  background: var(--thead);
  backdrop-filter: blur(12px);
  z-index: 2;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.drawer-body { padding: 20px; }

/* Toasts */
#toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-full);
  background: var(--overlay-bg);
  border: 1px solid var(--stroke-hi);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(20px) saturate(1.5);
  font-size: 13px;
  font-weight: 550;
  animation: toastIn 380ms var(--e-spring);
  max-width: 360px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.toast.out { transition: opacity 260ms, transform 260ms; opacity: 0; transform: translateY(10px); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.ok svg { color: var(--profit); }
.toast.err svg { color: var(--loss); }
.toast.info svg { color: var(--info); }

/* Command palette */
.palette {
  width: 580px;
  max-width: 100%;
  background: var(--overlay-bg);
  border: 1px solid var(--stroke-hi);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(30px) saturate(1.5);
  overflow: hidden;
  animation: popIn 280ms var(--e-spring);
  align-self: start;
  margin-top: 12vh;
}

.palette-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--stroke);
  padding: 17px 20px;
  font-size: 15px;
  color: var(--text-hi);
}

.palette-input::placeholder { color: var(--text-faint); }
.palette-input:focus { outline: none; box-shadow: none; }

.palette-list { max-height: 340px; overflow-y: auto; padding: 8px; }

.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-mid);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.palette-item svg { width: 16px; height: 16px; opacity: 0.8; }
.palette-item.sel { background: var(--accent-soft); color: var(--text-hi); }
.palette-item.sel svg { color: var(--accent); }
:root[data-theme="dusk"] .palette-item.sel svg { color: var(--accent-deep); }
.palette-item .hint { margin-left: auto; font-size: 11px; color: var(--text-faint); }

.palette-empty { padding: 26px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* Chart tooltip */
#chart-tip {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  background: var(--overlay-bg);
  border: 1px solid var(--stroke-hi);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  font-size: 12px;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 120ms;
  max-width: 260px;
}

#chart-tip.show { opacity: 1; }
#chart-tip .tip-title { font-weight: 600; color: var(--text-mid); font-size: 11px; margin-bottom: 3px; }
#chart-tip .tip-val { font-family: var(--f-mono); font-size: 13px; }

/* ============ Empty state ============ */

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
}

.empty svg { width: 34px; height: 34px; margin: 0 auto 12px; opacity: 0.4; }
.empty .h3 { color: var(--text-mid); margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 300px; margin: 0 auto; }

/* ============ Checklist ============ */

.check-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
  user-select: none;
}

.check-item:hover { background: var(--glass-soft); }

.check-box {
  width: 19px;
  height: 19px;
  border-radius: 7px;
  border: 1.5px solid var(--stroke-hi);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
  color: transparent;
  background: var(--field-bg);
}

.check-box svg { width: 11px; height: 11px; }

.check-item.done .check-box {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: var(--glow-accent);
}

.check-item.done .check-label { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--text-faint); }

.check-label { font-size: 13px; }

/* ============ Boot intro ============ */

#boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    linear-gradient(180deg, rgba(var(--sky-1), 0.35), transparent 55%),
    radial-gradient(120% 70% at 50% 115%, rgba(var(--sky-3), 0.4), transparent 60%),
    var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 700ms var(--e-out), visibility 700ms;
}

#boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.boot-inner { text-align: center; }

.boot-mark {
  width: 66px;
  height: 66px;
  margin: 0 auto 24px;
  border-radius: 20px;
  background: var(--accent-grad);
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  box-shadow: 0 20px 60px var(--accent-glow);
  animation: bootMark 900ms var(--e-spring), breathe 3.5s var(--e-inout) 1s infinite;
}

@keyframes bootMark {
  0% { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  100% { opacity: 1; transform: none; }
}

.boot-name {
  font-family: var(--f-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  animation: fadeUp 800ms var(--e-out) 250ms backwards;
}

.boot-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 10px;
  animation: fadeUp 800ms var(--e-out) 450ms backwards;
}

.boot-line {
  width: 180px;
  height: 2px;
  margin: 28px auto 0;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
  animation: fadeIn 400ms 600ms backwards;
}

.boot-line i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: var(--accent-grad);
  animation: bootLine 1.1s var(--e-inout) 600ms forwards;
}

@keyframes bootLine {
  from { width: 0; }
  to { width: 100%; }
}

/* ============ Responsive ============ */

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  /* sidebar becomes a bottom tab bar */
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 6px 10px;
    border-right: none;
    border-top: 1px solid var(--stroke);
    z-index: 60;
  }
  .brand, .nav-section, .sidebar-foot .row { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 10px 12px; width: auto; }
  .nav-item span { display: none; }
  .nav-item svg { width: 19px; height: 19px; }
  .sidebar-foot { border-top: none; padding-top: 0; margin-top: 0; }
  .main { padding-bottom: 62px; }
  .topbar .search-btn { display: none; }
  .topbar-title { font-size: 17px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .modal.wide { width: 100%; }
  .drawer { top: 0; right: 0; bottom: 0; border-radius: 0; }
  .drawer-head { border-radius: 0; }
}
