:root {
  --bg: #07090C; --bg-2: #0A0E12; --surface: #0E1318; --surface-2: #131A20;
  --ink: #EEF2F4; --ink-2: #97A4AC; --ink-3: #6E7B83;
  --green: #46E08A; --green-ink: #04140B; --blue: #6CB4FF; --silver: #C9D1D6; --warn: #FFB199;
  --line: color-mix(in oklab, var(--ink) 11%, transparent);
  --line-2: color-mix(in oklab, var(--ink) 22%, transparent);
  --r: 12px; --r-lg: 18px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --side: 232px; --tabs: 64px;
  --font: "Archivo", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--green); color: var(--green-ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num, td, .money input { font-variant-numeric: tabular-nums; }

.mark { font-stretch: 125%; font-weight: 800; font-size: 1.02rem; letter-spacing: .02em; text-decoration: none; color: var(--ink); display: inline-flex; gap: .35em; }
.mark span { font-weight: 300; color: var(--green); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot .mark { opacity: .6; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 1; } }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 22px 14px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; background: var(--bg); z-index: 5; }
.side__mark { padding: 6px 10px; }
.nav { display: grid; gap: 2px; }
.nav a, .tabs a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-2); border-radius: 10px; position: relative; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
.nav a { padding: 10px 12px; font-weight: 500; }
.nav a svg, .tabs a svg { width: 20px; height: 20px; flex: none; }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
@media (hover: hover) { .nav a:hover { color: var(--ink); background: var(--surface); } }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--green); color: var(--green-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.side__me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: 14px; }
.side__me[aria-current="page"], .side__me:hover { background: var(--surface); color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink); flex: none; }
.top { display: none; }
.view { margin-left: var(--side); padding: 32px clamp(20px, 4vw, 56px) 64px; max-width: calc(var(--side) + 1180px); outline: 0; }
.tabs { display: none; }

@media (max-width: 860px) {
  .side { display: none; }
  .top { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; background: color-mix(in oklab, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .top__me { text-decoration: none; }
  .view { margin-left: 0; padding: 20px 16px calc(var(--tabs) + 32px + env(safe-area-inset-bottom)); }
  .tabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 6; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in oklab, var(--bg) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabs a { flex-direction: column; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; border-radius: 0; }
  .tabs a[aria-current="page"] { color: var(--ink); }
  .tabs a[aria-current="page"] svg { color: var(--green); }
  .tabs .badge { position: absolute; top: 8px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
}

/* ---------- type + layout ---------- */
h1, h2, h3 { margin: 0; font-stretch: 112%; letter-spacing: -0.015em; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.fine { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin-top: 6px; color: var(--ink-2); max-width: 60ch; }
.stack > * + * { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,.04); }
.panel + .panel { margin-top: 16px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); background: color-mix(in oklab, var(--blue) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--blue) 22%, transparent); font-size: 13.5px; color: var(--ink-2); margin-bottom: 18px; }
.note b { color: var(--ink); font-weight: 600; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--blue); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r); background: var(--green); color: var(--green-ink); font-weight: 650; font-stretch: 105%; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform 120ms var(--ease), background-color 140ms var(--ease), opacity 140ms; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn--2 { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--danger { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--warn) 40%, transparent); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (hover: hover) { .btn:not([disabled]):hover { background: color-mix(in oklab, var(--green) 86%, white); } .btn--2:not([disabled]):hover, .btn--ghost:not([disabled]):hover { background: var(--surface-2); } .btn--danger:hover { background: color-mix(in oklab, var(--warn) 10%, transparent) !important; } }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); color: var(--ink); } }
.link { background: none; border: 0; padding: 6px 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: .2em; cursor: pointer; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; line-height: 1.4; }
textarea.input { resize: vertical; min-height: 96px; }
.input:focus, .input:focus-visible { outline: 0; box-shadow: inset 0 0 0 1.5px var(--green); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2397A4AC' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.money { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.money:focus-within { box-shadow: inset 0 0 0 1.5px var(--green); }
.money i { font-style: normal; color: var(--ink-3); }
.money input { width: 100%; min-width: 0; border: 0; background: none; outline: 0; text-align: right; font-size: 15px; -moz-appearance: textfield; appearance: textfield; }
.money input::-webkit-outer-spin-button, .money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.form { display: grid; gap: 14px; }
.err { color: var(--warn); font-size: 13.5px; min-height: 1.4em; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 38px; }

/* ---------- verdict + ledger ---------- */
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 750; font-stretch: 120%; letter-spacing: .05em; color: var(--v); background: color-mix(in oklab, var(--v) 14%, transparent); }
[data-v="buy"] { --v: var(--green); } [data-v="sell"] { --v: var(--blue); } [data-v="hold"] { --v: var(--silver); } [data-v="pass"] { --v: #8C979E; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 8px 0; }
.ledger td { text-align: right; padding: 8px 0; }
.ledger tr + tr > * { border-top: 1px solid var(--line); }
.ledger .net > * { border-top-color: var(--line-2) !important; font-size: 1.15rem; font-weight: 650; color: var(--ink); padding-top: 11px; }
.verdict { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.verdict b { font-stretch: 125%; font-weight: 800; font-size: 2.6rem; line-height: 1; letter-spacing: -0.02em; color: var(--v); }
.verdict span { color: var(--ink-2); font-size: 13.5px; text-align: right; }
.why { margin-top: 8px; }

/* ---------- lists + cards ---------- */
.deals { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.deal { display: grid; grid-template-rows: auto 1fr; text-align: left; border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; overflow: hidden; transition: box-shadow 160ms var(--ease), transform 160ms var(--ease); }
@media (hover: hover) { .deal:hover { box-shadow: inset 0 0 0 1px var(--line-2); transform: translateY(-1px); } }
.deal__img { aspect-ratio: 4 / 3; background: radial-gradient(70% 60% at 50% 60%, #15202A, var(--bg-2)); display: grid; place-items: center; padding: 14px; position: relative; }
.deal__img img { max-height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(0,0,0,.45)); }
.deal__img .pill { position: absolute; top: 10px; left: 10px; }
.deal__img .cat { position: absolute; top: 10px; right: 10px; font-size: 11.5px; color: var(--ink-3); }
.deal__body { padding: 12px 14px 14px; display: grid; gap: 8px; align-content: start; }
.deal__body h3 { font-size: 14.5px; line-height: 1.3; }
.deal__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; color: var(--ink-3); }
.deal__nums b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.deal__nums .pos { color: var(--green); } .neg { color: var(--silver); }
.thumb-svg { width: 46%; color: var(--ink-3); opacity: .8; }

.list { list-style: none; margin: 0; padding: 0; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.list > li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; }
.list > li + li { border-top: 1px solid var(--line); }
.list .t { width: 52px; height: 52px; border-radius: 10px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.list .t img { width: 100%; height: 100%; object-fit: contain; }
.list .t svg { width: 24px; height: 24px; color: var(--ink-3); }
.list .main { min-width: 0; }
.list .main h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.list .main p { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .end { display: flex; align-items: center; gap: 8px; text-align: right; }
.list .end .num { font-weight: 600; }
.list button.main { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.list li.hit { background: color-mix(in oklab, var(--green) 6%, transparent); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stat span { font-size: 12.5px; color: var(--ink-2); }
.stat b { display: block; margin-top: 4px; font-size: 1.45rem; font-weight: 650; font-stretch: 108%; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat b.pos { color: var(--green); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 110px 1fr 90px; gap: 12px; align-items: center; font-size: 13px; }
.bar__track { position: relative; height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.bar__track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; }
.bar__track i.cost { background: var(--line-2); } .bar__track i.val { background: var(--blue); height: 4px; top: 3px; }
.bar span:last-child { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- analyze ---------- */
.drop { position: relative; display: grid; place-items: center; gap: 10px; min-height: 260px; padding: 20px; border-radius: var(--r-lg); background: radial-gradient(70% 60% at 50% 55%, #121B22, var(--bg-2)); box-shadow: inset 0 0 0 1px var(--line-2); text-align: center; color: var(--ink-2); overflow: hidden; cursor: pointer; }
.drop.over { box-shadow: inset 0 0 0 1.5px var(--green); }
.drop svg.big { width: 40px; height: 40px; color: var(--ink); }
.drop img.preview { max-height: 320px; width: auto; border-radius: 10px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .beam { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: var(--green); box-shadow: 0 0 0 1px rgba(70,224,138,.4); animation: sweep 1.4s var(--ease) infinite alternate; }
.drop .beam::before { content: ""; position: absolute; top: 0; bottom: 0; right: 2px; width: 90px; background: linear-gradient(to left, rgba(70,224,138,.22), transparent); }
@keyframes sweep { to { left: calc(100% - 2px); } }
.ident { display: grid; gap: 10px; }
.ident__top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ident h2 { font-size: 1.35rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; padding: 4px 9px; border-radius: 7px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.range { display: grid; gap: 6px; }
.range b { font-size: 1.5rem; font-weight: 650; font-stretch: 108%; }
.conf { font-size: 12px; color: var(--ink-3); }

/* ---------- gate (welcome / login / setup / install) ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); background: radial-gradient(90% 60% at 70% 100%, #0C2A1C 0%, #08110D 40%, var(--bg) 75%); }
.card { width: 100%; max-width: 440px; }
.card > .mark { margin-bottom: 28px; }
.card h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem); }
.card .lead { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.card .form { margin-top: 26px; }
.card .alt { margin-top: 18px; text-align: center; color: var(--ink-2); font-size: 14px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { height: 3px; flex: 1; border-radius: 2px; background: var(--line-2); }
.steps i.on { background: var(--green); }
.interest { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.interest button { min-height: 52px; padding: 0 14px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: left; font-weight: 500; cursor: pointer; }
.interest button[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--green); background: color-mix(in oklab, var(--green) 7%, var(--surface)); }
.install { display: grid; gap: 12px; margin-top: 22px; }
.install li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.install li i { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 13px; }
.install li svg { display: inline; width: 18px; height: 18px; vertical-align: -3px; color: var(--blue); }
.install ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* ---------- sheet + toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(3, 5, 7, .66); animation: fade 200ms var(--ease); }
.sheet__panel { position: relative; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 24px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2), 0 40px 80px rgba(0,0,0,.5); animation: rise 260ms var(--ease); }
.sheet__x { position: absolute; top: 12px; right: 12px; }
#sheet-body > h2 { padding-right: 40px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (max-width: 640px) {
  .sheet { place-items: end stretch; }
  .sheet__panel { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation-name: up; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
}
.toast { position: fixed; z-index: 40; left: 50%; bottom: 24px; translate: -50% 0; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 40px rgba(0,0,0,.45); font-size: 14px; animation: rise 240ms var(--ease); }
@media (max-width: 860px) { .toast { bottom: calc(var(--tabs) + 16px + env(safe-area-inset-bottom)); } }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .drop .beam { display: none; }
}

.requery { display: flex; gap: 8px; }
.requery .input { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.comps { background: var(--bg); }
.comps > li { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 10px 12px; }
.comps .t { width: 44px; height: 44px; }
.comps .t img { object-fit: contain; }
.comps a.main { text-decoration: none; }
@media (hover: hover) { .comps a.main:hover h3 { text-decoration: underline; text-underline-offset: .2em; } }
