/* ==========================================================================
   League Control - visual language borrowed from a pit wall timing monitor:
   dense monospaced timing data, hairline rules, signal colours used only
   where they carry meaning (amber = steward action, red = ban, green = clear).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:        #0C1017;
  --panel:     #151C26;
  --panel-2:   #1B2430;
  --line:      #26313F;
  --text:      #E6EDF6;
  --dim:       #7C8CA0;
  --amber:     #FFC145;   /* steward action pending */
  --green:     #3DDC97;   /* clear / classified */
  --red:       #FF5A5F;   /* ban / disqualified */
  --blue:      #5AA9FF;   /* informational */

  --display: 'Barlow Condensed', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --r: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0;
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; color: var(--dim); letter-spacing: 0.12em; }

a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- shell ---------------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  display: flex; flex-direction: column;
}

.brand {
  font-family: var(--display);
  font-size: 19px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.brand-mark { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }

.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail nav button {
  background: none; border: 0; color: var(--dim);
  text-align: left; padding: 9px 20px; cursor: pointer;
  font-family: var(--display); font-size: 15px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-left: 2px solid transparent;
}
.rail nav button:hover { color: var(--text); background: var(--panel-2); }
.rail nav button[aria-current='true'] {
  color: var(--text); border-left-color: var(--amber); background: var(--panel-2);
}
.rail nav button .badge {
  float: right; background: var(--amber); color: #000;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px;
}

.rail .foot { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid var(--line); }
.rail .foot .who { font-size: 12px; color: var(--dim); }
.rail .foot .who strong { display: block; color: var(--text); font-size: 13px; }

main { padding: 24px 28px 60px; overflow-x: auto; min-width: 0; }

.head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.head .sub { color: var(--dim); font-size: 13px; }
.head .spacer { flex: 1; }

/* --- controls ------------------------------------------------------------- */

.btn {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 13px; cursor: pointer;
  font-family: var(--display); font-size: 14px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--amber); color: #10141A; border-color: var(--amber); font-weight: 600; }
.btn.danger  { background: transparent; color: var(--red); border-color: var(--red); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

input, select, textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 9px; width: 100%;
}
input:focus, select:focus, textarea:focus,
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
textarea { min-height: 78px; resize: vertical; }

label { display: block; margin-bottom: 12px; }
label span { display: block; font-size: 11px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 130px; }

/* --- panels and tables ---------------------------------------------------- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 18px;
}
.panel > header {
  padding: 11px 15px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.panel > .body { padding: 15px; }

table { width: 100%; border-collapse: collapse; }
th {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim);
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 8px 12px; border-bottom: 1px solid rgba(38,49,63,0.5); }
tbody tr:hover { background: var(--panel-2); }
.num, td.time, td.pts { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.time { color: var(--dim); font-size: 13px; }
td.pts  { font-weight: 700; text-align: right; }

/* Position column reads like a timing tower. */
.pos {
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  width: 34px; text-align: right; color: var(--dim);
}
tr.p1 .pos { color: var(--amber); }
tr.p2 .pos, tr.p3 .pos { color: var(--text); }
tr.dsq td { opacity: 0.45; text-decoration: line-through; }

.delta { color: var(--red); font-family: var(--mono); font-size: 12px; }
.gain  { color: var(--green); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 2px; border: 1px solid;
}
.tag.captured  { color: var(--dim);   border-color: var(--line); }
.tag.review    { color: var(--amber); border-color: var(--amber); }
.tag.final     { color: var(--green); border-color: var(--green); }
.tag.dsq, .tag.ban { color: var(--red); border-color: var(--red); }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0;
  margin: 0;
}
.tag-list li { display: flex; align-items: center; }

.empty { padding: 34px 15px; text-align: center; color: var(--dim); }
.empty strong { display: block; color: var(--text);
  font-family: var(--display); font-size: 17px;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }

/* --- signature: the superlicence card ------------------------------------- */

.licences { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.licence {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 5px;
  padding: 14px; position: relative; overflow: hidden;
}
/* Left edge is the status stripe: it turns amber then red as points build. */
.licence::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--green);
}
.licence.warn::before { background: var(--amber); }
.licence.banned::before { background: var(--red); }

.licence .name {
  font-family: var(--display); font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.licence .team { color: var(--dim); font-size: 12px; margin-bottom: 10px; }

/* Points shown as pips, the way a licence is actually punched. */
.pips { display: flex; gap: 3px; margin: 10px 0 6px; flex-wrap: wrap; }
.pip {
  width: 13px; height: 17px; border-radius: 2px;
  border: 1px solid var(--line); background: transparent;
}
.pip.used { background: var(--amber); border-color: var(--amber); }
.pip.over { background: var(--red); border-color: var(--red); }
.pip.quali-line { border-right: 2px solid var(--dim); margin-right: 4px; }

.licence .scale {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; color: var(--dim);
}
.licence .status {
  margin-top: 9px; font-family: var(--mono); font-size: 11px;
  display: flex; align-items: center; gap: 6px;
}

/* --- stewards ------------------------------------------------------------- */

.incident { border-bottom: 1px solid var(--line); padding: 13px 15px; }
.incident:last-child { border-bottom: 0; }
.incident .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.incident .who { font-family: var(--display); font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.04em; }
.incident .meta { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.incident .desc { margin: 7px 0; color: var(--text); font-size: 13px; }
.incident .evidence { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.incident .evidence a {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line); border-radius: 2px; padding: 3px 7px;
}

.verdict-form { background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin-top: 11px; }

/* Only the fields the chosen outcome actually needs are shown. */
.verdict-form [data-when] { display: none; }
.verdict-form [data-when].on { display: block; }

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

.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login { width: 100%; max-width: 330px; }
.login .brand { border: 0; padding: 0 0 18px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  padding: 11px 17px; border-radius: var(--r);
  font-size: 13px; z-index: 50; max-width: 480px;
}
.toast.bad { border-left-color: var(--red); }
.toast.good { border-left-color: var(--green); }

.hint { color: var(--dim); font-size: 12px; margin-top: 5px; }
.mono { font-family: var(--mono); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; align-items: center;
    padding: 10px 16px; gap: 10px; }
  .rail .brand { border: 0; padding: 0; margin: 0; font-size: 15px; }
  .brand-mark { width: 22px; height: 22px; }
  /* Replaced by the fixed bottom bar below — a horizontal-scrolling row of
     nine items up here meant the one you wanted was often off-screen,
     and there was no way to tell more existed without dragging a finger
     across the top of the page to find out. */
  .rail nav { display: none; }
  .rail .foot { display: none; }
  main { padding: 16px 13px calc(78px + env(safe-area-inset-bottom)); }

  #bottom-tabs {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #bottom-tabs button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    appearance: none; background: none; border: 0;
    padding: 8px 4px 6px;
    color: var(--dim);
    font-family: var(--display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    position: relative;
  }
  #bottom-tabs button[aria-current='true'] { color: var(--amber); }
  .bottom-tab-icon { width: 22px; height: 22px; }
  #bottom-tabs .badge {
    position: absolute; top: 2px; right: calc(50% - 20px);
    background: var(--amber); color: #000;
    font-family: var(--mono); font-size: 9px; font-weight: 700;
    padding: 0px 4px; border-radius: 8px; line-height: 1.4;
  }

  .more-drawer {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-end;
  }
  .more-drawer-sheet {
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--panel);
    border-radius: var(--r) var(--r) 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .more-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
  }
  .more-drawer-head h3 { margin: 0; }
  .more-drawer-item {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    appearance: none; background: none; border: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 4px;
    color: var(--text);
    font-family: var(--display);
    font-size: 14px;
    text-align: left;
  }
  .more-drawer-item:last-child { border-bottom: 0; }
  .more-drawer-item[aria-current='true'] { color: var(--amber); }
  .more-drawer-item .badge {
    background: var(--amber); color: #000;
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 8px;
  }
}

@media (min-width: 821px) {
  #bottom-tabs, .more-drawer { display: none; }
}

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

/* ==========================================================================
   Championship tabs, constructor seats and the records boards
   ========================================================================== */

.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
}

.tabs button:hover { color: var(--text); }

.tabs button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--amber);
}

.tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* ==========================================================================
   Setup's landing page — a dashboard grid of tiles grouped under headings.
   Clicking a tile drills into that section; a "← Setup" link in the head
   brings you back. Nothing stays persistently on screen once you're inside
   a section, unlike the old always-visible tab/button bar.
   ========================================================================== */

.setup-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.setup-grid-group h4 {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.setup-group-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--amber);
}

.setup-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.setup-tile {
  appearance: none;
  text-align: left;
  background: var(--panel-2, rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.setup-tile:hover { border-color: var(--amber); transform: translateY(-1px); }
.setup-tile:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.setup-tile-label {
  font-weight: 700;
  font-size: 16px;
}

.setup-tile-desc {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
}

.panel-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 10px;
}

/* Both seats on one row, so a team reads as a pair rather than two entries. */
.seats { display: flex; flex-wrap: wrap; gap: 6px 14px; }

.seat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.seat em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 4px;
}

.seat b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  font-weight: 500;
}

/* Records */
.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}

.board ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.board li {
  counter-increment: rank;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--panel-2);
}

.board li:first-child { border-top: 0; }

.board li::before {
  content: counter(rank);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--dim);
  min-width: 16px;
}

.board .who { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }

.board .who em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
}

.board li b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* The leader of each board is the only thing coloured, so it reads at a glance. */
.board li:first-child b { color: var(--amber); }

@media (max-width: 720px) {
  .tabs { overflow-x: auto; }
  .seats { flex-direction: column; gap: 3px; }
}

/* ==========================================================================
   Across divisions: one leader card per division, and the standout above them
   ========================================================================== */

.standout {
  display: grid;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.standout-label {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.standout-name {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.standout-meta { font-size: 13px; color: var(--dim); }

.standout-stat {
  margin-top: 8px;
  font-size: 13px;
  color: var(--dim);
}

.standout-stat b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  color: var(--text);
  margin-right: 4px;
}

.leaders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.leader {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}

.leader-name {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
}

.leader-team {
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leader-team-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
}

.stepper-dots {
  display: flex;
  gap: 8px;
}

.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--panel-2, rgba(255,255,255,0.1));
  border: 1px solid var(--line);
}

.stepper-dot.done { background: var(--green, #22c98a); border-color: var(--green, #22c98a); }
.stepper-dot.current { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,180,0,0.15); }

.storyline-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}

.storyline-card {
  background: var(--panel-2, rgba(255,255,255,0.04));
  border-radius: 12px;
  padding: 20px 22px;
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.storyline-card:hover {
  background: rgba(255,255,255,0.07);
  transform: translateY(-2px);
}

.storyline-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  font-weight: 700;
}

.storyline-headline {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.storyline-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg);
}

.storyline-detail {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
  margin: 0;
}

label.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

label.checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin-top: 3px;
}

.leader-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--panel-2);
}

.leader-stats div { display: flex; flex-direction: column; gap: 1px; }

.leader-stats dt {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.leader-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

@media (max-width: 520px) {
  .standout-name { font-size: 26px; }
}

/* ==========================================================================
   Mobile
   A driver checks the standings on a phone on Sunday night. That is the
   primary case, not an afterthought, so below 760px the sidebar becomes a
   bottom bar and tables stop trying to be tables.
   ========================================================================== */

@media (max-width: 760px) {
  body { padding-bottom: env(safe-area-inset-bottom); }

  .layout { display: block; }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    height: auto;
    display: flex;
    overflow-x: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--panel);
    z-index: 50;
  }

  .sidebar .brand { display: none; }

  .sidebar nav { display: flex; gap: 4px; }

  .sidebar a {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
  }

  main { padding: 14px 14px 76px; }

  .head { flex-wrap: wrap; gap: 8px; }
  h1 { font-size: 22px; }

  /* Tables become stacked cards: a ten-column grid on a 390px screen is
     unreadable however small the type gets. */
  table.stack thead { display: none; }

  table.stack tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--panel-2);
  }

  table.stack td { border: 0; padding: 0; }
  table.stack td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  /* Keep the wide grids scrollable rather than stacked. */
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scroll-x table { min-width: 640px; }

  .boards, .leaders { grid-template-columns: 1fr; }
  .standout-name { font-size: 24px; }

  /* Touch targets. 44px is the smallest thing most people hit reliably. */
  button, .tabs button, select, input { min-height: 44px; }
}

@media (max-width: 400px) {
  main { padding: 12px 10px 76px; }
  .panel { padding: 14px 12px; }
}

/* --- live timing tower --------------------------------------------------- */

.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red, #ff5c5c);
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.7);
  animation: live-pulse 2s ease-in-out infinite;
}

.live-dot.stale { background: var(--dim); box-shadow: none; animation: none; }

@keyframes live-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

table.tower td { padding: 8px 12px; font-size: 14px; }
table.tower .num { font-variant-numeric: tabular-nums; text-align: right; }
table.tower tr.in-pit { opacity: 0.75; }
table.tower tr.out { opacity: 0.4; text-decoration: line-through; }

.pit, .pen {
  font-size: 10px; letter-spacing: 0.08em; padding: 1px 5px;
  border-radius: 2px; margin-left: 6px; vertical-align: middle;
}
.pit { background: rgba(79, 195, 232, 0.18); color: #4fc3e8; }
.pen { background: rgba(255, 176, 32, 0.18); color: #ffb020; }

/* --- download page ------------------------------------------------------- */

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.download {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  background: var(--panel-2);
  transition: border-color 0.12s ease;
}

.download:hover { border-color: var(--amber); }

.download-label {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.download-note { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }

.steps { margin: 0; padding-left: 20px; line-height: 1.7; }
.steps li { margin-bottom: 8px; }

.checksums td { padding: 6px 10px 6px 0; font-size: 12px; vertical-align: top; }
.checksums .mono {
  font-family: var(--mono);
  color: var(--dim);
  word-break: break-all;
}

/* --- setup screens -------------------------------------------------------- */

.seat-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--panel-2);
}

.seat-row:first-child { border-top: 0; }
.seat-row strong { min-width: 110px; padding-bottom: 8px; }
.seat-row label { flex: 1 1 180px; margin: 0; }
.seat-row.empty-row { color: var(--dim); }

.team-panel { border-left: 3px solid var(--line); }

.teams-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 720px) {
  .teams-cards { grid-template-columns: 1fr; }
}

.team-card header { display: flex; align-items: center; gap: 10px; }
.team-card header h3 { margin: 0; }

.team-divisions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.team-division {
  padding-top: 10px;
  border-top: 1px solid var(--panel-2);
}
.team-division:first-child { border-top: 0; padding-top: 0; }

.team-division h5 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.team-division-stats {
  font-family: var(--body, inherit);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  font-size: 12px;
}

.team-division-drivers { display: flex; flex-wrap: wrap; gap: 8px; }

.driver-chip {
  appearance: none;
  background: var(--panel-2, rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
}

.driver-chip:hover { border-color: var(--amber); }
.driver-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.team-card-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--panel-2, rgba(255,255,255,0.04));
}

.team-logo-inline {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
  vertical-align: -3px;
  margin-right: 5px;
}

.team-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
}

.team-logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--panel-2, rgba(255,255,255,0.04));
  border: 1px solid var(--line);
}

.round-image-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
}

.round-image-preview {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--panel-2, rgba(255,255,255,0.04));
  border: 1px solid var(--line);
}

.principal-team-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.principal-team-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--panel-2, rgba(255,255,255,0.04));
  border: 1px solid var(--line);
}

.principal-team-swatch {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.principal-drivers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.principal-driver-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.principal-driver-card.warn {
  border-color: var(--red, #c33);
  background: rgba(204, 51, 51, 0.06);
}

.principal-driver-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 17px;
}

.principal-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 12px 8px;
  margin: 14px 0;
}

.principal-stat-grid .stat strong { font-size: 20px; }

.principal-recent {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.principal-recent-dot {
  font-size: 12px;
  font-family: var(--body, inherit);
}

.principal-h2h {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-2);
}

.principal-h2h-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  background: var(--panel-2, rgba(255,255,255,0.08));
}

.principal-h2h-bar span { display: block; height: 100%; }

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.collapsible-header h3 { margin: 0; }
.collapsible-header .hint { font-size: 13px; }

.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 6px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--dim);
  vertical-align: middle;
}

.tag.warn { color: var(--amber); border-color: var(--amber); }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-left: 4px; }

td.mono { font-family: var(--mono); font-size: 12px; }
td.mono.missing { color: var(--red); }

tr.out { opacity: 0.45; }

.btn.danger { color: var(--red); border-color: var(--red); }

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 760px) {
  .seat-row { flex-direction: column; align-items: stretch; }
  .seat-row strong { min-width: 0; }
}

/* The hidden attribute must beat any display rule. Without this a class like
   .login-wrap { display: grid } silently overrides it, and the login screen
   stays painted over a dashboard that is working perfectly behind it. */
[hidden] { display: none !important; }

/* --- edit panels, notices and keys ---------------------------------------- */

.edit-panel { border-left: 3px solid var(--amber); margin-bottom: 14px; }

.notice {
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 14px;
}

.notice.warn { border-color: var(--amber); color: var(--amber); }

.tag.good { color: var(--green, #22c98a); border-color: var(--green, #22c98a); }

.spacer { flex: 1; }

.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

p.key {
  font-size: 18px;
  letter-spacing: 0.14em;
  word-break: break-all;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 6px 0 14px;
}

#invite-screen { position: fixed; inset: 0; background: var(--bg, #0b0f0e); z-index: 100; }

/* --- points editor -------------------------------------------------------- */

.points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.points-editor {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--panel-2);
}

.points-head {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.points-table { width: 100%; border-collapse: collapse; }
.points-table th {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim); text-align: left; padding: 0 6px 6px 0; font-weight: 600;
}
.points-table td { padding: 2px 6px 2px 0; }
.points-table input {
  width: 100%; min-height: 34px; padding: 4px 8px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.points-table td:last-child { width: 1%; white-space: nowrap; }
.points-editor .add-row { margin-top: 8px; }

.inline-in {
  background: transparent; border: 1px solid transparent;
  color: var(--text); padding: 5px 7px; border-radius: 3px; width: 100%;
}
.inline-in:hover { border-color: var(--line); }
.inline-in:focus { border-color: var(--amber); background: var(--panel-2); outline: none; }

.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 180px; }

/* --- the desktop app guide ------------------------------------------------ */

.settings-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.settings-table th, .settings-table td {
  text-align: left; padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--panel-2);
  font-weight: 400; font-size: 14px;
}
.settings-table th { color: var(--dim); width: 45%; font-weight: 500; }
.settings-table tr.critical td { color: var(--amber); }

.faq { margin: 0; }
.faq dt {
  font-weight: 600; font-size: 14px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--panel-2);
}
.faq dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.faq dd { margin: 4px 0 0; color: var(--dim); font-size: 14px; line-height: 1.6; }

pre.code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px;
  font-family: var(--mono); font-size: 12px;
  overflow-x: auto; margin: 8px 0;
}

/* --- a driver's own submission page --------------------------------------- */

#submit-screen { position: fixed; inset: 0; overflow-y: auto; background: var(--bg, #0b0f0e); z-index: 90; }

.submit-wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 60px; }

.submit-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.submit-head h1 { margin: 0; font-size: 26px; }

.panel.urgent { border-left: 3px solid var(--amber); }

.case { padding: 14px 0; border-top: 1px solid var(--panel-2); }
.case:first-child { border-top: 0; padding-top: 0; }
.case-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.case-desc { margin: 8px 0; line-height: 1.6; }

.answered {
  border-left: 2px solid var(--green, #22c98a);
  padding: 8px 0 8px 12px; margin: 10px 0;
}
.answered strong { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.answered p { margin: 4px 0 0; }

.defence-form { margin-top: 10px; }
.submit-foot { text-align: center; margin-top: 24px; }

textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 3px; color: var(--text); padding: 9px 11px;
  font-family: inherit; font-size: 14px; line-height: 1.5; resize: vertical;
}
textarea:focus { border-color: var(--amber); outline: none; }

.late-ack {
  border: 1px solid var(--amber);
  border-radius: var(--r);
  padding: 10px 12px;
  margin: 12px 0;
  background: rgba(255, 176, 32, 0.07);
}

em.unit {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  margin-left: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- two-factor enrolment ------------------------------------------------- */

.qr-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 14px 0;
}

/* White backing: a QR code needs light quiet zones to scan reliably, and the
   page behind it is nearly black. */
.qr {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 10px;
  border-radius: var(--r);
  flex: none;
}

.qr-alt { flex: 1 1 240px; min-width: 220px; }
.qr-alt .key { font-size: 15px; letter-spacing: 0.12em; }

@media (max-width: 560px) {
  .qr-row { flex-direction: column; }
  .qr { width: 180px; height: 180px; align-self: center; }
}

/* --- driver movements ----------------------------------------------------- */

.move-current {
  padding: 12px 14px;
  background: var(--panel-2);
  border-radius: var(--r);
  margin: 12px 0;
  font-size: 14px;
}

.swap-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--blue, #4fc3e8); border-radius: var(--r);
  background: rgba(79, 195, 232, 0.07);
  font-size: 14px;
}

.preview-box {
  border: 1px solid var(--line); border-left: 3px solid var(--green, #22c98a);
  border-radius: var(--r); padding: 14px 16px; margin: 14px 0;
}
.preview-box.warn { border-left-color: var(--amber); }

.preview-kind {
  font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 6px;
}

.preview-table { width: 100%; max-width: 340px; margin: 10px 0; }
.preview-table td { padding: 5px 0; font-size: 14px; }
.preview-table td.num {
  text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.preview-table td.num.drop { color: var(--amber); }

.merge-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 12px 0;
}
.merge-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--panel-2);
}
.merge-card.merge-keep { border-color: var(--green); }

.where-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin: 12px 0;
  background: var(--panel-2); border-radius: var(--r); font-size: 14px;
}

/* --- add / bulk panels ---------------------------------------------------- */

.panel-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.import-report { margin-top: 16px; }

.fail-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.fail-table th {
  text-align: left; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim); padding: 0 10px 6px 0; font-weight: 600;
}
.fail-table td { padding: 6px 10px 6px 0; font-size: 13px; border-top: 1px solid var(--panel-2); }
.fail-table td.num { font-family: var(--mono); color: var(--dim); width: 1%; }

.division-box {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 12px 0;
  background: var(--panel-2);
}

.division-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 8px 0;
}

.division-ticks .checkbox { margin: 0; }

select[multiple] { padding: 6px; }

/* --- division assignment -------------------------------------------------- */

.division-picker {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 12px 0;
  background: var(--panel-2);
}

.picker-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.picker-boxes { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.picker-boxes .checkbox { margin: 0; }
.division-picker .hint { margin-top: 8px; }

.seat-note {
  border-left: 2px solid var(--line);
  padding-left: 10px;
  margin: 10px 0;
}

/* --- weekend format picker ------------------------------------------------ */

.format-picker {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 12px 0;
  background: var(--panel-2);
}

.format-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.format-option + .format-option { border-top: 1px solid var(--line); }
.format-option input { margin-top: 4px; }
.format-option span { display: flex; flex-direction: column; gap: 2px; }
.format-option em { font-style: normal; font-size: 12px; color: var(--dim); }

/* --- the calendar grid ---------------------------------------------------- */

table.grid { width: 100%; border-collapse: collapse; min-width: 780px; }

table.grid th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
  padding: 0 8px 8px 0;
}

table.grid th .hint { display: inline; font-size: 10px; text-transform: none; letter-spacing: 0; }
table.grid td { padding: 3px 8px 3px 0; vertical-align: middle; }

table.grid input, table.grid select {
  width: 100%;
  min-height: 38px;
  padding: 6px 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-size: 13px;
}

table.grid input:focus, table.grid select:focus {
  border-color: var(--amber);
  outline: none;
}

table.grid td:last-child { width: 1%; white-space: nowrap; }

/* The native date control draws its own calendar icon, but dark on dark is
   invisible, so it gets inverted. */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

.swatch {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 3px; border: 1px solid var(--line); vertical-align: middle;
}

.sub-head {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--panel-2);
}

/* --- unmatched driver names during import --------------------------------- */

.unmatched-row {
  padding: 12px 0;
  border-top: 1px solid var(--panel-2);
}
.unmatched-row:first-child { border-top: 0; padding-top: 0; }

.unmatched-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.unmatched-match, .unmatched-create { margin-top: 8px; }

/* --- filterable / sortable lists ------------------------------------------ */

.list-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.list-search { flex: 1 1 220px; min-width: 160px; }
.list-division { flex: 0 0 auto; min-width: 160px; }

th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover { color: var(--amber); }

/* --- searchable driver picker ---------------------------------------------- */

.driver-picker input.dp-input { width: 100%; }

/* --- public tickets screen and approvals ----------------------------------- */

#tickets-screen { position: fixed; inset: 0; overflow-y: auto; background: var(--bg, #0b0f0e); z-index: 90; }

.approvals-list { display: flex; flex-direction: column; gap: 14px; }
.approval-card { border-left: 3px solid var(--amber); }
.approval-card .actions { margin-top: 12px; }

/* --- live timing: division tabs and tyre indicators ------------------------ */

.live-tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.live-tab-bar button {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-2);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.live-tab-bar button[aria-selected="true"] {
  background: var(--amber);
  color: #1a1200;
  border-color: var(--amber);
  font-weight: 600;
}

.wear-bar {
  display: inline-block;
  width: 44px;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 4px;
}
.wear-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }

.corners {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 6px;
  vertical-align: middle;
}

.tyre {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #111;
}
/* Matching the colours used on real F1 broadcasts and timing screens. */
.tyre-soft { background: #ff3333; color: #fff; }
.tyre-medium { background: #ffe135; }
.tyre-hard { background: #f2f2f2; }
.tyre-intermediate { background: #43b02a; color: #fff; }
.tyre-wet { background: #0067c6; color: #fff; }

/* --- driver profile stat grid ---------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}
.stat {
  text-align: center;
  padding: 10px 6px;
  border-radius: 8px;
  background: var(--panel-2);
}
.stat strong { display: block; font-size: 22px; }
.stat span { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }

/* --- season setup checklist ------------------------------------------------- */

.season-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.season-step-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--dim);
}
.season-step.done .season-step-mark {
  background: var(--good, #3ba55c);
  border-color: var(--good, #3ba55c);
  color: #fff;
}
.season-step p { margin: 2px 0 0; }

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --------------------------------------------------- stream overlay ---- */

body.overlay-mode {
  background: transparent !important;
  margin: 0;
}
body.overlay-mode #login, body.overlay-mode #app { display: none !important; }

#overlay-page {
  font-family: var(--body, system-ui, sans-serif);
  width: fit-content;
  min-width: 320px;
}

.overlay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: rgba(12, 16, 23, 0.82);
  border-left: 4px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.overlay-row:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; }
.overlay-row:last-child { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-bottom: none; }

.overlay-pos {
  width: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.overlay-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overlay-name em { font-style: normal; color: #4fc3e8; font-size: 12px; margin-left: 4px; }

.overlay-tyre {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.overlay-gap {
  width: 74px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.overlay-empty {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  border-left: none;
}

/* ==========================================================================
   Public embed pages — minimal chrome, meant to sit inside another site's
   iframe. Deliberately self-contained rather than reusing .panel/.tabs, so
   this never silently breaks if the main app's styling changes.
   ========================================================================== */

.embed-page {
  font-family: var(--body, system-ui, sans-serif);
  background: transparent;
  color: var(--text, #eaf4f6);
  padding: 4px;
}

.embed-loading, .embed-error {
  padding: 20px;
  text-align: center;
  color: var(--dim, #8fb2ba);
}

.embed-tabs, .embed-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.embed-tab, .embed-subtab {
  appearance: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line, #223);
  border-radius: 999px;
  color: var(--dim, #8fb2ba);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
}

.embed-tab[aria-selected="true"], .embed-subtab[aria-selected="true"] {
  background: var(--amber, #ffb020);
  border-color: var(--amber, #ffb020);
  color: #111;
}

.embed-leaders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.embed-leader-card {
  border: 1px solid var(--line, #223);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 8px 10px;
}

.embed-leader-division {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim, #8fb2ba);
}

.embed-leader-name { font-weight: 700; margin-top: 2px; }
.embed-leader-team { font-size: 12px; color: var(--dim, #8fb2ba); }
.embed-leader-points { font-size: 15px; font-weight: 700; margin-top: 4px; }

.embed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.embed-table th, .embed-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line, #223);
  text-align: left;
}

.embed-table th.num, .embed-table td.num { text-align: right; }

.embed-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
