:root {
  --bg: #f4efe6; --panel: #fbf8f2; --ink: #2a2520; --muted: #7a6f63; --line: #e2d9cb;
  --accent: #b4532a; --accent-2: #3f6b5c; --soft: #ece4d6; --good: #3f7a52; --bad: #a83a2c;
  --serif: "Instrument Serif", Georgia, serif; --sans: "Geist", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916; --panel: #25211d; --ink: #efe8dc; --muted: #a59a8b; --line: #3a342d;
    --accent: #e07a4c; --accent-2: #7fb3a0; --soft: #2f2a24; --good: #7cc08f; --bad: #e07a6c; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.show-narrow { display: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.err { color: var(--bad); font-size: 13px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--accent); }
.brand-sub { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { width: min(100%, 380px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.gate-form { display: flex; gap: 8px; margin-top: 12px; }
.gate-form input { flex: 1; min-width: 0; }

.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px max(16px, calc((100vw - 1120px) / 2)) 12px; }
.who { display: flex; background: var(--soft); border-radius: 999px; padding: 3px; margin-left: auto; }
.who-btn { border: 0; background: none; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.who-btn[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 max(16px, calc((100vw - 1120px) / 2)); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.main { padding: 24px max(16px, calc((100vw - 1120px) / 2)) 40px; display: flex; flex-direction: column; gap: 16px; }
.foot { padding: 0 max(16px, calc((100vw - 1120px) / 2)) 32px; font-size: 12px; }

h1, h2, h3 { margin: 0; font-weight: 400; }
.title { font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.lede { margin: 6px 0 0; color: var(--muted); }
h2 { font-family: var(--serif); font-size: 24px; }
h3 { font-size: 15px; font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card > .note, .note { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tile .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile .big { font-family: var(--serif); font-size: 34px; line-height: 1.15; margin-top: 4px; }
.tile .sub { font-size: 12px; color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.ex { font-weight: 500; }
td.sm { font-size: 13px; color: var(--muted); }
tr.now td { background: var(--soft); }
.star { color: var(--accent); }
@media (max-width: 640px) {
  .hide-narrow { display: none; }
  .show-narrow { display: block; }
  .top { gap: 10px; }
  .brand-sub { display: none; }
  .title { font-size: 28px; }
  .card { padding: 16px; }
  td { padding: 10px 6px; }
}

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn.ghost { background: none; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--muted); padding: 2px 4px; font-size: 12px; text-decoration: underline; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; align-items: end; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form .full { grid-column: 1 / -1; }

.logex { border-top: 1px solid var(--line); padding: 14px 0; }
.logex:first-of-type { border-top: 0; }
.logex-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logex-last { font-size: 12px; color: var(--muted); }
.sets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.set { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.set span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.set input { width: 52px; border: 0; padding: 4px; background: transparent; text-align: center; font-family: var(--mono); }
.set input:focus { outline: 1px solid var(--accent); }
.rating { display: flex; gap: 4px; flex-wrap: wrap; }

.insight .coach { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.insight h3 { margin: 6px 0; }
.insight p { margin: 0; }
.agent { border-left: 3px solid var(--accent); }
.agent.mike { border-left-color: var(--accent-2); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 16px rgb(0 0 0 / .12); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }

.empty { text-align: center; padding: 32px 16px; }
.empty .title { font-size: 28px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 10; }
ul.plain { margin: 0; padding-left: 18px; }
