:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --raised: #ffffff;
  --hover: #f1f3f7;
  --line: #e2e6ec;
  --line-strong: #c9d0da;
  --text: #12151a;
  --muted: #5d6673;
  --faint: #8a93a0;
  --accent: #2563eb;
  --accent-soft: #e6eefe;
  --on-accent: #ffffff;
  --done: #16a34a;
  --changed: #e08a00;
  --changed-soft: #fff4e0;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgb(15 23 42 / .14), 0 2px 6px rgb(15 23 42 / .08);
  --ring: rgb(0 0 0 / .35);   /* outline so near-white/near-black colours stay visible */
  color-scheme: light;
}
/* Row size: large by default, body.compact for the dense view */
body {
  --cols: minmax(240px, 1.4fr) 196px 144px 188px 184px 136px 200px 180px minmax(180px, 1fr);
  --grid-min: 1648px;
  --row-min: 78px;
  --ctl-pad: 9px 12px;
  --pole-w: 16px; --pole-h: 64px;
  --sw-w: 44px; --sw-h: 27px;
  --pat-w: 120px; --pat-h: 60px;
}
body.compact {
  --cols: minmax(230px, 1.4fr) 180px 128px 176px 128px 88px 176px 160px minmax(150px, 1fr);
  --grid-min: 1418px;
  --row-min: 46px;
  --ctl-pad: 7px 10px;
  --pole-w: 10px; --pole-h: 36px;
  --sw-w: 30px; --sw-h: 17px;
  --pat-w: 72px; --pat-h: 34px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13;
    --panel: #15181e;
    --raised: #1d2129;
    --hover: #252a34;
    --line: #262b34;
    --line-strong: #3a414d;
    --text: #f1f3f6;
    --muted: #a7afbb;
    --faint: #7c8592;
    --accent: #4d8dff;
    --accent-soft: #1b2a47;
    --on-accent: #ffffff;
    --done: #3ccb7f;
    --changed: #f5a524;
    --changed-soft: #2d2412;
    --danger: #f87171;
    --shadow: 0 12px 32px rgb(0 0 0 / .55), 0 2px 8px rgb(0 0 0 / .4);
    --ring: rgb(255 255 255 / .38);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Elements toggled with the hidden attribute must stay hidden even when a rule sets display */
[hidden] { display: none !important; }
html, body { margin: 0; }
/* App layout: fixed header; the league list and the table each scroll on their own */
body {
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top {
  position: relative; z-index: 20; flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand h1 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.brand .sub { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; }
.tabs button {
  border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  font-weight: 500; color: var(--muted);
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.tabs button[aria-selected="true"] .count { color: color-mix(in srgb, var(--on-accent) 80%, transparent); }
.count { color: var(--faint); font-size: 12px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.tools input {
  border: 1px solid var(--line-strong); background: var(--raised);
  border-radius: 8px; padding: 7px 11px; width: 220px;
}
.tools input::placeholder { color: var(--faint); }
.filters { display: flex; padding: 3px; gap: 2px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; }
.filters button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13px; }
.filters button:hover { color: var(--text); }
.filters button.on { background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); min-width: 140px; justify-content: flex-end; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--done); }
.status.busy .dot { background: var(--accent); }
.status.error { color: var(--danger); }
.status.error .dot { background: var(--danger); }
.banner { flex: none; padding: 10px 20px; background: var(--changed-soft); border-bottom: 1px solid var(--changed); }

/* Layout */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px 1fr; }
.nav {
  overflow: auto;
  padding: 14px 10px 28px; border-right: 1px solid var(--line);
}
.nav h2 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 16px 10px 6px; }
.nav h2:first-child { margin-top: 0; }
.nav a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13px;
}
.nav a:hover { background: var(--hover); }
.nav a .n { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.nav a.complete .n { color: var(--done); font-weight: 600; }
.main { padding: 16px 20px 96px; min-width: 0; overflow: auto; }

/* League sections, each as wide as its table so the main area scrolls sideways */
.section { width: max-content; min-width: 100%; margin-bottom: 22px; scroll-margin-top: 8px; }
.section-head { display: flex; align-items: baseline; gap: 12px; padding: 4px 2px 10px; position: sticky; left: 0; }
.section-head h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.section-head .meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.grid { min-width: var(--grid-min); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row {
  display: grid; grid-template-columns: var(--cols); align-items: center;
  min-height: var(--row-min); border-top: 1px solid var(--line);
}
body:not(.compact) .row:not(.head) > div { padding: 8px 10px; }
body:not(.compact) .name .label { font-size: 15px; }
.row:first-child { border-top: 0; }
.row:not(.head):hover { background: color-mix(in srgb, var(--hover) 55%, transparent); }
.row.head {
  min-height: 34px; background: var(--raised);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
}
.row > div { padding: 5px 8px; min-width: 0; }
/* Filterable column titles */
.head-filter {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin: -3px -6px; padding: 3px 6px;
  border: 0; border-radius: 6px; background: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.head-filter:hover, .head-filter.open { background: var(--hover); color: var(--text); }
.head-filter .caret { font-size: 10px; opacity: .7; }
.head-filter.active { background: var(--accent-soft); color: var(--accent); }
.clear-filters {
  padding: 6px 11px; border: 1px solid var(--accent); border-radius: 9px; cursor: pointer; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 500;
}
/* View only: a per-browser lock on editing */
.view-only {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.view-only:hover { color: var(--text); }
.view-only[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.name {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
  align-self: stretch; box-shadow: inset 3px 0 0 transparent; padding-left: 14px !important;
}
.row.done .name { box-shadow: inset 3px 0 0 var(--done); }
.name .title { display: flex; align-items: center; gap: 6px; max-width: 100%; }
/* Name and ID copy themselves on click */
.name .label, .name .id, .name .venue {
  border: 0; background: none; cursor: pointer; border-radius: 5px; text-align: left;
  padding: 2px 4px; margin-left: -4px;
}
.name .venue:hover { background: var(--hover); color: var(--text); }
.name .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.name .id { flex: none; margin-left: 0; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.name .label:hover, .name .id:hover { background: var(--hover); }
.name .id:hover { color: var(--text); }
/* Copy feedback changes colour only, so nothing shifts */
.name .copied, .name .copied:hover { color: var(--done); background: color-mix(in srgb, var(--done) 16%, transparent); }

/* Dropdown buttons */
.pick {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: var(--ctl-pad); border-radius: 8px; cursor: pointer; text-align: left;
  border: 1px solid var(--line-strong); background: var(--raised);
  transition: border-color .12s, background .12s;
}
.pick:hover:not(:disabled) { border-color: var(--faint); background: var(--hover); }
.pick .value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.empty .value { color: var(--faint); }
.pick.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pick::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: -3px;
  border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted); transform: rotate(45deg);
}

/* Shared menu */
.menu {
  position: fixed; z-index: 50; min-width: 180px; max-height: min(560px, 80vh); overflow: auto;
  padding: 6px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow);
}
.menu .group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.menu .columns {
  display: grid; grid-template-columns: repeat(4, minmax(118px, 1fr)); gap: 2px 6px;
  margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line);
}
.menu .column + .column { border-left: 1px solid var(--line); padding-left: 6px; }
.menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 7px 10px; border-radius: 7px; cursor: pointer; text-align: left;
}
.menu button::before { content: ""; width: 14px; flex: none; text-align: center; color: var(--accent); font-weight: 700; }
.menu button[aria-selected="true"]::before { content: "✓"; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button[aria-selected="true"] { font-weight: 600; }
.menu button.muted { color: var(--muted); }
/* "EA" tag on the option EA uses */
.menu button .hint {
  margin-left: auto; padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); border: 1px solid var(--line-strong);
}

/* Meshing segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line-strong); }
.seg button {
  border: 0; background: none; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
body:not(.compact) .seg button { padding: 8px 13px; font-size: 14px; }
.seg button:hover:not(:disabled):not(.on) { color: var(--text); background: var(--hover); }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Changed from EA */
.changed { box-shadow: 0 0 0 2px var(--changed) !important; }
.seg.changed button.on { background: var(--changed); color: #1a1205; }

.pattern {
  position: relative; width: var(--pat-w); height: var(--pat-h); padding: 0; border-radius: 6px; cursor: pointer; overflow: hidden; display: block;
  border: 1px solid var(--line-strong); background: #fff;
}
.pattern img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Unset override (competitions): an empty dashed box instead of a pattern */
.pattern:has(.empty:not([hidden])) { background: none; border-style: dashed; }
.pattern .empty { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--faint); }
/* Custom request: the stand-in pattern fades behind a badge */
.pattern.custom { box-shadow: 0 0 0 2px var(--changed); }
.pattern.custom img { opacity: .35; }
.pattern .badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 2px 8px; border-radius: 6px; background: var(--changed); color: #1a1205;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}

/* Frame design: Custom reads as "needs work"; a corner dot (takes no width, so nothing shifts) means it has details */
.seg button.custom { position: relative; }
.seg button.custom.on { background: var(--changed); color: #1a1205; }
.seg button.custom.has-details::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .75;
}

.colours { display: flex; gap: 10px; align-items: center; }
body.compact .colours { gap: 6px; }
/* Mini support pole: real band proportions, bottom to top; padding overlay on padded styles */
.pole {
  position: relative; flex: none; width: var(--pole-w); height: var(--pole-h); border-radius: 4px;
  box-shadow: 0 0 0 1px var(--ring);
}
.pole .pad {
  position: absolute; left: -3px; right: -3px; bottom: 0; height: 76.6%; border-radius: 4px;
  box-shadow: 0 0 0 1px var(--ring);
}
/* Untinted metal clamp at 2.13–2.23 m: a collar, so it doesn't read as a gap */
.pole .clamp {
  position: absolute; left: -2px; right: -2px; bottom: 80.4%; height: 3.8%; min-height: 2px;
  background: #5b606a; border-radius: 2px;
}
/* Only the row's pole opens the zoom; the popover's preview pole doesn't */
.colours .pole { cursor: zoom-in; }
/* A colour that isn't set (competition overrides): dashed outline, empty bands */
.pole.unset { box-shadow: none; outline: 1px dashed var(--line-strong); }

/* Enlarged pole on hover */
.pole-zoom {
  position: fixed; z-index: 60; display: flex; gap: 12px; padding: 14px 16px 14px 18px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow);
  pointer-events: none;
}
.pole.big { width: 30px; height: 220px; border-radius: 6px; }
.pole.big .pad { left: -6px; right: -6px; border-radius: 6px; }
.pole.big .clamp { left: -4px; right: -4px; }
.pole-zoom .labels { position: relative; width: 140px; font-size: 12px; color: var(--muted); }
.pole-zoom .labels span { position: absolute; left: 0; white-space: nowrap; }
.pole-zoom .l-top { top: 2%; }
.pole-zoom .l-pad { bottom: 36%; color: var(--text); }
.pole-zoom .l-bottom { bottom: 2%; }
.colours .pair { display: flex; flex-direction: column; gap: 4px; }
.colours .swatch { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
body.compact .colours .swatch span { display: none; }
.colours .colour-actions { display: flex; flex-direction: column; align-items: center; gap: 2px; }
body.compact .colours .colour-actions { flex-direction: row; }
/* Swatch button: fill is set inline; inner ring keeps near-white/near-black visible */
.colours button.colour {
  width: var(--sw-w); height: var(--sw-h); padding: 0; border: 2px solid var(--raised); border-radius: 7px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-strong), inset 0 0 0 1px var(--ring);
}
.colours button.colour.open { box-shadow: 0 0 0 2px var(--accent), inset 0 0 0 1px var(--ring); }
.colours button.colour.unset { background: none; border-style: dashed; border-color: var(--line-strong); box-shadow: none; }
.colours button.colour.unset.open { box-shadow: 0 0 0 2px var(--accent); }
.colours button.colour:disabled { cursor: default; }

/* Colour popover */
.colour-pop {
  position: fixed; z-index: 65; width: 320px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow);
}
.colour-pop .head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.colour-pop .head strong { font-size: 13px; white-space: nowrap; }
.colour-pop .head .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colour-pop .pickers { display: flex; gap: 14px; }
.colour-pop .planes { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.colour-pop .sv {
  position: relative; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none;
  box-shadow: inset 0 0 0 1px var(--ring);
}
.colour-pop .knob {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .5), 0 1px 3px rgb(0 0 0 / .4);
}
.colour-pop .hue {
  appearance: none; -webkit-appearance: none; width: 100%; height: 12px; margin: 0; border-radius: 6px; cursor: pointer;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.colour-pop .hue::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 1px 3px rgb(0 0 0 / .35);
}
.colour-pop .hue::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 1px 3px rgb(0 0 0 / .35);
}
/* Live preview of the pole beside the picker */
.pole.mid { width: 18px; height: auto; margin: 0 4px; border-radius: 5px; }
.pole.mid .pad { left: -4px; right: -4px; border-radius: 5px; }
.colour-pop .fields { display: flex; align-items: center; gap: 6px; }
.colour-pop .now { flex: none; width: 30px; height: 30px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--ring); }
.colour-pop input:not(.hue) {
  height: 30px; min-width: 0; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--raised); color: var(--text); font: inherit; font-size: 13px;
}
.colour-pop .hex { width: 84px; font-family: ui-monospace, Consolas, monospace; }
.colour-pop .hex.bad { border-color: #dc2626; box-shadow: 0 0 0 3px rgb(220 38 38 / .18); }
.colour-pop input[type=number] { width: 40px; padding: 0 2px; text-align: center; -moz-appearance: textfield; }
.colour-pop input[type=number]::-webkit-inner-spin-button,
.colour-pop input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.colour-pop .dropper {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-left: auto; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--raised); color: var(--muted); cursor: pointer;
}
.colour-pop .dropper:hover { color: var(--text); background: var(--hover); }
.colour-pop .chip-groups { display: flex; flex-direction: column; gap: 9px; }
.colour-pop .group { margin-bottom: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.colour-pop .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.colour-pop .chip {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--ring); transition: transform .08s;
}
.colour-pop .chip:hover { transform: scale(1.15); }
.colour-pop .empty { font-size: 12px; color: var(--faint); }
.colour-pop .foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--faint);
}
.colour-pop .done {
  flex: none; padding: 6px 14px; border: 0; border-radius: 7px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600;
}
.reset, .swap { border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: 15px; }
.reset { color: var(--changed); }
.swap { color: var(--muted); }
.swap:hover { color: var(--text); }

input.notes {
  width: 100%; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--raised);
}
input.notes::placeholder { color: var(--faint); }

/* Real-life home stadium under the team name */
.name .venue {
  max-width: 100%; margin-top: -4px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Competitions: Neutral games / All games, a small switch under the name */
.name .seg.scope { padding: 2px; }
.name .seg.scope button { padding: 3px 9px; font-size: 12px; }

button:disabled, input:disabled { cursor: default; }
.readonly .pick, .readonly .seg, .readonly .pattern, .readonly .colours button.colour, .readonly input.notes { opacity: .8; }

/* Pattern picker */
.picker {
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 0;
  background: var(--panel); color: var(--text); width: min(900px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
.picker::backdrop { background: rgb(0 0 0 / .5); }
.picker-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.icon { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted); }
.picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px;
  padding: 18px; max-height: 70vh; overflow: auto;
}
.picker-grid button {
  border: 2px solid transparent; border-radius: 10px; padding: 5px; cursor: pointer;
  background: var(--raised); text-align: left;
}
.picker-grid button:hover { border-color: var(--line-strong); }
.picker-grid button img { width: 100%; aspect-ratio: 2 / 1; display: block; border-radius: 6px; background: #fff; }
.picker-grid button span { display: block; font-size: 12px; color: var(--muted); padding: 4px 2px 0; }
.picker-grid button.current { border-color: var(--accent); }
.picker-grid button.ea span::after { content: " · EA"; color: var(--changed); font-weight: 600; }
/* Stand-in pattern while a custom one is requested */
.picker-grid button.fallback { border-color: var(--line-strong); border-style: dashed; }
.picker-grid .custom-tile .plus {
  display: grid; place-items: center; aspect-ratio: 2 / 1; border-radius: 6px; padding: 0;
  border: 1px dashed var(--line-strong); color: var(--muted); font-size: 26px; font-weight: 300;
}
.picker-grid .custom-tile:hover .plus { color: var(--text); border-color: var(--muted); }
.picker-grid .custom-tile.current { border-color: var(--changed); }
.picker-grid .custom-tile.current .plus { background: color-mix(in srgb, var(--changed) 18%, transparent); color: var(--text); }
/* "Not set" (competitions) is a normal choice, not a "needs work" mark */
.picker-grid .none-tile.current { border-color: var(--accent); }
.picker-grid .none-tile.current .plus { background: var(--accent-soft); }

/* "Custom" details popover */
.custom-pop {
  position: fixed; z-index: 65; width: 340px; padding: 12px; display: flex; flex-direction: column; gap: 9px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow);
}
.custom-pop .head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.custom-pop .head strong { font-size: 13px; white-space: nowrap; }
.custom-pop .head .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-pop input {
  width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--raised); color: var(--text); font: inherit; font-size: 13px;
}
.custom-pop input::placeholder { color: var(--faint); }
.custom-pop .link-row { display: flex; align-items: center; gap: 8px; }
.custom-pop .open-link { flex: none; font-size: 12px; color: var(--accent); text-decoration: none; }
.custom-pop .open-link:hover { text-decoration: underline; }
.custom-pop .foot { display: flex; justify-content: space-between; align-items: center; padding-top: 9px; border-top: 1px solid var(--line); }
.custom-pop .remove { border: 0; background: none; padding: 4px 2px; cursor: pointer; font-size: 12px; color: var(--muted); }
.custom-pop .remove:hover { color: var(--danger); }
.custom-pop .done {
  margin-left: auto; padding: 6px 14px; border: 0; border-radius: 7px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  .tools { margin-left: 0; }
  .tools input { width: 160px; }
}
