/* insomnAIc.
 *
 * Pit wall, not sports media. This is arithmetic read under a sixty-second
 * clock, so the reference is an instrument panel: tight rows, tabular figures,
 * chrome that gets out of the way.
 *
 * One rule governs type: MONO IS THE INSTRUMENT, SERIF IS THE ANALYSIS.
 * Every figure, badge, label and control is IBM Plex Mono, because those are
 * scanned and have to line up in columns. Every sentence is Source Serif 4,
 * because the guide, the model's answers and the grader's notes are read, and
 * three paragraphs of monospace is a punishment. If a thing is a number, it is
 * mono. If it is a sentence, it is serif. There is no third case.
 *
 * Source Serif 4 is a low-contrast screen serif, which is what keeps it from
 * going thin and muddy on a dark ground the way a Didone would.
 *
 * Both faces are self-hosted. A tool used on draft night must not depend on a
 * font CDN being reachable, and the whole latin set is 134 KB, fetched once.
 *
 * Position colors are the only saturated color in the interface. They are a
 * real convention in this sport, so they carry meaning rather than decoration.
 * Amber is reserved for one job -- something needs you now.
 */

@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/static/fonts/ibmplexmono-400-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/static/fonts/ibmplexmono-400-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/static/fonts/ibmplexmono-600-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/static/fonts/ibmplexmono-600-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4'; font-style: italic; font-weight: 400 600;
  font-display: swap; src: url('/static/fonts/sourceserif4-400-600-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4'; font-style: italic; font-weight: 400 600;
  font-display: swap; src: url('/static/fonts/sourceserif4-400-600-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url('/static/fonts/sourceserif4-400-600-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url('/static/fonts/sourceserif4-400-600-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens live in theme.css, which is loaded first. Only the three names this
   file uses that theme.css calls something else are aliased here; every other
   token (--text, --dim, --line, the position colours, the type scale) already
   matches, which is why none of the rules below needed touching when the whole
   interface changed colour. */
:root {
  --ink: var(--bg);
  --panel: var(--surface);
  --raised: var(--surface-2);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body { line-height: 1.55; }

/* Anything numeric opts into the instrument face, and takes tabular figures
   and tighter leading with it. */
.mono, table, input, select, textarea, button, .btn,
label, th, .pos, .pill, .clock, .rec .nums, .call-score,
#poll-age, header, footer, .eyebrow {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--live);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- chrome ----------
 *
 * The app shell: a dark sidebar down the left with the league switcher on
 * top, a slim bar across the top of the content, and flat grey stock behind
 * white cards. On a phone the sidebar becomes a drawer behind a hamburger. The
 * drawer is a checkbox (#nav-toggle) and two labels, so it needs no script. */

.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-weight: 600; font-size: .98rem;
  letter-spacing: -.01em; color: var(--text);
}
.brand:hover { text-decoration: none; }
/* The wordmark always carries its dot: in the sidebar, the phone top bar and
   over the signed-out pages. */


/* Signed-out pages: no shell, just the wordmark over a centred column. */
.barehead {
  display: flex; gap: 1rem; align-items: center;
  max-width: 1140px; margin: 0 auto; padding: 1rem 1rem 0;
}

body.shell { background-image: none; }
.skip {
  position: absolute; left: -9999px; top: .5rem; z-index: 60;
  background: var(--surface); color: var(--text); padding: .5rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.skip:focus { left: .5rem; }

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.frame { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.frame > main { flex: 1 0 auto; width: 100%; }

.nav-toggle { display: none; }
.scrim, .hamburger, .side-close, .topbar-brand { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--nav-bg); color: var(--nav-text);
  border-right: 1px solid var(--nav-line);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  padding: 0 0 1.5rem;
  scrollbar-width: thin;
  z-index: 40;
}
.side-brand {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h); padding: 0 1rem;
  border-bottom: 1px solid var(--nav-line);
}
.sidebar .brand { color: var(--nav-text); }
.brand-dot {
  flex: none; width: 12px; height: 12px; border-radius: 4px 5px 3px 5px;
  background: var(--nav-mark); box-shadow: 2px 2px 0 var(--accent-2);
}

.league-switch { padding: .9rem 1rem .6rem; }
.league-switch label {
  margin: 0 0 .3rem; color: var(--nav-dim);
  font-size: var(--t-xs); letter-spacing: .08em;
}
.switch-row { display: flex; gap: .35rem; }
.league-switch select {
  flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 600;
  letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background: var(--nav-hover); color: var(--nav-text);
  border: 1px solid var(--nav-line); border-radius: var(--radius-sm);
  padding: .45rem .5rem; min-height: 40px;
}
.league-switch select option { background: var(--surface); color: var(--text); }
.switch-go {
  background: var(--nav-active); color: var(--nav-text);
  border-color: var(--nav-line); border-radius: var(--radius-sm); min-height: 40px;
}
/* With script, the switcher submits on change and the Go button is only
   clutter. It stays for anybody without script. */
.league-switch.auto .switch-go { display: none; }

.side-list { list-style: none; margin: .2rem 0; padding: 0 .55rem; }
.side-list a, .side-logout {
  display: flex; align-items: center; gap: .7rem;
  min-height: 40px; padding: .35rem .6rem;
  color: var(--nav-dim); font-size: var(--t-md);
  border-radius: var(--radius-sm);
  border: 0; background: none; width: 100%; text-align: left;
  position: relative;
}
.side-list a:hover, .side-logout:hover {
  background: var(--nav-hover); color: var(--nav-text); text-decoration: none;
}
.side-list a.active {
  background: var(--nav-active); color: var(--nav-text); font-weight: 600;
}
/* The current page is marked twice, by colour and by a bar, so it does not
   depend on telling two dark purples apart. */
.side-list a.active::before {
  content: ""; position: absolute; left: -.55rem; top: 6px; bottom: 6px;
  width: 4px; border-radius: 0 3px 3px 0; background: var(--nav-mark);
}
.ico {
  flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .9;
}
.side-list form { margin: 0; }
.side-rule { border: 0; border-top: 1px solid var(--nav-line); margin: .7rem 1rem; }
.side-empty { color: var(--nav-dim); font-size: var(--t-sm); padding: .9rem 1rem 0; margin: 0; }
.sidebar :focus-visible { outline-color: var(--nav-mark); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .9rem;
  height: var(--topbar-h); padding: 0 1.5rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--card-line);
}
.crumb {
  margin: 0; min-width: 0; flex: 1;
  font-size: var(--t-sm); color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumb a { color: var(--text); font-weight: 600; }
.crumb-sep { margin: 0 .45rem; color: var(--faint); }
.topbar-user { color: var(--dim); white-space: nowrap; }

main { max-width: 1140px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main.wide { max-width: 1680px; }
.shell main { max-width: 1240px; margin: 0; padding: 1.4rem 1.75rem 3rem; }
.shell main.wide { max-width: none; }

footer {
  border-top: 1px solid var(--card-line);
  margin-top: 3rem;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: baseline;
  max-width: 1140px;
  margin-inline: auto;
}
.shell footer { margin: 0; max-width: none; padding: 1rem 1.75rem 1.5rem; background: var(--topbar-bg); }
.footlinks { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.footlinks a { font-weight: 600; }
.footlinks:last-child { margin-left: auto; }

/* The drawer. Below 900px the sidebar leaves the grid and slides in over
   the page; the scrim behind it is a second label for the same checkbox, so
   a tap outside the drawer closes it. */
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px);
    transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease-out, visibility 0s linear .22s;
    box-shadow: none;
  }
  .nav-toggle {
    display: block; position: fixed; top: 0; left: 0;
    width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none;
  }
  .nav-toggle:checked ~ .app .sidebar {
    transform: none; visibility: visible;
    transition: transform .22s ease-out;
    box-shadow: 6px 0 0 rgba(0, 0, 0, .18);
  }
  .nav-toggle:checked ~ .app .scrim {
    display: block; position: fixed; inset: 0; z-index: 35; margin: 0;
    background: rgba(20, 16, 36, .5);
  }
  body:has(.nav-toggle:checked) { overflow: hidden; }
  .hamburger, .side-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: 0; cursor: pointer;
    color: inherit; border-radius: var(--radius-sm);
    font-size: 1.6rem; line-height: 1; text-transform: none; letter-spacing: 0;
  }
  .hamburger { margin-left: -.6rem; color: var(--text); }
  .hamburger:hover { background: var(--surface-2); }
  .side-close { color: var(--nav-dim); margin-right: -.6rem; }
  .nav-toggle:focus-visible ~ .app .hamburger { outline: 2px solid var(--live); outline-offset: 2px; }
  .topbar { padding: 0 1rem; gap: .5rem; }
  .topbar-brand { display: inline-flex; }
  .topbar-user { display: none; }
  .crumb { border-left: 1px solid var(--card-line); padding-left: .6rem; }
  .crumb:empty { border-left: 0; padding-left: 0; }
  /* No room for the whole trail: the drawer already names the league. */
  .crumb a:has(+ .crumb-sep), .crumb-sep { display: none; }
  .shell main { padding: 1rem .75rem 2.5rem; }
  .shell footer { padding: 1rem .75rem 1.5rem; }
}

/* ---------- type ---------- */

/* The page title is content, so it takes the reading face at a size that
   actually outranks the body. It was .05rem larger than body text before,
   which is not a hierarchy. */
h1 {
  font: 600 var(--t-xl)/1.2 var(--serif);
  margin: 0 0 .35rem; letter-spacing: -.015em; text-wrap: balance;
}

/* Section labels are chrome, not content: they stay on the instrument face,
   uppercase and tracked, so they read as panel legends. */
h2 {
  font: 600 var(--t-xs)/1 var(--mono);
  margin: 1.9rem 0 .55rem;
  text-transform: uppercase; letter-spacing: .14em; color: var(--dim);
}
h3 {
  font: 600 .68rem/1 var(--mono);
  margin: 1.1rem 0 .35rem;
  text-transform: uppercase; letter-spacing: .12em; color: var(--faint);
}

/* A heading that carries a name somebody chose -- a league, a provider -- is
   content, not a panel legend. Uppercasing it does to "Remember the Tight
   Ends" what it did to insomnAIc. */
h2.cardtitle {
  font: 600 1.15rem/1.3 var(--serif);
  margin: 0 0 .15rem;
  text-transform: none; letter-spacing: -.01em; color: var(--text);
}
h2.cardtitle a { color: inherit; }
h2.cardtitle a:hover { color: var(--link); text-decoration: none; }

p.lede { color: var(--dim); margin: 0 0 1.1rem; max-width: 68ch; font-size: var(--t-lg); line-height: 1.5; }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: var(--t-sm); }
.ok { color: var(--good-ink); }
.warn { color: var(--live-ink); }
.error { color: var(--bad-ink); }
code { font-family: var(--mono); background: var(--raised); padding: .05rem .3rem; border-radius: 3px; font-size: .88em; }

/* Measure. main is 1140px wide and prose was running the whole width, which is
   roughly 150 characters a line -- the eye loses its place on the return sweep
   long before that.
   The cap goes on the text elements, never on the container: a container with
   a measure on it also squeezes the data tables inside it down to one word a
   line, which is worse than the problem it fixes. */
.prose p, .prose ul, .prose ol, .prose blockquote,
.prose h1, .prose h2, .prose h3,
.guide-prose p, .guide-prose ul, .guide-prose ol {
  max-width: 74ch;
}

/* The guide is a document rather than a screen of instruments, so it gets a
   centred column. Tables may use its full width; sentences may not. */
.guide-prose { max-width: 960px; margin-inline: auto; }

/* ---------- surfaces ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: .85rem;
}
/* Inside the shell a card is white on grey with a hairline, as in any dense
   data tool: the heavy ink outline is kept for the signed-out pages, where a
   card is the only thing on screen. */
.shell .pill { border-color: var(--dim); }
.shell .panel, .bare .panel {
  border-color: var(--card-line);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--card-line);
  padding: .9rem 1.05rem;
}
.shell h1 { font-size: var(--t-2xl); letter-spacing: -.02em; }
.shell h2 { color: var(--text); }
/* The last thing in a card sits on the card's own padding, not on its
   margin as well. */
.shell .panel > :last-child { margin-bottom: 0; }
.shell .panel > h2:first-child {
  margin: 0 -1.05rem .75rem; padding: 0 1.05rem .65rem;
  border-bottom: 1px solid var(--card-line);
}
.grid { display: grid; gap: .85rem; }
.grid > *, .draftgrid > * { min-width: 0; }
/* The grid gap spaces its cards; a card margin on top of it doubles the gap. */
.grid > .panel { margin-bottom: 0; }
.grid { margin-bottom: .85rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.draftgrid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); gap: .85rem; }
/* In the shell the sidebar takes 248px, so the side column (pick box, roster,
   every team) gets a floor that fits a roster row on one line, and the wide
   column gives way instead. Below 1180px there is no room for both. */
.shell .draftgrid { grid-template-columns: minmax(0, 1fr) clamp(380px, 32%, 480px); }
@media (max-width: 1180px) { .shell .draftgrid, .draftgrid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- forms ---------- */

label {
  display: block; margin: .55rem 0 .18rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint);
}
input, select, textarea, button { font: inherit; font-family: var(--mono); }
input, select, textarea {
  width: 100%;
  color: var(--text); background: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .42rem .55rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--faint); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--good); }
button, .btn {
  cursor: pointer; display: inline-block; width: auto;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .4rem .8rem;
  font-size: .84rem;
}
button:hover, .btn:hover { border-color: var(--faint); text-decoration: none; }
button.primary {
  background: var(--good); color: var(--on-fill); border-color: var(--good); font-weight: 700;
}
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad-ink); border-color: var(--bad); }
button.tiny { padding: .16rem .45rem; font-size: .76rem; }
button:disabled { opacity: .5; cursor: default; }
/* Buttons that sit side by side, each in its own small form, keep a gap
   between them and wrap onto a second row with the same gap. */
form.inline { display: inline-block; margin: 0 .45rem .45rem 0; }
/* A button straight after a field in a stacked form does not touch it. */
input:not([type=hidden]) + button, select + button, textarea + button { margin-top: .6rem; }
.planrow > button { margin-top: 0; }
/* A field for one id or one short value does not need a whole row. */
input.field-md { display: block; max-width: 30rem; }
/* A cron field shows a whole five-field expression ("20 3 * * *"). */
input.cron { width: 11rem; min-width: 9.5rem; font-family: var(--mono); }
/* Previous and next week, as buttons with the same tap size as the others. */
.weeknav { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 .85rem; }
.weeknav .btn { font-size: var(--t-sm); }

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th {
  color: var(--dim); font-weight: 700; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .1em;
  border-bottom-color: var(--line);
  background: var(--thead-bg);
  white-space: nowrap;
}
tbody tr:last-child td, table tr:last-child td { border-bottom: 0; }
/* Dense rows: zebra stripes and a hover so a row can be followed across nine
   columns, and a header that stays put while a long table scrolls under the
   top bar. */
.shell th { position: sticky; top: var(--topbar-h); z-index: 2; }
.shell tr:nth-child(even) > td { background: var(--zebra); }
.shell tr:hover > td { background: var(--row-hover); }
/* Short values (times, ranges, sigma) stay on one line so a row is as tall
   as its text column, not as tall as a number broken in three. */
.nw { white-space: nowrap; }
/* The guide's tables are definitions to read, not rows to scan. */
.shell .guide-prose tr > td { background: none; }

/* A small overview table (mocks, schedules) sits in its own scroll box. Its
   cells keep their width instead of breaking one word a line, so on a narrow
   screen the box scrolls sideways and the page does not. */
table.nowrap td { white-space: nowrap; }
table.schedules td { vertical-align: middle; }
table.schedules td:nth-child(2) { min-width: 9rem; }
table.schedules td:nth-child(4) { min-width: 10rem; }

/* ---------- signals ---------- */

.flash {
  padding: .6rem .8rem; border-radius: var(--radius); margin-bottom: .6rem;
  border: 1px solid var(--line); border-left-width: 3px; font-size: var(--t-md);
}
.flash.ok { border-left-color: var(--good); }
.flash.warn { border-left-color: var(--live); }
.flash.error { border-left-color: var(--bad); }

.pill {
  display: inline-block; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px;
  padding: .02rem .5rem; font-size: .72rem; color: var(--dim);
  letter-spacing: .04em;
}
.pill.ok { color: var(--good-ink); border-color: var(--good-ink); }
.pill.warn { color: var(--live-ink); border-color: var(--live-ink); }
.pill.error { color: var(--bad-ink); border-color: var(--bad-ink); }

/* Position chips are the only saturated color in the interface. */
.pos {
  display: inline-block; min-width: 2.5em; text-align: center;
  border-radius: 3px; padding: 0 .3em;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  color: var(--on-fill);
}
.pos.QB { background: var(--qb); }
.pos.RB { background: var(--rb); }
.pos.WR { background: var(--wr); }
.pos.TE { background: var(--te); }
.pos.K  { background: var(--k); }
.pos.DEF{ background: var(--def); }

/* Flex and bench slots get their own chip colors so every row of the roster
   table is readable at a glance. Flex is a blend of the positions it can
   start; bench is deliberately the dimmest chip on the page. */
.pos.FLEX, .pos.WRRB_FLEX, .pos.REC_FLEX { background: var(--flex); }
.pos.SUPER_FLEX { background: var(--superflex); }
.pos.BN, .pos.IR, .pos.TAXI { background: var(--bench); color: var(--on-bench); }

/* ---------- the clock strip ---------- */

.clock {
  display: flex; gap: 1.5rem; align-items: baseline; flex-wrap: wrap;
  padding: .7rem .9rem; margin-bottom: .85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 3px solid var(--line);
}
.clock.live { border-left-color: var(--live); }
.clock .big {
  font-size: 1.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
}
.onclock { color: var(--live-ink); }
/* The grade headline is a sentence sitting inside an instrument panel, so the
   rule says serif even though its container is mono. The readout beside it
   ("669.9 over replacement") is data and stays mono. */
.clock .headline {
  font-family: var(--serif); font-size: var(--t-md);
  letter-spacing: 0; line-height: 1.5; max-width: 70ch;
}
#poll-age { font-size: .78rem; color: var(--faint); }
#poll-age.warn { color: var(--live-ink); }

/* ---------- the call ---------- */

/* One question matters on a pick clock: who do I take. The answer gets the
   space, and everything below it is supporting instrumentation. */
.call {
  border: 1px solid var(--line);
  border-left: 3px solid var(--good);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(72, 213, 151, .07), transparent 60%);
  padding: .8rem .95rem;
  margin-bottom: .6rem;
}
.call-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.call-name { font: 600 var(--t-2xl)/1.1 var(--serif); letter-spacing: -.025em; }
.call-meta { color: var(--dim); font-size: var(--t-sm); }
.call-score { margin-left: auto; text-align: right; color: var(--dim); font-size: .78rem; }
.call-score b { display: block; font-size: 1.15rem; color: var(--text); }
.call-why { margin: .5rem 0 0; padding: 0; list-style: none; }
.call-why li { color: var(--text); font-size: var(--t-md); line-height: 1.5; padding: .12rem 0 .12rem .9rem; position: relative; }
.call-why li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--faint);
}

/* ---------- recommendation rows ---------- */

.rec { border-bottom: 1px solid var(--line-soft); padding: .38rem .1rem; }
.rec:last-child { border-bottom: 0; }
.rec .top { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.rec .name { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; letter-spacing: 0; }
.rec .nums { margin-left: auto; color: var(--faint); font-size: .76rem; }
.rec ul { margin: .16rem 0 0 3.1rem; padding: 0; list-style: none; color: var(--dim); font-size: var(--t-md); line-height: 1.45; }
.rec ul li::before { content: "\2192\00a0"; color: var(--faint); }
.rec.steal { border-left: 3px solid var(--good); padding-left: .6rem; }

/* ---------- my roster card ---------- */

/* Slot-by-slot roster view: starters flow from the top, bench rows are fainter
   and indented so the split between who starts and who rides the pine is
   obvious at a glance. Unfilled slots stay visible as muted placeholders so
   you always know how many spots remain. */
table.roster td:first-child { width: 2.2rem; white-space: nowrap; }
table.roster .bench-row td { color: var(--dim); }
table.roster .bench-row .pos { opacity: .6; }
table.roster tr.roster-empty td { color: var(--faint); font-style: italic; }
table.roster tr.roster-empty td:first-child { opacity: .5; }

/* ---------- nearly-equal / tie ---------- */
.tie-banner {
  border: 1px solid var(--live);
  border-radius: var(--radius);
  padding: .4rem .6rem;
  margin-bottom: .5rem;
  background: rgba(232, 178, 63, .08);
}
.tie-note { margin: .3rem 0 0; }
.call.steal { border-left-color: var(--good); }
/* The STEAL chip is a small solid badge; keep it strictly to the span so it
   never over-rides the reason text underneath. */
.steal-chip {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--on-fill);
  background: var(--good);
  border-radius: 3px;
  padding: .08rem .4rem;
  margin-top: .3rem;
}
/* The steal reason keeps the ambient dark background and renders the text in
   the readable accent colour, so it stays legible in dark mode. */
.call-why li.steal-reason,
.rec ul li.steal-reason {
  color: var(--good-ink);
  font-weight: 600;
}
/* Colour the bullet to match its text, but respect each list's glyph:
   .call-why bullets are background dots, .rec bullets are text arrows, so
   the arrow gets its colour from `color` and never a solid background block. */
.call-why li.steal-reason::before { background: var(--good); }
.rec ul li.steal-reason::before { color: var(--good-ink); }
.call-why li.bye-clash::before { background: var(--live); }
.rec ul li.bye-clash::before { color: var(--live-ink); }
.bye-clash { color: var(--live-ink); }

/* Positional-run reasoning: "run is on", "don't chase it", "lock the tier". */
.call-why li.run-note,
.rec ul li.run-note { color: var(--dim); }
.call-why li.run-note::before { background: var(--faint); }
.rec ul li.run-note::before { color: var(--faint); }

.call-why li.dont-chase,
.rec ul li.dont-chase { color: var(--bad-ink); font-weight: 600; }
.call-why li.dont-chase::before { background: var(--bad); }
.rec ul li.dont-chase::before { color: var(--bad-ink); }

.call-why li.lock-tier,
.rec ul li.lock-tier { color: var(--good-ink); font-weight: 600; }
.call-why li.lock-tier::before { background: var(--good); }
.rec ul li.lock-tier::before { color: var(--good-ink); }

.call-why li.need-starter,
.rec ul li.need-starter { color: var(--text); font-weight: 600; }
.call-why li.need-starter::before { background: var(--qb); }
.rec ul li.need-starter::before { color: var(--qb); }

.call-why li.fill-lineup,
.rec ul li.fill-lineup { color: var(--live-ink); font-weight: 600; }
.call-why li.fill-lineup::before { background: var(--live); }
.rec ul li.fill-lineup::before { color: var(--live-ink); }

.call-why li.bench-stacked,
.rec ul li.bench-stacked { color: var(--dim); }
.call-why li.bench-stacked::before { background: var(--faint); }
.rec ul li.bench-stacked::before { color: var(--faint); }

.call-why li.thin-depth,
.rec ul li.thin-depth { color: var(--good-ink); }
.call-why li.thin-depth::before { background: var(--good); }
.rec ul li.thin-depth::before { color: var(--good-ink); }

.call-why li.handcuff,
.rec ul li.handcuff { color: var(--rb); font-weight: 600; }
.call-why li.handcuff::before { background: var(--rb); }
.rec ul li.handcuff::before { color: var(--rb); }

.call-why li.draft-deadline,
.rec ul li.draft-deadline { color: var(--live-ink); font-weight: 700; }
.call-why li.draft-deadline::before { background: var(--live); }
.rec ul li.draft-deadline::before { color: var(--live-ink); }

/* ---------- draft entry ---------- */

#search-results { border: 1px solid var(--line); border-radius: var(--radius); margin-top: .3rem; overflow: hidden; }
#search-results button {
  display: block; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0;
  background: var(--panel);
}
#search-results button:last-child { border-bottom: 0; }
#search-results button:hover { background: var(--raised); }

/* ---------- advice ---------- */

/* Admin table edit dropdowns (edit / league override). */
details.mutate { display: inline-block; }
details.mutate > summary {
  cursor: pointer; user-select: none; color: var(--accent-2);
  font-size: .8rem;
}
details.mutate > summary:hover { text-decoration: underline; }
details.mutate[open] > summary::after { content: " ▴"; }
details.mutate > form { margin-top: .5rem; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .6rem; }

.advice-entry { border: 1px solid var(--line); border-radius: var(--radius); margin-top: .45rem; background: var(--ink); }
.advice-entry > summary {
  cursor: pointer; padding: .38rem .6rem; display: flex; gap: .5rem;
  align-items: baseline; flex-wrap: wrap; font-size: .82rem;
}
.advice-entry > summary:hover { background: var(--raised); }
.advice-entry[open] > summary { border-bottom: 1px solid var(--line); }
.advice-body { padding: .65rem .85rem .8rem; }

.prose { font-size: var(--t-base); line-height: 1.68; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

/* "What data was sent to the model" expando inside an advice entry. */
details.sent-data {
  margin-top: .7rem; border-top: 1px dashed var(--line); padding-top: .5rem;
}
details.sent-data > summary {
  cursor: pointer; user-select: none; color: var(--dim);
  font-size: .8rem; display: inline-block;
}
details.sent-data > summary:hover { color: var(--text); }
pre.sent-prompt {
  margin: .4rem 0; padding: .6rem .7rem; background: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--mono); font-size: .76rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; color: var(--dim);
  max-height: 24rem; overflow-y: auto;
}
.prose p { margin: .75rem 0; }
/* The guide is a document, so its headings are content and get the reading
   face at real sizes. Only h4 stays a mono legend. */
.prose h1, .prose h2 {
  font: 600 var(--t-lg)/1.25 var(--serif);
  margin: 1.9rem 0 .5rem; color: var(--text);
  text-transform: none; letter-spacing: -.01em;
}
.prose h3 {
  font: 600 1.02rem/1.3 var(--serif);
  margin: 1.4rem 0 .35rem; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.prose h4 {
  font: 600 var(--t-xs)/1 var(--mono); margin: 1.1rem 0 .3rem;
  color: var(--faint); text-transform: uppercase; letter-spacing: .12em;
}
.prose ul, .prose ol { margin: .4rem 0; padding-left: 1.1rem; }
.prose li { margin: .3rem 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose em { color: var(--dim); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: .8rem 0; }
.prose blockquote { margin: .5rem 0; padding-left: .7rem; border-left: 2px solid var(--line); color: var(--dim); }
.prose a { text-decoration: underline; }

ul.notes { margin: .4rem 0; padding-left: 1.1rem; color: var(--dim); font-size: var(--t-md); line-height: 1.6; max-width: 74ch; }
ul.notes li { margin: .35rem 0; }

/* ---------- draft plan picker ---------- */

.planpick { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .6rem; }
.planrow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.planrow select { flex: 1 1 20rem; width: auto; }

/* ---------- keys ---------- */

.keycard { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; margin-bottom: .6rem; background: var(--ink); }
.keyhead { display: flex; gap: .55rem; align-items: baseline; flex-wrap: wrap; }
.keyfields { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.keyactions { display: flex; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.keyuse { border-top: 1px solid var(--line); margin-top: .55rem; padding-top: .1rem; }
label.tick {
  display: flex; gap: .45rem; align-items: baseline; margin: .18rem 0;
  font-family: var(--serif); font-size: var(--t-md); color: var(--text);
  text-transform: none; letter-spacing: 0;
}
label.tick input { width: auto; margin: 0; }
/* Literally white in both modes on purpose: a QR scanner needs the light
   modules light and the quiet zone white, whatever the page around it does. */
.qr svg { width: 168px; height: 168px; background: var(--qr-paper); padding: 6px; border-radius: var(--radius); }

/* ---------- login ---------- */

.signin { max-width: 380px; margin: 3.5rem auto 1.5rem; }
.promo { max-width: 380px; margin: 0 auto; display: grid; gap: .5rem; }
.promo-card {
  display: block; padding: .7rem .85rem;
  border: 1px solid var(--card-line); border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--card-line);
  background: var(--panel); color: var(--text);
}
.promo-card:hover { border-color: var(--faint); text-decoration: none; background: var(--raised); }
.promo-name { display: block; font-family: var(--mono); font-weight: 600; letter-spacing: .02em; }
.promo-line { display: block; color: var(--dim); font-size: var(--t-sm); margin-top: .15rem; font-family: var(--serif); }
.promo-go { display: block; color: var(--link); font-size: .76rem; margin-top: .35rem; }

/* ---------- guide ---------- */

.guide-prose table td { font-family: var(--serif); font-size: var(--t-md); letter-spacing: 0; line-height: 1.55; }
.guide-prose table td:first-child { font-family: var(--mono); font-size: var(--t-sm); color: var(--text); }

/* ---------- tier chart ----------
 *
 * Boris-style bands: tiers stack down the page, players flow left to right
 * inside each band, and the alternating surface makes a tier boundary read
 * from across the room. Taken players stay in place when shown, struck
 * through and dimmed -- a crossed-out name, not a missing one. */

.tierchart { display: flex; flex-direction: column; gap: .6rem; }

.tier-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left-width: 3px;
  padding: .55rem .7rem;
}
.tierchart .tier-band:nth-child(even) { background: var(--surface-2); }

.tier-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.tier-no {
  font-weight: 700; font-size: .74rem; letter-spacing: .06em;
  border-radius: 3px; padding: .06rem .45rem;
}
/* The tier badge cycles the accent tokens so neighbouring bands never share
   a colour, the way the printed charts alternate their band shading. */
.tierchart .tier-band:nth-child(6n+1) .tier-no { background: var(--accent); color: var(--on-fill); }
.tierchart .tier-band:nth-child(6n+2) .tier-no { background: var(--accent-2); color: var(--on-fill); }
.tierchart .tier-band:nth-child(6n+3) .tier-no { background: var(--accent-3); color: var(--on-accent-3); }
.tierchart .tier-band:nth-child(6n+4) .tier-no { background: var(--te); color: var(--on-fill); }
.tierchart .tier-band:nth-child(6n+5) .tier-no { background: var(--wr); color: var(--on-fill); }
.tierchart .tier-band:nth-child(6n+6) .tier-no { background: var(--qb); color: var(--on-accent-3); }

.tier-players { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.tier-player {
  display: inline-flex; align-items: baseline; gap: .35rem;
  font-size: var(--t-sm); white-space: nowrap;
}
.tp-name { font-weight: 600; }
.tp-team { color: var(--faint); font-size: var(--t-xs); }
.tp-pts { font-family: var(--mono); font-size: var(--t-xs); color: var(--dim); }
.tier-player.gone { opacity: .45; }
.tier-player.gone .tp-name { text-decoration: line-through; }
.tier-player.kept .tp-name::after { content: " (K)"; font-size: var(--t-xs); color: var(--live-ink); }

.tier-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; }
/* The filter bar: one compact strip of chips. The checked chip fills in. */
.shell .tier-controls.panel { padding: .55rem .75rem; gap: .45rem 1.2rem; }
.shell .tier-controls select { width: auto; max-width: 100%; padding: .3rem .5rem; font-size: var(--t-sm); }
.tier-controls-group { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; }
.tier-controls-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint);
}
.tier-check {
  display: inline-flex; align-items: center; gap: .3rem;
  margin: 0; text-transform: none; letter-spacing: 0;
  font-size: var(--t-sm); color: var(--text); font-family: var(--mono);
}
.shell .tier-check {
  border: 1px solid var(--card-line); border-radius: 999px;
  padding: .2rem .7rem; background: var(--surface); cursor: pointer; gap: .4rem;
}
.shell .tier-check:hover { border-color: var(--faint); }
/* The chip is the control: the radio or checkbox inside it stays in the tab
   order and in the accessibility tree, but only the chip is drawn. */
.shell .tier-check { position: relative; }
.shell .tier-check input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.shell .tier-check:has(input:focus-visible) { outline: 2px solid var(--live); outline-offset: 2px; }
.shell .tier-check:has(input[type=checkbox])::before {
  content: ""; width: .7rem; height: .7rem; border: 1.5px solid var(--dim); border-radius: 3px;
}
.shell .tier-check:has(input[type=checkbox]:checked)::before {
  background: var(--good); border-color: var(--good);
}
.shell .tier-check:has(input:checked) {
  background: var(--thead-bg); border-color: var(--text); font-weight: 600;
}
.shell .tier-controls-group { gap: .3rem .35rem; }
.shell .tier-controls button {
  padding: .2rem .9rem; font-size: var(--t-sm); line-height: inherit;
  border-radius: 999px; align-self: center;
}
.shell .tier-controls-label { margin-right: .25rem; }

/* ---------- picks ----------
   Okabe-Ito orange marks a coin flip, vermillion a pick the news flipped. A
   game that has kicked off is locked and dimmed. */
table.picks td { white-space: nowrap; }
table.picks td.why { white-space: normal; min-width: 16rem; }
table.picks tr.coin td:first-child { box-shadow: inset 3px 0 0 var(--oi-orange); }
table.picks tr.locked td { opacity: .5; }
.pill.coin { color: var(--oi-orange); border-color: var(--oi-orange); }
.pill.flip { color: var(--oi-vermillion); border-color: var(--oi-vermillion); }
table.picks tr.me td { font-weight: 600; }

/* ---------- narrow content ----------
 *
 * Between the drawer breakpoint and 1200px the sidebar leaves 650-900px for
 * content, and a nine-column table can be wider than that. The table becomes
 * its own scroll box so the page never scrolls sideways. The row group inside
 * stays a full-width table, so a table that fits still spans its card. */
@media (max-width: 1200px) {
  .shell main table:not(.guide-prose table, .table-scroll > table) {
    display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .shell main table:not(.guide-prose table, .table-scroll > table) > tbody { display: table; width: 100%; }
  /* The wrapper is the scroll box, so the table inside stays a real table. */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  /* Inside a scroll box a sticky top would push the header into the rows. */
  .shell th { top: auto; }
}

/* ---------- phone ----------
 *
 * A draft is the one thing here people genuinely do on a phone, sitting in a
 * room with the draft open on Sleeper. So the board gets the attention: the
 * call stays big, the numbers wrap instead of overflowing, and the panel order
 * puts what you read above what you type.
 *
 * Wide data tables scroll inside themselves rather than pushing the page
 * sideways. The guide is prose in a table, not data, so it stacks instead. */

@media (max-width: 760px) {
  main { padding: .85rem .65rem 2.5rem; }

  /* Nothing may push the page sideways. */
  body { overflow-x: hidden; }
  .panel { padding: .7rem .75rem; }

  /* Data tables become their own scroll container, with the first column
     pinned so a row keeps its name while the numbers slide under it. Inside
     that container a sticky top would push the header down into the rows, so
     the header only sticks sideways here. */
  table:not(.table-scroll > table) { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .shell th { top: auto; }
  .shell th:first-child, .shell td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--panel);
    box-shadow: inset -1px 0 0 var(--card-line);
  }
  .shell th:first-child { background: var(--thead-bg); z-index: 3; }
  .shell tr:nth-child(even) > td:first-child { background: var(--zebra); }
  .shell .guide-prose td:first-child { position: static; box-shadow: none; max-width: none; }
  .shell .guide-prose tr > td,
  .shell .guide-prose tr:nth-child(even) > td:first-child { background: none; }
  /* The pinned column gets at most 42% of the screen, so the numbers have
     room to slide by. Its pills wrap rather than set its width. */
  .shell td:first-child, .shell th:first-child { max-width: 42vw; }
  .shell td:first-child .pill { white-space: normal; border-radius: 6px; letter-spacing: 0; line-height: 1.3; }
  /* Notes need a readable line; the row scrolls sideways instead of
     stacking one word per line. */
  .shell td.why { min-width: 15rem; }
  .shell .tier-check { min-height: 40px; padding: .3rem .85rem; }

  /* The guide is definitions, not data. Stack each row as term then meaning. */
  .guide-prose table { display: block; }
  .guide-prose table tr:first-child { display: none; }
  .guide-prose table tr {
    display: block; border-bottom: 1px solid var(--card-line); padding: .5rem 0;
  }
  .guide-prose table tr:last-child { border-bottom: 0; }
  .guide-prose table td { display: block; padding: .08rem 0; border: 0; }
  .guide-prose table td:first-child { color: var(--text); font-weight: 600; margin-bottom: .2rem; }
  .guide-prose table td:not(:first-child) { color: var(--dim); }

  /* Touch targets. A 20px button is not tappable. */
  button, .btn { min-height: 40px; padding: .5rem .85rem; }
  button.tiny { min-height: 40px; padding: .3rem .7rem; font-size: .8rem; }
  .shell .tier-controls button { min-height: 40px; padding: .3rem .95rem; }
  input, select, textarea { min-height: 42px; font-size: 16px; }
  label.tick { min-height: 34px; align-items: center; }
  label.tick input { width: 20px; height: 20px; }
  #search-results button { min-height: 46px; }

  /* Clock strip: stack rather than crowd. */
  .clock { gap: .5rem .9rem; padding: .6rem .7rem; }
  .clock .big { font-size: 1.15rem; }
  .clock > div:last-child { margin-left: 0; text-align: left; width: 100%; }

  /* The call keeps its weight; it is the reason to look at a phone mid-draft. */
  .call { padding: .7rem .75rem; }
  .call-name { font-size: 1.15rem; }
  .call-score { margin-left: 0; text-align: left; width: 100%; }
  .call-score b { display: inline; margin-right: .4rem; }

  /* Recommendation rows wrap their numbers onto their own line. */
  .rec .nums { margin-left: 0; width: 100%; padding-left: 3.1rem; }
  .rec ul { margin-left: 0; }

  /* Tier chart: the player row is the tappable unit, so let it wrap. */
  .tier-player { white-space: normal; }
  .tier-controls-group, .tier-controls { gap: .4rem .9rem; }

  .keyfields { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .signin, .promo { max-width: none; margin-top: 1.5rem; }

  footer { gap: .9rem; flex-direction: column; padding: 1rem .65rem 2rem; }
  .footlinks:last-child { margin-left: 0; }
}

@media (max-width: 420px) {
  body { font-size: .95rem; }
  h1 { font-size: 1.25rem; }
  .call-name { font-size: 1.6rem; }
  .rec .nums { padding-left: 0; }
  .rec ul { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
