/* fund.freaklabs.dev — "night desk" theme */
:root {
  --bg: #07090b;
  --bg-2: #0b0e11;
  --panel: #0d1114;
  --panel-2: #11161a;
  --line: #1a2127;
  --line-2: #243039;
  --text: #e7edf0;
  --text-2: #aab6bd;
  --muted: #6e7c85;
  --up: #2ee6a6;
  --up-dim: rgba(46, 230, 166, .12);
  --down: #ff5a6e;
  --down-dim: rgba(255, 90, 110, .12);
  --amber: #f5b544;
  --spy: #8a97a0;
  --radius: 14px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Geist', ui-sans-serif, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--sans); font-feature-settings: "ss01";
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(46, 230, 166, .07), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(245, 181, 68, .045), transparent 60%),
    linear-gradient(var(--bg), var(--bg));
  overflow-x: hidden;
}
body::before { /* faint desk grid */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
.mono, .num, td.n, th.n { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--text-2); }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); font-weight: 400; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px;
  padding: 12px 28px; background: rgba(7, 9, 11, .78); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(140deg, var(--up), #12a37a); color: #03120c; font: 700 12px/1 var(--mono); letter-spacing: -.5px;
  box-shadow: 0 0 24px rgba(46, 230, 166, .25);
}
.brand-text { font: 500 14px var(--mono); color: var(--text-2); }
.brand-text b { color: var(--text); font-weight: 600; }
.brand-slash { color: var(--muted); margin: 0 2px; }
.cursor { color: var(--up); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--text-2); white-space: nowrap; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.on { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav a.nav-ghost { color: var(--amber); }
.status { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.mkt { display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--mono); color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.mkt i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mkt-open i { background: var(--up); box-shadow: 0 0 0 0 rgba(46,230,166,.6); animation: pulse 2s infinite; }
.mkt-pre i, .mkt-post i { background: var(--amber); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(46,230,166,0); } 100% { box-shadow: 0 0 0 0 rgba(46,230,166,0); } }
.clock { font-size: 12px; color: var(--muted); }

/* ---------- ticker tape */
.tape { position: relative; z-index: 1; border-bottom: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.tape-track { display: flex; width: max-content; animation: tape 60s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 22px; border-right: 1px solid var(--line); font: 12.5px var(--mono); white-space: nowrap; }
.tape-item .sym { color: var(--text-2); font-weight: 600; }
.tape-item .px { color: var(--text); }
@keyframes tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } .cursor { animation: none; } }

/* ---------- layout */
main { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 28px 28px 40px; }
.grid { display: grid; gap: 18px; }
.grid > *, .fund-cards > * { min-width: 0; }
.stat:last-child:nth-child(odd) { grid-column: span 2; }
.g-hero { grid-template-columns: minmax(300px, 400px) 1fr; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-21 { grid-template-columns: 2fr 1fr; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 38px 0 14px; }
.section-title h2 { margin: 0; font: 400 30px/1.1 var(--serif); letter-spacing: -.01em; }
.section-title h2 em { color: var(--muted); }
.section-title .aside { color: var(--muted); font: 12px var(--mono); }

.panel {
  position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; min-width: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.6);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel h2, .panel h3 { margin: 0; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.eyebrow { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(8px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal:nth-child(2) { animation-delay: .06s; } .reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .18s; } .reveal:nth-child(5) { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* ---------- hero */
.hero { display: flex; flex-direction: column; gap: 22px; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(46,230,166,.16)), transparent 70%); pointer-events: none;
}
.hero.is-down { --glow: rgba(255,90,110,.14); }
.nav-value { font: 400 clamp(44px, 5.4vw, 64px)/.95 var(--serif); letter-spacing: -.02em; margin: 6px 0 0; }
.nav-value .cents { color: var(--text-2); font-size: .58em; }
.day-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 500 15px var(--mono); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 600 12px var(--mono); }
.chip.up { background: var(--up-dim); } .chip.down { background: var(--down-dim); } .chip.flat { background: var(--panel-2); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat { background: var(--panel); padding: 12px 14px; }
.stat .k { font: 500 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat .v { font: 500 16px var(--mono); margin-top: 3px; font-variant-numeric: tabular-nums; }
.alpha-bar { display: flex; flex-direction: column; gap: 8px; }
.ab-row { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 10px; font: 12px var(--mono); }
.ab-track { height: 6px; background: var(--bg-2); border-radius: 3px; position: relative; overflow: hidden; }
.ab-track span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.ab-fund span { background: var(--up); } .ab-spy span { background: var(--spy); }
.ab-track span.neg { background: var(--down); }
.stale { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 6px; background: rgba(245,181,68,.12); color: var(--amber); font: 600 11px var(--mono); }

/* ---------- chart */
.chart-panel { display: flex; flex-direction: column; min-height: 420px; }
.reveal > .chart-panel { flex: 1; }
.chart { flex: 1; min-height: 320px; position: relative; }
.chart-empty[hidden] { display: none; }
.chart-empty { position: absolute; inset: 120px 0 0; display: grid; place-items: center; color: var(--muted); font: 13px var(--mono); }
.tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); font: 600 11.5px var(--mono); padding: 6px 10px; border-radius: 6px; cursor: pointer;
  transition: color .15s, background .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg i { width: 14px; height: 2px; border-radius: 2px; background: var(--up); }
.lg-spy i { background: var(--spy); }
.lg-alpha { color: var(--muted); }

/* ---------- fund cards */
.fund-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.fund-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; transition: border-color .2s, transform .2s; overflow: hidden; }
.fund-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--fc, var(--up)); }
.fund-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.fund-card .fc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fund-card .fc-name { font: 400 25px/1.05 var(--serif); }
.fund-card .fc-desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fund-card .fc-val { font: 500 20px var(--mono); }
.fund-card .fc-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.fund-card .fc-meta { display: flex; gap: 14px; font: 12px var(--mono); color: var(--muted); }
.fund-card .fc-meta b { font-weight: 500; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark-fill { stroke: none; opacity: .14; }
.spark-up .spark-line { stroke: var(--up); } .spark-up .spark-fill { fill: var(--up); }
.spark-down .spark-line { stroke: var(--down); } .spark-down .spark-fill { fill: var(--down); }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 600 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
th.n, td.n { text-align: right; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr:last-child td { border-bottom: 0; }
.tk { display: flex; align-items: center; gap: 10px; }
.tk-badge { display: grid; place-items: center; min-width: 44px; height: 26px; padding: 0 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); font: 600 11.5px var(--mono); }
.tk-name { color: var(--muted); font-size: 12.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.wbar { display: inline-block; width: 56px; height: 4px; background: var(--bg-2); border-radius: 2px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.wbar span { display: block; height: 100%; background: var(--amber); }
.type-pill { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-2); }
.type-buy { color: var(--up); } .type-sell { color: var(--down); } .type-dividend { color: var(--amber); } .type-split { color: #8fb3ff; }

/* ---------- movers & allocation */
.movers { display: flex; flex-direction: column; }
.mover { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mover:last-child { border-bottom: 0; }
.mover .mv-pct { font: 600 13px var(--mono); padding: 3px 8px; border-radius: 6px; }
.mover .mv-pct.up { background: var(--up-dim); } .mover .mv-pct.down { background: var(--down-dim); }
.alloc-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 6px 0 16px; }
.alloc-stack span { display: block; height: 100%; min-width: 3px; }
.alloc-list { display: grid; gap: 9px; }
.alloc-item { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.alloc-item i { width: 10px; height: 10px; border-radius: 3px; }
.alloc-item .mono { color: var(--text-2); font-size: 12.5px; }

/* ---------- market */
.g-market { grid-template-columns: 1.3fr 1fr; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.heat-tile {
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; gap: 6px; transition: background .3s;
}
.heat-tile .ht-sym { font: 600 12px var(--mono); color: var(--text-2); }
.heat-tile .ht-name { font-size: 12.5px; }
.heat-tile .ht-val { font: 600 17px var(--mono); }
.idx-name { font-weight: 500; }

/* ---------- empty / misc */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-state h1 { font: 400 46px/1 var(--serif); margin: 0 0 12px; }
.empty-state p { color: var(--text-2); max-width: 480px; margin: 0 auto 22px; }
.fund-hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.fund-hero-head h1 { margin: 0; font: 400 clamp(40px, 5vw, 60px)/1 var(--serif); letter-spacing: -.02em; }
.fund-hero-head p { margin: 8px 0 0; color: var(--text-2); max-width: 640px; }
.back { font: 12px var(--mono); color: var(--muted); display: inline-block; margin-bottom: 12px; }
.back:hover { color: var(--text); }
.mode-note { display: inline-flex; gap: 6px; align-items: center; font: 11px var(--mono); color: var(--amber); background: rgba(245,181,68,.08); border: 1px solid rgba(245,181,68,.2); padding: 4px 10px; border-radius: 6px; }
.flash-up { animation: fup 1.2s ease; } .flash-down { animation: fdown 1.2s ease; }
@keyframes fup { 0% { background: rgba(46,230,166,.25); } 100% { background: transparent; } }
@keyframes fdown { 0% { background: rgba(255,90,110,.25); } 100% { background: transparent; } }

/* ---------- forms / admin */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: 600 13px var(--sans); cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--up); border-color: var(--up); color: #03120c; }
.btn-primary:hover { background: #5cf0bd; border-color: #5cf0bd; }
.btn-danger { color: var(--down); border-color: rgba(255,90,110,.35); background: transparent; }
.btn-danger:hover { border-color: var(--down); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.form { display: grid; gap: 16px; max-width: 760px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font: 600 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  font: 14px var(--sans); text-transform: none; letter-spacing: 0; transition: border-color .15s, box-shadow .15s;
}
input[type=number], input[type=date], .mono-input { font-family: var(--mono); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--up); box-shadow: 0 0 0 3px rgba(46,230,166,.15); }
input[type=color] { padding: 3px; height: 42px; }
textarea { min-height: 90px; resize: vertical; }
.hint { font: 400 12px var(--sans); color: var(--muted); text-transform: none; letter-spacing: 0; }
.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid; margin-bottom: 18px; font-size: 13.5px; }
.alert-ok { border-color: rgba(46,230,166,.3); background: var(--up-dim); color: #b8f7df; }
.alert-err { border-color: rgba(255,90,110,.3); background: var(--down-dim); color: #ffc2ca; }
.alert-warn { border-color: rgba(245,181,68,.3); background: rgba(245,181,68,.08); color: #fbe0ad; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font: 400 40px/1 var(--serif); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.inline-form { display: inline; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.ac-list button { display: flex; width: 100%; gap: 10px; align-items: baseline; padding: 9px 12px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: 13px var(--sans); }
.ac-list button:hover, .ac-list button.on { background: var(--bg-2); }
.ac-list b { font: 600 12px var(--mono); min-width: 56px; }
.ac-list small { color: var(--muted); margin-left: auto; font: 11px var(--mono); }
.toggle-card { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line-2); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); transition: transform .2s, background .2s; }
.switch input:checked + span { background: rgba(245,181,68,.2); border-color: var(--amber); }
.switch input:checked + span::after { transform: translateX(22px); background: var(--amber); }
.login-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.login-card { width: min(400px, 100%); }
.login-card h1 { font: 400 38px/1 var(--serif); margin: 0 0 6px; }
.sev { font: 600 10.5px var(--mono); text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.sev-error { color: var(--down); background: var(--down-dim); } .sev-warning { color: var(--amber); background: rgba(245,181,68,.1); } .sev-info { color: var(--text-2); background: var(--panel-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi .v { font: 500 22px var(--mono); margin-top: 4px; }

/* ---------- earnings calendar */
.earn-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 6px 0 18px; }
.earn-ctrl { display: flex; align-items: center; gap: 4px; }
.icon-btn, .today-btn {
  position: relative; display: grid; place-items: center; height: 36px; min-width: 36px; padding: 0 8px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.today-btn { font: 500 13.5px var(--sans); padding: 0 14px; }
.icon-btn:hover, .today-btn:hover, .icon-btn[aria-expanded=true] { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.icon-btn:focus-visible, .today-btn:focus-visible, .day:focus-visible { outline: 2px solid var(--up); outline-offset: 2px; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.icon-btn .dot[hidden] { display: none; }
.pop-wrap { position: relative; }
.popover {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); width: 300px; display: grid; gap: 14px; padding: 16px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 48px rgba(0,0,0,.55);
}
.popover[hidden] { display: none; }
.pop-group { display: grid; gap: 8px; }
.popover .hint { margin: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.seg button { flex: 1; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 500 12px var(--mono); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.date-ghost { position: absolute; inset: auto 0 0 auto; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 13px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text); font: inherit;
  transition: border-color .15s, transform .15s, background .15s;
}
.day:hover { border-color: var(--line-2); transform: translateY(-1px); }
.day-dow { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.day-date { font: 400 22px/1 var(--serif); }
.day-meta { display: flex; align-items: center; gap: 7px; min-height: 22px; font: 12px var(--mono); color: var(--text-2); white-space: nowrap; }
.day.is-empty .day-meta { color: var(--muted); }
.day.is-today .day-dow { color: var(--up); }
.day.on { border-color: var(--up); background: linear-gradient(180deg, rgba(46,230,166,.10), var(--panel)); box-shadow: 0 0 0 1px var(--up) inset, 0 10px 30px -12px rgba(46,230,166,.35); }
.day.on .day-dow { color: var(--up); }
.stack { display: inline-flex; }
.stack .logo { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel); }
.stack .logo:first-child { margin-left: 0; }

.logo { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: #eef2f4; }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo.is-init { background: transparent; }
.logo-xs { width: 20px; height: 20px; border-radius: 50%; }
.logo-xs img { padding: 1px; }
.lg-init {
  display: grid; place-items: center; width: 100%; height: 100%; font: 700 13px var(--mono); color: hsl(var(--h) 70% 82%);
  background: hsl(var(--h) 38% 20%); border: 1px solid hsl(var(--h) 35% 30%); border-radius: inherit;
}
.logo-xs .lg-init { font-size: 8px; }

.earn-list { padding: 0; overflow: visible; }
.earn-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); font: 12.5px var(--mono); color: var(--text-2); }
.earn-sum b { color: var(--text); font-weight: 600; }
.earn-sum svg { vertical-align: -2px; }
.earn-sum .sep { color: var(--line-2); }
.linkish { border: 0; padding: 0; background: none; color: var(--amber); font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ev { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); transition: background .12s; }
.ev:last-child { border-bottom: 0; }
.ev:hover { background: rgba(255,255,255,.015); }
.ev.is-held { box-shadow: inset 3px 0 0 var(--amber); }
.ev-name { font-size: 16px; font-weight: 500; line-height: 1.3; }
.ev-tk { font: 12.5px var(--mono); color: var(--text-2); margin-top: 2px; }
.held-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 2px 8px; border-radius: 5px; font: 600 10.5px var(--mono); letter-spacing: .04em; color: var(--amber); background: rgba(245,181,68,.1); border: 1px solid rgba(245,181,68,.25); }
.ev-b { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.ev-b li::marker { color: var(--muted); }
.ev-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ev-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); font: 12.5px var(--mono); white-space: nowrap; }
.ev-pill b { font-weight: 600; color: var(--text); }
.ev-time { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.ev-bmo svg { color: var(--amber); } .ev-amc svg { color: #8fb3ff; }
.earn-empty { padding: 56px 20px; text-align: center; color: var(--muted); font: 13px var(--mono); }
.earn-more { display: flex; margin: 0 auto 18px; }
.earn-more[hidden] { display: none; }
.earn-note { font-size: 12px; margin: 14px 2px 0; }
.earn-loading .week, .earn-loading .earn-list { opacity: .5; transition: opacity .2s; pointer-events: none; }

/* ---------- notes */
.notes { display: flex; flex-direction: column; }
.note { padding: 18px 0; border-bottom: 1px solid var(--line); }
.note:first-child { padding-top: 2px; }
.note:last-child { border-bottom: 0; padding-bottom: 2px; }
.note.is-private { border-left: 2px dashed rgba(245,181,68,.45); padding-left: 16px; }
.note-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.note-subj.tk-badge { display: inline-grid; height: 24px; }
.note-subj.tk-badge:hover { border-color: var(--muted); }
.note-fund { display: inline-flex; align-items: center; gap: 7px; font: 600 12px var(--mono); color: var(--text-2); }
.note-fund i { width: 8px; height: 8px; border-radius: 2px; background: var(--fc); }
.note-fund:hover { color: var(--text); }
.note-date { font: 12px var(--mono); color: var(--muted); }
.note-private { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--amber); background: rgba(245,181,68,.1); border: 1px solid rgba(245,181,68,.25); padding: 1px 7px; border-radius: 5px; }
.note-edit { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.note-edit:hover { color: var(--up); }
.note .note-title { margin: 10px 0 0; font: 400 24px/1.15 var(--serif); color: var(--text); text-transform: none; letter-spacing: 0; }
.note-body { margin-top: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.65; max-width: 78ch; overflow-wrap: anywhere; }
.note-body p { margin: 0 0 10px; }
.note-body p:last-child { margin-bottom: 0; }
.note-body a { color: var(--up); text-decoration: underline; text-underline-offset: 3px; }
.note-body b { color: var(--text); }
.notes-empty { padding: 36px 10px; text-align: center; color: var(--muted); font: 13px var(--mono); }
.note-flag { font: 600 11px var(--mono); color: var(--amber); padding: 2px 6px; border-radius: 5px; background: rgba(245,181,68,.08); }
.note-flag:hover { background: rgba(245,181,68,.18); }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.note-chips a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 12.5px; }
.note-chips a:hover { color: var(--text); border-color: var(--muted); }
.note-chips a.on { color: var(--text); background: var(--panel-2); border-color: var(--up); }
.note-chips .chip-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--fc); }
.note-kind { max-width: 320px; }
.note-kind label { flex: 1; display: block; cursor: pointer; text-transform: none; letter-spacing: 0; }
.note-kind input { position: absolute; opacity: 0; width: 0; height: 0; }
.note-kind span { display: block; text-align: center; padding: 7px 10px; border-radius: 6px; font: 500 13px var(--sans); color: var(--text-2); }
.note-kind input:checked + span { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.note-kind input:focus-visible + span { outline: 2px solid var(--up); }
.note-form [hidden] { display: none; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); cursor: pointer; text-transform: none; letter-spacing: 0; font: 14px var(--sans); color: var(--text); }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--up); flex-shrink: 0; padding: 0; }
.check-row .hint { display: block; margin-top: 2px; }
.note-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.note-filters select, .note-filters input { width: auto; padding: 7px 10px; font-size: 13px; }
.note-filters input { width: 110px; }
.note-cell { white-space: normal; min-width: 260px; }
.vis-toggle { cursor: pointer; font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 5px; border: 1px solid rgba(245,181,68,.3); background: rgba(245,181,68,.08); color: var(--amber); }
.vis-toggle.is-public { color: var(--up); border-color: rgba(46,230,166,.3); background: var(--up-dim); }

/* ---------- command center */
.cc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.cc-head h1 { margin: 4px 0 0; font: 400 clamp(40px, 5vw, 60px)/1 var(--serif); letter-spacing: -.02em; }
.cc-head h1 em { color: var(--muted); }
.cc-head p { margin: 8px 0 0; color: var(--text-2); }
.cc-head-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cc-updated { font-size: 12px; color: var(--muted); padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); }
.cc-updated b { color: var(--up); font-weight: 600; }
.tabs .tab-a { padding: 6px 10px; border-radius: 6px; color: var(--muted); font: 600 12px var(--mono); }
.tabs .tab-a:hover { color: var(--text); }
.tabs .tab-a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.cc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.cc-kpi { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.cc-kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--k); opacity: .8; }
.cc-big { font: 400 clamp(32px, 3.2vw, 44px)/1.05 var(--serif); letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.cc-of { font-size: .55em; color: var(--muted); }
.cc-sub { font: 12px var(--mono); color: var(--muted); }
.cc-meter { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin: 4px 0 2px; }
.cc-meter span { display: block; height: 100%; border-radius: 3px; background: #8fb3ff; }

.cc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 18px; }
.cc-wide { grid-column: 1 / -1; }
.cc-chart { display: flex; flex-direction: column; }
.cc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.cc-svg .cc-gl { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.cc-svg .cc-gl.is-zero { stroke: var(--line-2); }
.cc-svg .cc-base { stroke: var(--line-2); stroke-width: 1; }
.cc-svg text { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cc-svg .cc-tick { fill: var(--muted); font-size: 11px; }
.cc-svg .cc-xlabel { fill: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cc-svg .cc-xlabel.is-now { fill: var(--text); font-weight: 600; }
.cc-svg .cc-vlabel { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.cc-svg .cc-seg { transition: opacity .15s; }
.cc-svg .cc-seg.is-partial { opacity: .55; }
.cc-svg .cc-hit { fill: transparent; cursor: default; outline: none; }
.cc-svg .cc-hit.on, .cc-svg .cc-hit:focus-visible { fill: rgba(255,255,255,.035); }
.cc-svg .cc-line { fill: none; stroke: var(--up); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cc-svg .cc-area { fill: rgba(46,230,166,.08); }
.cc-svg .cc-dot { fill: var(--up); stroke: var(--panel); stroke-width: 2; }
.cc-svg .cc-cross { stroke: rgba(255,255,255,.18); stroke-dasharray: 3 3; }
.cc-svg .cc-cross[hidden] { display: none; }
.cc-tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 160px; padding: 10px 12px; display: grid; gap: 5px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 36px rgba(0,0,0,.55); font: 12px var(--mono); color: var(--text-2);
}
.cc-tip[hidden] { display: none; }
.cc-tip b { color: var(--text); font-weight: 600; margin-bottom: 2px; }
.cc-tip span { display: flex; align-items: center; gap: 8px; }
.cc-tip i { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.cc-tip em { font-style: normal; margin-left: auto; padding-left: 14px; color: var(--text); }
.cc-tip .tt-total { border-top: 1px solid var(--line-2); padding-top: 5px; margin-top: 2px; color: var(--text); }
.cc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font: 12px var(--mono); color: var(--text-2); }
.cc-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cc-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cc-legend .is-partial-swatch { background: var(--text-2); opacity: .45; }
.cc-total { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font: 13px var(--mono); color: var(--text-2); }
.cc-total b { color: var(--text); font-size: 15px; margin-left: 4px; }
.cc-table { margin-top: 10px; font-size: 13px; }
.cc-table summary { cursor: pointer; font: 12px var(--mono); color: var(--muted); }
.cc-table summary:hover { color: var(--text); }
.cc-table table { margin-top: 8px; }
.cc-split { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 16px; }
.cc-split span { min-width: 4px; }
.cc-hero-num { font: 400 38px/1 var(--serif); margin-bottom: 14px; }
.cc-hero-num span { font: 12px var(--mono); color: var(--muted); margin-left: 6px; }
.cc-sources { list-style: none; margin: 0; padding: 0; display: grid; }
.cc-sources li { display: grid; grid-template-columns: 12px 1fr auto 56px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cc-sources li:last-child { border-bottom: 0; }
.cc-sources i { width: 12px; height: 12px; border-radius: 3px; }
.cc-sources b { font: 500 14px var(--mono); font-variant-numeric: tabular-nums; }
.cc-sources em { font: normal 12px var(--mono); color: var(--muted); text-align: right; }
.cc-foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.cc-walk { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.cc-walk > div:not(.op) { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); min-width: 0; }
.cc-walk span { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cc-walk b { font: 500 16px var(--mono); font-variant-numeric: tabular-nums; }
.cc-walk .op { display: grid; place-items: center; color: var(--muted); font: 16px var(--mono); }
.cc-walk .is-total { border-color: var(--line-2); background: var(--panel-2); }
.cc-walk .cc-walk-side { margin-left: auto; border-style: dashed; }
.cc-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 46px 16px; color: var(--muted); font-size: 13.5px; }
.cc-empty b { color: var(--text-2); font-weight: 500; }
.cc-empty span { max-width: 420px; }
.cc-hold { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cc-hold li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.cc-hold .rk { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); font: 600 11px var(--mono); color: var(--muted); grid-column: 1; grid-row: 1 / 3; }
.cc-hold .tk { font: 600 14px var(--mono); grid-column: 2; grid-row: 1; }
.cc-hold b { font: 500 13px var(--mono); color: var(--up); text-align: right; grid-column: 3; grid-row: 1; }
.cc-hold .wbar { grid-column: 2 / 4; grid-row: 2; width: 100%; margin: 0; }
.cc-only-narrow { display: none; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 8px; }
@media (max-width: 1080px) {
  .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-grid { grid-template-columns: minmax(0, 1fr); }
  .cc-hold { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cc-kpis { gap: 10px; }
  .cc-big { font-size: 30px; }
  .cc-hold { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-walk .op { display: none; }
  .cc-walk > div:not(.op) { flex: 1 1 140px; }
  .cc-walk .cc-walk-side { margin-left: 0; }
  .cc-only-wide { display: none; }
  .cc-only-narrow { display: block; }
  /* 640-unit charts render at ~0.7x on phones: enlarge text in viewBox units */
  .cc-svg .cc-tick, .cc-svg .cc-xlabel { font-size: 15px; }
  .cc-svg .cc-vlabel { font-size: 15px; }
}

/* ---------- footer */
.foot { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 26px 28px 40px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

/* ---------- responsive */
@media (max-width: 1080px) {
  .g-hero, .g-21, .g-market { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; }
  .clock { display: none; }
  main { padding: 20px 16px 32px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .fund-cards { grid-template-columns: minmax(0, 1fr); }
  .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .chart-panel { min-height: 360px; }
  .chart { min-height: 260px; }
  .tabs button { padding: 6px 7px; }
  .section-title h2 { font-size: 26px; }
  .foot { padding: 22px 16px 32px; }
  .hide-sm { display: none; }
  .week { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px; gap: 8px; }
  .week::-webkit-scrollbar { display: none; }
  .day { flex: 0 0 104px; scroll-snap-align: center; }
  .earn-ctrl { position: relative; width: 100%; justify-content: flex-end; }
  .earn-ctrl .pop-wrap { position: static; }
  .popover { left: 0; right: 0; width: auto; }
  .ev { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .ev .logo:not(.logo-xs) { width: 38px; height: 38px; }
  .ev-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; order: -1; }
  .ev-main { order: -2; }
  .ev .logo:not(.logo-xs) { order: -3; }
  .ev-b { font-size: 13.5px; }
  .earn-sum { padding: 12px 16px; }
}
