/* Layout/structure only - all colors come from the site_theme CSS custom
   properties injected by webapp/theme.py (see base.html's <style> block). */

* { box-sizing: border-box; }

html { color-scheme: light dark; }

/* Blanket tap-target fix for every <details>/<summary> disclosure widget
   site-wide (Owners nav dropdown, every admin expander, News/Trophy
   Case filters, Player/Owner Compare's own expanders, etc.) - none of
   the specific per-widget rules set their own padding, so each one's
   real clickable height was only its text line (~18-22px), well under
   a comfortable touch target. Element-level, so it's always beaten by
   any more specific selector that wants its own spacing instead. */
details > summary { padding: 0.5rem 0; }

body {
  margin: 0;
  background: var(--page_bg);
  color: var(--ink);
  color-scheme: light dark;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}

/* Confirmed real cause (2026-09-15, reproduced with the browser's own OS
   dark mode on, over plain localhost - not a caching/CDN issue): some
   browsers' automatic "dark theme for web content" specifically re-colors
   elements it heuristically detects as hyperlinks, and does this
   inconsistently with `color-scheme: light` above - background and plain
   text were correctly left alone, only <a> text was overridden. Two
   standard counter-measures, both applied to every link rule below:
   `!important` (still generally honored even by these heuristics, unlike
   a plain cascade value) and an explicit `background-color` (some
   heuristics only skip re-coloring an element once they can see a real,
   local light background to preserve contrast against, rather than one
   only inherited from an ancestor). */
/* No !important here (unlike the specific rules below) - a blanket
   `a{!important}` was a real bug: it unconditionally beat every OTHER
   link rule that didn't also carry !important (.tab-nav-item, .site-nav a,
   etc.), regardless of those rules' higher specificity, silently
   recoloring them to --flag. Now that real dark-mode support is declared
   (color-scheme: light dark, above), the browser shouldn't be forcing
   anything on this page at all - the targeted !important rules below are
   belt-and-suspenders for the specific spots that were actually observed
   broken, not a reason to make every link !important by default. */
a { color: var(--flag); }

/* Every owner/player/matchup link (webapp/links.py's owner_link_html etc.)
   uses this class. Explicit var(--ink), NOT `inherit` - a real, separate
   bug found and fixed earlier: browsers restrict what a `:visited` link
   can be styled with (a privacy protection against history-sniffing), and
   `inherit` (a computed/relative value) isn't reliably honored there -
   several browsers silently fall back to their own default `:visited`
   color instead once a link has actually been clicked. A concrete color
   value (a custom property still counts as concrete - it resolves to a
   real color at compute time, unlike `inherit`) doesn't hit that
   restriction - var(--ink) itself still correctly flips between the
   light/dark palettes (see webapp/theme.py), this just avoids `inherit`
   specifically. Every .site-link in this app sits on the general page
   background, not the dark hero card, so var(--ink) is correct in both
   themes - revisit if a future hero-card-hosted link needs var(--chalk)
   instead. */
a.site-link, a.site-link:visited {
  color: var(--ink) !important;
  background-color: transparent !important;
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: 'Oswald', -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-masthead {
  /* masthead_bg/masthead_ink, not the fixed midnight/chalk - matches v3's
     own behavior (see dashboard/utils/theme.py's _SITE_TEXT_DARK
     docstring): dark mode's masthead_bg is the exact same navy the
     masthead always used, so dark mode looks identical to before; only
     light mode gets a real (cooler, paper-toned) band of its own instead
     of always forcing the dark one regardless of theme. */
  background: var(--masthead_bg);
  color: var(--masthead_ink);
  border-bottom: 3px solid var(--flag);
}

.site-masthead-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-brand {
  color: var(--masthead_ink);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}

.v4-badge {
  background: var(--flag);
  color: var(--midnight);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  vertical-align: middle;
}

/* Moved out of the masthead brand line per direct request - a quiet
   footer credit rather than sitting next to the site name on every page. */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  text-align: center;
}

.site-meta { color: var(--masthead_meta); font-size: 0.8rem; white-space: nowrap; }

/* --- Score ticker (below the masthead row, above page content) ---
   Deliberately NOT theme-adaptive - a fixed dark turf-green band in both
   light and dark mode, unlike the masthead (which got its own real
   light/dark treatment earlier). This matches v3's actual current CSS
   (dashboard/utils/theme.py's own .site-ticker-wrap etc. read colors
   from the always-light-palette dict, never swapped for dark mode) -
   restoring it per direct feedback ("I did like the previous
   implementation of the top score tickers being green"), which the
   masthead-toned var(--masthead_bg2)/var(--masthead_ink) version this
   replaced didn't have. */
.site-ticker-wrap {
  background: #1b4332;
  border-top: 1px solid rgba(237,239,234,0.14);
  border-bottom: 1px solid rgba(237,239,234,0.14);
  overflow-x: auto;
}
.site-ticker {
  display: flex;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.site-tick {
  /* flex: 0 0 170px (a genuine fixed width, not flex:0 0 auto+min-width) -
     the actual bug behind "the name wraps instead of truncating": with
     no max-width, the card had nothing stopping it from just growing
     wider to fit a long name, so the grid's 1fr column never needed to
     shrink/truncate at all - it only had somewhere to go once this width
     is truly fixed rather than merely lower-bounded. */
  flex: 0 0 170px;
  /* Hard containment - regardless of what's happening with the internal
     grid's own sizing, nothing can visually escape this card's actual
     170px box once this is set. Belt-and-suspenders on top of the
     flex-basis fix above, not a replacement for it. */
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(237,239,234,0.14);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
  color: #edefea !important;
}
.site-tick:hover { background: rgba(255,255,255,0.12); }
.site-tick-flag {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f2a93b;
  margin-bottom: 0.3rem;
}
/* Grid, not flex+justify-content - a flex child's automatic min-width can
   ignore max-width and either overflow or (as reported: a long owner
   name wrapping into ~6 lines) fall back to wrapping instead of
   truncating, the same class of bug already hit and fixed this way for
   .mu-row/.owner-menu-row. min-width:0 on the name column is what
   actually lets it shrink/truncate instead of forcing the row wider. */
.site-tick-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; font-size: 0.82rem; padding: 0.1rem 0; color: rgba(237,239,234,0.62); }
.site-tick-row.win { color: #edefea; font-weight: 700; }
.site-tick-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* align-items:center - real regression from the mobile-audit's blanket
   `details > summary { padding: 0.5rem 0 }` tap-target fix: Owners (a
   <details><summary>) picked up that padding while the plain <a> links
   next to it didn't, and with no align-items set here this flex row
   defaulted to `stretch`, which stretches each item's BOX to match row
   height but leaves each one's own content sitting wherever its own
   padding puts it - Owners' padding-top visibly pushed its text down
   relative to the unpadded links. Centering (not removing the padding)
   keeps the a11y tap-target win everywhere while making every item's
   text align on the same midline regardless of its own padding. */
.site-nav { display: flex; align-items: center; gap: 1rem; flex: 1; flex-wrap: wrap; }
.site-nav a { color: var(--masthead_ink); text-decoration: none; opacity: 0.85; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }

.logout-form { display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.site-user { font-size: 0.85rem; opacity: 0.75; }

/* Wraps site-nav + logout-form so mobile gets a real hamburger toggle
   with zero JS - the classic checkbox hack (a visually-hidden checkbox +
   a <label for=...> styled as the ☰ icon; CSS keys entirely off
   :checked). NOT a <details> forced open via CSS at desktop widths -
   that was this component's first version, and it failed outright (no
   nav visible at ANY width) because a browser's native "hide
   non-summary content while closed" behavior for <details> isn't
   reliably beatable by an ordinary author rule the way a plain
   checkbox's :checked boolean is - nothing native fights you here.
   Desktop just always shows the panel (checkbox state irrelevant,
   hamburger label hidden); below the breakpoint visibility flips onto
   :checked. */
.mobile-nav { position: relative; display: flex; flex: 1; align-items: center; }
.mobile-nav-checkbox { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.hamburger-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--masthead_ink);
  /* Padding + a matching negative margin - real tap target grows to
     ~40px without changing the header's visual spacing (the glyph
     alone was only ~20px, well under a comfortable touch target). */
  padding: 0.6rem 0.75rem;
  margin: -0.6rem -0.75rem;
}
.mobile-nav-panel { display: flex; align-items: center; gap: 1.5rem; flex: 1; flex-wrap: wrap; }

@media (max-width: 700px) {
  .mobile-nav { display: block; flex: 0 0 auto; margin-left: auto; }
  .hamburger-toggle { display: inline-block; }
  .mobile-nav-panel {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    position: absolute;
    right: 0;
    top: 2.2rem;
    min-width: 200px;
    /* Real bug: a long account email (.site-user, inside .logout-form
       below) has no natural break point and no width limit here, so it
       could force this right-anchored panel wider than the phone screen
       itself - off the left edge, unreachable. */
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    background: var(--masthead_bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  }
  .mobile-nav-checkbox:checked ~ .mobile-nav-panel { display: flex; }
  .site-nav { flex-direction: column; gap: 0.6rem; }
  .logout-form { border-top: 1px solid var(--line); padding-top: 0.6rem; justify-content: space-between; flex-wrap: wrap; }
  .site-user { overflow-wrap: anywhere; min-width: 0; }

  /* The Owners dropdown normally escapes into its own position:absolute
     popover (see .nav-dropdown-panel below) - fine standalone in the
     always-visible desktop nav, but nested inside THIS panel it used to
     render as position:fixed at <=480px, overlaying (and hiding) the
     hamburger label above it - once opened there was no visible way
     back to Home/Seasons/News/Settings/Logout short of a reload. Forcing
     it back to normal in-flow position here means opening Owners just
     expands the list inline in the same scrollable panel - the ☰ label
     stays visible/tappable the whole time to close everything. */
  .mobile-nav .nav-dropdown-panel {
    position: static;
    margin-top: 0.4rem;
    max-width: none;
    max-height: none;
    box-shadow: none;
  }
}

.link-button {
  background: none;
  border: none;
  color: var(--flag);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.login-card {
  max-width: 380px;
  margin: 3rem auto;
  padding: 1.5rem;
}

.login-card .subtitle { color: var(--dusk); margin-top: -0.5rem; }

/* flex-wrap + the email's own overflow-wrap - real bug: a long account
   email has no natural break point, so avatar + email + the "Admin →"
   link (settings.html) could exceed a phone's content width and force
   the whole page to scroll horizontally. */
.settings-identity { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.settings-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.settings-email { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }

.settings-section {
  max-width: 560px;
  margin: 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.settings-section .btn-primary { width: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.settings-section:last-of-type { border-bottom: none; }

.form-error {
  /* Semi-transparent, not a solid light hex - same theme-neutral overlay
     convention as .info-box.error, so it reads correctly on both the
     light and dark page background. */
  background: rgba(194,84,60,0.12);
  color: var(--regret);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-success {
  /* Same theme-neutral overlay convention as .form-error, just the
     "good" palette color instead of --regret. */
  background: rgba(27,67,50,0.12);
  color: var(--turf);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

form label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}

form label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Real tap target is this whole label, not just the 16px checkbox -
     with no padding it was only as tall as its text line (~18-20px),
     used for every opt-in/consent checkbox in the app including the
     "sends real email to the league now" send-confirmation gates. */
  padding: 0.5rem 0;
}
form label.checkbox-label input { display: inline; width: auto; margin-top: 0; }

input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  font-size: 1rem; /* avoids mobile Safari/Chrome auto-zoom on focus, same fix as the dashboard's inject_mobile_input_fix */
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  color: var(--ink);
  background: var(--page_bg);
}
textarea { resize: vertical; }

.btn-primary {
  background: var(--turf);
  color: var(--chalk);
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover { opacity: 0.9; }

.empty-state { color: var(--dusk); }

.archive-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
}

.archive-list { list-style: none; margin: 0; padding: 0; }

.archive-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.5rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.archive-row:hover { background: var(--hero_bg); }
.archive-row.active { background: var(--hero_bg2); border-left: 3px solid var(--flag); }
.archive-subject { display: block; font-weight: 600; }
.archive-meta { display: block; font-size: 0.8rem; color: var(--dusk); }

.archive-preview { min-height: 400px; }
.newsletter-frame {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--line);
  border-radius: 8px;
}
/* Admin's own "Preview As" personalized-addendum iframe - same idea,
   just shorter since it's one small addendum section, not a full issue. */
.newsletter-frame-compact {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Phone width: stack the list above the preview instead of side by side. */
@media (max-width: 700px) {
  .archive-layout { grid-template-columns: 1fr; }
}

/* --- Home / hero / stat sheet / matchups / league pulse --- */

.site-hero {
  /* var(--hero_bg)/var(--hero_bg2), NOT var(--midnight)/var(--midnight2) -
     those are the masthead's own FIXED (never theme-swapped) navy, so
     reusing them here made the hero card go dark-navy-on-dark-navy in
     dark mode (real feedback: "the dark mode background makes the
     headline story background not stand out, it is also blue"). hero_bg
     is v3's actual, already-theme-adaptive token for this exact card
     (warm cream in light mode, a lighter blue-slate in dark mode -
     distinct from --page_bg in both) - this now matches
     dashboard/utils/theme.py's own .site-hero rule instead of an earlier,
     un-updated copy of it. */
  background: linear-gradient(135deg, var(--hero_bg) 0%, var(--hero_bg2) 100%);
  color: var(--ink);
  border-left: 4px solid var(--flag);
  border-radius: 8px;
  padding: 1.4rem 1.75rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.site-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--flag);
  color: var(--midnight);
}
.site-tag.tag-rivalry, .site-tag.tag-lookahead { background: var(--rivalry_dot); color: var(--chalk); }
.site-tag.tag-playoff { background: var(--flag); color: var(--midnight); }
.site-tag.tag-regret { background: var(--regret_dot); color: var(--chalk); }
.site-tag.tag-anomaly { background: var(--anomaly_dot); color: var(--chalk); }
.site-tag.tag-trade { background: var(--trade_dot); color: var(--chalk); }

.site-hero-headline { color: var(--ink); margin: 0.5rem 0 0.3rem; }
.site-hero-dek { color: var(--dusk); margin: 0 0 0.8rem; }

/* Week Recap's "Top Stories" grid - v3 built this from individual
   st.container(border=True) widgets (no reusable CSS class of its own to
   port), so this is a new, from-scratch card matching this app's own
   existing bordered-card conventions (.matchup-card/.info-box). */
.story-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0.75rem 0 1.25rem; }
@media (max-width: 800px) { .story-card-grid { grid-template-columns: 1fr; } }
.story-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
}
.story-card:hover { border-color: var(--flag); }
.story-card .site-card-tag { margin-bottom: 0.3rem; }
.story-card-headline { font-weight: 600; margin: 0.2rem 0 0.3rem; }
.story-card-subtitle { font-size: 0.85rem; color: var(--dusk); }

.btn-link {
  display: inline-block;
  color: var(--flag);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-link:hover { text-decoration: underline; }

.section-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin: 1rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--line);
}

.home-columns { display: grid; grid-template-columns: 3fr 2fr; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .home-columns { grid-template-columns: 1fr; } }

.week-label { font-weight: 600; margin-bottom: 0.4rem; }

.matchup-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: inherit;
}
/* Only real <a> cards (a real matchup_id to link to) get the hover
   affordance - a plain <div> card (no matchup yet, e.g. a bye) isn't
   clickable and shouldn't look like it is. */
a.matchup-card:hover { border-color: var(--flag); }
/* Grid, not inline-block+percentage-widths - the old version wrapped
   unpredictably (both team names stacking, VS floating to the right)
   whenever the two 45%-min-width blocks plus VS's own width/margins
   didn't quite fit one line. Same robust pattern already used for
   Matchup Detail's .mu-row. */
.matchup-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.matchup-side { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex-wrap: wrap; }
.matchup-side-away { justify-content: flex-end; }
.matchup-team-name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchup-score { font-variant-numeric: tabular-nums; color: var(--dusk); flex-shrink: 0; }
.matchup-record, .matchup-projected { font-size: 0.72rem; color: var(--dusk); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.matchup-vs { color: var(--dusk); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.matchup-playoff { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--dusk); }

.live-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.6rem 0;
}
.live-summary .caption { font-size: 0.82rem; color: var(--dusk); margin: 0.15rem 0; }

.stat-sheet { display: flex; flex-direction: column; gap: 0.6rem; }
.stat-row { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.stat-name { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--dusk); }
.stat-body { font-size: 0.95rem; margin-top: 0.15rem; }
.stat-body .num { font-variant-numeric: tabular-nums; font-weight: 600; }

.pulse-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 0.5rem; }
@media (max-width: 800px) { .pulse-columns { grid-template-columns: 1fr; } }
.pulse-columns h4 { margin: 0 0 0.5rem; }

.metric { display: flex; flex-direction: column; margin-bottom: 0.6rem; }
.metric-value { font-size: 1.4rem; font-weight: 600; font-family: 'Oswald', sans-serif; }
.metric-label { font-size: 0.78rem; color: var(--dusk); }

.plain-list { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.plain-list li { padding: 0.15rem 0; }

.transaction-line { margin: 0.3rem 0; font-size: 0.92rem; }

.info-box {
  background: var(--hero_bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}

.log-view {
  background: var(--hero_bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- News / story --- */
.story-article { max-width: 760px; }
.story-subtitle { color: var(--dusk); font-size: 1.05rem; margin-top: -0.4rem; }
.story-body { line-height: 1.6; margin-top: 1rem; }

/* "Mentioned in this story" chip row - port of dashboard/utils/theme.py's
   .site-card-tag/.mention-* rules (a dot + label, not a filled pill like
   .site-tag) - one chip per owner/team, season, week, or player named in
   the story, each linking to that thing's own page. */
.mention-chip-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.3rem 0 1rem; }
.site-card-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.site-card-tag .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
/* Story-type category chips (Week Recap's story card grid) - port of
   dashboard/utils/theme.py's own .site-card-tag.{category} rules, same
   var()s (already emitted for every theme token, not just the mention-*
   ones this file already had) since v4 has one global stylesheet instead
   of Streamlit's per-container CSS injection. */
.site-card-tag.rivalry { color: var(--rivalry); }
.site-card-tag.rivalry .dot { background: var(--rivalry_dot); }
.site-card-tag.playoff { color: var(--playoff); }
.site-card-tag.playoff .dot { background: var(--flag); }
.site-card-tag.lookahead { color: var(--dusk); }
.site-card-tag.lookahead .dot { background: transparent; border: 1px solid var(--dusk); }
.site-card-tag.regret { color: var(--regret); }
.site-card-tag.regret .dot { background: var(--regret_dot); }
.site-card-tag.anomaly { color: var(--anomaly); }
.site-card-tag.anomaly .dot { background: var(--anomaly_dot); }
.site-card-tag.trade { color: var(--trade); }
.site-card-tag.trade .dot { background: var(--trade_dot); }
.site-card-tag.default { color: var(--dusk); }
.site-card-tag.default .dot { background: var(--dusk); }
.site-card-tag.trending { color: var(--playoff); }
.site-card-tag.mention-owner { color: var(--mention_owner); }
.site-card-tag.mention-owner .dot { background: var(--mention_owner); }
.site-card-tag.mention-season { color: var(--mention_season); }
.site-card-tag.mention-season .dot { background: var(--mention_season); }
.site-card-tag.mention-week { color: var(--mention_week); }
.site-card-tag.mention-week .dot { background: var(--mention_week); }
.site-card-tag.mention-player { color: var(--mention_player); }
.site-card-tag.mention-player .dot { background: var(--mention_player); }
.site-card-tag.mention-position { color: var(--mention_position); }
.site-card-tag.mention-position .dot { background: var(--mention_position); }

/* News side panel's collapsed-by-default Filters (real v3 request: "should
   be hidden via drop down by default") - a plain <details>, not JS. */
.news-filters { margin: 0.4rem 0 0.8rem; }
.news-filters summary { cursor: pointer; font-size: 0.85rem; color: var(--dusk); }
.news-filter-form { margin-top: 0.6rem; }
.news-filter-form label { font-size: 0.8rem; margin-bottom: 0.6rem; }
.news-filter-form .btn-primary { padding: 0.5rem; font-size: 0.85rem; }

/* All-Articles archive (/news/archive) - always-visible filters (a full
   page's width to spare, unlike the News side panel's own narrow one). */
.story-archive-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: end;
  margin: 1rem 0 0.5rem;
}
.story-archive-filters .btn-primary { width: auto; padding: 0.6rem 1.2rem; }
@media (max-width: 700px) { .story-archive-filters { grid-template-columns: 1fr 1fr; } }

.story-archive-row {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  text-decoration: none;
  color: var(--ink);
}
.story-archive-row:hover { background: var(--hero_bg); }
.story-archive-headline { font-weight: 600; margin: 0.2rem 0; }
.story-archive-subtitle { color: var(--dusk); font-size: 0.9rem; margin: 0; }

/* --- Story supplements (_story_supplement.html) - the real deterministic
   data behind a season_recap/draft/rivalry/etc. story, alongside its
   narrative. --- */
.champion-podium { display: flex; gap: 1rem; align-items: flex-end; margin: 0.8rem 0 1.2rem; flex-wrap: wrap; }
.podium-spot {
  flex: 1 1 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  text-align: center;
}
.podium-1 { order: 2; border-color: var(--flag); }
.podium-2 { order: 1; }
.podium-3 { order: 3; }
.podium-team { font-weight: 700; font-size: 1.05rem; margin: 0.4rem 0 0.15rem; }
.podium-owner { color: var(--dusk); font-size: 0.85rem; margin-bottom: 0.4rem; }
.podium-record { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }

.wide-table tr.playoff-row { background: rgba(27,67,50,0.1); font-weight: 600; }

/* --- Page layout / site-wide side column --- */
.page-layout.has-side {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 1.75rem;
  align-items: start;
}
.page-layout.no-side { display: block; }

@media (max-width: 900px) {
  .page-layout.has-side { grid-template-columns: 1fr; }
  .page-side { order: 2; }
}

.side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  margin-bottom: 1rem;
}
.side-card-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.side-headline-row {
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  /* !important + explicit background - see the .site-link comment near the
     top of this file for why (forced-dark browser heuristics on <a>). */
  color: var(--ink) !important;
  background-color: transparent !important;
  text-decoration: none;
  font-size: 0.88rem;
}
.side-headline-row:last-of-type { border-bottom: none; }
.side-headline-row:hover { color: var(--flag); }
.side-view-all {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--flag);
  text-decoration: none;
}
.side-view-all:hover { text-decoration: underline; }

.side-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.side-table td { padding: 0.25rem 0.4rem 0.25rem 0; }
.side-table .side-rank { color: var(--dusk); width: 1.4em; }
.side-table .side-num { text-align: right; white-space: nowrap; }

.empty-state.small { font-size: 0.82rem; }
.caption { font-size: 0.82rem; color: var(--dusk); }

/* --- Owner Profile --- */
.owner-hero { display: flex; align-items: center; gap: 1.2rem; }
.owner-hero-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.owner-hero-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--flag); color: var(--midnight);
  font-size: 1.8rem; font-weight: 700; font-family: 'Oswald', sans-serif;
}
.your-profile-badge { font-size: 0.55em; opacity: 0.8; font-weight: 400; }

.metric-row { display: flex; gap: 1.75rem; flex-wrap: wrap; margin: 0.5rem 0 1.2rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.plain-list.bullet li { padding: 0.2rem 0; }

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.trophy-tile { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 0.8rem 0.5rem; }
.trophy-emoji { font-size: 2.2rem; }
.trophy-label { font-weight: 600; font-size: 0.85rem; margin-top: 0.2rem; }
.trophy-count { color: var(--dusk); font-size: 0.85rem; }
.trophy-weeks { margin-top: 0.4rem; font-size: 0.78rem; }
.trophy-weeks summary { cursor: pointer; color: var(--dusk); }

.story-teaser-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
}
.story-teaser-headline { font-weight: 600; margin: 0.2rem 0; }
.story-teaser-body { color: var(--dusk); margin: 0 0 0.4rem; font-size: 0.92rem; }

/* --- Owner Profile tab nav / shared bits --- */
.tab-nav {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.tab-nav-item {
  padding: 0.65rem 0.9rem;
  color: var(--dusk);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-nav-item:hover { color: inherit; }
.tab-nav-item.active { color: inherit; border-bottom-color: var(--flag); }

.inline-form { margin-bottom: 1rem; }
.inline-form label { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.inline-form select { padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; font-size: 0.95rem; }

.chart-embed { margin: 0.75rem 0; overflow-x: auto; }

/* --- Player Comparison tool (_player_comparison.html) --- */
.pc-form { margin: 0.8rem 0 1.2rem; }

.pc-filter-grid {
  /* auto-fit, not a fixed repeat(N) - the unlocked (Seasons > Compare)
     mode has a 6th "Owner(s)" box the locked (Owner Profile Stats tab)
     mode doesn't, so a fixed column count would leave the 6th box
     stranded alone on its own row. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.pc-filter-grid label { font-size: 0.82rem; margin-bottom: 0; }
.pc-filter-grid select[multiple] { height: auto; }
@media (max-width: 900px) {
  .pc-filter-grid { grid-template-columns: 1fr 1fr; }
}
/* A further drop to 1 column on phones - stuck at 2 columns all the way
   down, a <select multiple size="6"> only got ~165px on a ~375px phone,
   silently clipping any player/owner name past ~20 characters with no
   way to see the rest (native <select> options don't wrap or scroll
   horizontally). */
@media (max-width: 480px) {
  .pc-filter-grid, .pc-option-grid { grid-template-columns: 1fr; }
}

.pc-option-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.pc-option-grid label { font-size: 0.82rem; margin-bottom: 0; }
@media (max-width: 900px) {
  .pc-option-grid { grid-template-columns: 1fr 1fr; }
}
.pc-apply { width: auto; padding: 0.6rem 1.4rem; }
.pc-form-actions { display: flex; align-items: center; gap: 1rem; }

.component-rows { display: flex; flex-direction: column; gap: 0.8rem; margin: 0.75rem 0; }
.component-row-label { font-size: 0.85rem; margin-bottom: 0.25rem; }
.progress-bar { background: var(--line); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar-fill { background: var(--flag); height: 100%; }
.component-row-tag { font-size: 0.78rem; color: var(--dusk); margin-top: 0.2rem; }

.draft-class-expander {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.7rem;
}
.draft-class-expander summary { cursor: pointer; font-weight: 600; }

.wide-table { width: 100%; }
.wide-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; color: var(--dusk); padding: 0.3rem 0.6rem 0.3rem 0; border-bottom: 1px solid var(--line); }
.wide-table td { padding: 0.35rem 0.6rem 0.35rem 0; border-bottom: 1px solid var(--line); }
.wide-table.game-log tr.win-row { background: rgba(27,67,50,0.08); }
.wide-table.game-log tr.loss-row { background: rgba(194,84,60,0.08); }

/* Neither .side-table nor .wide-table (nor .site-main/body) has any
   overflow-x guard - once a many-column table (up to ~50 across this
   app, some genuinely unbounded like Owner Compare's per-selected-owner
   columns) gets wider than the viewport, the .side-num/.matchup-score
   nowrap cells push the WHOLE PAGE into horizontal scroll, not just the
   table. Making the table itself the scroll container (not the page)
   is the standard CSS-only fix - no template changes needed since every
   affected table already carries one of these two classes. */
@media (max-width: 700px) {
  table.wide-table, table.side-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  table.wide-table thead, table.wide-table tbody,
  table.side-table thead, table.side-table tbody {
    display: table;
    width: 100%;
  }
}

.btn-link.small { font-size: 0.8rem; }

.info-box.success { background: rgba(27,67,50,0.1); border-color: rgba(27,67,50,0.3); }
.info-box.error { background: rgba(194,84,60,0.1); border-color: rgba(194,84,60,0.3); }

/* --- Matchup Detail: ESPN-style box score. Deliberately NOT collapsed to
   a stacked single column at narrow widths - the whole point is a home-
   vs-away comparison, so it shrinks (smaller type/avatars, dropped pro
   team text) instead of reflowing, all the way down to phone width. --- */
.mu-header {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.mu-team { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.mu-team-away { justify-content: flex-end; text-align: right; }
.mu-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--line); }
.mu-team-info { min-width: 0; }
.mu-team-name { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-team-meta { font-size: 0.72rem; color: var(--dusk); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-score { font-family: 'Oswald', sans-serif; font-size: 1.7rem; font-weight: 700; white-space: nowrap; }
.mu-mid { text-align: center; font-size: 0.68rem; color: var(--dusk); white-space: nowrap; padding: 0 0.3rem; }
.mu-playoff { font-weight: 700; }

.mu-table {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; margin-bottom: 1rem;
}
.mu-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.mu-row:last-child { border-bottom: none; }
.mu-cell { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; min-width: 0; }
.mu-cell-home { justify-content: flex-start; }
/* No flex-direction: row-reverse here - .mu-player-info's flex:1 already
   stretches to fill the cell, so the DOM order alone (points, name,
   image - see _mu_row.html) puts points at the label-adjacent inner edge
   and the photo at the outer edge, mirroring .mu-cell-home. row-reverse
   combined with that same flex:1 middle child was actually flipping
   those two ends the wrong way around - a real bug, not a style choice. */
.mu-cell-away { justify-content: flex-start; }
.mu-cell-label { padding: 0 0.4rem; font-size: 0.7rem; font-weight: 700; color: var(--dusk); text-align: center; white-space: nowrap; }
.mu-headshot { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--line); }
.mu-player-info { min-width: 0; flex: 1; }
.mu-player-name { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-cell-away .mu-player-info { text-align: right; }
.mu-player-team { font-size: 0.7rem; color: var(--dusk); }
.mu-points { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.9rem; min-width: 2.6em; text-align: right; flex-shrink: 0; }
.mu-cell-away .mu-points { text-align: left; }

.mu-row-total { background: var(--hero_bg); }
.mu-row-total .mu-cell { justify-content: center; }
.mu-row-total .mu-points { font-size: 1.05rem; min-width: 0; }

/* --- Matchup browser (a whole .mu-row IS the link here, not just names
   inside it) --- */
.mu-browser-row {
  text-decoration: none;
  color: var(--ink) !important;
  background-color: transparent !important;
}
.mu-browser-row:hover { background-color: var(--hero_bg) !important; }
.mu-row-bye {
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  color: var(--dusk);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .mu-avatar { width: 34px; height: 34px; }
  .mu-score { font-size: 1.3rem; }
  .mu-team-name { font-size: 0.8rem; }
  .mu-team-meta { font-size: 0.62rem; }
  .mu-headshot { width: 22px; height: 22px; }
  .mu-player-team { display: none; }
  .mu-player-name { font-size: 0.74rem; }
  .mu-points { font-size: 0.78rem; min-width: 2em; }
  .mu-cell-label { font-size: 0.6rem; padding: 0 0.2rem; }
  .mu-cell { padding: 0.35rem 0.3rem; gap: 0.25rem; }
}

/* --- Owner Profile > Rosters (per-week snapshot, _roster_row.html) -
   reuses .mu-table/.mu-headshot/.mu-player-info/.mu-player-name/
   .mu-player-team/.mu-points from Matchup Detail's own row layout
   (webapp/matchup_detail.py), just a single-side row instead of a
   paired home/away one, plus a stats column for the extra per-player
   detail (projected points, live game status) that a two-team score
   comparison has no room for. --- */
.roster-row {
  display: grid;
  grid-template-columns: 2.6rem 2.2rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.roster-row:last-child { border-bottom: none; }
.roster-row-label { font-size: 0.7rem; font-weight: 700; color: var(--dusk); }
.roster-row-avatar { display: flex; }
.roster-row-stats { display: flex; align-items: center; gap: 0.5rem; }
.roster-row-proj { font-size: 0.72rem; color: var(--dusk); white-space: nowrap; }
.roster-row-status {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  padding: 0.1rem 0.35rem; border-radius: 4px; white-space: nowrap;
}
.roster-status-pre { color: var(--dusk); background: var(--line); }
.roster-status-in { color: var(--turf); background: rgba(27,67,50,0.14); }
.roster-status-post { color: var(--ink); background: var(--line); }
@media (max-width: 480px) {
  .roster-row { grid-template-columns: 2rem 1.8rem 1fr auto; gap: 0.35rem; padding: 0.4rem 0.4rem; }
  .roster-row-proj { display: none; }
}

/* --- Player Profile --- */
.player-hero { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.25rem; }
.player-hero-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--line); flex-shrink: 0; }
.player-hero h1 { margin: 0; }

/* --- Owner Compare ---
   <select multiple class="pc-toggle-select"> (click-to-toggle, no
   Ctrl/Cmd needed - see base.html's own script) rather than a checkbox
   grid, for the same reason and matching the same pattern as the Player
   Comparison tool's own filters (_player_comparison.html). */
.compare-picker { margin: 1rem 0 1.5rem; }
.compare-select { max-width: 320px; margin-bottom: 0.8rem; }
.compare-submit { width: auto; margin-top: 0.6rem; padding: 0.55rem 1.4rem; }

/* --- Owners nav dropdown --- */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown summary {
  list-style: none; cursor: pointer;
  /* masthead_ink, not the fixed chalk - same fix as .site-brand/.site-nav a,
     missed here originally. chalk stays near-white regardless of theme,
     which only worked while the masthead was always dark; light mode's
     masthead is now a real light band of its own (see .site-masthead). */
  color: var(--masthead_ink); opacity: 0.85;
  font: inherit;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover { opacity: 1; text-decoration: underline; }
.nav-dropdown[open] summary { opacity: 1; }
.nav-dropdown[open] summary::after { content: " \25b4"; }
.nav-dropdown:not([open]) summary::after { content: " \25be"; }

.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.6rem;
  background: var(--page_bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
  padding: 0.75rem;
  min-width: 300px;
  max-width: min(360px, 90vw);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 50;
}

.owner-menu-tools { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.owner-menu-tool-chip {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--flag);
  border-radius: 6px;
  /* !important + explicit background - see the .site-link comment near the
     top of this file for why (forced-dark browser heuristics on <a>). */
  color: var(--ink) !important; background-color: transparent !important; text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
}
.owner-menu-tool-chip:hover { background: var(--hero_bg); }
.owner-menu-tool-arrow { color: var(--flag); }

.owner-menu-division {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--flag);
  margin: 0.7rem 0 0.3rem;
}
.owner-menu-division-inactive { color: var(--dusk); }

.owner-menu-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  padding: 0.25rem 0;
  font-size: 0.85rem;
}
.owner-menu-name { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner-menu-name-inactive { font-weight: 400; color: var(--dusk); }
.owner-menu-side { display: flex; align-items: baseline; gap: 0.5rem; white-space: nowrap; flex-shrink: 0; }
.owner-menu-team { min-width: 0; color: var(--dusk); font-size: 0.8rem; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-menu-record { font-variant-numeric: tabular-nums; font-weight: 600; }

@media (max-width: 480px) {
  /* .nav-dropdown-panel itself no longer needs an override here - it
     only ever appears nested inside .mobile-nav now, where the more
     specific .mobile-nav .nav-dropdown-panel rule already forces
     position:static at every width <=700px (see that rule's own
     comment for why). */
  .owner-menu-team { max-width: 7em; }
}
