/* ==========================================================================
   Match Tag — design system

   Direction: a pitch under floodlights. The page is deep ink navy, the only
   green on it is the pitch itself, and the accent is the warm amber of stadium
   lights rather than a screen colour. Team colours are the two brightest
   things on screen, because in match data the team is the first thing you read.

   Type: Big Shoulders Display for anything that behaves like signage — the
   masthead, stat figures, team names. IBM Plex Sans for reading, IBM Plex Mono
   for anything positional or temporal, where digits must line up.
   ========================================================================== */

:root {
  /* Surfaces, darkest to lightest */
  --ink:            #0a1120;
  --surface:        #101a2c;
  --surface-2:      #16233a;
  --surface-3:      #1e2e49;
  --line:           #24344f;
  --line-soft:      #1b2941;

  /* Text */
  --chalk:          #e9eef7;
  --chalk-dim:      #9fb0cc;
  --chalk-faint:    #6c7f9d;

  /* The pitch — the one green surface */
  --turf:           #2c6540;
  --turf-light:     #33734a;
  --turf-line:      #dfe8f2;

  /* Floodlight */
  --amber:          #ffb020;
  --amber-dim:      #b87c14;

  /* Teams: overridden per match from the tagger's own colour pickers */
  --team-1:         #e8503a;
  --team-2:         #3d8bfd;

  /* Signals */
  --good:           #3fd98a;
  --bad:            #ff5c5c;
  --warn:           #ffc861;

  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      16px;

  --shadow-lift:    0 10px 30px rgba(0, 0, 0, .45);
  --shadow-panel:   0 1px 0 rgba(255, 255, 255, .03) inset;

  --font-display:   'Big Shoulders Display', 'Arial Narrow', system-ui, sans-serif;
  --font-body:      'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:      'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --header-h:       58px;
  --gap:            14px;
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* A faint floodlight glow from above, so the page is not a flat black field */
  background-image:
    radial-gradient(1200px 420px at 50% -180px, rgba(255, 176, 32, .07), transparent 70%),
    radial-gradient(900px 500px at 100% 0, rgba(61, 139, 253, .05), transparent 65%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

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

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2b4066; }

/* -------------------------------------------------------------------------- */
/* Typographic roles                                                          */
/* -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--chalk-faint);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1;
}

.figure {
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: .95;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.muted { color: var(--chalk-dim); }
.faint { color: var(--chalk-faint); }

/* -------------------------------------------------------------------------- */
/* Masthead                                                                   */
/* -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: rgba(10, 17, 32, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--chalk);
  white-space: nowrap;
}
.brand b { color: var(--amber); font-weight: 800; }

/* The scoreline sits in the masthead the way it does on a broadcast. */
.scoreline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.scoreline .side {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.scoreline .swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}
.scoreline .name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 15ch;
}
.scoreline .score {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0 8px;
  color: var(--amber);
}

.masthead .spacer { flex: 1; }

/* -------------------------------------------------------------------------- */
/* Buttons and inputs                                                         */
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, transform .06s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: #2e4160; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #241701;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #ffc247; border-color: #ffc247; }

.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 92, 92, .12); border-color: rgba(255, 92, 92, .4); }

.btn-sm { height: 27px; padding: 0 9px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; }

.input, .select, textarea.input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
  min-width: 0;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus { border-color: var(--amber-dim); }
.input::placeholder { color: var(--chalk-faint); }

.select {
  appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239fb0cc' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--chalk-faint);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.link-button {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; text-transform: none; letter-spacing: 0;
  color: var(--amber); text-decoration: underline; text-underline-offset: 2px;
}
.link-button:hover { color: #ffc247; }
.select:disabled { opacity: .75; cursor: default; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-tight { gap: 5px; }

/* -------------------------------------------------------------------------- */
/* Panels                                                                     */
/* -------------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 44px;
}
.panel-head .spacer { flex: 1; }

.panel-body { padding: 13px; min-width: 0; }
.panel-body-flush { padding: 0; }

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  align-items: start;
  max-width: 1900px;
  margin: 0 auto;
}

.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.full-width { grid-column: 1 / -1; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------------------- */
/* Video                                                                      */
/* -------------------------------------------------------------------------- */

.video-frame {
  position: relative;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }

.video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  color: var(--chalk-dim);
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .012) 0 22px, transparent 22px 44px),
    var(--surface);
}
.video-empty .figure { font-size: 46px; color: var(--chalk-faint); letter-spacing: .02em; }

.video-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.clock {
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  padding: 4px 9px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.clock b { color: var(--amber); font-weight: 500; }

/* -------------------------------------------------------------------------- */
/* Timeline — the signature element                                           */
/*                                                                            */
/* Events sit above or below a centre axis according to team, so a passage of  */
/* play reads as a shape: sustained pressure is a run of ticks on one side.    */
/* -------------------------------------------------------------------------- */

.timeline {
  position: relative;
  height: 74px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius) var(--radius);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}
.timeline canvas { display: block; width: 100%; height: 100%; }

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--chalk-faint);
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.legend-chip { display: inline-flex; align-items: center; gap: 5px; }
.legend-chip i {
  width: 9px; height: 9px; border-radius: 2px; display: inline-block;
}

/* -------------------------------------------------------------------------- */
/* Pitch                                                                      */
/* -------------------------------------------------------------------------- */

.pitch-wrap {
  position: relative;
  background: var(--turf);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 120 / 80;
}
.pitch-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.pitch-wrap.is-armed canvas { cursor: cell; }

.pitch-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10, 17, 32, .82);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--chalk-dim);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .18s ease;
}
.pitch-hint.is-visible { opacity: 1; }

/* Event type palette */
.palette { display: flex; flex-wrap: wrap; gap: 6px; }

.evt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 10px 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--chalk);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.evt:hover { background: var(--surface-3); }
.evt.is-active {
  background: rgba(255, 176, 32, .14);
  border-color: var(--amber);
  color: #ffd88a;
}
.evt kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .07);
  color: var(--chalk-faint);
}
.evt.is-active kbd { background: rgba(255, 176, 32, .2); color: #ffd88a; }
.evt .kill {
  display: none;
  margin-left: 2px;
  width: 15px; height: 15px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--chalk-dim);
  font-size: 11px; line-height: 1;
  cursor: pointer;
  padding: 0;
}
.evt:hover .kill { display: inline-flex; align-items: center; justify-content: center; }
.evt .kill:hover { background: var(--bad); color: #fff; }

/* Two-team toggle */
.team-toggle { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.team-toggle button {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border: 0;
  background: var(--surface);
  color: var(--chalk-dim);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 0;
  transition: background .12s ease, color .12s ease;
}
.team-toggle button span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-toggle button i {
  width: 9px; height: 9px; border-radius: 2px; flex: none;
}
.team-toggle button.is-active { background: var(--surface-3); color: var(--chalk); }
.team-toggle button:not(:last-child) { border-right: 1px solid var(--line); }

/* -------------------------------------------------------------------------- */
/* Tabs and workspace panel                                                   */
/* -------------------------------------------------------------------------- */

.tabs { display: flex; gap: 2px; align-items: center; }

.tab {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--chalk-faint);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--chalk-dim); }
.tab.is-active { color: var(--chalk); border-bottom-color: var(--amber); }
.tab .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--chalk-dim);
  letter-spacing: 0;
}

.tabpane { display: none; }
.tabpane.is-active { display: block; }

/* -------------------------------------------------------------------------- */
/* Tables                                                                     */
/* -------------------------------------------------------------------------- */

.table-scroll { overflow: auto; max-height: 380px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--chalk-faint);
  white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--chalk-dim); }
table.data th[data-dir="asc"]::after  { content: " ▲"; font-size: 8px; color: var(--amber); }
table.data th[data-dir="desc"]::after { content: " ▼"; font-size: 8px; color: var(--amber); }

table.data td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  color: var(--chalk);
}
table.data tbody tr:hover td { background: rgba(255, 255, 255, .035); }
table.data tbody tr.is-selected td { background: rgba(255, 176, 32, .1); }
table.data td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--chalk-dim);
  white-space: nowrap;
}
.tag-good { background: rgba(63, 217, 138, .15); color: var(--good); }
.tag-bad  { background: rgba(255, 92, 92, .15);  color: var(--bad); }
.tag-goal { background: var(--good); color: #05230f; font-weight: 700; }
.tag-ai   { background: rgba(255, 176, 32, .14); color: var(--amber); }
/* Weak evidence. Amber rather than red: the event is probably real, it is the
   support for it that is thin, and colouring that like a failure would read as
   "this did not happen". The word beside it carries the meaning either way. */
.tag-warn { background: rgba(255, 176, 32, .14); color: var(--amber); }

.team-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.empty-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--chalk-faint);
}
.empty-state .figure { font-size: 30px; color: var(--chalk-faint); margin-bottom: 6px; }
.empty-state p { margin: 4px 0 0; font-size: 13px; }

/* -------------------------------------------------------------------------- */
/* Statistics                                                                 */
/* -------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.stat-card .figure { font-size: 30px; }
.stat-card .eyebrow { margin-top: 3px; }

/* A single bar split between the two teams: the comparison is the point, so
   one bar reads faster than two. */
.versus { display: grid; gap: 11px; }
.versus-row { display: grid; grid-template-columns: 62px 1fr 62px; gap: 10px; align-items: center; }
.versus-row .v-num {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.versus-row .v-num.left  { text-align: right; }
.versus-row .v-num.right { text-align: left; }
.versus-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  display: flex;
}
.versus-bar i { display: block; height: 100%; }
.versus-label {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: -6px;
}

/* Two independent meters, for rates that do not sum between teams. */
.rate-pair { display: grid; gap: 4px; }
.rate-track {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.rate-track i { display: block; height: 100%; border-radius: 999px; }

canvas.heatmap {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}

/* The running list of what has just been tagged, beside the video. */
.feed { display: flex; flex-direction: column; overflow: hidden; }
.feed-list { overflow: auto; flex: 1; min-height: 120px; }
.feed-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 7px 13px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 12.5px;
}
.feed-item:hover { background: rgba(255, 255, 255, .04); }
.feed-item.is-selected { background: rgba(255, 176, 32, .1); }
.feed-item .at { font-family: var(--font-mono); font-size: 11.5px; color: var(--chalk-faint); }
.feed-item .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .who { color: var(--chalk-dim); }

.timeline-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--chalk-faint);
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Analysis panel                                                             */
/* -------------------------------------------------------------------------- */

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  background: rgba(255, 255, 255, .012);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--amber);
  background: rgba(255, 176, 32, .06);
}
.dropzone .figure { font-size: 24px; color: var(--chalk-dim); }

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  transition: width .35s ease;
}

.stage-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.stage-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--chalk-faint);
}
.stage-item .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface-3); flex: none;
}
.stage-item.is-active { color: var(--chalk); background: var(--surface-3); }
.stage-item.is-active .dot { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.stage-item.is-done { color: var(--chalk-dim); }
.stage-item.is-done .dot { background: var(--good); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.notice {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--chalk-dim);
  line-height: 1.6;
}
.notice-warn { border-color: rgba(255, 200, 97, .34); background: rgba(255, 200, 97, .08); color: #ffdc9a; }
.notice-bad  { border-color: rgba(255, 92, 92, .34);  background: rgba(255, 92, 92, .08);  color: #ffb3b3; }
.notice code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(0, 0, 0, .3);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--amber);
}

/* -------------------------------------------------------------------------- */
/* Toasts and shortcuts                                                       */
/* -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
  animation: toast-in .22s ease;
}
.toast-good { border-left: 3px solid var(--good); }
.toast-bad  { border-left: 3px solid var(--bad); }
.toast-info { border-left: 3px solid var(--amber); }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog.sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--chalk);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-lift);
}
dialog.sheet::backdrop { background: rgba(4, 8, 16, .68); backdrop-filter: blur(3px); }
dialog.sheet .panel-body { max-height: 70vh; overflow: auto; }

.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 7px 18px; }
.keys div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 3px 0; }
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--chalk-dim);
  white-space: nowrap;
}

/* GitHub's own green, so the button reads as GitHub's rather than ours. */
.btn-github {
  background: #23863620;
  border-color: #2ea04355;
  color: #7ee787;
  text-decoration: none;
}
.btn-github:hover { background: #23863635; border-color: #2ea043; text-decoration: none; }

/* One ad unit, below the work. Labelled, boxed and kept out of the tagging
   flow — an advert inside the pitch or the timeline would cost more in
   mis-clicks than it earns. */
.ad-slot {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 10px 14px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  min-height: 60px;
}
.ad-slot .eyebrow { display: block; margin-bottom: 8px; }

.site-footer {
  padding: 22px 18px 34px;
  text-align: center;
  color: var(--chalk-faint);
  font-size: 12px;
  border-top: 1px solid var(--line-soft);
  margin-top: 20px;
}
.footer-line { margin: 0; color: var(--chalk-dim); font-size: 13px; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--chalk-dim);
  font-size: 12.5px;
  text-decoration: none;
}
.footer-links a:hover { color: var(--amber); text-decoration: none; }


/* ---------------------------------------------- editing a tagged event */

/* Tagging live means getting things wrong, and the row being corrected should
   look like a form rather than like a row that has gone strange. */
.data tr.is-editing {
  background: rgba(255, 176, 32, .07);
  box-shadow: inset 2px 0 0 var(--amber);
}

.input-sm {
  padding: 4px 7px;
  font-size: 12.5px;
  height: 28px;
  min-width: 0;
  width: 100%;
}

/* Buttons that belong together must not be split across two lines when the
   table is narrow — a Save that has wrapped away from its Cancel reads as two
   unrelated controls. */
.nowrap { white-space: nowrap; }
