/* Cheat Sheet Creator — v1 test harness.
   Simple, white, high-contrast. One accent colour, 1px lines, no gradients
   except the skeleton shimmer. Deliberately restrained: this is still a
   harness, not a design system. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-sunken: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --good: #15803d;

  --radius: 6px;
  --radius-lg: 10px;
  --gap: 12px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 13px; }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--text-muted); font-size: 12px; }
.page { max-width: 1560px; margin: 0 auto; padding: 20px 24px 48px; }

/* ------------------------------------------------------------------ header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: var(--gap);
}
.app-header-left,
.app-header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-header-left { flex: 1; }

.app-title { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.app-title-name { font-weight: 600; letter-spacing: -0.01em; }

.badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 5px;
}

.sheet-name-input {
  font-size: 14px;
  font-weight: 600;
  min-width: 220px;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover:not(:disabled) { background: var(--surface-sunken); border-color: #9ca3af; }
.btn:active:not(:disabled) { background: #f1f5f9; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: #1e40af; border-color: #1e40af; }

.btn-quiet { border-color: transparent; color: var(--text-muted); }
.btn-quiet:hover:not(:disabled) { color: var(--text); background: var(--surface-sunken); }

.btn-danger { color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }

.btn-block { display: flex; width: 100%; margin-bottom: 6px; }

.btn-icon {
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
}
.btn-icon:hover:not(:disabled) { color: var(--text); }

/* ------------------------------------------------------------------ inputs */

input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px 8px;
  width: 100%;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
input[type="file"] { font-size: 12px; border: none; padding: 0; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field + .field { margin-top: 0; }
.field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field-sm { width: 110px; flex: none; }
.field-grow { flex: 1; }
.field-wide { width: 100%; }
.field-row { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: flex-end; }

.card-body > .field + .field { margin-top: 10px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.check input { width: auto; }

.input-with-button { display: flex; gap: 6px; align-items: stretch; }
.input-with-button select { width: auto; flex: none; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 0 0 12px;
}
legend {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 4px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(56px, 1fr));
  gap: 6px;
  margin: 4px 0 12px;
}
.roster-grid label { display: flex; flex-direction: column; gap: 2px; }
.roster-grid span { font-size: 11px; color: var(--text-muted); }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--gap);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
}
.card-body { padding: 12px; }
.card > .field-row, .card > .starters { padding: 12px; }
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.card-danger { border-color: #fecaca; }
.card-danger .card-head { background: var(--danger-soft); border-color: #fecaca; }
.card-danger h3 { color: var(--danger); }

.card-collapsible summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
  background: var(--surface-sunken);
  list-style: none;
}
.card-collapsible summary::-webkit-details-marker { display: none; }
.card-collapsible summary::before {
  content: "▸";
  color: var(--text-faint);
  font-size: 10px;
}
.card-collapsible[open] summary { border-bottom: 1px solid var(--border); }
.card-collapsible[open] summary::before { content: "▾"; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 10px; }
.section-head:first-child { margin-top: 0; }

/* ----------------------------------------------------------------- notices */

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin-bottom: var(--gap);
  font-size: 12px;
}
.notice-icon {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}
.notice-warn { background: var(--danger-soft); border-color: #fecaca; border-left-color: var(--danger); }
.notice-warn .notice-icon { background: var(--danger); }
.notice-info { background: var(--warn-soft); border-color: #fde68a; border-left-color: var(--warn); }
.notice-error { background: var(--danger-soft); border-color: #fecaca; border-left-color: var(--danger); }
.notice code {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
#import-report ul { margin: 4px 0 8px; padding-left: 18px; }

/* --------------------------------------------------------------- workspace */

.workspace { display: flex; gap: 16px; align-items: flex-start; }
.workspace-main { flex: 1; min-width: 0; }
.workspace-side {
  width: 320px;
  flex: none;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}
.workspace-side .card:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- tabstrip */

.tabstrip {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--gap);
  overflow-x: auto;
}
.tabstrip button {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tabstrip button:hover:not(:disabled) { color: var(--text); background: var(--surface-sunken); }
.tabstrip button:disabled {
  color: var(--accent);
  border-bottom-color: var(--accent);
  opacity: 1;
  cursor: default;
}

/* --------------------------------------------------------------- filterbar */

.filterbar {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filterbar-row { display: flex; gap: var(--gap); align-items: flex-end; flex-wrap: wrap; }
.filterbar-tags { align-items: center; gap: 8px; }
.filterbar .field-label { white-space: nowrap; }

.chiprow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* -------------------------------------------------------------------- tags */

/* Off state is an outlined chip with dark text, never washed-out colour on
   colour — that was unreadable. On state is the filled tag colour. */
.tag {
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tag:hover { border-color: var(--text-faint); color: var(--text); }
.tag.on { color: #fff; border-color: transparent; }
.tag.static { cursor: default; }

/* ------------------------------------------------------------------- table */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: var(--surface);
}
table.players { border-collapse: separate; border-spacing: 0; width: 100%; }
table.players th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  padding: 7px 8px;
  white-space: nowrap;
}
table.players td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.players tr:last-child td { border-bottom: none; }
table.players tbody tr:hover td { background: var(--surface-sunken); }
table.players tr.dragging td { opacity: 0.4; }
table.players tr.row-drag-over td { box-shadow: inset 0 2px 0 var(--accent); }

/* v2 10.1 — a real bug, not polish: triple-digit ranks were clipped, which made
   manual rank entry unusable for the bottom two-thirds of a sheet. With the
   bucket change ranks now reach roughly 289, so everything numeric is sized for
   4 characters minimum and set in tabular-nums so columns align. */
.col-grip { width: 22px; }
.col-rank { width: 80px; }
.col-posrank { width: 92px; }
.col-num { width: 72px; text-align: right; }
.col-pos { width: 44px; }
.col-tierchip { width: 118px; }
.col-team { width: 56px; }
.col-bye { width: 44px; text-align: right; }
.col-actions { width: 1%; white-space: nowrap; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.player-name { font-weight: 500; }
.player-name .name-text { overflow-wrap: anywhere; }

.grip { cursor: grab; color: var(--text-faint); user-select: none; text-align: center; }
.grip:active { cursor: grabbing; }

.rank-input {
  width: 66px;
  padding: 3px 5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* v2 3.4 — both numbers on a position tab. Overall rank is the prominent one;
   positional rank is the muted secondary, and the editable one, because a
   position tab reorders within its own position and tier breaks are keyed to it. */
.overall-rank { font-weight: 600; font-size: 13px; }
.col-posrank { white-space: nowrap; }
.posrank-prefix {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 3px;
  font-variant-numeric: tabular-nums;
}
.col-posrank .rank-input { width: 56px; }

/* Notes are a textarea so imported newlines survive a round trip, and they
   render pre-wrap rather than being turned into <br> (v2 9.1). */
.note-input {
  padding: 3px 6px;
  min-width: 150px;
  min-height: 26px;
  resize: vertical;
  white-space: pre-wrap;
  font-family: inherit;
}

.delta-pos { color: var(--good); font-variant-numeric: tabular-nums; }
.delta-neg { color: var(--danger); font-variant-numeric: tabular-nums; }
.dash { color: var(--text-faint); }

/* v2 5.2 — position-qualified tier chip for the overall list. A chip and a
   swatch, never a row tint: adjacent rows there are different positions with
   independent tier structures, so full-row tinting would rainbow-stripe. */
.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.tier-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* v2 7.6 — live character counter as a limit approaches. */
.charcount {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
.charcount.at-limit { color: var(--danger); font-weight: 600; }

.flag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 5px;
  white-space: nowrap;
}
.flag-stale { background: var(--danger-soft); color: var(--danger); border: 1px solid #fca5a5; }
.flag-custom { background: var(--accent-soft); color: var(--accent); border: 1px solid #bfdbfe; }

/* ------------------------------------------------------------------- tiers */

.tier-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--gap);
  flex-wrap: wrap;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: var(--gap);
}

.tier-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
}
/* The palette colour reads as a solid left rail plus a filled pill, so the tier
   colour is unmistakable while the text stays dark on white. */
.tier-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
}
.tier-group:not(:has(table)) .tier-header { border-bottom: none; }
.tier-pill {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.tier-header .tier-name { width: 150px; font-weight: 600; }
.tier-header .tier-note { width: 190px; }
.tier-header select { width: auto; }
.tier-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tier-spacer { flex: 1; }
.tier-empty {
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  border-top: 1px solid var(--border);
}
.tier-group .table-wrap { border: none; border-radius: 0; }
.tier-group table.players th { top: 0; }

/* -------------------------------------------------------------- board view */

.board { display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; padding-bottom: 6px; }
.board-col {
  flex: 1;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.board-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 7px 10px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}
.board-col ol { margin: 0; padding: 4px 4px 4px 30px; }
.board-col li {
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  font-size: 12px;
}
.board-col li:last-child { border-bottom: none; }
.board-col li:hover { background: var(--surface-sunken); }
.board-col li.row-drag-over { box-shadow: inset 0 2px 0 var(--accent); }

/* ------------------------------------------------------------- sheet list */

.sheet-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sheet-card-main { flex: 1; min-width: 0; }
.sheet-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.sheet-card-name:hover { text-decoration: underline; }
.sheet-card.unreadable { background: var(--danger-soft); border-color: #fecaca; }

.starters { display: flex; gap: var(--gap); flex-wrap: wrap; }
.starter {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--surface-sunken);
}
.starter h3 { margin-bottom: 3px; }

/* ------------------------------------------------------------- misc pieces */

.pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0 7px;
}
.meter {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 8px;
}
.meter.full { color: var(--danger); font-weight: 500; }

.hidden-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.hidden-row:last-of-type { border-bottom: none; }
.hidden-row-main { flex: 1; min-width: 0; }

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-sunken);
}
.empty-state p { margin-bottom: 10px; }

footer {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------- skeleton loaders (7) */

.skeleton-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--surface);
}
.skeleton-row {
  height: 20px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: skeleton 1.3s ease-in-out infinite;
}
.skeleton-row:last-child { margin-bottom: 0; }
@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* --------------------------------------------------- v2 additions (7.1, 8) */

/* 7.1 — Saving… / Saved / Save failed. "Failed" is deliberately loud and holds
   persistently; a transient green "saved" after a real failure is worse than no
   indicator at all. */
.save-status {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  white-space: nowrap;
}
.save-saving { color: var(--warn); border-color: #fde68a; background: var(--warn-soft); }
.save-saved { color: var(--good); border-color: #bbf7d0; background: #f0fdf4; }
.save-failed { color: #fff; background: var(--danger); border-color: var(--danger); }

/* 9.3 — inline settings validation. */
.settings-feedback { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.settings-error {
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  padding: 4px 8px;
}
.settings-warning {
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  padding: 4px 8px;
}

/* 8 — draft mode. The bar is the visible indication that ranking edits are off. */
.draft-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  margin-bottom: var(--gap);
  font-size: 12px;
  background: var(--surface-sunken);
}
.draft-bar.on { background: #f0fdf4; border-color: #bbf7d0; border-left: 4px solid var(--good); }
.draft-bar.paused { background: var(--warn-soft); border-color: #fde68a; border-left: 4px solid var(--warn); }
.draft-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--good);
  border-radius: 4px;
  padding: 1px 6px;
}
.draft-bar.paused .draft-badge { background: var(--warn); }

/* Drafted players render struck through and dimmed, still in position (8.2). */
tr.drafted td, li.drafted { opacity: 0.45; }
tr.drafted .name-text, li.drafted { text-decoration: line-through; }
.flag-drafted { background: #f0fdf4; color: var(--good); border: 1px solid #bbf7d0; }
.flag-needs-position {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #fde68a;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
}
.pick-history { margin: 0; padding-left: 22px; font-size: 12px; }
.pick-history li { padding: 2px 0; }
.pick-history .num { display: inline-block; min-width: 34px; color: var(--text-muted); }

/* 5.3 — colour picker: palette presets, native input, hex field, reset. */
.color-picker { display: inline-flex; align-items: center; gap: 4px; }
.color-picker select { width: auto; }
.color-native { width: 30px; height: 26px; padding: 1px; flex: none; cursor: pointer; }
.color-hex { width: 84px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.color-hex.invalid { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }

.tag-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tag-color-row:last-child { border-bottom: none; }

/* 6 — custom players are editable after creation. */
.custom-player-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.custom-player-row:last-of-type { border-bottom: none; }
.custom-player-row .custom-player-name { flex: 1; min-width: 0; }
.custom-player-row select { width: auto; flex: none; }
.custom-player-row.needs-position { background: var(--warn-soft); }

/* 7.5 — the mandatory import preview. */
.import-preview ul { margin: 0 0 10px; padding-left: 20px; }
.import-preview li { padding: 2px 0; font-size: 12px; }

/* 7.4 — recently deleted. */
.sheet-card.deleted { background: var(--surface-sunken); opacity: 0.85; }

/* 4.2 — the zero-result hint that makes scoped search safe. */
.cross-hint {
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
}

/* 10.1 — overflow pass: nothing clips at maximum values. A 60-character sheet
   name, a 30-character tier name, a 280-character note and six-plus tags all
   wrap or scroll rather than being cut off. */
.sheet-card-main { overflow-wrap: anywhere; }
.tier-count { font-variant-numeric: tabular-nums; }
.tier-header { row-gap: 6px; }
.sheet-name-input { max-width: 320px; }

/* Rows can receive focus (10.3). */
tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ADP spec 4.8 — required attribution, shown wherever ADP-derived rankings are. */
.attribution {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--gap);
}
.attribution a { color: var(--accent); }

/* ------------------------------------------------------------------- toast */

#toast {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  max-width: 62ch;
  background: #111827;
  color: #fff;
  font-size: 12px;
  border-radius: var(--radius);
  padding: 9px 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
