:root {
  --bg: #0f1216;
  --panel: #171c22;
  --panel-2: #1e242c;
  --line: #2a323c;
  --text: #e6ebf2;
  --dim: #8b98a8;
  --accent: #4da3ff;
  --win: #4ccf8f;
  --warn: #f0b354;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
h1 { margin: 0; font-size: 17px; letter-spacing: .3px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }

select, input[type="search"] {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; font: inherit; min-width: 150px;
}
select:focus, input:focus { outline: 1px solid var(--accent); }

/* sport switcher: the top-level choice, so it reads as a segmented control
   rather than another filter dropdown ------------------------------------- */
.sports {
  display: flex; gap: 4px; padding: 3px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
}
.sport {
  background: none; border: none; border-radius: 7px; cursor: pointer;
  color: var(--dim); font: inherit; font-weight: 600;
  padding: 7px 15px; display: flex; gap: 7px; align-items: center;
  white-space: nowrap;
}
.sport:hover { color: var(--text); background: var(--panel); }
.sport--on { color: #06131f; background: var(--accent); }
.sport__n { font-size: 11px; font-weight: 500; opacity: .75;
            font-variant-numeric: tabular-nums; }
.sport--tool { margin-left: 8px; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.sport--tool.sport--on { border-left-color: transparent; border-radius: 7px; }
body.mode-pyramida .tabs, body.mode-pyramida .controls { display: none; }
.run { margin-left: auto; align-self: center; font-size: 12px; color: var(--dim); white-space: nowrap; }
.run b { color: var(--text); font-weight: 600; }
.run__fail { color: #e5484d; }

.tabs { display: flex; gap: 4px; padding: 10px 20px 0; flex-wrap: wrap; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--dim); padding: 8px 14px; font: inherit; cursor: pointer;
  border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab--on { color: var(--text); border-bottom-color: var(--accent); }

main { padding: 16px 20px 60px; max-width: 1100px; }
.view--off { display: none; }
.filters { margin-bottom: 12px; display: flex; gap: 12px; align-items: center;
           flex-wrap: wrap; }
.check { color: var(--dim); display: flex; gap: 6px; align-items: center;
         cursor: pointer; user-select: none; }
/* A `display` rule beats the hidden attribute's default display:none, so the
   sport-specific filters stayed visible when toggled off. Anything hidden is
   hidden, whatever its class says. */
[hidden] { display: none !important; }
.check input { accent-color: var(--accent); }

.note {
  color: var(--warn); background: rgba(240,179,84,.08);
  border: 1px solid rgba(240,179,84,.25); border-radius: 7px;
  padding: 8px 11px; margin: 0 0 12px;
}
.note:empty { display: none; }

.day { color: var(--dim); font-size: 12px; text-transform: uppercase;
       letter-spacing: .6px; margin: 18px 0 7px; }

/* The meta column is a FIXED width, not `auto`: sized to its content it grows
   with the tournament name, which shoves the set columns to a different
   horizontal position on every row and destroys the scoreboard alignment
   between rows ('WTA Billie Jean King Cup - World Group 2026' vs 'Final'). */
.match {
  display: grid; grid-template-columns: 1fr 180px; gap: 10px;
  align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; margin-bottom: 6px; cursor: pointer;
}
.match:hover { border-color: var(--accent); }
/* Player-detail view only: background tint keyed to that profile's own
   result, not whichever side happens to be the absolute winner -- so a
   loss for the player you're looking at still reads as red even though
   their opponent's name is the one in green text. */
.match--mine-win  { background: rgba(76, 207, 143, .12); border-color: rgba(76, 207, 143, .35); }
.match--mine-loss { background: rgba(226, 112, 122, .10); border-color: rgba(226, 112, 122, .3); }
.match--mine-win:hover, .match--mine-loss:hover { border-color: var(--accent); }
.match__players { display: grid; gap: 3px; min-width: 0; }
/* The name column flexes and the score columns do not, so the two players'
   set scores land in the same place regardless of name length. */
.match__p { display: flex; gap: 8px; align-items: baseline; }
.match__p--win { color: var(--win); font-weight: 600; }
/* Fixed width and right-aligned: a rank is a small annotation, so it must not
   push the names out of line when it is 3 digits on one row and absent on
   the other. */
.match__rk { width: 30px; flex: none; text-align: right; color: var(--dim);
             font-size: 11px; font-variant-numeric: tabular-nums; }
/* min-width:0 is required for the ellipsis to work: a flex item's default
   `min-width:auto` refuses to shrink below its text, so a long name widens
   the whole row instead of truncating and scrolls the page sideways. */
.match__name { flex: 1; min-width: 0; overflow: hidden;
               text-overflow: ellipsis; white-space: nowrap; }
.match__g { display: flex; gap: 0; flex: none; }
/* Fixed-width cells, not `gap`: a set column has to be the same width on both
   rows for '10' under '6' to still line up. Up to 7 sets (table tennis). */
.set { width: 22px; text-align: center; color: var(--dim);
       font-variant-numeric: tabular-nums; font-size: 13px; }
.set--won { color: var(--fg); font-weight: 600; }
.match__p--win .set--won { color: var(--win); }
.match__won { width: 20px; flex: none; text-align: center; font-weight: 700;
              font-size: 16px; font-variant-numeric: tabular-nums;
              border-left: 1px solid var(--line); }
.match__meta { color: var(--dim); font-size: 12px; text-align: right;
               line-height: 1.35; overflow-wrap: anywhere; }
/* The round and tournament are on two lines here, so the dot separator is
   only for the narrow layouts that collapse them onto one. */
.match__sep { display: none; }
.match__date { color: var(--text); font-weight: 600; white-space: nowrap; }
.tag {
  display: inline-block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--line); color: var(--dim); margin-left: 6px;
}
.tag--ret { color: var(--warn); border-color: rgba(240,179,84,.4); }
/* Not played out (retired / walkover): a red cross badge by the player who
   did not finish, and a red edge on the row so it shows in a long list. */
.hurt {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  padding: 1px 6px 1px 4px; border-radius: 4px; vertical-align: middle;
  background: rgba(242, 13, 13, .16); border: 1px solid rgba(242, 13, 13, .55);
  color: #ff6b6b; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  white-space: nowrap;
}
.hurt__x {
  display: inline-grid; place-items: center; width: 12px; height: 12px;
  border-radius: 3px; background: #f20d0d; color: #fff; font-size: 10px; line-height: 1;
}
.match--hurt { box-shadow: inset 3px 0 0 #f20d0d; }
/* Not played out: red edge plus a faint hatch over the win/loss tint, so it
   reads as "doesn't really count" at a glance. */
.match.match--hurt, .form__row.form__row--hurt {
  background-image: repeating-linear-gradient(-45deg, rgba(242, 13, 13, .10) 0 6px, transparent 6px 12px);
}
.form__row--hurt { box-shadow: inset 3px 0 0 #f20d0d; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 600; font-size: 12px;
     text-transform: uppercase; letter-spacing: .5px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--panel); }
.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

.h2h-pick { display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
            flex-wrap: wrap; }
.h2h-vs { color: var(--dim); }
.h2h-head {
  display: flex; gap: 22px; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; margin-bottom: 14px;
}
.h2h-score { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.h2h-name { color: var(--dim); }
.h2h-rk { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.h2h-rk--none { color: var(--dim); font-weight: 400; }
.h2h-age { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.h2h-h { font-size: 12px; color: var(--dim); text-transform: uppercase;
         letter-spacing: .06em; margin: 22px 0 8px; }

/* autocomplete ------------------------------------------------------------ */
.ac { position: relative; }
.ac__list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  /* Full names are longer than the input; let the list outgrow it rather
     than wrapping every entry onto two lines. */
  max-height: 290px; overflow-y: auto; min-width: 320px; width: max-content;
  max-width: 420px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
.ac__list--off { display: none; }
.ac__item {
  padding: 8px 11px; cursor: pointer; display: flex;
  justify-content: space-between; gap: 12px; align-items: baseline;
  border-bottom: 1px solid var(--line);
}
.ac__item:last-child { border-bottom: 0; }
.ac__item:hover, .ac__item--on { background: var(--panel-2); }
.ac__meta { color: var(--dim); font-size: 11px; white-space: nowrap; }

/* recent form, both players ----------------------------------------------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form__col { background: var(--panel); border: 1px solid var(--line);
             border-radius: 9px; padding: 4px 0; overflow: hidden; }
.form__head { font-weight: 600; padding: 9px 12px;
              border-bottom: 1px solid var(--line); }
.form__row {
  display: grid; grid-template-columns: 20px 1fr auto auto auto;
  gap: 9px; align-items: baseline; padding: 7px 12px; cursor: pointer;
  font-size: 13px;
}
.form__row:hover { background: var(--panel-2); }
/* Same tints as .match--mine-*: the row reads as this player's result. */
.form__row--w { background: rgba(76, 207, 143, .12); }
.form__row--l { background: rgba(226, 112, 122, .10); }
.form__row--w:hover { background: rgba(76, 207, 143, .2); }
.form__row--l:hover { background: rgba(226, 112, 122, .18); }
.form__row + .form__row { border-top: 1px solid var(--bg); }
/* centred under both columns */
.form__more { text-align: center; margin-top: 10px; }
/* Opponent's rank at the time, before the name -- like .match__rk. */
/* Age on the match date, after a name in match, form and common-opponent rows. */
.match__age { color: var(--dim); font-size: 11px; font-weight: 400;
              font-variant-numeric: tabular-nums; }
.form__rk { display: inline-block; min-width: 30px; padding-right: 6px;
            text-align: right; color: var(--dim); font-size: 11px;
            font-variant-numeric: tabular-nums; }
.form__wl { font-weight: 700; font-size: 11px; }
.form__wl--w { color: var(--win); }
.form__wl--l { color: #e2707a; }
.form__opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The set scores, not the set COUNT, are the detail worth reading here, so
   they get the stronger colour and the bare count is dimmed beside them. */
.form__sets { font-variant-numeric: tabular-nums; font-size: 12px;
              white-space: nowrap; }
.form__sc { font-variant-numeric: tabular-nums; color: var(--dim);
            font-size: 12px; }
.form__meta { color: var(--dim); font-size: 11px; white-space: nowrap; }

/* common opponents -------------------------------------------------------- */
main.main--h2h { max-width: 1800px; }
/* Recent form on the left, common opponents on the right; stacked when the
   four columns would get too narrow for the set scores. */
.h2h-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.h2h-split > section { min-width: 0; }
@media (max-width: 1280px) { .h2h-split { grid-template-columns: 1fr; } }
.co-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.co-range { background: var(--panel); color: var(--text); border: 1px solid var(--line);
            border-radius: 7px; padding: 5px 8px; font: inherit; font-size: 13px; }
.co-rec { float: right; color: var(--dim); font-weight: 500; font-variant-numeric: tabular-nums; }
/* Squash-site look: the opponent's colour fills the row (same opponent, same
   colour in both columns), the underline says won (green) or lost (red). */
.co-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 9px; align-items: baseline; padding: 6px 12px 5px; cursor: pointer; font-size: 13px;
  background: color-mix(in srgb, var(--oc) 22%, transparent);
  box-shadow: inset 5px 0 0 var(--oc);
  border-bottom: 2px solid;
}
.co-row:hover { background: color-mix(in srgb, var(--oc) 28%, transparent); }
.co-row--w { border-bottom-color: var(--win); }
.co-row--l { border-bottom-color: #e2707a; }
.co-row__res { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12px; }
.co-row--w .co-row__res { color: var(--win); }
.co-row--l .co-row__res { color: #e2707a; }
.co-foot { margin: 8px 2px 0; }
.co-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 14px; font: inherit; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.co { margin-top: 12px; }
.co__sub th { font-size: 10px; padding-top: 0; }
.co__win { color: var(--win); font-weight: 600; }
.dimcell { color: var(--dim); font-size: 12px; }

/* rankings ---------------------------------------------------------------- */
.mv { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mv--up   { color: var(--win); }
.mv--down { color: #e2707a; }
.mv--same { color: var(--dim); }
.mv--new  { color: var(--accent); font-size: 10px; text-transform: uppercase; }

.chart { width: 100%; height: auto; margin: 6px 0 4px; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2;
               stroke-linejoin: round; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__lbl  { fill: var(--dim); font-size: 11px; }

@media (max-width: 720px) {
  .form { grid-template-columns: 1fr; }
  .sports { width: 100%; }
  .sport { flex: 1; justify-content: center; }
  /* Seven set columns plus a name do not fit 360px, so the round/tournament
     STACKS BELOW the players instead of sitting beside them. It is not
     dropped: "which tournament" is a thing you read a result for, and an
     earlier version hid it here, which simply lost the information on
     phones. The set cell must stay WIDER than a two-digit score -- at 17px
     the digits of '11 11 11' touch and the row reads as '111111'. */
  /* min-width:0 lets the single column shrink below its content: without it
     a long tournament name sets the grid's minimum width and scrolls the
     whole page sideways instead of wrapping. */
  .match { grid-template-columns: minmax(0, 1fr); }
  .set { width: 20px; font-size: 12px; }
  /* A 7-set row spends 140px on games alone; trimming the fixed furniture
     (narrower rank, tighter gaps) keeps the NAME from being squeezed to
     nothing, which is what overflowed the page in table tennis. */
  .match__p { gap: 5px; }
  .match__rk { width: 20px; }
  .match__meta { text-align: left; margin-top: 6px; min-width: 0;
                 padding-top: 6px; border-top: 1px solid var(--line); }
  /* Two lines of meta cost a lot of vertical space on a phone, so the round
     and the tournament sit on one line, separated by the dot that the
     markup carries for exactly this purpose. */
  .match__meta br { display: none; }
  .match__sep { display: inline; }
}

.more { color: var(--dim); font-size: 13px; padding: 14px 0;
        display: flex; gap: 10px; align-items: center; }
.empty { color: var(--dim); padding: 22px 0; }
/* Needs !important: the elements this hides set their own `display` (.filters
   is flex), and a single class cannot outrank another on specificity alone. */
.hidden { display: none !important; }

.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 20;
}
.sheet--off { display: none; }
.sheet__box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; max-width: 760px; width: 100%;
  max-height: 84vh; overflow: auto; position: relative;
}
.sheet__close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: var(--dim); font-size: 24px; cursor: pointer; line-height: 1;
}
.sheet__close:hover { color: var(--text); }
.sheet h2 { margin: 0 0 4px; font-size: 17px; }
/* Inside the 760px sheet a 180px meta column is proportionally much wider
   than on the full-width page, so a long name ('ATP Davis Cup - World Group
   2026') wraps to two lines and pushes the row taller. Give it more room
   here; the scores still share one line because the column is still fixed. */
.sheet .match { grid-template-columns: 1fr 210px; }
.sheet h3 { margin: 18px 0 6px; font-size: 13px; color: var(--dim);
            text-transform: uppercase; letter-spacing: .5px; }
/* A date range inside a heading opts out of the uppercasing: 'OCT 2, 2023 –
   SEP 14, 2026, 121 WEEKS' shouts, and it is a caption, not a title. */
.sheet h3 .dimcell { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sheet__sub { color: var(--dim); margin: 0 0 12px; font-size: 13px; }

/* -------------------------------------------------------------------------
   hockey
   Only the pieces the racket views have no equivalent for: recent-form pips,
   the OT/SO tag and the lineup grid. Matches, tables and the sheet reuse the
   styles above unchanged, which is what keeps the two sports looking like one
   app rather than two stapled together.
   ------------------------------------------------------------------------- */

/* Recent form, most recent first. A result that the standings counted but the
   results page has not resolved yet arrives as '?' and stays neutral grey. */
.hk-f {
  display: inline-block; width: 17px; height: 17px; line-height: 17px;
  margin-right: 2px; border-radius: 4px; text-align: center;
  font-size: 11px; font-weight: 700;
  background: var(--panel-2); color: var(--dim);
}
.hk-f--w { background: var(--win);  color: #06131f; }
.hk-f--l { background: #c5545b;     color: #fff; }

/* Overtime/shootout. Warn-coloured rather than the red of a retirement: it
   qualifies a result rather than flagging one that did not finish. */
.tag--ot { background: var(--warn); color: #06131f; }

.hk-lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .hk-lineups { grid-template-columns: 1fr; } }
.hk-side h4 { margin: 12px 0 6px; font-size: 13px; }
.hk-unit { display: flex; gap: 8px; padding: 4px 0;
           border-bottom: 1px solid var(--line); font-size: 13px; }
.hk-unit__n { flex: 0 0 76px; color: var(--dim); font-size: 11px;
              text-transform: uppercase; letter-spacing: .4px; padding-top: 2px; }
.hk-pl { display: inline-block; margin: 0 10px 2px 0; white-space: nowrap; }
.hk-j { display: inline-block; min-width: 18px; margin-right: 4px;
        color: var(--dim); font-variant-numeric: tabular-nums; }
/* (C), (A), (G) */
.hk-role { margin-left: 3px; color: var(--warn); font-size: 11px; }

/* pyramida: a static cheat sheet, so it reads as cards of prose + one table
   rather than the list-of-matches layout the data tabs use ---------------- */
.py-num {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; font: inherit; width: 110px;
  font-variant-numeric: tabular-nums;
}
.py-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.py-chip {
  background: var(--panel-2); color: var(--dim); font: inherit;
  border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 11px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.py-chip:hover { color: var(--text); border-color: var(--accent); }
.py-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.py-card h3 { margin: 0 0 6px; font-size: 15px; }
.py-card p { margin: 0 0 10px; color: var(--dim); }
.py-card p strong, .py-card p em { color: var(--text); }
/* The table scrolls sideways inside its card on a phone rather than
   stretching the page. */
.py-table { display: block; overflow-x: auto; }
.py-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.py-leg { color: var(--accent); font-weight: 700; font-size: 15px; }
.py-foot { font-size: 12px; margin-top: 10px !important; }
.py-check { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.py-result { font-size: 15px; }
.py-result--ok { color: var(--win) !important; }
.py-result--short { color: var(--warn) !important; }
.py-tips { margin: 0; padding-left: 18px; color: var(--dim); }
.py-tips li { margin-bottom: 6px; }
.py-tips strong { color: var(--text); }

/* draws ------------------------------------------------------------------
   Ported from the squash-results draw sheet. The UI around the sheet uses
   this app's dark tokens; the sheet itself keeps fixed colours on purpose:
   it is paper, not UI, and ink colours have to read the same on it. */
main.main--wide { max-width: none; }
.draws-sub { color: var(--dim); font-size: 13px; }
.draws-h { margin: 26px 0 10px; font-weight: 500; font-size: 16px; }
.month-divider {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 10px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim);
}
.month-divider::after { content: ""; flex: 1; border-top: 2px solid var(--line); }
.draws-h + .month-divider { margin-top: 0; }
.draw-archive { border-top: 2px solid var(--line); padding: 10px 0; }
.draw-archive summary {
  cursor: pointer; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim);
}
.draw-archive summary span { margin-left: 8px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.draw-archive[open] summary { margin-bottom: 12px; }
.draw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.draw-card {
  display: block; padding: 12px 14px; border: 1px solid #e0dccd; border-radius: 8px;
  background: #fdfbf3; color: #222; text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.draw-card:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .35); transform: translateY(-1px); }
.draw-card.no-draw { background: #ecebe6; }
.draw-card.no-draw .name { color: #777; }
.draw-card .card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.draw-card .tier {
  padding: 1px 8px; border-radius: 4px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #fff; background: #777;
}
.draw-card .tier-grand-slam { background: #5b2a86; }
.draw-card .tier-atp-finals, .draw-card .tier-wta-finals { background: #111; }
.draw-card .tier-atp-1000, .draw-card .tier-wta-1000 { background: #c9a227; }
.draw-card .tier-atp { background: #1f5fae; }
.draw-card .tier-wta { background: #a8327a; }
.draw-card .tier-challenger { background: #a9714b; }
.draw-card .tier-wta-125 { background: #e0663f; }
.draw-card .gender { color: #666; }
.draw-card .notes { margin-left: auto; color: #1e4fd8; font-weight: 500; }
.draw-card .name { margin-top: 6px; font-weight: 500; }
.draw-card .meta, .draw-card .state { margin-top: 2px; font-size: 12px; color: #888; }
.draw-card .state { font-style: italic; }
.draw-card .checked { margin-top: 4px; font-size: 11px; color: #999; }
.dlocal { white-space: nowrap; }

.dsheet .sheet-header { display: flex; align-items: baseline; gap: 20px; }
.dsheet .back { color: var(--dim); text-decoration: none; white-space: nowrap; }
.dsheet .back:hover { color: var(--text); }
.dsheet h2 { margin: 0 0 2px; font-size: 20px; }
.dsheet h2 .gender { color: var(--dim); font-weight: 400; }
.dsheet .subtitle { color: var(--dim); font-size: 13px; }
.dsheet .subtitle a { color: inherit; }
.dsheet-error a { color: var(--accent); }

.dtoolbar {
  position: sticky; top: 64px; z-index: 4;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin: 14px 0 12px; padding: 8px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.dtoolbar .group { display: flex; align-items: center; gap: 4px; }
.dtoolbar .tool {
  min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.dtoolbar .tool.thin { padding: 0 7px; font-size: 12px; }
.dtoolbar .tool:hover:not(:disabled) { border-color: var(--dim); }
.dtoolbar .tool.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.dtoolbar .tool:disabled { opacity: .4; cursor: default; }
.dtoolbar .swatch {
  width: 22px; height: 22px; padding: 0; border: 2px solid var(--panel); border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line); cursor: pointer;
}
.dtoolbar .swatch.active { box-shadow: 0 0 0 2px var(--text); }
.dtoolbar .zoom { min-width: 42px; text-align: center; font-size: 13px; color: var(--dim); }
.dtoolbar .save { margin-left: auto; font-size: 12px; color: var(--win); }
.dtoolbar .save.pending, .dtoolbar .save.saving { color: var(--dim); }
.dtoolbar .save.error { color: #ff6b6b; }

.dsheet .sheet-scroll { overflow: auto; padding: 6px 6px 18px; }
.dsheet .paper {
  position: relative; background-color: #fdfbf3;
  background-image:
    linear-gradient(to right, rgba(70, 120, 200, .08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(70, 120, 200, .08) 1px, transparent 1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}
.dsheet .bracket { position: absolute; inset: 0; font-family: "Helvetica Neue", Arial, sans-serif; }
.dsheet .rule { fill: none; stroke: #3b3b3b; stroke-width: 1.2; }
.dsheet .round-date { text-anchor: middle; font-size: 11.5px; font-weight: 500; fill: #6f6550; }
.dsheet .round-date.estimated { font-style: italic; fill: #a89f88; }
.dsheet .match-time { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; fill: #4f4734; }
.dsheet .match-time .day { font-weight: 500; fill: #a89f88; }
.dsheet .round-head {
  text-anchor: middle; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; fill: #8a7f66;
}
.dsheet .name { font-size: 13px; fill: #222; }
.dsheet .scores { font-size: 11px; fill: #666; text-anchor: end; }
.dsheet .scores .games { font-weight: 700; font-size: 12px; }
.dsheet .won .name { font-weight: 700; fill: #000; }
.dsheet .won .scores { fill: #333; }
.dsheet .lost .name { fill: #9a9a9a; }
.dsheet .bye .name { font-style: italic; fill: #aaa; }
.dsheet .champion .name { font-size: 15px; }
.dsheet .ink { position: absolute; inset: 0; touch-action: none; }
.dsheet .ink.tool-hand, .dsheet .ink.tool-pick { pointer-events: none; }
.dsheet .ink.tool-pen, .dsheet .ink.tool-marker { cursor: crosshair; }
.dsheet .ink.tool-eraser { cursor: cell; }

.dsheet .round-h2h {
  position: absolute; z-index: 2; transform-origin: top right;
  font-size: 13px; line-height: 17px; font-weight: 600; padding: 1px 8px;
  border: 1px solid #cfc6ae; border-radius: 6px; background: #fffdf6; color: #6f6550; cursor: pointer;
}
.dsheet .round-h2h:hover:not(:disabled) { background: #f3ecd8; color: #3b3424; }
.dsheet .round-h2h:disabled { opacity: .45; cursor: default; }
.dsheet .match-h2h {
  position: absolute; z-index: 2; transform-origin: right center;
  font-size: 9px; line-height: 12px; font-weight: 700; letter-spacing: .02em; padding: 0 3px;
  border: 1px solid #d8cfb6; border-radius: 4px; background: #fffdf6; color: #8a7f63; text-decoration: none;
}
.dsheet .match-h2h:hover { background: #f3ecd8; color: #3b3424; border-color: #b9ad8c; }
.dsheet .h2h-note {
  margin: 0 0 8px; padding: 6px 10px; border-radius: 8px;
  background: #fff4e0; color: #7a4b00; font-size: 13px;
}
.dsheet .h2h-note button { border: none; background: none; cursor: pointer; color: inherit; }
.dsheet .h2h-note.pick-help { background: #eef3ff; color: #1e3a8a; }

/* Picks: the user's predicted winners, in "pen blue" so they read as handwritten. */
.dsheet .predicted .name { fill: #1e4fd8; font-style: italic; }
.dsheet .picked .name { fill: #1e4fd8; font-weight: 700; text-decoration: underline; }
.dsheet .missed .name { fill: #d32f2f; text-decoration: line-through; }
.dsheet .pick-hit { fill: transparent; cursor: pointer; }
.dsheet .pick-hit:hover { fill: rgba(30, 79, 216, .08); stroke: rgba(30, 79, 216, .35); }
.dsheet .pick-hit.has-pick { fill: rgba(30, 79, 216, .04); }
.dsheet .pick-backdrop { position: absolute; inset: 0; z-index: 3; }
.dsheet .pick-menu {
  position: absolute; z-index: 4; display: flex; flex-direction: column; min-width: 190px; padding: 6px;
  border: 1px solid #cfc6ae; border-radius: 8px; background: #fffdf6; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.dsheet .pick-title {
  padding: 2px 6px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #8a7f66;
}
.dsheet .pick-menu button {
  padding: 5px 8px; border: none; border-radius: 5px; background: none; color: #222;
  text-align: left; font-size: 13px; cursor: pointer;
}
.dsheet .pick-menu button:hover { background: #f3ecd8; }
.dsheet .pick-menu button.current { color: #1e4fd8; font-weight: 700; }
.dsheet .pick-menu button.clear { color: #8a7f66; border-top: 1px solid #eee5cf; border-radius: 0 0 5px 5px; }
.dsheet .name .rank { font-size: 12px; font-weight: 600; font-style: normal; fill: #5f6f86; text-decoration: none; }
.dsheet .odds { font-size: 13.5px; font-weight: 700; fill: #3d2f0c; text-anchor: end; font-variant-numeric: tabular-nums; }
.dsheet .odds .in { fill: #1b7a24; font-size: 11.5px; }
.dsheet .odds .out { fill: #c62828; font-size: 11.5px; }
.dsheet .lost .odds { fill: #8a8170; }
.dsheet .odds .src { font-size: 10px; font-weight: 700; fill: #6f6650; }
/* Tipsport under the line when Winamax holds the main slot: smaller, quieter. */
.dsheet .odds.odds2 { font-size: 12px; font-weight: 700; fill: #4a3d1c; }
.dsheet .odds.odds2 .in, .dsheet .odds.odds2 .out { font-size: 10.5px; }
.dsheet .odds.wmx, .dsheet .odds.wmx .src { fill: #d32f2f; }
.dsheet .odds.tip, .dsheet .odds.tip .src { fill: #1565c0; }
.dsheet .lost .odds { opacity: .55; }
/* Winamax and Tipsport disagree a lot on this match (see D_GAP_PCT in draws.js). */
.dsheet .odds-gap { fill: #ffd54f; fill-opacity: .28; }
.dsheet .odds-gap.hi { fill: #ffb300; fill-opacity: .42; }
.dsheet .hot rect { fill: #f20d0d; }
.dsheet .hot text { font-size: 11px; font-weight: 700; fill: #fff; text-anchor: middle; font-variant-numeric: tabular-nums; }
.dsheet .hot.past, .dsheet .lost .hot { opacity: .45; }
.draw-card .tier[class*="tier-itf"] { background: #6f7f62; }
.draw-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.draw-levels button {
  background: var(--surface, #1a1f27); color: var(--muted, #9aa4b2); border: 1px solid var(--border, #2a313c);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.draw-levels button span { opacity: .6; font-size: 11px; margin-left: 2px; }
.draw-levels button.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* Court surface letter (see surf() in app.js) and country flags. */
.surf {
  display: inline-block; min-width: 15px; margin-right: 5px; padding: 0 3px;
  border-radius: 3px; font: 700 10px/15px system-ui, sans-serif; text-align: center;
  color: #fff; vertical-align: 1px;
}
.surf--clay { background: #c8643b; }
.surf--hard { background: #2f6fb4; }
.surf--grass { background: #3c9a46; }
.surf--carpet { background: #8a6d3b; }
.surf--in { background: #5b5f97; }
.flag { margin-right: 5px; font-size: 1.05em; }

/* levels: tennis tiers. The note column wraps, unlike the pyramida table. */
.lv-table td.lv-note { white-space: normal; color: var(--dim); min-width: 220px; }
.lv-pts { color: var(--accent); font-weight: 700; }
/* Full width so the three cards line up; the wrap scrolls on a phone. */
.lv-wrap { overflow-x: auto; }
.lv-wrap .lv-table { display: table; width: 100%; }

/* Upsets (see upset() in app.js): a win over a much higher-ranked player, or a
   loss to a much lower-ranked one, gets the same hue several shades deeper. */
.match--mine-win.match--upset  { background: rgba(31, 168, 99, .38); border-color: #1fa863; }
.match--mine-loss.match--upset { background: rgba(200, 40, 55, .36); border-color: #c82837; }
.form__row--w.form__row--upset { background: rgba(31, 168, 99, .38); }
.form__row--l.form__row--upset { background: rgba(200, 40, 55, .36); }
.form__row--w.form__row--upset:hover { background: rgba(31, 168, 99, .5); }
.form__row--l.form__row--upset:hover { background: rgba(200, 40, 55, .48); }
/* No upset marking on common-opponent rows: only the recent-matches lists show it. */
.form__me { opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- School: guess the odds of a past draw match ---------- */
.sc-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 16px; }
.sc-go { background: var(--accent); color: #06131f; border-color: var(--accent); font-weight: 600; }
.sc-go:hover { filter: brightness(1.1); }
.sc-go:disabled { opacity: .5; }
.sc-stat { color: var(--dim); font-size: 13px; }
.sc-stat b { color: var(--text); }
.sc-bar { height: 4px; background: #e6e1cf; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sc-bar span { display: block; height: 100%; background: #2e7d32; }
.sc-hist { font-size: 13px; width: 100%; }
.sc-hist td { vertical-align: top; }
.sc-w { font-weight: 600; color: var(--win); }
.sc-grade { display: inline-block; padding: 2px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.sc-g1 { background: #1f5d3a; color: #b9f5cf; }
.sc-g2 { background: #3b5320; color: #dcf5b0; }
.sc-g3 { background: #5d4a1a; color: #f7dfa2; }
.sc-g4 { background: #5d2222; color: #f7b9b9; }

.sc-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.sc-head .back { color: var(--dim); text-decoration: none; white-space: nowrap; }
.sc-head .back:hover { color: var(--text); }
.sc-title { flex: 1; min-width: 0; }
.sc-rounds { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--dim); font-size: 13px; margin-bottom: 12px; }
.sc-rounds .btn { padding: 3px 9px; font-size: 12px; }
.sc-rounds .btn span { color: var(--dim); margin-left: 3px; }
.sc-rounds .btn.active { border-color: var(--accent); color: var(--accent); }

.sc-quiz { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.sc-q-top { font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.sc-q-top b { color: var(--text); }
.sc-q-top a { color: var(--accent); }
.sc-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.sc-vs { color: var(--dim); padding-top: 4px; }
.sc-name { font-size: 17px; font-weight: 600; }
.sc-seed { color: var(--dim); font-weight: 400; font-size: .85em; margin-right: 3px; }
.sc-in { display: inline-flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--dim); font-size: 13px; }
.sc-in input { width: 92px; font-size: 18px; padding: 6px 8px; }
.sc-hint { min-height: 18px; margin: 10px 0 4px; font-size: 13px; color: var(--dim); }
.sc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sc-res { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.sc-res-top { line-height: 1.7; }
.sc-res-top .sc-grade { margin-right: 6px; }
.sc-odds { margin: 10px 0; font-size: 14px; max-width: 640px; }
.sc-odds th:first-child { color: var(--dim); font-weight: 400; white-space: nowrap; }
.sc-drop { color: var(--win); font-size: 12px; margin-left: 4px; }
.sc-drift { color: #ff7a7a; font-size: 12px; margin-left: 4px; }
.sc-hot { font-size: 12px; margin-left: 4px; }
.sc-res-win { margin: 6px 0 4px; }
.sc-upset { color: var(--warn); margin-left: 6px; }

/* the bracket: paper like the draw sheets, columns centred on their feeders */
.sc-wrap { overflow-x: auto; background: #fdfbf3; border-radius: 8px; padding: 12px 10px 16px; color: #222; }
.sc-bracket { display: flex; gap: 22px; min-width: max-content; }
.sc-round { width: 210px; display: flex; flex-direction: column; }
.sc-rh { font-size: 12px; color: #776f57; text-align: center; margin-bottom: 6px; font-weight: 600; }
.sc-col { display: flex; flex-direction: column; justify-content: space-around; flex: 1;
          min-height: calc(var(--n) * 54px); }
.sc-m { position: relative; border: 1px solid #ddd6bf; border-radius: 5px; background: #fff; margin: 3px 0; font-size: 12px; }
.sc-m--can { cursor: pointer; }
.sc-m--can:hover { border-color: #1e4fd8; box-shadow: 0 0 0 1px #1e4fd8; }
.sc-m--target { border-color: #d32f2f; }
/* the hand-drawn circle round the match to price */
.sc-m--target::after { content: ''; position: absolute; inset: -9px -12px; border: 2.5px solid #d32f2f;
  border-radius: 50%; transform: rotate(-2.5deg); pointer-events: none; }
.sc-p { display: flex; gap: 5px; align-items: center; padding: 2px 6px; height: 21px; white-space: nowrap; }
.sc-p + .sc-p { border-top: 1px solid #f0ead8; }
.sc-p--w { font-weight: 700; }
.sc-p--tbd { color: #aaa; }
.sc-pn { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sc-rk { color: #8a8270; font-size: 11px; }
.sc-sets { color: #555; font-variant-numeric: tabular-nums; }
.sc-done { position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: #2e7d32; font-weight: 700; }
.h2h-before { background: #2b2410; border: 1px solid #5d4a1a; color: #f7dfa2; border-radius: 8px;
              padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.h2h-before .btn { margin-left: 8px; padding: 2px 8px; font-size: 12px; }
@media (max-width: 600px) {
  .sc-pair { grid-template-columns: 1fr; }
  .sc-vs { display: none; }
}

/* H2H signs: the opponent going into the match (signs() in app.js). */
.sg { display: inline-flex; gap: 6px; align-items: baseline; white-space: nowrap;
      font-size: 11px; font-variant-numeric: tabular-nums; color: var(--dim); }
.sg__elo { display: inline-block; min-width: 34px; padding: 0 4px; border-radius: 4px;
           text-align: center; font-weight: 600; background: var(--panel-2); }
.sg__elo--new { color: var(--dim); font-weight: 400; font-style: italic; }
.sg__elo--0 { color: var(--dim); }
.sg__elo--1 { color: var(--text); }
.sg__elo--2 { color: #9fd0ff; background: rgba(77, 163, 255, .14); }
.sg__elo--3 { color: #ffd38a; background: rgba(240, 179, 84, .16); }
.sg__elo--4 { color: #1a1206; background: #f0b354; }
.sg__form { letter-spacing: 1px; font-size: 10px; }
/* Each dot is one result: green won, red lost. */
.sg__w { color: var(--win); }
.sg__l { color: #e2707a; }
.sg__form { display: inline-flex; gap: 2px; letter-spacing: 0; }
/* Under each dot: was that opponent stronger (▲) or weaker (▼) than them? */
.sg__d { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.sg__op { font-style: normal; font-size: 7px; height: 7px; line-height: 7px; }
.sg__op--h { color: var(--accent); }
.sg__op--e { color: var(--warn); }
.sg-legend .sg__op { font-size: 9px; }
.sg__neu { color: var(--dim); font-weight: 700; }
.sg__sos { font-size: 10px; }
.sg__sos--up { color: var(--accent); }
.sg__sos--down { color: var(--warn); }
.sg__gs { min-width: 26px; text-align: right; }
.sg__gs--hi { color: var(--win); }
.sg__gs--lo { color: #e2707a; }
.sg-legend { color: var(--dim); font-size: 11px; margin: -4px 2px 8px; }
.sg-legend .sg__elo, .sg-legend .sg__form, .sg-legend .sg__sos, .sg-legend .sg__gs { font-size: 11px; }
/* Their own line under the opponent's name: beside it, four columns of
   recent form leave the name no room at all. */
.form__row .sg, .co-row .sg { grid-column: 2 / -1; grid-row: 2; margin-top: -3px; }
/* Full names, wrapping if need be: "Carlos Alc…" said nothing. */
.form__row .form__opp, .co-row .form__opp { white-space: normal; overflow: visible; }
.form__opp .match__age { white-space: nowrap; }

/* "Red on Winamax" list above the draw cards */
.hot-list { margin-bottom: 18px; }
.hot-list .draws-h span { color: var(--dim); font-weight: 400; }
.hot-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); text-decoration: none; }
.hot-row:hover { background: var(--panel-2); }
.hot-row.past { opacity: .55; }
/* On Tipsport, not on Winamax: the same rows, in Tipsport's blue. */
.hot-row.tiponly { border-color: #2f7fd6; box-shadow: 0 0 0 1px #2f7fd6 inset; }
.hot-row.tiponly .hot-pill { background: #1565c0; }
.hot-row.tiponly .hot-odds .wmx { color: var(--dim); }
.hot-pill { flex: none; min-width: 26px; padding: 2px 7px; border-radius: 10px; text-align: center;
  background: #f20d0d; color: #fff; font-weight: 700; font-size: 13px; }
.hot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hot-players { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-players i { color: var(--dim); font-style: normal; font-size: 12px; }
.hot-players .pick { font-weight: 700; }
.hot-meta { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-odds { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: 12px; font-variant-numeric: tabular-nums; }
.hot-odds .wmx { color: #ff6b6b; }
.hot-odds .tip { color: var(--accent); }

/* The player's own rating: in the H2H header, and "1890 vs" before each
   opponent's signs in the form and common-opponent rows. */
.h2h-elo { font-size: 12px; color: var(--dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.h2h-elo .sg { font-size: 12px; }
.h2h-elo .sg__elo { font-size: 13px; }
.sg--pair { flex-wrap: wrap; row-gap: 2px; }
.sg__me { opacity: .65; }
.sg__vs { font-style: normal; font-size: 10px; color: var(--dim); }
/* H2H link of a match where the lower-ranked player has the higher rating (dEloFlip). */
.dsheet .match-h2h.flip { border-color: #e0a100; background: #fff3c4; color: #7a5200; }
.dsheet .match-h2h.flip b { color: #d32f2f; margin-right: 2px; }

/* Opponent pop-up (openOpponent): their matches up to the clicked one. */
.opp-top { display: flex; align-items: center; gap: 10px; }
.opp-top .btn { padding: 2px 10px; }
.opp-signs { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; font-size: 12px; }
.opp-signs .sg { font-size: 12px; }
.opp-mode { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.opp-mode .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.opp-mode .dimcell { margin-left: auto; font-size: 12px; }
.opp-list .form__row[data-hl] { outline: 2px solid var(--warn); outline-offset: -2px; }

/* squash v2: link back to the Angular site */
.v1-link { font-size: 12px; font-weight: 400; margin-left: 10px; color: inherit; opacity: .6; }

/* ---- The main site's features (app.js, v1 block) ---- */
body.mode-global .sports, body.mode-global .controls { visibility: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.btn--danger { color: var(--bad, #f85149); }
.btn--danger:hover { border-color: var(--bad, #f85149); }
.tag--live { color: #fff; background: #d33; border-color: #d33; }

/* Injury cross beside a player in a match row. */
.inj { margin-left: 4px; font-size: 12px; cursor: pointer; opacity: .25; flex: none; }
.inj--half { color: var(--warn, #f0b354); opacity: 1; }
.inj--full { color: #f85149; opacity: 1; }
.inj:hover { opacity: 1; }

/* Medical card, photo, notes. */
.pextra { display: flex; gap: 14px; align-items: flex-start; margin: 8px 0; }
.pextra__info { line-height: 1.9; }
.pextra a { color: var(--accent); }
.pphoto { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.med { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; margin-right: 6px;
  background: rgba(63,185,80,.15); color: #3fb950; border: 1px solid rgba(63,185,80,.4); }
.med--half { background: rgba(240,179,84,.15); color: #f0b354; border-color: rgba(240,179,84,.5); }
.med--full { background: rgba(248,81,73,.15); color: #f85149; border-color: rgba(248,81,73,.5); }
.med--edit { cursor: pointer; }
.pnote { margin: 10px 0 12px; position: relative; }
.pnote textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 60px; font: inherit; font-size: 14px;
  color: inherit; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 8px 10px; }
.pnote textarea:focus { outline: none; border-color: #4ea8ff; }
.pnote__st { font-size: 12px; color: #3fb950; }

/* H2H: photos, cards, notes either side of the model's prediction. */
.h2h-extra { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; margin: 12px 0; }
.h2h-x { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.h2h-x .pnote { width: 100%; }
.pred { text-align: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
@media (max-width: 640px) { .h2h-extra { grid-template-columns: 1fr; } }

/* Livescores. */
.live-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.live-card { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 14px; cursor: pointer; }
.live-card:hover:not(:disabled) { border-color: var(--accent); }
.live-card:disabled { opacity: .5; cursor: default; }
.live-list { margin: 8px 0 16px; padding-left: 18px; line-height: 1.8; }
.live-list a { color: var(--accent); }

/* Winamax. */
.wmx-status { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.wmx-svc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #6b7280; }
.dot--ok { background: #3fb950; } .dot--stale { background: #f0b354; }
.dot--error { background: #f85149; } .dot--idle { background: #4ea8ff; }
.wmx-info { margin: 8px 0; font-size: 13px; }
.wmx-restart { margin: 10px 0; }
.wmx-tbl a { color: var(--accent); }
.wmx--done { opacity: .45; }

/* Tools. */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; margin-bottom: 14px; }
.tool h3 { margin-top: 0; }
.tool__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 8px 0 10px; }
.tool__grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.tool__grid input { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 8px; }
#tn-q { min-width: 260px; }
.tab[hidden] { display: none; }

/* Activity. */
.act-users { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.act-users .btn.active { border-color: var(--accent); }
.act-login td { color: var(--win); }
.act-site { font-size: 11px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); }
.act-site--v2 { color: var(--accent); }
.act-site--mobile { color: var(--warn); }

/* Activity: one row per user per day, opening to the individual clicks. */
.act-day { cursor: pointer; }
.act-day:hover td { background: var(--panel-2); }
.act-day td { font-weight: 600; }
.act-caret { display: inline-block; color: var(--dim); transition: transform .12s; }
.act-day--open .act-caret { transform: rotate(90deg); }
.act-click td:first-child { padding-left: 26px; }
.act-click[hidden] { display: none; }

/* Settings: one row per tab, a YES/NO switch for the other users. */
.set-tbl { max-width: 720px; }
.set-tbl .check { display: inline-flex; }
