:root {
  --bg: #f7f6f2; --card: #ffffff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e4e2dc;
  --a: #2f6fdb; --b: #e0812b; --good: #2e9a5b; --bad: #c8443c; --dim: #b9b7b0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141416; --card: #1e1e21; --ink: #eeeeef; --muted: #9a9aa0; --line: #333338;
    --a: #6b9cf0; --b: #f0a45e; --good: #5cc487; --bad: #ec6b62; --dim: #55555a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }
header h1 { margin: 0 0 4px; font-size: 28px; }
header p { margin: 0; color: var(--muted); }
nav { margin: 12px 0 4px; font-size: 14px; }
nav a { color: var(--a); margin-right: 14px; }
h2 { font-size: 20px; margin: 34px 0 6px; }
.note { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.tile b { display: block; font-size: 26px; }
.tile span { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; }
svg { display: block; width: 100%; height: auto; }
svg text { fill: var(--muted); font-size: 11px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.t { white-space: normal; min-width: 220px; }
th { color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.young td { color: var(--dim); }
.legend { font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin: 0 4px 0 10px; }
.verdict { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--card); border-left: 4px solid var(--dim); }
.verdict.up { border-color: var(--good); } .verdict.down { border-color: var(--bad); }
a { color: var(--a); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards .legend { grid-column: 1 / -1; }
.vcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); text-decoration: none; }
.vcard:hover { border-color: var(--a); }
.vcard img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.vcard.short img { aspect-ratio: 9 / 16; max-height: 360px; }
.vb { padding: 10px 12px 12px; }
.vt { font-weight: 600; font-size: 15px; line-height: 1.3; margin-bottom: 8px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.stats b { color: var(--ink); font-size: 16px; }
.meter { height: 6px; border-radius: 3px; background: var(--line); margin: 10px 0 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--b); }
.vs { font-size: 12px; color: var(--muted); }

.tile.call { border-left: 5px solid var(--dim); }
.tile.call.up { border-left-color: var(--good); } .tile.call.up b { color: var(--good); }
.tile.call.down { border-left-color: var(--bad); } .tile.call.down b { color: var(--bad); }

.recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.rec { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; color: #fff; text-decoration: none;
  background: #1d1d1f; box-shadow: 0 6px 20px rgba(0,0,0,.18); transition: transform .15s; }
.rec:hover { transform: translateY(-3px); }
.rec .img, .rec .strip { height: 220px; background: #333 center / cover no-repeat; }
.rec .strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.rec .strip a { background: #333 center / cover no-repeat; }
.rec .strip a:hover { filter: brightness(1.15); }
.rec .rt { padding: 14px 16px 16px; }
.rec .rt b { display: block; font-size: 36px; line-height: 1.05; letter-spacing: -1px; color: #ffd34d; }
.rec .rt span { font-size: 14px; color: #d8d8dc; }

/* v7: review pass */
.hero { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.btn { display: inline-block; background: #e5322d; color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.tiles.four { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 520px) { .tiles.four { grid-template-columns: 1fr 1fr; } }
.tile.call b { font-size: 24px; }
.tile.call .lab { display: block; color: var(--ink); font-weight: 600; margin-top: 2px; }
.tile.call .was { display: block; font-size: 12px; }
.card.chart { padding: 10px 14px; }
svg text { font-size: 12px; }
svg text.val { font-size: 13px; font-weight: 700; fill: var(--ink); }
svg text.sub { font-size: 11px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px; scrollbar-width: thin; }
.row > * { scroll-snap-align: start; }
.row .vcard.long { width: 260px; }
.row:has(.vcard.long) { grid-auto-columns: 260px; }
.vcard.short img { aspect-ratio: 9 / 16; max-height: none; }
.vcard.young { opacity: .6; }
.rec .strip a { background-size: contain; background-color: #000; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.miles { list-style: none; margin: 0; padding: 0; }
.miles li { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.miles li:last-child { border-bottom: 0; }
.miles li span { color: var(--muted); min-width: 54px; }
@media (max-width: 520px) {
  .recs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rec .img, .rec .strip { height: 170px; }
  .rec .rt { padding: 10px 12px 12px; }
  .rec .rt b { font-size: 26px; }
  .rec .rt span { font-size: 12px; }
  .tile.call b { font-size: 20px; }
}

.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(96px, 30%) 1fr 56px; align-items: center; gap: 10px; }
.hn { font-weight: 600; font-size: 14px; line-height: 1.2; }
.hn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.ht { height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; }
.ht i { display: block; height: 100%; background: var(--a); border-radius: 7px; }
.hv { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.hb.dim .hv, .hb.dim .hn { color: var(--dim); }

/* goals */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.goal { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; overflow: hidden; }
.gthumb { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 10px; background: #333 center / cover; }
.gname { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding-right: 52px; }
.gnow { margin: 4px 0 8px; }
.gnow b { font-size: 30px; letter-spacing: -1px; }
.gnow span { color: var(--muted); font-size: 15px; }
.gbar { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; }
.gbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--a), var(--good)); }
.gbar.thin { height: 5px; margin-top: 4px; }
.gbar.thin i { background: var(--b); }
.gpct { font-size: 13px; font-weight: 700; margin-top: 4px; }
.gbig { margin-top: 10px; font-size: 12px; color: var(--muted); }
/* wins timeline */
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: 170px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; }
.win { scroll-snap-align: start; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .15s; }
.win:hover { transform: translateY(-3px); }
.wimg { position: relative; height: 150px; background: linear-gradient(135deg, var(--a), var(--good)) center / cover no-repeat; }
.wbadge { position: absolute; left: 10px; bottom: 10px; background: #ffd34d; color: #1d1d1f; font-weight: 800; font-size: 22px; padding: 2px 10px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.wt { padding: 10px 12px 12px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.wdate { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
/* 5 of 60: fanned covers, each cropped to the Short (hqdefault is 4:3 with the 9:16 cover in the middle) */
.rec .strip { display: flex; justify-content: center; align-items: center; padding: 18px 10px; gap: 0; background: radial-gradient(circle at 50% 40%, #3a3a40, #151517); }
.rec .strip a { position: relative; flex: 0 0 auto; height: 100%; aspect-ratio: 9 / 16; background: #000 center / auto 100% no-repeat;
  border-radius: 8px; border: 2px solid #151517; box-shadow: 0 4px 14px rgba(0,0,0,.5); margin-left: -78px; transition: transform .15s; }
.rec .strip a:first-child { margin-left: 0; }
.rec .strip a:nth-child(odd) { transform: rotate(-4deg); }
.rec .strip a:nth-child(even) { transform: rotate(4deg) translateY(4px); }
.rec .strip a:hover { transform: translateY(-8px) scale(1.06); z-index: 5; }
@media (max-width: 520px) { .rec .strip { padding: 14px 6px; } .rec .strip a { margin-left: -60px; } }
.rec .strip a:nth-child(1) { z-index: 4; } .rec .strip a:nth-child(2) { z-index: 3; } .rec .strip a:nth-child(3) { z-index: 2; } .rec .strip a:nth-child(4) { z-index: 1; }
@media (max-width: 520px) {
  .goals { grid-template-columns: 1fr 1fr; gap: 10px; }
  .goal { padding: 12px; }
  .gname { font-size: 11px; padding-right: 0; min-height: 2.6em; }
  .gthumb { display: none; }
  .gnow b { font-size: 22px; }
  .gnow span { font-size: 12px; }
  .gbar { height: 9px; }
  .gpct { font-size: 12px; }
  .gbig { font-size: 11px; margin-top: 6px; }
}

.win.miss .wbadge { background: var(--bad); color: #fff; }
.win.miss .wimg:not([style]) { background: linear-gradient(135deg, #5a2a2a, #2a2a30); }
.win.miss .wimg[style] { filter: grayscale(.55); }
