/* ============================================================================
   site.css - shared stylesheet for nhltradetree.ca
   All page CSS lives here (no inline <style> blocks in templates).
   Design tokens and conventions: see DESIGN.md at the repo root.
   Extracted from per-template <style> blocks on 2026-07-19; selectors are
   page-specific by class name, verified collision-free across templates.
   ============================================================================ */

/* Barlow Condensed - self-hosted, latin subset (DESIGN.md section 3) */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-condensed-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/barlow-condensed-700.woff2") format("woff2");
}

:root {
  /* Page surface */
  --ice: #eef3f6;

  /* Type roles */
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  /* Console navy: search card, code panels, dark chrome */
  --navy-deep: #0f0f23;
  --navy:      #1a1a2e;
  --navy-2:    #16213e;
  --navy-edge: #2d2d5e;

  /* Semantic event colors - color always carries meaning (DESIGN.md) */
  --trade:      #0891b2;  /* trade event (swimlane) */
  --trade-hi:   #0c7ea6;
  --trade-mid:  #0a6a8c;
  --trade-lo:   #08526e;
  --acquire:    #FFE500;  /* acquisition callout */
  --draft-deep: #2e1065;  /* draft origin */
  --draft:      #4c1d95;
  --draft-tint: #c4b5fd;
  --history:    #fbbf24;  /* origin / backward chain */
  --forward:    #4ade80;  /* afterward / outcome chain */

  /* Neutral stat-sheet surfaces */
  --line:        #e2e8f0;
  --surface-2:   #f8fafc;
  --muted:       #64748b;
  --text-strong: #0f172a;
}

/* ============================================================================
   Base (all pages) - from base.html
   ============================================================================ */
    body { padding-top: 4.5rem; background: var(--ice); }

    h1, h2, h3, h4, h5, h6, .modal-title {
      font-family: var(--display);
      font-weight: 600;
      letter-spacing: .01em;
    }

    /* House eyebrow label (DESIGN.md section 3) */
    .eyebrow {
      font-size: .72rem;
      font-weight: 700;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--muted);
    }

    /* Page header: eyebrow + condensed title + one-line sub (landing register) */
    .page-head { margin: 1.75rem 0 1.5rem; }
    .page-head h2 {
      font-size: clamp(2rem, 4.5vw, 2.7rem);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .01em;
      line-height: 1.05;
      color: var(--text-strong);
      margin: .2rem 0 .3rem;
    }
    .page-sub {
      color: var(--muted);
      font-size: .95rem;
      max-width: 42rem;
      margin: 0;
    }

    /* Centered content column for browse/list pages */
    .page-wrap { max-width: 1240px; margin: 0 auto; }

    /* White sheet card: tables sit on the ice inside one of these */
    .sheet-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: .5rem;
      box-shadow: 0 2px 8px rgba(15,23,42,.05);
      overflow: hidden;
    }
    .sheet-card > .table,
    .sheet-card .table-responsive > .table { margin-bottom: 0; }
    .sheet-card-bar {
      display: flex;
      align-items: center;
      gap: .75rem;
      flex-wrap: wrap;
      padding: .6rem .9rem;
      background: var(--surface-2);
      border-bottom: 1px solid var(--line);
    }

    /* Scoreboard table header - navy strip, condensed caps */
    .table-scoreboard thead th {
      background: var(--navy);
      color: #fff;
      border-color: var(--navy-edge);
      font-family: var(--display);
      font-weight: 600;
      font-size: .95rem;
      text-transform: uppercase;
      letter-spacing: .05em;
      white-space: nowrap;
    }

    /* Input width utilities (replace inline style attributes) */
    .field-num   { width: 90px; }
    .field-num-sm{ width: 80px; }
    .field-team  { width: 70px; }
    .field-search{ max-width: 280px; }
    .col-narrow  { width: 90px; }
    .col-date    { width: 140px; }

    /* Navbar: navy console chrome, scoreboard type */
    .site-nav {
      background: var(--navy);
      border-bottom: 1px solid var(--navy-edge);
    }
    .site-nav .navbar-brand {
      font-family: var(--display);
      font-weight: 700;
      font-size: 1.35rem;
      letter-spacing: .05em;
      text-transform: uppercase;
    }
    .site-nav .nav-link {
      font-family: var(--display);
      font-weight: 500;
      font-size: 1.05rem;
      letter-spacing: .06em;
      text-transform: uppercase;
      color: rgba(255,255,255,.72);
      border-bottom: 2px solid transparent;
    }
    .site-nav .nav-link:hover { color: #fff; }
    .site-nav .nav-link.active {
      color: #fff;
      border-bottom-color: rgba(255,255,255,.85);
    }
    @media (max-width: 991.98px) {
      /* Collapsed menu: roomier touch targets, underline off */
      .site-nav .nav-link {
        padding-top: .6rem;
        padding-bottom: .6rem;
        border-bottom: none;
      }
      .site-nav .nav-link.active { color: #fff; font-weight: 700; }
    }

    :focus-visible {
      outline: 2px solid var(--trade);
      outline-offset: 2px;
    }

    @media (prefers-reduced-motion: reduce) {
      #tree-search-btn.loading::after { animation: none; }
    }
    pre.tree-output {
      background: var(--navy);
      color: #c8c8d8;
      padding: 1.5rem;
      border-radius: .5rem;
      font-size: .85rem;
      line-height: 1.6;
      white-space: pre;
      overflow-x: auto;
      border: 1px solid var(--navy-edge);
      box-shadow: 0 4px 16px rgba(0,0,0,.35);
    }
    .conf-high   { color: #198754; font-weight: 600; }
    .conf-medium { color: #fd7e14; font-weight: 600; }
    .conf-low    { color: #dc3545; font-weight: 600; }
    .raw-text    { font-family: monospace; font-size: .875rem; background: var(--surface-2);
                   padding: .5rem .75rem; border-radius: .25rem; }
    .card + .card { margin-top: 1.25rem; }

/* ============================================================================
   Trade tree (/tree) - from tree.html
   ============================================================================ */
/* -- Search form ----------------------------------------------------------- */
.tree-search-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border: 1px solid var(--navy-edge);
  border-radius: .5rem;
  /* keep Bootstrap's muted text readable on the navy console */
  --bs-secondary-color: #8d8dc0;
}
.tree-search-card label {
  color: #7878aa;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: .3rem;
  display: block;
}
.tree-search-card .form-control {
  background: var(--navy-deep);
  border: 1px solid var(--navy-edge);
  color: #e0e0ff;
  transition: border-color .15s, box-shadow .15s;
}
.tree-search-card .form-control:focus {
  background: var(--navy-deep);
  border-color: #5555aa;
  color: #e0e0ff;
  box-shadow: 0 0 0 .2rem rgba(85,85,170,.25);
}
.tree-search-card .form-control::placeholder { color: #44446a; }
.tree-search-card .form-select {
  background-color: var(--navy-deep);
  border: 1px solid var(--navy-edge);
  color: #e0e0ff;
  /* Bootstrap's chevron, recolored for the dark console */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238d8dc0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.tree-search-card .form-select:focus {
  border-color: #5555aa;
  box-shadow: 0 0 0 .2rem rgba(85,85,170,.25);
}
.depth-select { width: 72px; }

/* -- Player header --------------------------------------------------------- */
.player-header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--line);
}
.player-header h4 {
  margin: 0;
  font-weight: 700;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.depth-badge {
  background: var(--line);
  color: var(--muted);
  font-size: .72rem;
  font-family: monospace;
  padding: .2rem .55rem;
  border-radius: .25rem;
}

/* -- Trade swimlane -------------------------------------------------------- */
.trade-swimlane {
  background: linear-gradient(135deg, var(--trade-hi) 0%, var(--trade-mid) 60%, var(--trade-lo) 100%);
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.22);
  margin-bottom: 1.5rem;
}

/* Scroll container: wide trees scroll horizontally instead of squishing */
.tree-scroll { overflow-x: auto; margin-bottom: 1.5rem; }
.tree-scroll > .trade-swimlane { width: fit-content; min-width: 100%; margin-bottom: 0; }

.swimlane-meta {
  background: rgba(0,0,0,.22);
  padding: .4rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sw-date {
  font-family: monospace;
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.95);
  flex-shrink: 0;
}
.sw-note {
  font-size: .75rem;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* min-width: 0 so the nowrap note never widens a content-sized swimlane */
  flex: 1 1 auto;
  min-width: 0;
}

/* Timeline bar */
.swimlane-timeline {
  display: flex;
  align-items: center;
  padding: .65rem 1.5rem;
}
.tl-line {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,.6);
}
.tl-arrow {
  color: white;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 .2rem;
}
.tl-bubble {
  width: 54px;
  height: 54px;
  background: white;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--trade);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  text-transform: uppercase;
  flex-shrink: 0;
  margin: 0 .4rem;
}

/* Body */
.swimlane-body {
  display: flex;
  /* center vertically so a short side sits beside a tall one, not above a cavern */
  align-items: center;
  padding: .5rem 1.25rem 1.75rem;
  gap: .5rem;
}
.sw-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sw-divider {
  width: 1px;
  min-height: 80px;
  background: rgba(255,255,255,.18);
  align-self: stretch;
  margin: .25rem 0;
  flex-shrink: 0;
}

/* Team acquires box */
.team-acquires-box {
  background: var(--acquire);
  color: #111;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .35rem 1rem;
  border-radius: .25rem;
  text-align: center;
  white-space: nowrap;
}

/* Tree connectors */
.tree-trunk {
  width: 2px;
  height: 20px;
  background: rgba(255,255,255,.6);
  margin: 0 auto;
}

.tree-children {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.tree-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 20px;
}

/* Horizontal bar spanning from center of first to center of last child */
.tree-child::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,.6);
}
.tree-child:first-child::before { left: 50%; }
.tree-child:last-child::before  { right: 50%; }
.tree-child:only-child::before  { display: none; }

/* Vertical drop from the bar to the asset */
.tree-child::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: rgba(255,255,255,.6);
}

/* Asset nodes */
.asset-node {
  color: white;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  line-height: 1.25;
  padding: .2rem .5rem;
  text-decoration: none !important;
  display: block;
  min-width: 9rem;
  max-width: 16rem;
}
a.asset-node:hover { opacity: .8; color: white; }
.asset-node-focus {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.asset-node-pick {
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}
.asset-node-sub {
  font-size: .7rem;
  font-weight: 400;
  color: rgba(255,255,255,.6);
  margin-top: .15rem;
  display: block;
  text-align: center;
}

/* Forward chain */
.forward-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chain-arrow-down {
  color: rgba(255,255,255,.6);
  font-size: 1.3rem;
  line-height: 1.1;
}
.chain-to-box {
  background: var(--acquire);
  color: #111;
  font-family: var(--display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: .2rem;
  text-align: center;
  white-space: nowrap;
  margin-bottom: .1rem;
}
.chain-current {
  font-size: .7rem;
  color: rgba(255,255,255,.5);
  font-style: italic;
  text-align: center;
}

/* -- Sub-swimlane (nested recursive trades) ------------------------------- */
.chain-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.chain-connector-line {
  width: 2px;
  height: 14px;
  background: rgba(255,255,255,.5);
}
.chain-connector-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid rgba(255,255,255,.5);
}
.chain-connector-up .chain-connector-arrow {
  border-top: none;
  border-bottom: 7px solid rgba(255,255,255,.5);
  order: -1;
}

.sub-swimlane {
  background: rgba(0,0,0,.2);
  border-radius: .4rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  /* hug content: a narrow nested trade shouldn't stretch into a wide empty box */
  max-width: 100%;
}
.sub-swimlane-meta {
  background: rgba(0,0,0,.22);
  padding: .2rem .7rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sub-swimlane-body {
  display: flex;
  align-items: center;
  padding: .3rem .7rem .8rem;
  gap: .4rem;
}
.sub-swimlane .team-acquires-box  { font-size: .68rem; padding: .25rem .6rem; }
.sub-swimlane .tree-trunk         { height: 12px; }
.sub-swimlane .tree-child         { padding-top: 12px; }
.sub-swimlane .tree-child::after  { height: 12px; }
.sub-swimlane .asset-node         { font-size: .82rem; min-width: 7.5rem; }
.sub-swimlane .asset-node-focus   { font-size: 1.1rem; }
.sub-swimlane .asset-node-pick    { font-size: .76rem; }
.sub-swimlane .sw-divider         { min-height: 40px; }

.chain-label {
  font-size: .7rem;
  color: rgba(255,255,255,.5);
  font-style: italic;
  text-align: center;
  padding: .15rem .4rem;
}

/* -- Chain direction sections: amber = origin (past), green = afterward --
   Colors flow through CSS custom properties so the NEAREST section ancestor
   wins - a history chain nested inside a forward sub-trade stays amber. */
.chain-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  width: auto;
  max-width: 100%;
  margin-top: .35rem;
  padding: .1rem .5rem .35rem;
  border-radius: .45rem;
  border: 1px solid var(--chain-edge);
  background: var(--chain-bg);
}
.chain-section-tag {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .1rem .5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
  color: var(--chain-accent);
}
.chain-section-history {
  --chain-accent: var(--history);
  --chain-soft: rgba(251,191,36,.75);
  --chain-edge: rgba(245,158,11,.4);
  --chain-bg: rgba(245,158,11,.08);
}
.chain-section-forward {
  --chain-accent: var(--forward);
  --chain-soft: rgba(74,222,128,.7);
  --chain-edge: rgba(74,222,128,.4);
  --chain-bg: rgba(74,222,128,.08);
}
.chain-section .chain-connector-line { background: var(--chain-soft); }
.chain-section .chain-connector-arrow { border-top-color: var(--chain-soft); }
.chain-section .chain-connector-up .chain-connector-arrow { border-bottom-color: var(--chain-soft); }
.chain-section .chain-label { color: var(--chain-soft); }
.chain-section .sub-swimlane {
  border-color: var(--chain-edge);
  border-left: 3px solid var(--chain-accent);
}
/* Pick outcome annotations are forward-looking info */
.asset-node-pick .asset-node-sub { color: rgba(74,222,128,.75); }

/* Draft origin card */
.draft-swimlane {
  background: linear-gradient(135deg, var(--draft-deep) 0%, var(--draft) 100%);
  border-radius: .75rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.draft-swimlane .team-acquires-box {
  background: var(--draft-tint);
  color: var(--draft-deep);
  flex-shrink: 0;
}
.draft-detail {
  color: white;
  font-weight: 700;
  font-size: 1rem;
}
.draft-detail-sub {
  color: rgba(255,255,255,.55);
  font-size: .78rem;
}

/* -- Stat analyzer panel --------------------------------------------------- */
.stat-analyzer {
  margin: -.75rem 0 1.5rem 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
}
.stat-analyzer > summary {
  list-style: none;
  cursor: pointer;
  padding: .55rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #475569;
  user-select: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.stat-analyzer > summary::-webkit-details-marker { display: none; }
.stat-analyzer > summary::before {
  content: "\25B6";
  font-size: .65rem;
  color: #94a3b8;
  transition: transform .15s;
}
.stat-analyzer[open] > summary::before { transform: rotate(90deg); }
.stat-grid-wrap {
  overflow-x: auto;
}
.stat-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.stat-grid th,
.stat-grid td {
  border: 1px solid var(--line);
  padding: .35rem .55rem;
  vertical-align: top;
}
.stat-grid thead th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  text-align: center;
}
.stat-grid thead th.trade-head {
  background: #e0f2fe;
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.stat-grid thead th.pre-head  { background: #fef3c7; color: #92400e; }
.stat-grid thead th.post-head { background: #dcfce7; color: #166534; }
.stat-grid td.team-cell {
  background: #fafafa;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  width: 3rem;
}
.stat-grid td.empty-cell { color: #cbd5e1; text-align: center; }
.stat-entry {
  display: block;
  padding: .15rem 0;
}
.stat-entry + .stat-entry { border-top: 1px dashed var(--line); margin-top: .15rem; }
.stat-entry-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: .78rem;
}
.stat-entry-line {
  font-size: .72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stat-entry-line strong { color: var(--text-strong); font-weight: 700; }
.stat-entry-pick {
  font-size: .68rem;
  color: #94a3b8;
  font-style: italic;
}
.stat-grid thead th.summary-head {
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.stat-grid thead th.input-head  { background: #fde68a; color: #78350f; }
.stat-grid thead th.result-head { background: #bbf7d0; color: #14532d; }
.stat-grid td.summary-cell {
  background: #fafafa;
  border-left: 2px solid #cbd5e1;
  border-right: 2px solid #cbd5e1;
  min-width: 9rem;
}
.stat-grid td.input-cell  { background: #fffbeb; }
.stat-grid td.result-cell { background: #f0fdf4; }
.summary-names {
  font-size: .68rem;
  color: var(--muted);
  margin-bottom: .25rem;
  line-height: 1.25;
}
.summary-line {
  font-size: .72rem;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.summary-line strong { color: #1e3a8a; }
.summary-line + .summary-line { margin-top: .15rem; }
.summary-pending {
  font-size: .65rem;
  color: #94a3b8;
  font-style: italic;
  margin-top: .25rem;
}

/* -- Player browse list (thead styled by .table-scoreboard) ---------------- */
.player-table thead th { color: rgba(255,255,255,.8); }
.player-table tbody tr:hover { background: var(--surface-2); }
.player-table a.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.player-table a.sort-link:hover { color: #fff; }
.player-table a.sort-link.active { color: #fff; }
.player-table .sort-arrow {
  display: inline-block;
  font-size: .65rem;
  line-height: 1;
  opacity: .35;
}
.player-table a.sort-link.active .sort-arrow { opacity: 1; }
.player-link {
  font-weight: 500;
  text-decoration: none;
  color: #0d6efd;
}
.player-link:hover { text-decoration: underline; }
.trade-count-badge {
  display: inline-block;
  background: var(--line);
  color: #495057;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 2rem;
  min-width: 2rem;
  text-align: center;
}
.trade-swimlane { scroll-margin-top: 4.5rem; }
.tree-continue-link { text-decoration: none; }
.tree-continue-link:hover { text-decoration: underline; }
.tree-deeper-link { text-decoration: none; }
.tree-deeper-link:hover { text-decoration: underline; }
#tree-search-btn.loading { pointer-events: none; opacity: .65; }
#tree-search-btn.loading::after {
  content: "";
  display: inline-block;
  width: .85rem;
  height: .85rem;
  margin-left: .45rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1rem;
  animation: tree-spin .7s linear infinite;
}
@keyframes tree-spin { to { transform: rotate(360deg); } }

/* -- Cinematic fullscreen (expand a single swimlane to fill the viewport) -- */
.cinematic-trigger {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: .25rem;
  cursor: pointer;
  flex-shrink: 0;
}
.cinematic-trigger:hover,
.cinematic-trigger:focus-visible { color: #fff; }
.swimlane-meta .cinematic-trigger { margin-left: -.5rem; }
.sub-swimlane-meta .cinematic-trigger {
  margin-left: -.25rem;
  font-size: .68rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
}

.cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-deep);
  opacity: 0;
  transition: opacity .2s ease;
  /* Last-resort clip: if a fit() scale calc is ever stale (font swap,
     nested-chain reflow), content still can't spill past the viewport. */
  overflow: hidden;
}
.cinematic-overlay.is-open { opacity: 1; }
.cinematic-overlay[hidden] { display: none; }
body.cinematic-open { overflow: hidden; }

.cinematic-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.cinematic-stage[hidden] { display: none; }
/* Let the moved-in swimlane size to its own content, unconstrained by the
   min-width:100% / tree-scroll rules that apply to it inline in the page. */
.cinematic-stage .trade-swimlane,
.cinematic-stage .sub-swimlane {
  width: max-content;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}
/* The stage centers with flexbox, so the moved-in swimlane is a flex item:
   without flex-shrink:0 a tree wider than the viewport gets squeezed back to
   the stage width and its own overflow:hidden clips the right-hand side. It
   must keep its max-content width and let fit() scale it down instead. */
.cinematic-stage > .trade-swimlane,
.cinematic-stage > .sub-swimlane { flex: 0 0 auto; }
/* Percentage clamp inside a now content-sized tree can only cut content off. */
.cinematic-stage .chain-section { max-width: none; }

.cinematic-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cinematic-close:hover,
.cinematic-close:focus-visible { background: rgba(255,255,255,.18); }

.cinematic-rotate-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: 2rem;
}
.cinematic-rotate-prompt[hidden] { display: none; }
.cinematic-rotate-icon {
  font-size: 2.5rem;
  animation: cinematic-rotate-hint 1.6s ease-in-out infinite;
}
.cinematic-rotate-prompt p { margin: 0; font-size: .95rem; }
.cinematic-rotate-skip {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: rgba(255,255,255,.85);
  border-radius: .25rem;
  padding: .35rem .9rem;
  font-size: .8rem;
  cursor: pointer;
}
.cinematic-rotate-skip:hover { background: rgba(255,255,255,.1); }

@keyframes cinematic-rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-overlay { transition: none; }
  .cinematic-rotate-icon { animation: none; }
}

/* ============================================================================
   Draft capital (/capital) - from capital.html
   ============================================================================ */
  /* Filter groupings (Year, Overall) - quiet sheet register */
  .filter-group {
    background: var(--surface-2);
    border-color: var(--line) !important;
  }
  .filter-group-label {
    font-size: .7rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    line-height: 1;
    margin-bottom: .25rem;
  }

  /* Moved picks: acquire-yellow row tint + badge (color = meaning) */
  #picks-table .table-warning { --bs-table-bg: #fdf6c8; }
  .badge-acquired {
    background: var(--acquire);
    color: #111;
    font-family: var(--display);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
  }

  /* Sortable picks-table headers */
  #picks-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
  }
  #picks-table th.sortable:hover {
    background-color: var(--navy-2);
  }
  #picks-table th.sortable::after {
    content: " \2195";
    opacity: .35;
    font-weight: normal;
  }
  #picks-table th.sortable.sort-asc::after {
    content: " \25B2";
    opacity: 1;
    color: #fff;
  }
  #picks-table th.sortable.sort-desc::after {
    content: " \25BC";
    opacity: 1;
    color: #fff;
  }

/* ============================================================================
   Admin: cleanup (/cleanup) - from cleanup.html
   ============================================================================ */
  .audit-card        { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem 1.25rem; }
  .audit-num         { font-size: 1.8rem; font-weight: 700; line-height: 1; }
  .audit-num.zero    { color: #adb5bd; }
  .audit-num.warn    { color: #d63384; }
  .audit-label       { color: var(--muted); font-size: .78rem; text-transform: uppercase;
                        letter-spacing: .07em; margin-top: .2rem; }
  .pair-card         { border: 1px solid var(--line); border-radius: .5rem; margin-bottom: 1rem;
                        overflow: hidden; }
  .pair-card-header  { background: var(--surface-2); padding: .5rem .9rem; display: flex;
                        align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .pair-card-body    { padding: .75rem .9rem; }
  .pair-card-footer  { background: var(--surface-2); padding: .5rem .9rem; border-top: 1px solid var(--line);
                        display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
  .trade-panel       { background: #fafbfc; border: 1px solid var(--line); border-radius: .35rem;
                        padding: .65rem .8rem; height: 100%; font-size: .82rem; }
  .trade-panel.is-canonical {
                        border-color: #198754; background: #f6fff8;
                        box-shadow: inset 0 0 0 1px rgba(25,135,84,.18); }
  .trade-panel h6    { margin: 0 0 .25rem 0; font-size: .95rem; font-weight: 700;
                        display: flex; align-items: center; gap: .35rem; }
  .trade-meta        { color: var(--muted); font-size: .72rem; margin-bottom: .45rem;
                        display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
  .trade-meta code   { color: #495057; font-size: .72rem; }
  .trade-notes       { color: #495057; font-size: .76rem; font-style: italic;
                        margin-bottom: .45rem; line-height: 1.3; }

  .asset-row         { display: flex; gap: .4rem; padding: .15rem .25rem;
                        border-radius: .2rem; line-height: 1.4; }
  .asset-row.shared    { background: rgba(13,110,253,.06); }
  .asset-row.unique-a  { background: rgba(253,126,20,.07); }
  .asset-row.unique-b  { background: rgba(253,126,20,.07); }
  .asset-marker      { width: 1rem; flex-shrink: 0; text-align: center; font-size: .82rem; }
  .asset-marker.shared  { color: #0d6efd; }
  .asset-marker.unique  { color: #fd7e14; }
  .asset-main        { flex: 1; min-width: 0; }
  .asset-main .name  { font-weight: 600; }
  .asset-main .pid   { color: var(--muted); font-family: monospace; font-size: .72rem; }
  .asset-main .dir   { color: var(--muted); }
  .asset-extras      { color: var(--muted); font-size: .7rem; margin-top: .05rem; line-height: 1.25; }

  .conflict-badge    { background: #d63384; color: white; font-size: .68rem;
                        padding: .15rem .5rem; border-radius: 2rem; }
  .safe-badge        { background: #20c997; color: white; font-size: .68rem;
                        padding: .15rem .5rem; border-radius: 2rem; }
  .canonical-pill    { background: #198754; color: white; font-size: .62rem;
                        padding: .12rem .45rem; border-radius: .2rem;
                        text-transform: uppercase; letter-spacing: .04em; }
  .pair-row-table th,
  .pair-row-table td { font-size: .78rem; padding: .25rem .4rem; }
  .pair-row-table th { color: var(--muted); }

/* ============================================================================
   Admin: replay player (/replay) - from replay_play.html
   ============================================================================ */
  .replay-wrap { max-width: 1100px; margin: 0 auto; }
  .rink-canvas {
    width: 100%; height: auto; display: block;
    background: #f4faff; border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
  }
  .controls { display: flex; gap: .75rem; align-items: center; margin-top: .75rem; flex-wrap: wrap; }
  .controls .scrub { flex: 1 1 250px; }
  .legend { display: flex; gap: 1rem; margin-top: .5rem; font-size: .9rem; }
  .legend .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
  .meta-line { font-size: .85rem; color: #555; }
  .player-tooltip {
    position: absolute; display: none; pointer-events: none; z-index: 1000;
    background: rgba(0,0,0,.85); color: #fff;
    padding: .25rem .55rem; border-radius: .25rem;
    font-size: .8rem; white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
  }
  .rink-canvas { cursor: default; }
  .event-log {
    margin-top: 1rem; max-height: 340px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: .5rem; background: #fff;
  }
  .event-log table { margin-bottom: 0; font-size: .85rem; }
  .event-log tr { cursor: pointer; }
  .event-log tr.active { background: #fff3cd !important; }
  .event-log tr:hover { background: #f1f3f5; }
  .event-log .t-shot         { background: #ffe5e5; }
  .event-log .t-shot_attempt { background: #fff0e5; }
  .event-log .t-pass         { background: #e5efff; }
  .event-log .t-burst        { background: var(--line); }
  .event-log .t-hit          { background: #f4e5ff; }
  .event-log .t-goal         { background: #d1f0d1; font-weight: 600; }
  .event-log .badge-type {
    display: inline-block; padding: .1rem .45rem; border-radius: .25rem;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .03em;
    background: #495057; color: #fff;
  }
  .event-log .t-shot .badge-type         { background: #dc3545; }
  .event-log .t-shot_attempt .badge-type { background: #fd7e14; }
  .event-log .t-pass .badge-type         { background: #0d6efd; }
  .event-log .t-burst .badge-type        { background: var(--muted); }
  .event-log .t-hit .badge-type          { background: #6f42c1; }
  .event-log .t-goal .badge-type         { background: #198754; }
  .event-log .badge-src {
    display: inline-block; padding: .1rem .35rem; border-radius: .25rem;
    font-size: .65rem; font-weight: 600; letter-spacing: .03em; color: #fff;
  }
  .event-log .src-bdc     { background: #0f5132; }
  .event-log .src-derived { background: var(--muted); }
  #eventTable.hide-src .src-col { display: none; }

/* ============================================================================
   Admin: replay frame inspector - from replay_inspect.html
   ============================================================================ */
  table.frames { font-size: .75rem; font-family: monospace; }
  table.frames th, table.frames td { padding: .15rem .35rem; }
  table.frames .puck { background: #fff3cd; }

/* ============================================================================
   Landing (/) - from index.html
   ============================================================================ */
.landing {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 4rem;
}
.landing-hero {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 3.5rem 0 1rem;
}
.hero-thesis { flex: 1 1 46%; }
.hero-thesis h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--text-strong);
  margin: .35rem 0 .75rem;
}
.hero-sub {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 1.4rem;
}
.hero-graphic { flex: 1 1 54%; min-width: 0; }
.hero-tree { margin-bottom: .6rem; }
.hero-tree .tl-bubble { width: 44px; height: 44px; font-size: 1.15rem; }
.hero-tree .swimlane-body { padding-bottom: 1.1rem; }
.hero-tree .asset-node-focus { font-size: 1.3rem; }
.hero-caption {
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}
.landing-section { margin-top: 3.25rem; }
.landing-card h3 { font-size: 1.5rem; margin-bottom: .4rem; }
.landing-card p { color: var(--muted); margin-bottom: .6rem; }
.landing-card .card-link { font-weight: 600; text-decoration: none; }
.landing-card .card-link:hover { text-decoration: underline; }

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.legend-list li {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  padding: .4rem 0;
  font-size: .9rem;
}
.legend-swatch {
  flex-shrink: 0;
  width: .95rem;
  height: .95rem;
  border-radius: .25rem;
  transform: translateY(.15rem);
}
.swatch-trade   { background: var(--trade); }
.swatch-acquire { background: var(--acquire); border: 1px solid rgba(0,0,0,.15); }
.swatch-draft   { background: var(--draft); }
.swatch-history { background: var(--history); }
.swatch-forward { background: var(--forward); }

.glossary dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.glossary dd {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .8rem;
}

.landing-terms p { font-size: .9rem; color: #3d4a5c; max-width: 46rem; }
.landing-terms .terms-note {
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: .9rem;
  margin-top: 1.2rem;
}

@media (max-width: 991.98px) {
  .landing-hero {
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
  }
  .hero-thesis, .hero-graphic { flex: 1 1 auto; width: 100%; }
}

/* ============================================================================
   Admin: coverage (/coverage) - from coverage.html
   Back-end data-fidelity diagnostic; never shown to public visitors.
   ============================================================================ */
  .cov-table td, .cov-table th { font-variant-numeric: tabular-nums; }
  .cov-table td.cov-year { font-weight: 600; white-space: nowrap; }
  .cov-table td.cov-zero { color: #adb5bd; }
  .cov-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .1rem .45rem;
    border-radius: .35rem;
    line-height: 1.4;
  }
  .cov-badge.full      { background: rgba(74,222,128,.18);  color: #15803d; }
  .cov-badge.partial   { background: rgba(251,191,36,.20);  color: #b45309; }
  .cov-badge.missing   { background: rgba(220,38,38,.14);   color: #b91c1c; }
  .cov-badge.no-season { background: var(--surface-2);      color: var(--muted); }
  .cov-note {
    font-size: .7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
  }
  .cov-legend { font-size: .8rem; color: var(--muted); }
  .cov-legend .cov-badge { margin-right: .3rem; }
  .cov-prose { max-width: 60rem; }
