/* Components. Each is one class (plus modifiers) and uses tokens only. */

/* icons: a mask over the current text colour, so one file serves every theme and state */
.ico { display: inline-block; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-overview { --i: url(/icons/overview.svg); } .ico-coins { --i: url(/icons/coins.svg); } .ico-trades { --i: url(/icons/trades.svg); }
.ico-risk { --i: url(/icons/risk.svg); } .ico-settings { --i: url(/icons/settings.svg); } .ico-activity { --i: url(/icons/activity.svg); }
.ico-plan { --i: url(/icons/plan.svg); } .ico-history { --i: url(/icons/history.svg); } .ico-stop { --i: url(/icons/stop.svg); } .ico-pause { --i: url(/icons/pause.svg); } .ico-play { --i: url(/icons/play.svg); } .ico-out { --i: url(/icons/out.svg); }

/* brand */
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--brand-from), var(--brand-to)); color: #fff; font-weight: 800; letter-spacing: -.02em; }
.wordmark { font-weight: 700; font-size: var(--text-lg); letter-spacing: .01em; }
.lockup { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.lockup .mark { width: 40px; height: 40px; font-size: 1.2rem; }
.lockup .wordmark { font-size: var(--text-xl); }

/* side navigation */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4) var(--s3); background: var(--nav-bg); color: var(--nav-ink); border-right: 1px solid var(--nav-line); overflow-y: auto; }
.side .brandrow { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s3) var(--s5); }
.navlink { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-md); color: var(--nav-muted); text-decoration: none; font-weight: 550; transition: background var(--t-fast), color var(--t-fast); }
.navlink:hover { background: var(--nav-hover); color: var(--nav-ink); }
.navlink[aria-current=page] { background: var(--nav-active); color: #fff; }
.side-foot { margin-top: auto; padding: var(--s3); font-size: var(--text-xs); color: var(--nav-muted); }
.side-foot p { margin: var(--s3) 0 0; }
.side-foot .tools { flex-wrap: wrap; }
.side .input { background: var(--nav-hover); color: var(--nav-ink); border-color: var(--nav-line); }
.side .input:hover { border-color: var(--nav-muted); }
.side .input option { color: #0f1b2d; background: #fff; }
@media (max-width: 900px) {
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: var(--s1); padding: var(--s2) var(--s3); overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--nav-line); }
  .side .brandrow { padding: 0 var(--s3) 0 0; }
  .side .wordmark { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; }
  .side-foot p { display: none; }
  .navlink { white-space: nowrap; min-height: 36px; }
}

/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: var(--top-h); padding: var(--s2) var(--s5); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .brand { display: flex; align-items: center; gap: var(--s3); }
.tools { display: flex; gap: var(--s2); align-items: center; }
.tools .input.inline { width: auto; min-height: 32px; padding: 0 var(--s2); font-size: var(--text-sm); }
.top .btn, .top .muted, .live { white-space: nowrap; }
.top > .spacer { min-width: var(--s2); }
.live { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--text-sm); color: var(--muted); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 2.4s ease-out infinite; }
.live.off::before { background: var(--down); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (max-width: 900px) { .top { padding: var(--s2) var(--s3); } .card { padding: var(--s4); } .tile { padding: var(--s3) var(--s4); } }

/* card, tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.card > h2:first-child, .row-head h2 { font-size: var(--text-md); text-transform: none; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4) var(--s5); box-shadow: var(--shadow); }
.tile .label { color: var(--muted); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tile .value { font-size: var(--text-xl); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.35; margin-top: var(--s1); letter-spacing: -.015em; }
.tile .sub { color: var(--muted); font-size: var(--text-sm); }
.bar { height: 8px; background: var(--surface-2); border-radius: var(--r-pill); margin-top: var(--s3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); width: 0; border-radius: var(--r-pill); transition: width var(--t-med) var(--ease); }

/* forms */
.field { margin-top: var(--s4); }
.field > label, .label { display: block; font-size: var(--text-sm); font-weight: 550; color: var(--ink); margin-bottom: var(--s1); }
.hint { font-size: var(--text-sm); color: var(--muted); margin-top: var(--s1); }
.input { width: 100%; min-height: var(--tap); padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input:hover { border-color: var(--muted); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.inline { width: 7rem; min-height: 32px; padding: 2px var(--s2); }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 32px; color: var(--ink); font-size: var(--text-md); }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.card.form { max-width: 680px; }
.grid2.equal { align-items: stretch; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: end; margin-bottom: var(--s3); }
.toolbar .field { margin-top: 0; min-width: 14rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.btn .ico { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { border-color: var(--muted); background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn.danger { border-color: var(--down); color: var(--down); background: transparent; }
.btn.danger:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--down); }
.btn.danger.armed { background: var(--down); border-color: var(--down); color: #fff; }
.btn.small { min-height: 32px; padding: 0 var(--s3); font-size: var(--text-sm); }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0 var(--s1); min-height: 0; text-decoration: underline; font-weight: 500; }
.btn:disabled { opacity: .55; cursor: default; }
.tabs { display: flex; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.tabs .btn[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; cursor: pointer; }
.sort:hover { color: var(--ink); }

/* messages, badges, chips */
.msg { padding: var(--s3) var(--s4); border-radius: var(--r-md); margin-top: var(--s3); background: var(--info-bg); color: var(--info-ink); border: 1px solid color-mix(in srgb, var(--info-ink) 14%, transparent); }
.msg.ok { background: color-mix(in srgb, var(--up) 12%, var(--surface)); color: var(--ink); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.msg.err { background: var(--danger-bg); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger-ink) 18%, transparent); }
.msg.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 18%, transparent); }
.badge { background: var(--warn-bg); color: var(--warn-ink); padding: 2px var(--s3); border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px var(--s3); border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.active { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.chip.draining { color: var(--warn-ink); background: var(--warn-bg); }

/* table */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: var(--s3) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td:first-child { font-weight: 600; }
th { font-size: var(--text-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
th:first-child { border-top-left-radius: var(--r-sm); } th:last-child { border-top-right-radius: var(--r-sm); }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* chart, meters, figures */
.chart { width: 100%; min-height: 0; }
.meter + .meter { margin-top: var(--s4); }
.meter-head { display: flex; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s1); }
.meter .label { margin-bottom: 0; }
.meter.near .bar > span { background: var(--warn-ink); }
.meter.over .bar > span { background: var(--down); }
.figures { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); margin: var(--s4) 0 0; }
.figures dt { color: var(--muted); }
.figures dd { margin: 0; text-align: right; font-weight: 600; }
.row-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.row-head h2 { margin: 0; }

/* feed, empty and loading states */
.feed { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.feed li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); display: flex; gap: var(--s3); }
.feed li:last-child { border-bottom: 0; }
.feed .t { color: var(--muted); min-width: 3.2rem; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: var(--s5) var(--s4); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-md); margin-top: var(--s3); }
.skeleton { height: 1em; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
main > * { animation: enter var(--t-med) var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* development inbox (only exists when the server runs with it) */
.dev { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: var(--s3); margin-top: var(--s5); font-size: var(--text-sm); }
.dev pre { white-space: pre-wrap; word-break: break-all; margin: var(--s2) 0; font-family: var(--font-mono); }

/* ---- the premium layer (ADR 0062): a calm aurora behind glass, large figures, one gradient accent.
   Colours come from tokens only; every motion is cut by the reduced-motion rule of base.css. */
body { background: var(--bg); background-image: radial-gradient(900px 520px at 12% -8%, var(--glow-1), transparent 70%), radial-gradient(760px 480px at 92% 4%, var(--glow-2), transparent 70%); background-attachment: fixed; background-repeat: no-repeat; }
::selection { background: var(--accent-soft); }

/* side navigation: glass, a soft active pill with a lit edge */
.side { background: var(--nav-bg); backdrop-filter: blur(18px) saturate(1.3); border-right: 1px solid var(--nav-line); padding: var(--s5) var(--s4); gap: var(--s1); }
.side .brandrow { padding: 0 var(--s2) var(--s6); }
.mark { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-from) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.wordmark { font-size: 1.2rem; font-weight: 750; letter-spacing: -.01em; }
.navlink { position: relative; min-height: 42px; border-radius: 12px; padding: 0 var(--s3); font-weight: 560; color: var(--nav-muted); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.navlink:hover { background: var(--nav-hover); color: var(--nav-ink); }
.navlink:hover .ico { transform: scale(1.08); }
.navlink .ico { transition: transform var(--t-fast); }
.navlink[aria-current=page] { background: var(--nav-active); color: var(--nav-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.navlink[aria-current=page] .ico { color: var(--accent); }
.navlink[aria-current=page]::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--brand-from), var(--brand-to)); box-shadow: 0 0 14px var(--brand-from); animation: grow var(--t-med) var(--ease); }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.side-foot { border-top: 1px solid var(--nav-line); padding: var(--s4) var(--s2) 0; }

/* top bar: slim glass, status as a pill */
.top { background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--nav-line); min-height: 60px; }
.live { padding: 5px 12px 5px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--up) 11%, transparent); border: 1px solid color-mix(in srgb, var(--up) 26%, transparent); color: var(--ink); font-weight: 560; }
.live.off { background: color-mix(in srgb, var(--down) 11%, transparent); border-color: color-mix(in srgb, var(--down) 28%, transparent); }
.badge { background: color-mix(in srgb, var(--warn-ink) 14%, transparent); color: var(--warn-ink); border: 1px solid color-mix(in srgb, var(--warn-ink) 28%, transparent); font-size: .68rem; letter-spacing: .12em; }

/* cards: glass with a lit rim */
.card, .tile { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 100%, #fff 3%), var(--surface)); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow), inset 0 1px 0 var(--rim); transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med); }
.card { padding: var(--s5) calc(var(--s5) + 2px); }
.card:hover, .tile:hover { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); }
.card > h2:first-child, .row-head h2 { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: var(--s4); }
.page-head h1 { font-size: 1.9rem; font-weight: 750; letter-spacing: -.025em; background: linear-gradient(90deg, var(--ink) 55%, color-mix(in srgb, var(--ink) 55%, var(--accent))); }
@supports (background-clip: text) or (-webkit-background-clip: text) { .page-head h1 { -webkit-background-clip: text; background-clip: text; color: transparent; } }
@media (forced-colors: active) { .page-head h1, .narrow .lockup .wordmark { background: none; color: CanvasText; } }
.page-head { margin-bottom: var(--s6); }
.wrap { max-width: 1280px; padding: var(--s6) var(--s6) var(--s7); }

/* tiles: an icon chip, a large figure, a spark of the recent past */
.tiles { gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { position: relative; padding: var(--s5); overflow: hidden; }
.tile::after { content: ''; position: absolute; right: -40px; top: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, var(--glow-1), transparent 70%); pointer-events: none; }
.tile:hover { transform: translateY(-3px); }
.tile .head { display: flex; align-items: center; gap: var(--s3); }
.tile .chipicon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); }
.tile .chipicon .ico { width: 17px; height: 17px; }
.tile .label { font-size: .72rem; letter-spacing: .1em; }
.tile .value { font-size: 1.9rem; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; margin-top: var(--s3); }
.tile .sub { margin-top: var(--s1); font-size: var(--text-sm); }
.tile .spark { position: absolute; right: var(--s4); bottom: var(--s4); width: 38%; height: 34px; background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; opacity: .9; }
.value.up, .value.down { text-shadow: 0 0 24px color-mix(in srgb, currentColor 35%, transparent); }

/* meters: a lit gradient bar */
.bar { height: 8px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.bar > span { background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); box-shadow: 0 0 12px color-mix(in srgb, var(--brand-from) 55%, transparent); }
.meter.near .bar > span { background: linear-gradient(90deg, var(--warn-ink), color-mix(in srgb, var(--warn-ink) 55%, #fff)); box-shadow: 0 0 12px color-mix(in srgb, var(--warn-ink) 50%, transparent); }
.meter.over .bar > span { background: linear-gradient(90deg, var(--down), color-mix(in srgb, var(--down) 55%, #fff)); box-shadow: 0 0 12px color-mix(in srgb, var(--down) 55%, transparent); }

/* buttons: a lit primary, quiet secondaries */
.btn { border-radius: 12px; min-height: 42px; border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-2) 70%, transparent); font-weight: 580; }
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn.primary { background: linear-gradient(135deg, var(--brand-from), color-mix(in srgb, var(--brand-from) 78%, var(--brand-to))); color: #fff; border-color: transparent; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-from) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, color-mix(in srgb, var(--brand-from) 88%, #fff), var(--brand-to)); border-color: transparent; box-shadow: 0 10px 28px color-mix(in srgb, var(--brand-from) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.danger { background: color-mix(in srgb, var(--down) 8%, transparent); border-color: color-mix(in srgb, var(--down) 55%, transparent); }
.tabs .btn[aria-pressed=true] { background: linear-gradient(135deg, var(--brand-from), color-mix(in srgb, var(--brand-from) 78%, var(--brand-to))); color: #fff; border-color: transparent; }
.input { border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-color: var(--line-strong); }
.input:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
.msg { border-radius: 12px; }

/* tables: air, small-cap headers, a row you can follow */
th { background: transparent; border-bottom: 1px solid var(--line-strong); font-size: .7rem; letter-spacing: .1em; padding-top: var(--s2); padding-bottom: var(--s2); }
td { padding: 14px var(--s3); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.chip { padding: 3px 11px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.empty { border-radius: 14px; border-style: dashed; background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.feed li { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }

/* the palette and the menu */
.scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; background: color-mix(in srgb, #02030a 55%, transparent); backdrop-filter: blur(6px); animation: fade var(--t-fast) linear; }
.scrim.clear { background: transparent; backdrop-filter: none; padding: 0; display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.palette { width: min(580px, calc(100vw - 2 * var(--s4))); background: var(--glass); backdrop-filter: blur(24px); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 var(--rim); padding: var(--s3); animation: enter var(--t-med) var(--ease); }
.palette-list, .ctx { list-style: none; margin: var(--s2) 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.ctx { max-height: calc(100vh - 16px); overscroll-behavior: contain; }
.palette-item, .ctx-item { display: flex; justify-content: space-between; gap: var(--s4); align-items: center; min-height: 42px; padding: 0 var(--s3); border-radius: 12px; cursor: pointer; }
.palette-item.on, .ctx-item:hover, .ctx-item:focus { background: var(--nav-active); outline: none; }
.ctx-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.palette-none { padding: var(--s3); color: var(--muted); }
.kbd { color: var(--muted); font-size: var(--text-xs); }
.ctx { position: fixed; width: 250px; margin: 0; padding: var(--s1); background: var(--glass); backdrop-filter: blur(24px); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .42), inset 0 1px 0 var(--rim); animation: enter var(--t-fast) var(--ease); }
@media (max-width: 900px) {
  .wrap { padding: var(--s4) var(--s3) var(--s6); }
  .page-head h1 { font-size: 1.5rem; }
  .side { padding: var(--s2) var(--s3); }
  .navlink[aria-current=page]::before { display: none; }
}
.cmdk { border-color: var(--line-strong); border-radius: var(--r-pill); color: var(--muted); min-height: 36px; font-size: var(--text-sm); background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cmdk:hover:not(:disabled) { color: var(--ink); }
.side-foot .btn { margin-top: var(--s3); justify-content: flex-start; }
.top { flex-wrap: nowrap; }
.top .spacer { flex: 1 1 auto; }
@media (max-width: 1100px) { .top { flex-wrap: wrap; } }

/* the hero of the overview: the account value, large, and its curve */
.hero { padding: var(--s6); position: relative; overflow: hidden; background-image: radial-gradient(600px 220px at 85% -10%, var(--glow-1), transparent 70%), linear-gradient(180deg, color-mix(in srgb, var(--surface) 100%, #fff 3%), var(--surface)); }
.hero .label { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0; }
.hero-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.hero-value { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 760; letter-spacing: -.045em; line-height: 1.05; margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.delta { padding: 7px 16px; border-radius: var(--r-pill); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--muted); background: color-mix(in srgb, currentColor 11%, transparent); border: 1px solid color-mix(in srgb, currentColor 24%, transparent); }
.delta:empty { display: none; }
.hero-chart { margin: 0 calc(var(--s3) * -1); }

/* the signed-out screen: a centred lockup and a card with a lit rim */
.narrow { max-width: 468px; margin-top: 8vh; }
.narrow .lockup { justify-content: center; margin-bottom: var(--s3); }
.narrow .lockup .mark { width: 52px; height: 52px; border-radius: 16px; font-size: 1.5rem; }
.narrow .lockup .wordmark { font-size: 2.1rem; letter-spacing: -.03em; background: linear-gradient(90deg, var(--ink), color-mix(in srgb, var(--ink) 45%, var(--accent))); }
@supports (background-clip: text) or (-webkit-background-clip: text) { .narrow .lockup .wordmark { -webkit-background-clip: text; background-clip: text; color: transparent; } }
.narrow > p.muted { text-align: center; margin-bottom: var(--s5); }
.narrow > .card { padding: var(--s6); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent), 0 30px 80px color-mix(in srgb, var(--brand-from) 16%, transparent); }
.narrow .tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 6%, transparent); margin-bottom: var(--s4); }
.narrow .tabs .btn { flex: 1 1 auto; min-height: 38px; border: 0; background: transparent; font-size: var(--text-sm); padding: 0 var(--s2); box-shadow: none; }
.narrow .tabs .btn[aria-pressed=true] { box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-from) 35%, transparent); }
.narrow .btn.primary[type=submit] { width: 100%; min-height: 46px; }

/* rows that name a thing and give its value (the plan), and checkboxes inside a field */
tbody th[scope=row] { text-align: left; text-transform: none; letter-spacing: 0; font-size: var(--text-md); font-weight: 500; color: var(--muted); background: transparent; padding: 14px var(--s3); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
tbody tr:last-child th[scope=row] { border-bottom: 0; }
.field > label.check { display: flex; font-size: var(--text-md); font-weight: 500; margin-bottom: 0; }
.check { padding: 2px 0; }
@media (max-width: 900px) { .cmdk { display: none; } .top .muted { display: none; } }
.tiles:empty { display: none; }
.tile.has-spark { padding-bottom: calc(var(--s5) + 20px); }
.tile.has-spark .sub { max-width: 58%; }
@media (max-width: 900px) { .side-foot { border-top: 0; padding: 0; } .side-foot .btn { margin-top: 0; } }

/* ---- strategies as cards you switch on (the plan page) */
.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.scard { position: relative; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); border-radius: 16px; cursor: pointer; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface-2) 55%, transparent); transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.scard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.scard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.scard-name { font-weight: 650; letter-spacing: -.01em; }
.scard input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.scard-desc { color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.scard-meta { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: auto; padding-top: var(--s1); }
.scard:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 12px 30px color-mix(in srgb, var(--brand-from) 16%, transparent); }
.scard.locked, .scard:has(input:disabled:not(:checked)) { cursor: default; opacity: .6; }
.scard.locked:hover { transform: none; }
.scard:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip.regime::before, .chip.soft::before, .chip.locked::before { display: none; }
.chip.regime { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip.regime.range { color: var(--brand-to); background: color-mix(in srgb, var(--brand-to) 12%, transparent); }
.chip.soft { color: var(--muted); background: transparent; border-style: dashed; }
.chip.locked { color: var(--warn-ink); background: var(--warn-bg); }

/* ---- the frame: a command pill with its key, whose account it is, and motion that arrives in turn */
.cmdk { gap: var(--s3); padding-right: var(--s2); }
.kbd-chip { font: 600 .68rem/1 var(--font-mono); letter-spacing: .04em; padding: 4px 7px; border-radius: 7px; color: var(--muted); border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.account { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); margin-bottom: var(--s3); border-radius: 14px; background: var(--nav-hover); border: 1px solid var(--nav-line); min-width: 0; }
.avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 750; background: linear-gradient(135deg, var(--brand-from), var(--brand-to)); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-from) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.account-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.account-mail { font-size: var(--text-sm); font-weight: 600; color: var(--nav-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-sub { font-size: var(--text-xs); color: var(--nav-muted); }
@media (max-width: 900px) { .account { display: none; } }

/* the page arrives in turn: the heading, then each tile and card a beat after the one before */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-head, .tiles.arrive > .tile, .wrap > div > .card, .wrap > div > .grid2 > *, .wrap > div > .tiles + .card { animation: rise .55s var(--ease) both; }
.tiles.arrive > .tile:nth-child(2), .grid2 > *:nth-child(2) { animation-delay: 70ms; }
.tiles.arrive > .tile:nth-child(3) { animation-delay: 140ms; }
.tiles.arrive > .tile:nth-child(4) { animation-delay: 210ms; }
.wrap > div > .card:nth-of-type(2) { animation-delay: 90ms; }
.wrap > div > .card:nth-of-type(3) { animation-delay: 160ms; }

/* long tables keep their headings in view while they scroll */
.scroll.tall { max-height: min(64vh, 680px); overflow: auto; }
.scroll.tall th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); }

/* the chart's tooltip */
.tip { position: absolute; z-index: 3; pointer-events: none; padding: 8px 12px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 var(--rim); font-size: var(--text-sm); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); }
.tip b { display: block; font-size: 1.05rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tip span { color: var(--muted); font-size: var(--text-xs); }
.u-cursor-pt { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); }
.top .cmdk { border-color: var(--line-strong); }
.kbd-chip { text-transform: none; font-variant-caps: normal; }

/* narrower screens: the table of the coins loses what the hover already says, a list of rights stacks, the bar keeps icons only */
@media (max-width: 1500px) { .why-regime { display: none; } td { padding-left: 10px; padding-right: 10px; } }
@media (max-width: 640px) {
  table.kv, table.kv tbody, table.kv tr, table.kv th, table.kv td { display: block; width: 100%; }
  table.kv tr { padding: var(--s2) 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  table.kv tbody th[scope=row], table.kv td { border: 0; padding: 2px var(--s3); text-align: left; white-space: normal; }
  table.kv td { font-weight: 600; }
  .top .btn:not(.danger) > span:not(.ico) { display: none; }
  .top .btn:not(.danger) { padding: 0 var(--s3); }
}

/* a card that is being asked again (a range of days in the history): dimmed, with a light moving across its top edge */
.busy { position: relative; opacity: .55; pointer-events: none; transition: opacity var(--t-med); }
.busy::after { content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 40%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: sweep 1s var(--ease) infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* a choice of one among a few (the range of the curve): a row of small buttons that read as one */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: var(--text-sm); font-weight: 600; min-height: 30px; padding: 0 var(--s3); border-radius: 9px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--rim) inset, 0 4px 12px rgba(0, 0, 0, .18); }
.hero-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.hero-period { font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

/* tables that must fit the room they are in: less air between the columns, a smaller figure, names cut short (the full name is the cell's title) */
table.dense th, table.dense td { padding-left: 8px; padding-right: 8px; }
table.dense td { font-size: var(--text-sm); padding-top: 11px; padding-bottom: 11px; }
table.dense th { font-size: .64rem; letter-spacing: .06em; }
table.dense .chip { padding: 2px 8px; font-size: .68rem; }
table.dense td .btn.link { font-size: var(--text-xs); }
@media (max-width: 1500px) { table.slim .opt { display: none; } }
@media (max-width: 1280px) { table.dense .opt2 { display: none; } }
@media (max-width: 1250px) { .grid2.equal { grid-template-columns: minmax(0, 1fr); } table.dense th, table.dense td { padding-left: 6px; padding-right: 6px; } }
@media (max-width: 1100px) and (min-width: 901px) { table.dense .opt3 { display: none; } }

/* a REAL account: impossible to mistake for the simulation */
.badge.live-money { background: #b00020; color: #fff; border-color: #b00020; }
