/* Atlas dashboard: Atlas app palette (docs/ops/dashboard.html), light by default, dark via prefers-color-scheme. Header and footer stay the site's dark shell.
   Fonts and type/motion tokens come from /assets/atlas-type.css (self-hosted, CSP font-src 'self'), linked before this file. */
:root {
  --bg: #F5F2EA; --panel: #FFFDF8; --fg: #0F1112; --muted: #5E625F; --line: #E1DCCD;
  --accent: #B5761A; --accent-bright: #D89A28; --accent-soft: #F1E2C4; --glow-a: 30%; --good: #3F6B2E; --bad: #B23B2A; --good-soft: #E1EBD7; --bad-soft: #F3DCD6; --bar: #4E7690;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1112; --panel: #1B1E21; --fg: #E7E3D7; --muted: #9A9C95; --line: #2A2D2F;
    --accent: #D89A28; --accent-bright: #EEB64C; --accent-soft: #3A2E17; --glow-a: 55%; --good: #8DB36E; --bad: #E2725F; --good-soft: #1F2A19; --bad-soft: #3A1E19; --bar: #6F98B3;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--t-body)/1.5 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; overflow-wrap: anywhere; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.site-header, footer { background: var(--shell-bg); color: var(--shell-fg); padding-inline: 16px; }
.site-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-block: 8px; border-bottom: 1px solid var(--shell-line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: 36px; flex: none; }
.brand span { font: 500 17px/1.2 var(--font-display); letter-spacing: .04em; }
.brand small { display: block; font: 500 var(--t-label)/1.6 var(--font-data); letter-spacing: .1em; color: var(--shell-muted); }
/* T-262: same nav + beta button as the public header (atlas-public.css); nav hides below 1120px like there */
.site-header nav { display: flex; gap: clamp(18px, 2.2vw, 34px); font-size: 14px; margin-left: auto; }
.site-header nav a { position: relative; white-space: nowrap; text-decoration: none; color: var(--shell-muted); transition: color .2s; }
.site-header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--shell-link); transform: scaleX(0); transform-origin: left; transition: transform .35s; }
.site-header nav a:hover { color: var(--shell-fg); }
.site-header nav a:hover::after { transform: scaleX(1); }
.site-header nav [aria-current="page"] { color: var(--shell-link); }
.site-header .btn-small { display: inline-flex; align-items: center; padding: 11px 18px; font: 600 13px/1 var(--font-body); white-space: nowrap; text-decoration: none; background: #D89A28; color: #0F1112; border: 1px solid #D89A28; border-radius: 999px; transition: background .25s; }
.site-header .btn-small:hover { background: #EEB64C; }
@media (max-width: 1120px) { .site-header nav { display: none; } }
@media (max-width: 560px) { .brand small { display: none; } .site-header .btn-small { display: none; } } /* sign-in status needs the room; "Get the app" sits on the page */
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; min-width: 0; }
.who .user { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.who .link { white-space: nowrap; }
.who select { background: transparent; font: 500 var(--t-label) var(--font-data); color: var(--shell-muted); border: 1px solid var(--shell-line); border-radius: 999px; padding: 1px 8px; }
.who .link, .who a { color: var(--shell-link); }

main { flex: 1; width: 100%; max-width: 960px; margin-inline: auto; padding: 20px 16px 48px; display: grid; gap: 16px; align-content: start; }
footer { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font: 500 var(--t-label)/1.6 var(--font-data); letter-spacing: var(--ls-label); color: var(--shell-muted); border-top: 1px solid var(--shell-line); }
footer a { text-decoration: none; }
footer a:hover { color: var(--shell-link); }

h1 { font: 400 clamp(28px, 4vw, 40px)/1.1 var(--font-display); letter-spacing: -.02em; margin: 0 0 12px; text-wrap: balance; }
h2 { font: 500 var(--t-label)/1.4 var(--font-data); text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--muted); margin: 0 0 12px; }
h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
small { color: var(--muted); font-size: 12px; display: block; }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted, .note, .empty, .status { color: var(--muted); }
.note { font-size: 12px; margin: 12px 0 0; }
.empty { font-size: 14px; margin: 4px 0; }
.status { padding: 24px 0; text-align: center; }
.banner { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: 13px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.board { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.title { font: 600 clamp(22px, 2.4vw, 28px)/1.2 var(--font-body); text-transform: none; letter-spacing: -.01em; color: var(--fg); margin: 0 0 14px; }
h3 { font: 500 var(--t-label)/1.4 var(--font-data); text-transform: uppercase; letter-spacing: var(--ls-label); margin: 0 0 4px; }

/* Hero: the app's PORTFOLIO VALUE block — big mono number, accent change line, chart, range chips. */
.hero { display: grid; gap: 6px; }
.hero h2 { margin: 0; }
.big { font: 500 clamp(44px, 9vw, 72px)/1.05 var(--font-data); letter-spacing: -.02em; margin: 4px 0; }
.delta { font: 500 clamp(17px, 2.2vw, 20px) var(--font-data); margin: 0; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--accent); } .delta.down { color: var(--bad); }
.sub { margin: 0; color: var(--muted); font-size: 15px; }
.hero .note { margin: 0; }
.chart { display: block; width: 100%; height: clamp(140px, 22vw, 220px); margin-top: 12px; overflow: visible; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .08; }
.ranges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ranges button { width: auto; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 0; background: none; color: var(--muted); font: 500 14px var(--font-data); letter-spacing: .06em; }
.ranges button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 0; }
.stats div { text-align: center; padding: 0 8px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font: 500 clamp(24px, 4vw, 32px)/1.2 var(--font-data); }
.stats small { font: 500 var(--t-label) var(--font-data); text-transform: uppercase; letter-spacing: .12em; }

/* Most valuable: card art tiles, horizontal scroll like the app's carousel. */
.tiles { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 180px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.tile { scroll-snap-align: start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 12px; display: grid; gap: 4px; text-align: center; align-content: start; }
.art { position: relative; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden; background: var(--line); margin-bottom: 6px; }
.art .img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; font: 400 40px var(--font-display); color: var(--muted); }
.qty { position: absolute; top: 6px; right: 6px; background: rgba(15, 17, 18, .82); color: #E7E3D7; border-radius: 999px; padding: 1px 8px; font: 500 13px var(--font-data); }
.tile .name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .price { font-size: 17px; font-weight: 500; }
.pct { font: 500 13px var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pct.up { color: var(--accent); } .pct.down { color: var(--bad); } .pct.none { color: var(--muted); }

/* Movers: gainers / losers side by side from 760 px, thumbnail rows. */
.split { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.mini { flex: none; width: 40px; aspect-ratio: 63 / 88; border-radius: 4px; object-fit: cover; background: var(--line); font-size: 18px; }
.card { flex: 1; min-width: 0; }
.card b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .r { display: grid; justify-items: end; gap: 2px; }
.rows .price { font-size: 14px; }

/* Sets in progress: one card per set, value right, bar below (app style). */
.sets { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .sets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sets li { padding: 18px; display: grid; gap: 6px; }
.set-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.set-head b { font-weight: 600; font-size: 16px; }
.set-head .num { font-size: 16px; }
.sets small.num { font-size: 13px; }
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; margin: 4px 0 0; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--bar); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--bar); border-radius: 3px; }

.signin { max-width: 440px; width: 100%; margin: 24px auto; border-top: 2px solid var(--accent); }
form { display: grid; gap: 10px; }
form p { margin: 0; color: var(--muted); font-size: 14px; }
label { font-size: 12px; font-weight: 600; }
input, button { font: inherit; font-size: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 10px 12px; min-width: 0; width: 100%; }
input#code { font-family: var(--font-data); letter-spacing: .4em; text-align: center; }
button { width: auto; background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 600; cursor: pointer; min-height: 44px; }
button:disabled { opacity: .55; cursor: default; }
button.link { background: none; border: 0; padding: 4px 0; min-height: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; font-weight: 500; }
.links { margin: 0; }
.msg { min-height: 1.4em; font-size: 13px; color: var(--bad); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px var(--accent); }
.btn { display: inline-block; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: var(--shell-bg); font-weight: 600; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base); text-decoration: none; }
.empty-state { text-align: center; padding-block: 40px; }
.empty-state p { margin: 0 0 12px; }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }

/* T-237 entrance (added once by dashboard.mjs): sections rise in order, the chart wipes in left to right, tiles and rows follow;
   a range switch slides the new chart in. The value count-up and bar fill run in JS. Reduced motion: none of it (rule above). */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes wipe { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -2% -10% 0); } }
@keyframes chartin { from { opacity: 0; transform: translateX(12px); } }
.board.enter > * { animation: rise 700ms var(--ease-out) both; }
.board.enter > :nth-child(2) { animation-delay: 120ms; } .board.enter > :nth-child(3) { animation-delay: 240ms; }
.board.enter > :nth-child(4) { animation-delay: 360ms; } .board.enter > :nth-child(5) { animation-delay: 480ms; } .board.enter > :nth-child(n+6) { animation-delay: 600ms; }
.board.enter .chart { animation: wipe 1100ms cubic-bezier(.65,0,.35,1) 250ms backwards; }
.board.enter .tile, .board.enter .rows li, .board.enter .sets li { animation: rise 600ms var(--ease-out) both; animation-delay: calc(300ms + var(--i, 0) * 60ms); }
.board.enter .tile:nth-child(2), .board.enter .rows li:nth-child(2), .board.enter .sets li:nth-child(2) { --i: 1; }
.board.enter .tile:nth-child(3), .board.enter .rows li:nth-child(3), .board.enter .sets li:nth-child(3) { --i: 2; }
.board.enter .tile:nth-child(4), .board.enter .rows li:nth-child(4), .board.enter .sets li:nth-child(4) { --i: 3; }
.board.enter .tile:nth-child(n+5), .board.enter .rows li:nth-child(n+5), .board.enter .sets li:nth-child(n+5) { --i: 4; }
.chart.swap { animation: chartin 450ms var(--ease-out) both; }
.tile { transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-base); }
.tile:hover { transform: translateY(-3px); border-color: var(--accent); }

/* Tournaments block (T-263): rows reuse .rows/.card; the whole row links to /t/<ID> */
.t-link { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; text-decoration: none; }
.t-link:hover b { color: var(--accent); }
.t-role { font: 600 var(--t-label)/1.4 var(--font-data); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--accent); }
.t-record { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
