/* Visual language matches stamphost.net: black, deep blue panels, gold accent, uppercase display headings, pill buttons. */
@font-face { font-family: "Lemon Milk"; src: url("../fonts/LEMONMILK-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
:root {
  --bg: #000; --bg2: #060C20; --bg3: #111A30; --line: #1E2536; --text: #fff; --mute: #B4BCCB;
  --accent: #D9A43E; --gold: #D9A43E; --accent2: #7FA8FF; --ref: #9FB0CC; --on-gold: #1E1500;
  --ok: #4cc27d; --warn: #F0883E; --bad: #ef6b60;
  --display: "Lemon Milk", "Montserrat", "Arial Black", sans-serif;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); }
a { color: var(--accent2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; margin: 0 0 .6rem; letter-spacing: .01em; line-height: 1.15; }
h1 { font-size: clamp(26px, 3.6vw, 40px); }
h2 { font-size: 16px; letter-spacing: .03em; }
h3 { font-size: 14px; letter-spacing: .03em; }
p { margin: 0 0 .75rem; }
small, .mute { color: var(--mute); }
small { font-size: .86rem; }
b, strong { font-weight: 600; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid #1c1c1c; }
.bar { display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-decoration: none; color: var(--text); white-space: nowrap; }
nav { display: flex; gap: 22px; margin-left: auto; }
nav a { text-decoration: none; font-weight: 500; font-size: 15px; color: #c9cfdc; padding: 20px 0 17px; border-bottom: 3px solid transparent; white-space: nowrap; }
nav a:hover { color: var(--text); }
nav a.on { color: var(--gold); border-bottom-color: var(--gold); }
main { padding-top: 36px; padding-bottom: 80px; min-height: 70vh; }
footer { border-top: 1px solid var(--line); color: #8a91a1; font-size: 14px; padding: 22px 0; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer .logo { font-size: 14px; margin-right: auto; color: var(--text); }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.top p { margin: 4px 0 0; color: var(--mute); max-width: 46em; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.grid > .card { margin-top: 0 !important; }
.card.gold-top { border-top: 3px solid var(--gold); }
.card h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { border-top: 3px solid var(--gold); }
.stat .lbl { color: var(--mute); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat .val { font-size: 2rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 4px 0; }
.stat .val small { font-size: .9rem; font-weight: 500; }
.stat .sub { color: var(--mute); font-size: .88rem; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

button, .btn { font: 600 15px/1 var(--font); cursor: pointer; border: 0; background: var(--bg); color: var(--text); padding: 12px 20px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px #4A4F5C; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .btn:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
button.primary { background: var(--text); color: #000; box-shadow: none; }
button.primary:hover, .btn.primary:hover { background: #E6E8EE; }
.btn.primary { background: var(--text); color: #000; box-shadow: none; }
button.gold { background: var(--gold); color: var(--on-gold); box-shadow: none; }
button.ghost { background: transparent; box-shadow: none; padding: 8px 12px; color: var(--mute); }
button.ghost:hover { color: var(--text); box-shadow: none; }
button.danger { color: var(--bad); }
button.sm { padding: 7px 14px; font-size: 13.5px; }
button.ghost.sm { padding: 6px 10px; }
input, select, textarea { font: inherit; color: var(--text); background: #0B1328; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
input:focus, select:focus { border-color: var(--gold); }
input[type=checkbox] { accent-color: var(--gold); width: 18px; height: 18px; }
input::placeholder { color: #6c7690; }
input[type=number] { font-variant-numeric: tabular-nums; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--mute); font-weight: 500; }
label.f input, label.f select { font-size: 1rem; color: var(--text); }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > label.f { flex: 1 1 120px; }
.row.center { align-items: center; }
.seg { display: inline-flex; border: 1.5px solid #4A4F5C; border-radius: 999px; padding: 3px; }
.seg button { box-shadow: none; background: transparent; padding: 7px 14px; font-size: 13px; color: #c9cfdc; }
.seg button.on { background: var(--gold); color: var(--on-gold); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; color: var(--mute); font-size: .8rem; padding: 0 12px 10px 0; border-bottom: 3px solid var(--gold); white-space: nowrap; }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
td:first-child { font-weight: 500; }
td.n, th.n { text-align: right; padding-right: 0; padding-left: 12px; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; background: var(--bg3); color: var(--mute); font-weight: 600; }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.notice { border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); padding: 12px 16px; border-radius: 0 12px 12px 0; margin: 12px 0; font-size: .95rem; }
.notice.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.empty { text-align: center; padding: 30px 12px; color: var(--mute); }

.chart-wrap { position: relative; }
svg.chart { display: block; width: 100%; overflow: visible; }
svg text.ax { fill: var(--mute); font-size: 11px; font-family: var(--font); }
svg line.grid { stroke: var(--line); stroke-width: 1; }
svg line.cross { stroke: var(--mute); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-empty { display: flex; align-items: center; justify-content: center; color: var(--mute); border: 1px dashed var(--line); border-radius: 12px; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: #0F1626; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.5); border-radius: 12px; padding: 7px 12px; font-size: .84rem; white-space: nowrap; }
.chart-tip .tip-d { color: var(--mute); margin-bottom: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--mute); margin-bottom: 6px; }
.sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw.sw-dot { width: 8px; height: 8px; border-radius: 50%; }
.sw.sw-ref { height: 0; border-top: 2px dashed currentColor; background: transparent !important; }

/* muscle map */
.bm-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
svg.bm { flex: 1 1 380px; max-width: 640px; width: 100%; height: auto; }
.bm-title { fill: var(--mute); font: 700 40px var(--display); letter-spacing: .12em; }
.bm-wrap { position: relative; }
.bm-base path, .bm-p { fill: #1B2338; stroke: #05080f; stroke-width: 2; stroke-linejoin: round; }
.bm-m { cursor: pointer; stroke: #05080f; stroke-width: 2; stroke-linejoin: round; transition: opacity .15s; }
.bm-sh { pointer-events: none; stroke: none; }
.bm-hot { stroke: #fff; stroke-width: 4; }
.bm-dim { opacity: .5; }
.bm-tip { position: absolute; z-index: 6; width: 290px; max-width: calc(100% - 8px); pointer-events: none; background: #0F1626; border: 1px solid #2c3652; box-shadow: 0 16px 40px rgba(0,0,0,.6); border-radius: 14px; padding: 12px 14px; font-size: .9rem; }
.bm-tip[hidden] { display: none; }
.bm-tt { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.bm-tt span { color: var(--gold); font-size: .82rem; }
.bm-rg { margin-top: 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bm-rg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bm-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0 2px 18px; }
.bm-row b { font-variant-numeric: tabular-nums; }
.bm-none, .bm-note { color: var(--mute); font-size: .78rem; margin-top: 8px; line-height: 1.4; }
.bm-hint { text-align: center; margin: 6px 0 0; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: 600; color: var(--mute); white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.th-sort.on { color: var(--gold); }
.th-sort .arr { font-size: .78rem; opacity: .35; min-width: 1em; }
.th-sort.on .arr { opacity: 1; }
th.n .th-sort { justify-content: flex-end; }
.bm-d { fill: none; stroke: rgba(0,0,0,.45); stroke-width: 1.2; stroke-linecap: round; pointer-events: none; }
.bm-line { fill: none; stroke: #8a93a8; stroke-width: 3; }
.bm-dot { fill: var(--text); stroke: #000; stroke-width: 2; }
.bm-name { fill: var(--text); font: 600 46px var(--font); }
.bm-val { fill: var(--gold); font: 500 36px var(--font); }
.bm-val.zero { fill: #6c7690; }
.bm-l:hover .bm-name { fill: var(--gold); }
.body-legend { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: .82rem; color: var(--mute); margin-top: 8px; }
.ramp { width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, #3B4764), var(--accent)); }

.bar-p { height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.bar-p > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.bar-p.warn > i { background: var(--warn); } .bar-p.bad > i { background: var(--bad); }
details { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 10px 0; background: #0B1328; }
summary { cursor: pointer; font-weight: 600; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #000; padding: 12px 22px; border-radius: 999px; z-index: 50; box-shadow: 0 12px 32px rgba(0,0,0,.5); max-width: 90vw; font-weight: 500; }
.mono { font-family: var(--mono); }
.tag-s { color: var(--mute); font-size: .78rem; font-family: var(--font); text-transform: none; letter-spacing: 0; font-weight: 500; }
.search-res { border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; overflow: hidden; }
.search-res button { display: flex; width: 100%; justify-content: space-between; gap: 12px; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); text-align: left; background: #0B1328; padding: 12px 16px; font-weight: 500; }
.search-res button:hover { background: var(--bg3); box-shadow: none; }
.search-res button:last-child { border-bottom: 0; }
.sess-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sess-sum { color: var(--mute); font-size: .92rem; margin-top: 6px; }
.sess-card.collapsed { padding-top: 16px; padding-bottom: 16px; }
.name-in { font-weight: 600; font-size: 1.05rem; max-width: 220px; }

@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; gap: 20px; padding-bottom: 0; }
  nav a { padding: 10px 0 9px; }
  .bar { gap: 0 20px; }
  .logo { padding: 18px 0 0; }
  .bar { row-gap: 0; }
}
@media (max-width: 700px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  main { padding-top: 24px; }
  .stat .val { font-size: 1.7rem; }
  .card { padding: 18px; }
}
@media print { header, footer, .top button { display: none; } }
td.n + td, th.n + th { padding-left: 18px; }
@media (max-width: 700px) { .bm-name { font-size: 50px; } .bm-val { font-size: 40px; } .bm-title { font-size: 48px; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; color: var(--mute); }
.pager button:disabled { opacity: .35; cursor: default; }
.selband { fill: var(--gold); opacity: .13; pointer-events: none; }
.selline { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.cmp h2 small { color: var(--mute); font-weight: 400; }
.cmp table td:last-child, .cmp table th:last-child { text-align: right; }
tr.picked td { background: rgba(217,164,62,.10); }

 background: #0B1226; border: 1px solid var(--line); color: var(--text); font-size: .9rem; padding: 0; box-shadow: none; }
svg.chart text.ax2 { fill: var(--accent2); }
.lg-note { color: var(--mute); }

.calwrap { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.caldow { display: grid; grid-template-rows: 20px repeat(7, 32px); gap: 4px; font-size: .75rem; color: var(--mute); flex: none; }
.caldow div { line-height: 32px; } .caldow .mlab { line-height: 20px; }
.calscroll { overflow-x: auto; flex: 1; padding-bottom: 8px; }
.calgrid { display: grid; grid-template-rows: 20px repeat(7, 32px); grid-auto-flow: column; grid-auto-columns: 32px; gap: 4px; width: max-content; }
.calgrid .mlab { font-size: .75rem; color: var(--mute); white-space: nowrap; overflow: visible; line-height: 20px; }
.calgrid button { width: 32px; height: 32px; border-radius: 8px; background: #0B1226; border: 1px solid var(--line); color: var(--text); font-size: .78rem; padding: 0; box-shadow: none; }
.calgrid button.on { background: var(--accent2); color: #04101f; border-color: var(--accent2); font-weight: 700; }
.calgrid button.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.calgrid button.fut { opacity: .4; }

svg.chart text.ax3 { fill: var(--ok); }
