:root {
  /* Farben */
  --bg: #0e1116; --panel: #161b22; --panel-2: #1c232d; --line: #2a323d;
  --ink: #e6edf3; --ink-dim: #9aa7b4; --ink-faint: #6b7885;
  --accent: #4b9fff; --good: #3fb950; --bad: #f85149; --warn: #d29922;
  --accent-ink: #fff;          /* Schrift auf --accent; wandert in Phase 5 mit */
  --gold: #c8a24a;             /* Banlist-Rand, Zierlinien; Phase 5 baut darauf auf */
  /*
   * ⚠️ Gefuellte Flaeche mit weisser Schrift braucht ein DUNKLERES Blau.
   * Weiss auf --accent (#4b9fff) ist 2,73:1 — unter WCAG AA. --accent-strong
   * (#2668c9) traegt 5,38:1, gemessen 30.08.2026. --accent bleibt fuer
   * Raender, Fokusringe und duenne Akzente, wo keine weisse Schrift darauf sitzt.
   */
  --accent-strong: #2668c9;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  /*
   * Abstände, Radien, Typografie.
   *
   * Bis hierher hatte diese Datei auf 346 Zeilen genau vier Variablen, alle für
   * Farben — jede Zahl stand einzeln im Regelwerk. Eine Umstellung der Optik
   * hätte an dreißig Stellen von Hand passieren müssen. Die Werte unten sind
   * exakt die, die vorher verstreut standen; es ist eine Umbenennung, keine
   * Neugestaltung. Sie sind die Grundlage, auf der Phase 5 aufsetzt.
   */
  --space-1: 4px;  --space-2: 6px;  --space-3: 8px;  --space-4: 10px;
  --space-5: 12px; --space-6: 14px; --space-7: 16px; --space-8: 18px;
  --space-9: 20px; --space-10: 24px;

  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px;
  --radius-xl: 10px; --radius-2xl: 12px;

  --text-xs: 10px;  --text-sm: 11px;  --text-base: 12px; --text-md: 13px;
  --text-lg: 14px;  --text-xl: 15px;  --text-2xl: 19px;  --text-3xl: 24px;
  --text-4xl: 26px;
  --weight-medium: 500; --weight-semibold: 600;
  --line-tight: 1.3; --line-base: 1.5; --line-relaxed: 1.6;
  --track-wide: 0.05em; --track-wider: 0.06em;

  /*
   * Handy-Liste: kleineres Vorschaubild. Bei 30x42 wäre die Zeile 58 px hoch,
   * bei 24x34 sind es 48 — und damit passen siebzehn Positionen auf einen
   * 390x844-Schirm statt einer. Gemessen, nicht geschätzt.
   *
   * Weiter herunter geht es bewusst nicht: jede Zeile ist ein Tippziel, und
   * unter 44 px unterschreitet das die Mindestgröße für Berührungsziele.
   */
  --phone-thumb-w: 24px; --phone-thumb-h: 34px;
}


* { box-sizing: border-box; }
/* display:flex on .set-lock would otherwise beat the hidden attribute */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
header {
  padding: 8px 16px;
  /*
   * Das Hieroglyphenband liegt dezent im Kopf. Die dunkle Deckschicht (0.93)
   * haelt den Kontrast von Logo und Navigation — die Textur ist ein Hauch.
   * Unten eine goldene Zierlinie statt der grauen Trennlinie.
   */
  background:
    linear-gradient(rgba(22, 27, 34, .93), rgba(22, 27, 34, .93)),
    var(--panel) url("/assets/hieroglyphs.webp") center / cover;
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 1px 0 rgba(200, 162, 74, .25);
  position: sticky; top: 0; z-index: 20;
}
/* Kopfzeile: Logo links, Abmelden rechts. */
.topbar { display: flex; align-items: center; gap: 16px; }
.brandlock { margin: 0; }
h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.brand { height: 34px; width: auto; display: block; }

/* Navigation: drei Gruppen-Dropdowns + Betrieb-Zahnrad, keine Scroll-Leiste. */
nav { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
nav .spacer { flex: 1; }
.navgroup { position: relative; }
.navgroup-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; color: var(--ink-dim); padding: 7px 12px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.navgroup-btn:hover, .navgroup-btn[aria-expanded="true"] { background-color: var(--panel-2); color: var(--ink); }
.navgroup-btn.active { background-color: var(--accent-strong); color: #fff; }
.navgroup-label { white-space: nowrap; }
.navgroup-caret { font-size: 10px; opacity: .8; }
.navgroup-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
  display: flex; flex-direction: column; min-width: 168px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); padding: 4px;
}
.navgroup-menu button {
  text-align: left; background: none; border: 0; color: var(--ink);
  padding: 9px 12px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.navgroup-menu button:hover { background-color: var(--panel-2); }
.navgroup-menu button[aria-current="true"] { color: var(--accent); font-weight: var(--weight-semibold); }
.nav-gear {
  background: none; border: 0; color: var(--ink-dim); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: 6px;
}
.nav-gear svg { display: block; }
.nav-gear:hover { background-color: var(--panel-2); color: var(--ink); }
.nav-gear.active { background-color: var(--accent-strong); color: #fff; }
.spacer { flex: 1; }
.stamp { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

main { padding: 20px; max-width: 1280px; margin: 0 auto; }
section[hidden] { display: none !important; }

/* ---------- capture ---------- */
.capture-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card h2 { margin: 0 0 14px; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-dim); font-weight: 600; }

.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row input {
  font-family: var(--mono); font-size: 26px; letter-spacing: 0.06em;
  background: var(--bg); border: 2px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 12px 14px; width: 100%; text-transform: uppercase;
}
.code-row input:focus { outline: none; border-color: var(--accent); }
.set-lock {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 20px; color: var(--accent); white-space: nowrap;
}
.set-lock button { background: none; border: 0; color: var(--ink-faint); cursor: pointer; font-size: 16px; }

.hint { font-size: 12px; color: var(--ink-faint); margin-top: 8px; }
.hint kbd {
  font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; font-size: 11px; color: var(--ink-dim);
}

.resolved { margin-top: 16px; min-height: 92px; }
.resolved-empty { color: var(--ink-faint); font-size: 13px; padding: 20px 0; }
.match { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 8px; cursor: pointer; }
.match:hover { border-color: var(--accent); }
.match[data-selected="true"] { border-color: var(--accent); background: #17263a; }
.match img { width: 44px; border-radius: 4px; }
.match .name { font-weight: 600; }
.match .meta { font-size: 12px; color: var(--ink-dim); font-family: var(--mono); }

.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.field label { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 5px; }
.field select, .field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 8px 10px; font-size: 14px;
}
/* Mehrzeiliger Text (Eigenkarten-Kartentext): erbt Schrift, nur vertikal ziehbar. */
textarea { font: inherit; resize: vertical; min-height: 3.5em; }
.cond-row { display: flex; gap: 5px; flex-wrap: wrap; }
.cond-row > * {
  flex: 1; min-width: 52px;
}
.cond-row button, .cond-row .ghost {
  flex: 1; min-width: 52px; background: var(--bg); border: 1px solid var(--line);
  color: var(--ink-dim); border-radius: 6px; padding: 7px 4px; cursor: pointer;
  font-family: var(--mono); font-size: 13px;
}
.cond-row button[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.cond-row button small { display: block; font-size: 9px; opacity: 0.7; }

.primary {
  margin-top: 16px; width: 100%; background: var(--accent-strong); border: 0; color: #fff;
  padding: 13px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
  /* Native Buttons erben die Schrift in Safari NICHT — sonst steht der Knopf in
     der System-Schrift statt in der App-Schrift. */
  font-family: inherit;
}
.primary:disabled { background: var(--panel-2); color: var(--ink-faint); cursor: not-allowed; }
/* ⚠️ `.primary` bringt nur margin-top mit. Folgt darauf ein weiterer Knopf —
   „Eintragen" und darunter „Weiter zu Importieren →" —, klebten beide
   aneinander, weil die Abstandsklassen der Folgeknöpfe margin-BOTTOM setzen.
   Als Geschwister-Regel, damit es überall gilt, wo das Muster auftritt. */
.primary + button { margin-top: var(--space-5); }

/*
 * Scrollbalken in den App-Farben.
 *
 * ⚠️ Ohne diese Regeln zeichnet der Browser seinen hellen Standardbalken —
 * im Kartendetail-Modal fiel das als heller Streifen im dunklen Panel auf.
 * Zwei Schreibweisen, weil `scrollbar-color` in Safari erst spät kam und
 * `::-webkit-scrollbar` dort weiterhin die zuverlässigere ist. Gilt bewusst
 * für die ganze App, nicht nur fürs Modal — dasselbe Problem hatten Editor,
 * Kartensuche und Changelog-Liste.
 */
* { scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 999px;
  /* Rand aus der Hintergrundfarbe: lässt den Balken schmaler wirken, ohne die
     Trefferfläche zu verkleinern. */
  border: 2px solid var(--bg); background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

.log { max-height: 480px; overflow-y: auto; }
.log-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.log-item .code { font-family: var(--mono); color: var(--ink-faint); font-size: 11px; }
.log-item .val { font-variant-numeric: tabular-nums; color: var(--good); }

/* ---------- portfolio ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint);
  display: flex; align-items: center; gap: var(--space-2); }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .d { font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--ink-faint); }

/* Aktions-Buttons und Tags klar trennen (Annotation 11): eigene Zeilen, deren
   Kinder NICHT auf flex:1 gestreckt werden (anders als .cond-row). */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* Info-Popover (P0.7): ein Button, ein Panel; genau eines offen, Escape/Außenklick
   schließen, Fokus kehrt zurück. Kein Hover-Tooltip. */
.info-pop { position: relative; display: inline-flex; }
.info-btn { width: 16px; height: 16px; flex: 0 0 auto; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-dim);
  font-size: 10px; line-height: 1; cursor: pointer; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-faint); }
.info-panel { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  width: max-content; max-width: min(240px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-4); font-size: var(--text-sm);
  color: var(--ink-dim); line-height: var(--line-base); text-transform: none; letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: normal; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-faint); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600;
  /* top:0, not 52px: .table-wrap is its own scroll container, so the offset
     would push the header down onto the first row instead of pinning it. */
  position: sticky; top: 0; background: var(--panel); cursor: pointer; z-index: 3; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Marc's cockpit rule: the identifying column stays put while scrolling wide
   tables. The table scrolls inside its own box so that both the header and the
   key column stay visible with a few thousand positions. */
.table-wrap {
  overflow: auto; max-height: 70vh;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
/*
 * Statistik-Tabellen (Deck-Report/Deckbau/Feld-Sim): ALLE Spalten sichtbar mit
 * eigenem horizontalen Scroll — NICHT das `.phone-cols`-Spaltenverstecken, das
 * sie auf dem Handy komplett leerte (Fable/Codex-Befund). Eigener Container,
 * weil `.table-wrap` in der Mobile-Media-Query `overflow:visible` bekommt und
 * dann der Seitenkörper horizontal scrollen würde.
 */
.stat-scroll {
  overflow: auto; max-height: 70vh; -webkit-overflow-scrolling: touch;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}

/* Dezenter Neu-laden-Hinweis, wenn ein Deploy die offene Sitzung überholt hat. */
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 40;
  display: flex; gap: 10px; align-items: center;
  padding: 8px 14px; border-radius: 999px;
  /* --accent-strong (nicht --accent): Weiß auf --accent ist 2,73:1, unter AA. */
  background: var(--accent-strong); color: #fff; font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.update-bar button {
  border: 1px solid rgba(255,255,255,0.6); background: transparent; color: #fff;
  padding: 3px 10px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
td.key { position: sticky; left: 0; background: var(--panel); z-index: 1; }
/* The frozen header cell sits at both intersections, so it needs the highest layer */
th.key { position: sticky; left: 0; background: var(--panel); z-index: 4; }
tbody tr:hover td.key { background: var(--panel-2); }
.code { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.badge { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--ink-dim); font-family: var(--mono); }
.badge.manual { border-color: var(--accent); color: var(--accent); }
.badge.warn { border-color: var(--warn); color: var(--warn); }

.chart { width: 100%; height: 200px; }
.notice { background: #1d1a12; border: 1px solid var(--warn); border-radius: 8px;
  padding: 10px 14px; font-size: 12px; color: #e5c07b; margin-bottom: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-faint); }


/* ---------- edit sheet ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px; z-index: 50; overflow-y: auto;
}
.sheet {
  position: relative;   /* Anker für das absolute Schließen-× oben rechts */
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  width: 100%; max-width: 620px;
  /* ⚠️ Das Sheet selbst scrollt NICHT — der innere .sheet-scroll tut es. Nur so
     bleibt das am Sheet verankerte × beim Scrollen an seinem Platz, statt mit
     dem Inhalt aus dem Bild zu wandern (Marc, langer Kartentext, Desktop+Handy). */
  display: flex; flex-direction: column; max-height: calc(100vh - 120px);
}
.sheet-scroll {
  padding: 20px; overflow-y: auto; overscroll-behavior: contain; min-height: 0;
}
.sheet-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
  padding-right: 44px;   /* Platz für den absoluten Schließen-Knopf */
}
.sheet-head > div:first-child { flex: 1; }
/* ⚠️ Das × gehört IMMER oben rechts, egal wie hoch die Faktentabelle ist
   (Marc): darum absolut am Sheet verankert, nicht im Fluss der Kopfzeile. */
/* Opakes, gut tappbares Chip, unter der iOS-Statusleiste (safe-area) und dank
   z-index über dem scrollenden Sheet-Inhalt — immer erreichbar. */
#editClose {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px;
  z-index: 3; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
}
#editClose:hover { color: var(--ink); border-color: var(--ink-faint); }
body.modal-open { overflow: hidden; }
.sheet-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.icon-btn { background: none; border: 0; color: var(--ink-faint); cursor: pointer; font-size: 16px; }
.icon-btn:hover { color: var(--ink); }
/*
 * ⚠️ `.ghost` OHNE Elementnamen — `button.ghost` griff auf einem `<a>` nicht.
 * Der Herunterladen-Knopf in der Deckansicht ist ein Link (ein `<a download>`
 * lädt, ein `<button>` müsste dafür Javascript bemühen) und sah deshalb aus
 * wie eine blaue Textzeile zwischen zwei Knöpfen. Der Klassentest fand nichts:
 * `.ghost` IST definiert — nur eben nur für Knöpfe.
 */
.ghost {
  display: inline-block; text-align: center; text-decoration: none;
  background: none; border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 14px;
  font-family: inherit;   /* wie .primary: sonst System- statt App-Schrift */
}
.ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
button.danger {
  background: none; border: 1px solid var(--bad); color: var(--bad);
  border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 14px;
}
button.danger:hover { background: var(--bad); color: #fff; }
tbody tr[data-id] { cursor: pointer; }

/* Katalogbild UND eigenes Foto exakt gleich groß (Kartenformat), damit die
   zwei Figuren + ihre Unterschriften symmetrisch stehen. */
.sheet-img { box-sizing: border-box; display: block; width: 92px; aspect-ratio: 813 / 1185; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sheet-head .figure { width: 92px; }
.facts {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 14px;
  margin: 10px 0 0; font-size: 12px;
}
.facts dt { color: var(--ink-faint); }
.facts dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.cardtext {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; font-size: 12px; line-height: 1.6; color: var(--ink-dim);
  margin-bottom: 16px; white-space: pre-wrap; max-height: 160px; overflow-y: auto;
}

/* The owner's own photo sits next to the catalog art and is marked as such. */
.sheet-img.own { border: 2px solid var(--accent); }
.rowphoto {
  width: 30px; height: 42px; object-fit: cover; border-radius: 3px;
  border: 1px solid var(--line); display: block;
}
.rowphoto-missing {
  width: 30px; height: 42px; border-radius: 3px; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--ink-faint); font-size: 14px;
}

/* ================= schmale Bildschirme ================= */
/*
 * Below ~760px the 16-column table stops being a table. Each row becomes a
 * card with labelled values, because scrolling sideways through three screen
 * widths to read one position is not a usable phone interface.
 */
@media (max-width: 760px) {
  header { height: auto; padding: 8px 12px; flex-wrap: wrap; gap: 8px 12px; }
  .brand { height: 26px; }
  /* Das ThordeX-Logo bleibt auf dem Handy sichtbar (es IST die Marke),
     nur etwas kompakter. */
  .brandlock .brand-full { height: 26px; }
  /* ⚠️ KEIN overflow-x auf nav (früher für die Scroll-Reiter): das machte die
     Achse zum Clipping-Container und schnitt die Dropdowns ab (Codex). Nur drei
     Gruppen + Zahnrad — passt ohne Scrollen; Menüs dürfen überstehen. */
  nav { width: 100%; overflow: visible; gap: 4px; }
  .navgroup-btn { padding: 7px 10px; font-size: 13px; }
  .stamp { font-size: 11px; }

  main { padding: 12px; }
  .card { padding: 14px; }
  .capture-grid { grid-template-columns: 1fr; }

  /* Bigger targets: these get tapped hundreds of times during capture. */
  .cond-row button { min-width: 60px; padding: 11px 6px; }
  .code-row input { font-size: 20px; padding: 12px; }
  .field select, .field input { padding: 11px; font-size: 16px; } /* 16px stops iOS zooming in */
  .cm-wish-select, .cm-wish-price { font-size: 16px; } /* dito: kein iOS-Zoom beim Fokus */

  .stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
  .stat { padding: 11px 12px; }
  .stat .v { font-size: 19px; }

  /*
   * Die Tabelle bleibt eine Tabelle — sie zeigt nur weniger.
   *
   * Vorher brach jede Zelle zu einer eigenen beschrifteten Zeile um. Gemessen
   * am 29.08.2026 bei 390x844: 466 px je Position, also genau EINE Karte je
   * Bildschirm. Sechzehn Spalten in sechzehn Zeilen zu stapeln macht aus einer
   * Übersicht eine Aktenmappe.
   *
   * Jetzt: Bild, Name, Set-Code, Wert in einer Zeile, alles Übrige aus. Der
   * Rest steckt in der Detailansicht, die man ohnehin öffnet. Die vier Spalten
   * werden über :nth-child gewählt und nicht über data-label — Attributwerte
   * sind Anzeigetexte, die sich ändern dürfen, ohne dass das Layout kippt.
   */
  /* Nicht für Tabellen mit eigenem Scroll-Container (.stat-scroll): die
     Deck-Kartenliste mit sechs Spalten schob sonst den Seitenkörper seitlich. */
  .table-wrap:not(.stat-scroll) { max-height: none; overflow: visible; border: 0; background: none; }
  #holdingsTable {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius-xl); overflow: hidden;
  }
  /*
   * `.ph` = phone. Vier markierte Spalten bleiben, der Rest geht.
   *
   * ⚠️ Bewusst NICHT über :nth-child und auch nicht über data-label. Positionen
   * driften still, sobald jemand eine Spalte einfügt oder umsortiert — und
   * data-label sind Anzeigetexte, die sich ändern dürfen. Eine Klasse ist ein
   * Bezeichner und hält beides aus.
   *
   * `.empty` ist ausgenommen: der leere Zustand ist eine einzelne Zelle über
   * die volle Breite und trägt keine Spaltenmarkierung.
   *
   * ⚠️ Die Regel haengt an `.phone-cols` und nicht an `#holdingsTable`: eine
   * Tabelle muss sich anmelden. Sonst verschwaenden in jeder anderen Tabelle,
   * die keine `.ph`-Markierungen hat, saemtliche Spalten.
   */
  .phone-cols :is(th, td):not(.ph):not(.empty) { display: none; }
  #holdingsTable th, #holdingsTable td {
    padding: var(--space-2) var(--space-3); vertical-align: middle;
  }
  /* Die Kennspalte bleibt stehen, aber ohne den Klebe-Trick: bei vier Spalten
     gibt es nichts mehr, wovor sie stehen bleiben müsste. */
  #holdingsTable td.key, #holdingsTable th.key { position: static; }
  #holdingsTable td.key {
    font-weight: var(--weight-semibold); font-size: var(--text-lg);
    line-height: var(--line-tight); max-width: 45vw;
  }
  #holdingsTable td.key .badge { display: none; }   /* Platz vor Schmuck */
  #holdingsTable td.key .badge.warn { display: inline; }  /* „Preis offen" bleibt */
  #holdingsTable .rowphoto, #holdingsTable .rowphoto-missing {
    width: var(--phone-thumb-w); height: var(--phone-thumb-h);
  }
  /*
   * ⚠️ Die Spaltenköpfe kleben hier NICHT.
   *
   * Die Basisregel setzt `position: sticky; top: 0` — sinnvoll, solange
   * .table-wrap der Scroll-Container ist. Auf dem Handy ist der aber auf
   * `overflow: visible` gestellt, es scrollt also die Seite, und dort klebt
   * bereits der App-Kopf mit z-index 20. Die Köpfe (z-index 3) würden beim
   * Scrollen hinter ihm verschwinden statt darunter stehen zu bleiben.
   */
  #holdingsTable th { font-size: var(--text-xs); position: static; }

  /* Das Edit-Sheet füllt auf dem Handy den Schirm und scrollt IN sich selbst
     (Panel-Hintergrund bleibt, das × oben rechts bleibt gepinnt). Oben/unten
     die safe-area einrechnen, damit nichts unter Statusleiste/Home-Indikator
     verschwindet. */
  .overlay { padding: 0; align-items: stretch; }
  .sheet {
    border-radius: 0; max-width: none;
    max-height: 100vh; max-height: 100dvh; height: 100dvh;
  }
  /* safe-area gehört auf den scrollenden Inhalt, nicht aufs Sheet, damit oben
     unter der Statusleiste und unten überm Home-Indikator nichts klemmt. */
  .sheet-scroll {
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .sheet-head { flex-wrap: wrap; }
  .sheet-foot { flex-wrap: wrap; }
  .sheet-foot button { flex: 1; min-width: 130px; }
  .controls { grid-template-columns: 1fr 1fr; }
}

/* ================= Depotliste: Suche und Seitenwahl ================= */
/*
 * Die Leiste sitzt zwischen Verlauf und Tabelle. Sie bleibt schmal: bei 3.000
 * Karten ist die Tabelle das Werkzeug, die Leiste nur ihr Griff.
 */
.listbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 0 0 10px;
  /* Deckender Grund (optisch identisch mit --bg), damit das P12-Wasserzeichen
     hinter Suchfeld/Trefferzahl garantiert nicht durchscheint (Codex). */
  background: var(--bg);
}
.listbar input[type="search"] {
  flex: 1 1 260px; min-width: 180px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 8px 10px; font: inherit;
}
.listbar input[type="search"]:focus { outline: none; border-color: var(--accent); }
.listbar select {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 8px; font: inherit;
}
.listcount { color: var(--ink-dim); font-size: 13px; white-space: nowrap; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.chip[disabled] { opacity: .4; cursor: not-allowed; }
.badge.splash { border-color: var(--accent); color: var(--accent); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  background: var(--bg); border: 0; color: var(--ink-dim);
  padding: 8px 12px; font: inherit; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-strong); color: #fff; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 14px 0 4px; background: var(--bg); }
.pager button {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 6px 11px; font: inherit; cursor: pointer; min-width: 38px;
}
.pager button[aria-current="true"] { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { color: var(--ink-faint); padding: 0 2px; }

/* Auf großen Bildschirmen sortiert man über die Tabellenköpfe. */
.only-mobile { display: none; }
.navlink {
  color: var(--ink-dim); text-decoration: none; padding: 8px 14px;
  border-radius: 6px; font: inherit;
}
.navlink:hover { color: var(--ink); background: var(--bg-soft, rgba(255,255,255,.06)); }

@media (max-width: 760px) {
  /*
   * Die Tabellenköpfe sind hier ausgeblendet — und mit ihnen war die einzige
   * Möglichkeit zu sortieren verschwunden. Das Auswahlfeld ersetzt sie.
   */
  .only-mobile { display: block; }

  /*
   * 16 px, sonst zoomt Safari beim Antippen die ganze Seite heran und das
   * Layout steht danach verschoben. Der Schutz galt bisher nur für die Felder
   * im Erfassungsformular — ausgerechnet die Depotsuche, der Hauptzugriff auf
   * dreitausend Karten, war nicht dabei.
   */
  #listSearch, #listPerPage, #listSort, #pasteTarget, #pasteBox, #deckSelect,
  .listbar input, .listbar select { font-size: 16px; }

  /* Fingerbreite Ziele statt Mauszeiger-Ziele. */
  .seg button, .pager button { min-height: 40px; }
}

/* Die einzelnen Exemplare eines Stapels, jedes mit seinem Foto. */
.copyrow { display: flex; gap: 6px; flex-wrap: wrap; }
.copyrow img { width: 44px; height: 62px; object-fit: cover; border-radius: 4px;
               border: 1px solid var(--accent); display: block; }
.copy-nophoto {
  width: 44px; height: 62px; border-radius: 4px; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--ink-faint); font-size: 12px;
}

/*
 * Randlos auf dem iPhone.
 *
 * `viewport-fit=cover` plus eine durchscheinende Statusleiste heißt: der Inhalt
 * beginnt UNTER der Uhr. Ohne diese Abstände säße die Navigation hinter dem
 * Notch, und unten läge die letzte Tabellenzeile unter dem Home-Indikator.
 */
@supports (padding: env(safe-area-inset-top)) {
  /*
   * ⚠️ Der Abstand zur Statusleiste gehoert an den HEADER, nicht an die nav.
   *
   * Im Homescreen-Modus beginnt der Inhalt unter der Uhr. Vorher bekam nur die
   * nav den safe-area-Abstand — auf dem Handy umbricht der Header aber, das Logo
   * steht in der ERSTEN Zeile ueber der nav, und genau die lag damit hinter der
   * Uhr (gemeldet 30.08.2026, PEVO-DE010-Screenshot). Der Header traegt den
   * Abstand jetzt selbst, dann sitzt alles darin darunter.
   */
  header {
    padding-top: calc(env(safe-area-inset-top) + 8px);
    padding-left: max(env(safe-area-inset-left), 12px);
    padding-right: max(env(safe-area-inset-right), 12px);
  }
  nav {
    padding-left: max(env(safe-area-inset-left), 14px);
    padding-right: max(env(safe-area-inset-right), 14px);
  }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ================= Foto in voller Größe ================= */
/*
 * Vorher war das ein `target="_blank"` auf /scan-photo/…. Im Standalone-Modus
 * hat iOS dort weder Zurück-Geste noch Adresszeile: Marc saß fest und musste
 * die App über den Aufgabenumschalter verlassen. Ein Overlay in der Seite hat
 * dasselbe Ergebnis und einen Weg zurück — Kreuz, Tippen daneben, Escape.
 */
#photoOverlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-9); z-index: 60;
}
#photoOverlay img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: var(--radius-lg); display: block;
}
#photoOverlayClose {
  position: absolute; top: max(env(safe-area-inset-top), var(--space-5)); right: var(--space-5);
  width: 44px; height: 44px;                 /* Fingerbreit, nicht Mauszeigerbreit */
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 50%; font-size: var(--text-2xl); line-height: 1; cursor: pointer;
}
#photoOverlayCaption {
  position: absolute; bottom: max(env(safe-area-inset-bottom), var(--space-5));
  left: 0; right: 0; text-align: center;
  color: var(--ink-dim); font-size: var(--text-md);
}

/* ================= Bildunterschriften in der Detailansicht ================= */
/*
 * Ohne sie stehen zwei Bilder nebeneinander und man rät, welches das eigene
 * ist. Der blaue Rahmen allein trägt die Information nicht — er ist Farbe.
 */
.figure { margin: 0; text-align: center; }
/* Das Bild ist ein Bedienelement, also muss es sich auch bedienen lassen —
   vorher waren es Links, die im Fokuslauf standen. Ohne das koennte man das
   Overlay per Tastatur schliessen, aber nicht oeffnen. */
.figure[role="button"] { cursor: zoom-in; }
.figure[role="button"]:focus-visible,
.sheet-img[role="button"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm);
}
.figure figcaption {
  font-size: var(--text-xs); color: var(--ink-faint);
  margin-top: var(--space-1); line-height: var(--line-tight);
}
/*
 * ⚠️ Die gestrichelte Fläche hängt an der <figure>, NICHT am <img>.
 * Im Leerfall ist das Bild `hidden`, und `[hidden]{display:none!important}`
 * macht jede Regel darauf wirkungslos — die Fläche wäre nie erschienen und
 * unter der Bildunterschrift hätte nichts gestanden.
 */
.figure.is-empty::before {
  content: ""; display: block; box-sizing: border-box; width: 92px; aspect-ratio: 813 / 1185;
  border: 1px dashed var(--line); border-radius: var(--radius-md);
  /* Gleich großer Kartenrahmen + durchgestrichene Kamera = „kein eigenes Foto". */
  background: var(--panel-2) url("/assets/no-camera.svg") center / 40px no-repeat;
}

/* ================= Filterleiste auf dem Handy ================= */
/*
 * Suche und Topf bleiben sichtbar — das sind die beiden Griffe, die man am
 * Regal stehend braucht. Sortierung und Seitenlänge klappen weg.
 */
#filterToggle { display: none; }
.filter-extra { display: contents; }

@media (max-width: 760px) {
  #filterToggle {
    display: block; background: var(--bg); border: 1px solid var(--line);
    color: var(--ink-dim); border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-5); font: inherit; cursor: pointer; min-height: 40px;
  }
  #filterToggle[aria-expanded="true"] { border-color: var(--accent); color: var(--ink); }
  .filter-extra { display: none; width: 100%; gap: var(--space-4); }
  .filter-extra.open { display: flex; flex-wrap: wrap; }
  .filter-extra > * { flex: 1 1 140px; }
}

/* ================= Aufnehmen als Ansicht in der App ================= */
/*
 * Die Seite gab es schon, aber nur unter /upload.html — in der PWA hieß das:
 * die App verlassen. Als sechste Ansicht bleibt man drin.
 */
.shot {
  display: block; width: 100%; padding: 22px; margin-bottom: var(--space-6);
  background: var(--accent-strong); color: #fff; border: 0;
  border-radius: var(--radius-2xl);
  font-size: 17px; font-weight: var(--weight-semibold); cursor: pointer;
}
.shot small {
  display: block; font-weight: 400; opacity: .8;
  margin-top: 3px; font-size: var(--text-md);
}
/* Aufnehmen (P11): zwei kompaktere, zentrierte Knöpfe mit Icon nebeneinander. */
.shot-row { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-bottom: var(--space-6); }
.shot-row .shot { flex: 1 1 240px; margin-bottom: 0; display: flex; align-items: center; justify-content: center;
  gap: var(--space-4); padding: 16px; text-align: left; }
.shot-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.shot-label { display: block; }
.shot-alt { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.shot-alt:hover { border-color: var(--ink-faint); }
/* Höhere Spezifität als `.cardmodal-box { max-width: 520px }`, sonst wirkungslos (Codex). */
.cardmodal-box.webcam-box { max-width: 560px; }
/* ── Ausrichtrahmen der Webcam ────────────────────────────────────────────
 * Eine Yu-Gi-Oh-Karte misst 59 × 86 mm, Verhältnis 0,686. Der Rahmen zeigt,
 * wohin die Karte gehört — und begrenzt zugleich den Bereich, den die
 * Automatik auf Schärfe und Ruhe prüft. `pointer-events: none`, damit er den
 * Auslöser nicht abfängt.
 */
.webcam-stage { position: relative; display: block; }
.webcam-frame {
  position: absolute; inset: 0; margin: auto;
  height: 82%; aspect-ratio: 59 / 86;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  pointer-events: none; display: flex; align-items: flex-end; justify-content: center;
}
.webcam-frame.ready { border-color: var(--good, #3fb950); }
.webcam-frame-hint {
  margin-bottom: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px;
}
.webcam-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-dim); }

.webcam-video { width: 100%; border-radius: var(--radius-lg); background: #000; display: block; margin-bottom: var(--space-5); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.res-item {
  display: flex; gap: var(--space-5); align-items: center;
  padding: var(--space-4) 0; border-bottom: 1px solid var(--line);
}
.res-item img { width: 44px; border-radius: var(--radius-sm); }
.ok { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }

/* Der leere Zustand mit Ausweg: „nichts gefunden" ist nicht „nichts da". */
.empty-action { margin-top: var(--space-6); }

/* ================= Hilfsklassen ================= */
/*
 * Eingesammelt aus 31 `style="…"` im JavaScript und 29 im Markup. Inline-Stile
 * sind beim Suchen unsichtbar und lassen sich nicht überschreiben; jede
 * einzelne hätte in Phase 5 von Hand angefasst werden müssen.
 *
 * ⚠️⚠️ DIESER BLOCK STEHT AM ENDE DER DATEI, UND DAS IST DER GANZE PUNKT.
 *
 * Ein Inline-Stil schlägt jede Regel im Stylesheet. Eine Klasse tut das nicht:
 * bei gleicher Spezifität gewinnt die SPÄTERE Regel. Stand dieser Block oben —
 * so war es zuerst —, dann verlor `.btn-inline` gegen `.primary`, `.pull-up`
 * gegen `.hint` und `.t-accent` gegen `.navlink`. Gemessen am 29.08.2026: der
 * „Inbox einlesen"-Knopf war 1202 px breit statt schmal, weil `.primary`
 * mit `width:100%` gewann. Vier sichtbare Regressionen aus einer einzigen
 * falschen Zeilenposition.
 *
 * Wer hier etwas ergänzt: ans Ende, nicht an den Anfang.
 */
.t-faint  { color: var(--ink-faint); }
.t-dim    { color: var(--ink-dim); }
.t-warn   { color: var(--warn); }
.t-bad    { color: var(--bad); }
.t-good   { color: var(--good); }
.t-accent { color: var(--accent); }
.t-mono   { font-family: var(--mono); }
.t-xs     { font-size: var(--text-sm); }
.t-sm     { font-size: var(--text-base); }
.t-md     { font-size: var(--text-md); }
.t-strong { font-weight: var(--weight-semibold); }
.t-normal { font-weight: 400; }
.t-nowrap { white-space: nowrap; }
/* `opacity` und nicht `color`: der Zusatz steht IN einem Label, das bereits
   ink-faint ist. Mit derselben Farbe wäre er davon nicht zu unterscheiden. */
.faded    { opacity: .5; }
.row      { display: flex; gap: var(--space-6); align-items: flex-start; }
/* Ebenfalls Spezifitaet: `.sheet-head > div:first-child { flex: 1 }` (0-2-1)
   schlaegt `.row-tight`. `flex: 1` setzt flex-shrink auf 1 — die Bildgruppe
   wuerde auf schmalen Schirmen zusammenschrumpfen. Vorher hielt der
   Inline-Stil dagegen, der jede Regel schlaegt. */
.row-tight{ display: flex; gap: var(--space-3); flex-shrink: 0; }
/* `:first-child` muss mit: ohne es steht (0,2,0) gegen die (0,2,1) von
   `.sheet-head > div:first-child` und verliert. Gemessen: flex-shrink blieb 1. */
.sheet-head > .row-tight:first-child { flex: 0 0 auto; }
.grow     { flex: 1; }
.span-all { grid-column: 1 / -1; }
.stack-xs { margin-bottom: var(--space-2); }
.stack-sm { margin-bottom: var(--space-5); }
.stack    { margin-bottom: var(--space-7); }
.stack-lg { margin-bottom: var(--space-9); }

/* Sammlung als eingeklappter Subbereich im Depot (statt eigenem Reiter). Der
   Summary ist ein Klapp-Header; die enthaltenen Karten behalten ihr eigenes
   Aussehen und erscheinen darunter. */
.depot-collection > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-weight: 600; color: var(--ink-dim);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.depot-collection > summary::-webkit-details-marker { display: none; }
.depot-collection > summary::after { content: "▾"; margin-left: auto; color: var(--ink-faint); transition: transform 0.15s ease; }
.depot-collection[open] > summary { color: var(--ink); }
.depot-collection[open] > summary::after { transform: rotate(180deg); }
.depot-collection > summary:hover { color: var(--ink); border-color: var(--ink-faint); }
.depot-collection[open] > *:not(summary):first-of-type { margin-top: var(--space-6); }
.gap-sm   { gap: var(--space-3); }
.mt-1     { margin-top: var(--space-1); }
.mt-2     { margin-top: var(--space-3); }
.mt-3     { margin-top: var(--space-5); }
.mt-4     { margin-top: var(--space-7); }
.my-note  { margin: var(--space-5) 0 var(--space-3); }
.tight    { margin: 0 0 var(--space-4); }
.pull-up  { margin: -6px 0 var(--space-5); }
.lead     { font-size: var(--text-md); color: var(--ink-dim); margin: 0 0 var(--space-5); }
.linkish  { background: none; border: 0; color: var(--ink-faint); cursor: pointer; }
.thumb-md { width: 78px; border-radius: var(--radius-md); }
/* In the review list the photo opens the lightbox — the cursor says so first. */
.thumb-zoom { cursor: zoom-in; }
.btn-inline { width: auto; padding: 9px var(--space-7); }
/* Der Speichern-Knopf steht in einer Flex-Zeile neben „Abbrechen". Das
   margin-top von .primary schöbe ihn dort gegen die anderen nach unten —
   deshalb eine eigene Klasse und nicht .btn-inline, die anderswo genau dieses
   margin behalten soll. */
.btn-foot   { width: auto; padding: var(--space-4) var(--space-9); margin: 0; }
.field-wide {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-md); padding: 9px;
}
.field-wide.spaced { margin-bottom: var(--space-4); }
.field-wide.mono { padding: var(--space-4); font-family: var(--mono); font-size: var(--text-base); }
/* ⚠️ `.cond-row .pick-btn` und nicht `.pick-btn` allein: die Bauteilregel
   `.cond-row button` hat mit 0-1-1 die hoehere Spezifitaet und gewinnt
   unabhaengig von der Reihenfolge in der Datei. Die Raritaetsknoepfe waeren
   sonst 52 statt 150 px breit — die Kaskade hat zwei Achsen, und das
   Verschieben ans Ende heilt nur eine davon. */
.cond-row .pick-btn { flex: 1; min-width: 150px; padding: var(--space-4); text-align: left; }
.pick-btn .pick-title { font-weight: var(--weight-semibold); font-size: var(--text-md); }
/* Cardmarket product block in the edit sheet: the product in use is outlined;
   the two buttons wrap on narrow phones instead of overflowing the sheet. */
.cm-block { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.cm-block .row-tight { flex-wrap: wrap; }
/* Desktop-only pieces (the Mac recognition box): the phone uploads and moves on. */
@media (max-width: 760px) { .desktop-only { display: none !important; } }
.agent-row { align-items: center; flex-wrap: wrap; }
.cond-row .pick-btn.is-current { border-color: var(--accent); }
.minilabel {
  display: block; font-size: var(--text-sm); text-transform: uppercase;
  letter-spacing: var(--track-wide); color: var(--ink-faint); margin-bottom: var(--space-2);
}
.is-ready { border-color: var(--good); }
/* Auch in der App-Ansicht gebraucht, nicht nur auf der eigenen Seite. */
.result   { margin-top: var(--space-6); }

/* Stapel-Upload-Fortschritt: Zähler + Balken. */
.up-progress { margin-top: var(--space-6); }
.up-progress .up-count { font-size: 0.9rem; opacity: 0.85; margin-bottom: 6px; }
.up-bar { height: 8px; border-radius: 999px; background: rgba(127, 127, 127, 0.25); overflow: hidden; }
.up-bar-fill { height: 100%; width: 0; background: var(--accent, #3d7bfd); border-radius: 999px; transition: width 0.15s ease; }
/* Der Rücksprung aus der Aufnehmen-Seite. Bewusst NICHT .navlink: die bringt
   Polsterung und einen Hover-Hintergrund mit, die dieser Link nie hatte. */
.backlink { color: var(--accent); font-size: var(--text-md); text-decoration: none; }
/* Aufzählung in einem Hinweiskasten — die Regelprüfung nennt oft mehreres. */
.tight-list { margin: var(--space-3) 0 0; padding-left: var(--space-9); }
.tight-list li { margin-bottom: var(--space-1); }

/* ================= Leere Zustände mit Figur ================= */
/*
 * Eine Figur je leerem Zustand — groß und stark abgedunkelt hinter dem Satz.
 * Sie sagt, WELCHE Liste leer ist; der Satz sagt, was zu tun ist. Nur beim
 * echten Leerstand („noch nichts da"), nicht bei „nichts gefunden": dort fehlt
 * kein Bild, sondern ein Ausweg (der Knopf).
 */
.empty-figure {
  padding-top: 190px; background: top center / 150px no-repeat;
  opacity: .9;
}
.empty-depot { background-image: url("/assets/dragon.webp"); }

/* -------------------------------------------------------- Atmosphäre (P12) --
 *
 * Ein sehr schwaches Motiv-Wasserzeichen je Ansicht, fixiert hinter dem Inhalt.
 * ⚠️ Es liegt auf z-index -1 UNTER den Karten (die sind mit --panel deckend),
 * darum zeigt es sich nur in den Lücken auf dem --bg und berührt den Text-
 * Kontrast nicht. Deckkraft bewusst niedrig (~4 %); rein dekorativ, daher
 * pointer-events:none und kein aria (P0.8). Motiv je Reiter über body[data-view].
 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: center / min(58vmin, 660px) no-repeat;
  background-image: var(--atmo, none);
  /* Deutlicher als vorher (war .045, zu subtil — Marc), aber noch hinter dem
     Text: die Motive sollen erkennbar sein, ohne den Kontrast zu stören. */
  opacity: .12;
}
body[data-view="portfolio"]  { --atmo: url("/assets/dragon.webp"); }
body[data-view="collection"] { --atmo: url("/assets/slifer.webp"); }
body[data-view="search"]     { --atmo: url("/assets/magician.webp"); }
body[data-view="upload"]     { --atmo: url("/assets/kaiba.webp"); }
body[data-view="scan"]       { --atmo: url("/assets/kaiba.webp"); }
body[data-view="capture"]    { --atmo: url("/assets/yugi.webp"); }
body[data-view="deckbau"]    { --atmo: url("/assets/ra.webp"); }
body[data-view="decks"]      { --atmo: url("/assets/obelisk.webp"); }
body[data-view="ops"]        { --atmo: url("/assets/yugi-full.webp"); }
@media (prefers-reduced-motion: no-preference) {
  body::before { transition: background-image .3s ease, opacity .3s ease; }
}

/* Wunschliste: per Kartensuche vormerken. */

/* Aufklappende Kartensuche — wird weiterhin vom Deck-Editor benutzt
   (`.edit-add-search`), auch wenn die Wunschliste keine eigene Suche mehr hat.
   ⚠️ Beim Aufräumen fast gelöscht: „heißt wish, gehört zur Wunschliste" war
   falsch. Wer CSS entfernt, muss die Klasse im MARKUP suchen, nicht im Namen. */
.wish-search-wrap { position: relative; }
.wish-results { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 2px;
  max-height: 320px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.35)); }
.wish-result { display: flex; align-items: center; gap: var(--space-3); width: 100%;
  padding: var(--space-3); background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-align: left; cursor: pointer; font-size: var(--text-base); }
.wish-result:last-child { border-bottom: 0; }
.wish-result:hover, .wish-result:focus-visible { background: var(--panel-2); }
.wish-result img { width: 30px; height: 44px; flex-shrink: 0; object-fit: cover; border-radius: 3px; }
.wish-result-empty { padding: var(--space-4); color: var(--ink-dim); }
.wish-pick { display: inline-flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 160px;
  padding: var(--space-2) var(--space-3); background: var(--panel-2); border-radius: var(--radius); }
.wish-pick-thumb { width: 26px; height: 38px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }

/* ── Wunschlisten im Depot: je Liste ein Einzeiler ───────────────────────── */
/* Drei Bauvorschläge nebeneinander. */
.variant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-5); }
.variant-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2);
}
.variant-card h4 { margin: 0; font-size: var(--text-lg); }
.variant-card button { margin-top: auto; }
.variant-cards { margin: var(--space-2) 0; }
.variant-cards summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.variant-cards .tight-list { max-height: 40vh; overflow-y: auto; font-size: 13px; }

.wish-lists { display: flex; flex-direction: column; gap: var(--space-2); }
.wish-listrow {
  display: flex; align-items: center; gap: var(--space-4); width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6); color: var(--ink); cursor: pointer;
  font-family: inherit; font-size: var(--text-lg);
}
.wish-listrow:hover { border-color: var(--accent-strong); }
.wish-listname { flex: 1; font-weight: var(--weight-medium); }
.wish-listmeta { color: var(--ink-dim); font-size: var(--text-base); }

/* Die Karten einer Liste als Katalogbilder. */
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-6); }
.wish-card { display: flex; flex-direction: column; gap: var(--space-1); text-align: center; }
.wish-card img { width: 100%; aspect-ratio: 813 / 1185; object-fit: cover; border-radius: var(--radius-md); cursor: pointer; }
.wish-card-name { font-size: var(--text-base); line-height: var(--line-tight); }
.wish-card-price { font-size: var(--text-base); color: var(--ink-dim); }

/* Vormerken im Kartendetail. */
.cm-wish { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }
/* Auswahl + €-Feld ans dunkle App-Design angleichen (vorher Browser-Default,
   hell auf dunkel — Marc). Gleiches Muster wie `.listbar input/select`. */
.cm-wish-select, .cm-wish-price {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 8px 10px; font: inherit;
}
.cm-wish-select:focus, .cm-wish-price:focus { outline: none; border-color: var(--accent); }
.cm-wish-select { flex: 0 0 auto; max-width: 14rem; }
.cm-wish-price { flex: 0 0 9rem; }


/* ⚠️ Diese Zeile lag in `.cond-row`, das für die Zustandsknöpfe (MT/NM/EX …)
   gebaut ist und JEDES Kind auf gleiche Breite streckt (`> * { flex: 1 }`).
   Ergebnis war ein abgeschnittenes „Wunsch € (optio…" neben einem
   überbreiten „Vormerken". Hier zählt: Feld schmal, Knopf so breit wie sein
   Text. */

/* Deck-Editor (P4). */
.deck-actions { align-items: center; flex-wrap: wrap; }
/* Die Rückmeldung nach dem Speichern/Löschen — hebt sich vom Bericht ab und
   verschwindet nach ein paar Sekunden von selbst. */
.deck-flash { border-left: 3px solid var(--accent-strong); }
.deck-actions h2 { margin: 0; }
.deck-actions-spacer { flex: 1; }
.field-label { display: block; color: var(--ink-dim); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.field-label input { margin-top: 4px; }
.edit-add { align-items: stretch; margin-bottom: var(--space-5); }
.edit-add-search { position: relative; flex: 1; min-width: 180px; }
.edit-add-section { max-width: 130px; }
.edit-section { margin-top: var(--space-5); }
.edit-section h3 { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3); }
.edit-section-count { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-weight: var(--weight-regular); }
.edit-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line); }
.edit-card:last-child { border-bottom: 0; }
.edit-card-name { flex: 1; min-width: 0; cursor: pointer; }
.edit-count { display: inline-flex; align-items: center; gap: var(--space-3); }
.count-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink); border-radius: var(--radius); cursor: pointer; font-size: var(--text-base); line-height: 1; }
.count-btn:hover { border-color: var(--ink-faint); }
.count-val { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.edit-rm { color: var(--ink-faint); padding: 0 var(--space-3); }
.edit-rm:hover { color: var(--bad); }
/* Set-Fortschrittsbalken. */
.setbar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; cursor: pointer; }
.setbar .track { flex: 1; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.setbar .fill { height: 100%; background: var(--gold); }
.setbar .label { min-width: 0; flex: 1 1 40%; }
.setbar .num { color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Simulation: zwei Profilkarten nebeneinander + schlanke Balken in den Kacheln. */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); margin-top: var(--space-5); }
@media (max-width: 640px) { .cols-2 { grid-template-columns: 1fr; } }
.simbar { height: 6px; margin-top: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.simbar-fill { height: 100%; width: 0; background: var(--accent-strong); }
.wish-flag { color: var(--gold); font-weight: var(--weight-semibold); }
/* Aufklappbare Fehlliste eines Sets. */
.set-missing { padding: var(--space-3) 0 var(--space-5) var(--space-4);
  border-left: 2px solid var(--line); margin: 0 0 var(--space-4) var(--space-2); }

/* ─────────────────────────────────────────────────────────────────────────
   Deckbau: Größen-Regler und Kopien-Stepper.

   Der Regler war das eine Bauteil, das die App noch nicht hatte. Bewusst groß
   (44px Daumen) für den Touch am iPhone, das primäre Gerät.
   ───────────────────────────────────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  outline: none; margin: var(--space-3) 0;
}
/* Schlanker Handle (Pill) statt Kreis — ruhiger in der Optik (Marc). */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 26px; border-radius: 5px;
  background: var(--accent-strong); border: 1px solid var(--gold);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 26px; border-radius: 5px;
  background: var(--accent-strong); border: 1px solid var(--gold); cursor: pointer;
}

/* Kurzer Ladebalken beim Deck-Generieren. */
.loadbar { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.loadbar span {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: var(--gold); animation: loadslide 0.9s ease-in-out infinite;
}
@keyframes loadslide {
  0% { margin-left: -40%; } 100% { margin-left: 100%; }
}

/* Kopien-Stepper je Karte in der Bauliste. */
.copy-step { display: inline-flex; align-items: center; gap: var(--space-2); }
.copy-step button {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  font-size: var(--text-lg); line-height: 1; cursor: pointer; padding: 0;
}
.copy-step button:hover { border-color: var(--accent); }
.copy-step .n { min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }

/* Vorlagen-Kachel in der Auswahl. */
.tpl { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--panel-2); cursor: pointer; width: 100%; text-align: left; }
.tpl:hover { border-color: var(--accent); }
.tpl[aria-pressed="true"] { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent-strong) 18%, var(--panel-2)); }
.tpl .kind { font-size: var(--text-xs); color: var(--ink-dim); text-transform: uppercase; letter-spacing: var(--track-wide); }

@media (max-width: 760px) {
  input[type="range"] { height: 10px; }
  input[type="range"]::-webkit-slider-thumb { width: 20px; height: 40px; border-radius: 6px; }
  input[type="range"]::-moz-range-thumb { width: 20px; height: 40px; border-radius: 6px; }
  .copy-step button { width: 40px; height: 40px; }
}

/* ── Karten-Detail-Modal (Deckbauer) ──────────────────────────────────────── */
.cardmodal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center; padding: var(--space-7);
}
.cardmodal-box {
  position: relative; background: var(--panel); border: 1px solid var(--gold);
  border-radius: var(--radius-xl); padding: var(--space-8);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.cardmodal-close {
  position: absolute; top: var(--space-4); right: var(--space-4);
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-size: var(--text-2xl); line-height: 1; cursor: pointer;
}
.cardmodal-box .cm-head { display: flex; gap: var(--space-6); align-items: flex-start; }
.cardmodal-box img { width: 160px; border-radius: var(--radius-md); flex: none; }
/* Regelwerk-Lightbox: großes Bild, zoombar; Schließen-× fix im Bild-Eck. */
.refmodal-box { position: relative; max-width: 100%; max-height: 92vh; overflow: auto; }
.refmodal-img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); }
.refmodal-frame { display: block; width: min(1240px, 96vw); height: 90vh; border: 0; border-radius: var(--radius-md); background: #fff; }
/* ⚠️ Under the iOS status bar (viewport-fit=cover) a `top: 12px` button is not
   tappable — the lightbox had no visible way out on the iPhone (02.09.2026). */
#refModalClose { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 2; }
.refmodal-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 2;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  font-size: var(--text-md); color: var(--ink);
}
.refmodal-nav button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-size: var(--text-2xl); line-height: 1; cursor: pointer;
}
.refmodal-nav button:disabled { opacity: .35; cursor: default; }
.refmodal-nav a { color: var(--ink-dim); text-decoration: none; padding: 0 6px; }
.refmodal-nav a:hover { color: var(--ink); }
.cardmodal-box h3 { margin: 0 0 var(--space-2); font-size: var(--text-2xl); }
.cardmodal-box .cm-sub { color: var(--ink-dim); font-size: var(--text-md); margin-bottom: var(--space-3); }
.cardmodal-box .cm-text { margin-top: var(--space-6); white-space: pre-wrap; line-height: var(--line-relaxed); font-size: var(--text-md); }
.cardmodal-box .cm-deck { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.cardmodal-box .cm-deck-label { color: var(--ink-dim); font-size: var(--text-md); width: 100%; }

/* Thumbnail in der Deckliste (wie im Depot). */
.deck-thumb { width: 26px; height: 38px; border-radius: 3px; object-fit: cover; vertical-align: middle; margin-right: var(--space-3); cursor: pointer; }
/* Probehand: fünf Karten nebeneinander, klickbar zum Detailmodal. */
.hand-row { display: flex; gap: 8px; flex-wrap: wrap; min-height: 96px; margin: 10px 0 12px; }
.hand-card { width: 66px; height: 96px; border-radius: 5px; object-fit: cover; border: 1px solid var(--line); cursor: pointer; }
.hand-card-none {
  width: 66px; height: 96px; border-radius: 5px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 10px; padding: 4px; color: var(--ink-dim); box-sizing: border-box;
}
/* Teilmengen-Zeilen (Tuner/Counter) dezent abgesetzt — sie zählen in ihre
   Hauptgruppe hinein und stehen darum eingerückt und gedimmt. */
.deck-stoch tr.subset td { color: var(--ink-dim); }
.deck-stoch tr.subset .key { padding-left: var(--space-6); }
.card-link { cursor: pointer; }
.card-link:hover { color: var(--accent); }

@media (max-width: 760px) {
  .cardmodal-box .cm-head { flex-direction: column; align-items: center; text-align: center; }
  .cardmodal-box img { width: 60%; max-width: 220px; }
  .deck-thumb { width: 32px; height: 46px; }
}


/* Wortmarke „Thordex": das x ist aus c+k gezeichnet — Silhouette wie ein x,
   beim Hinsehen „ck" (Deck), waehrend „dex" den Sammelfokus traegt. */
/* ThordeX-Markenzeichen: THORDE-Schriftzug + X-Icon als Lockup. Hebt den von
   `header h1` geerbten Trennstrich auf, da das Lockup selbst die Identitaet ist. */
.brandlock {
  display: inline-flex; align-items: center;
  margin: 0; padding: 0; border: 0;
}
.brandlock .brand-full { height: 30px; width: auto; display: block; }
/* Auf der Anmeldeseite groesser und zentriert. */
.login .login-brand { justify-content: center; margin: 0 auto 24px; }
.login .login-brand .brand-full { height: 54px; }

/* Beta-Label neben dem Logo. */
.beta-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  padding: 1px 7px; line-height: 1.5; align-self: center; white-space: nowrap;
}
.brandlock .beta-badge { margin-left: 8px; }
/* Versionen & Änderungen (Betrieb). */
.release + .release { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.release-head { margin-bottom: 4px; }
.release-notes { margin: 0; padding-left: 18px; color: var(--ink-dim); }
.release-notes li { margin: 2px 0; }

/* Kompakte Changelog-Liste (P8): eine anklickbare Zeile je Version, Detail im Modal. */
.cl-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line); padding: var(--space-4) var(--space-2);
  color: var(--ink); cursor: pointer; }
.cl-row:first-child { border-top: 0; }
.cl-row:hover { background: var(--panel-2); }
.cl-head { display: flex; align-items: baseline; gap: var(--space-3); }
.cl-firstline { display: flex; align-items: baseline; gap: var(--space-3); min-width: 0; color: var(--ink-dim); font-size: var(--text-md); }
.cl-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cl-more { flex: 0 0 auto; color: var(--ink-faint); }
.cl-more-btn { margin-top: var(--space-5); }

/* ===================== Kartensuche ===================== */
.search-controls { display: flex; gap: 10px; margin-top: 10px; align-items: stretch; }
.search-controls #searchSort { flex: 1; }

/* Alle Bedienelemente der Kartensuche in der dunklen App-Optik (vorher native,
   weiße Selects — passte nicht zum Rest). 16px Schrift verhindert iOS-Zoom. */
#searchInput,
.search-controls #searchSort,
.search-filters select,
.search-filters input {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 16px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 10px 12px;
}
#searchInput::placeholder, .search-filters input::placeholder { color: var(--ink-faint); }

/* Selects: native Optik AUS, eigener Chevron — die ganze Fläche öffnet das
   Menü (Marc), der Pfeil ist nur Zierde. */
.search-controls #searchSort,
.search-filters select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b97a5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}

/* „Filter"-Umschalter: normaler App-Knopf (nicht der Monospace-Toggle-Stil),
   voll klickbar, Pfeil dreht sich beim Öffnen. */
.filter-toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 8px; padding: 10px 16px; font-size: 15px; font-family: inherit; cursor: pointer;
}
.filter-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }
.filter-toggle[aria-expanded="true"] { color: var(--ink); border-color: var(--accent-strong); }
.filter-caret { color: var(--ink-faint); transition: transform 0.15s ease; }
.filter-toggle[aria-expanded="true"] .filter-caret { transform: rotate(180deg); }

.search-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px; margin-top: 10px;
}
#searchResults { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.search-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
}
.search-row:hover, .search-row:focus-visible { border-color: var(--accent); outline: none; }
.search-thumb { width: 34px; height: 50px; flex-shrink: 0; }
.search-row-main { flex: 1; min-width: 0; }
.search-row-name { font-weight: 600; }
.search-row-price { color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
#searchMore { display: block; margin: 12px auto 0; }

/* Regelwerk im Betrieb: die fuenf Referenzplatten und die Rulebooks. Liegen als
   statische Dateien unter ui/reference/ und kommen ueber den normalen
   UI-Auslieferungsweg mit — deshalb braucht es dafuer keine eigene Route. */
.reflist {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: var(--space-4);
}
.reflist a {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-5) var(--space-6);
  background: var(--panel-2); color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
}
.reflist a:hover { background: var(--panel); border-color: var(--accent-strong); }
.reflist a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.reflist strong { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.reflist small  { font-size: var(--text-sm); color: var(--ink-dim); line-height: var(--line-base); }
.reflist .meta {
  font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-faint);
  letter-spacing: var(--track-wide); text-transform: uppercase; margin-top: var(--space-1);
}

/* Einordnung eines Decks: Archetyp · Strategie · Engine.
   Bewusst ruhiger als `.badge` — das hier ist Beschreibung, keine Warnung. */
.deck-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.deck-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim); }
.deck-tag-key { color: var(--ink-faint); margin-right: 5px; }

/* Simulation: standing result after the selection changed — visibly not current. */
.sim-stale { margin-bottom: .6rem; }

/* Combo lines under the role statistics of a deck. */
.lines-block { margin-top: 12px; }

/* Review list: one heading per upload batch. */
.batch-head { margin: var(--space-7) 0 var(--space-3); font-size: var(--text-md); display: flex; gap: var(--space-4); align-items: baseline; flex-wrap: wrap; }
.batch-head:first-of-type { margin-top: var(--space-4); }
/* A checkbox with its caption on one line (edition switch in the capture view). */
.check-label { display: inline-flex; align-items: center; gap: var(--space-2); }
