@font-face {
  font-family: "Hanken Grotesk";
  src: url("hanken-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Ink-slate base: a desk lamp at night, not a casino (PLAN.md 7.1) */
  --bg: #141920;
  --surface: #1b222b;
  --raised: #232b36;
  --line: #2a333f;
  --felt: #181e26;
  --text: #e6e9ee;
  --muted: #8c96a5;

  /* Fixed meaning across the whole app */
  --push: #43b581;
  --fold: #6e7785;
  --call: #5a9bef;
  --mistake: #e8594f;
  --close: #e2b54a;

  /* 4-color deck, as full card faces */
  --spade: #dfe3ea;
  --heart: #d8483f;
  --diamond: #3d7fd6;
  --club: #3a9a5f;

  --radius: 6px;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }

body { margin: 0; background: var(--bg); color: var(--text); }
h1, h2, h3, p { margin: 0; }
h1 { margin-bottom: 1.5rem; font-size: 1.5rem; font-weight: 600; }
h2 { margin-bottom: 0.75rem; font-size: 1.1rem; font-weight: 600; }
h3 { margin-bottom: 0.2rem; font-size: 1rem; font-weight: 600; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--call); outline-offset: 2px; }

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

button {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:hover { border-color: var(--muted); }
button:disabled { opacity: 0.5; cursor: progress; }

select, input, textarea {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input::-webkit-calendar-picker-indicator { filter: invert(0.8); }
textarea { resize: vertical; }

.muted { color: var(--muted); }
.empty { color: var(--muted); }
.good { color: var(--push); }
.bad, .error { color: var(--mistake); }
.warn { color: var(--close); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.25rem 0.75rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand { padding: 0 0.75rem 1rem; font-weight: 700; letter-spacing: 0.01em; }

.nav a {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--line); }
.nav-group { padding: 1rem 0.75rem 0.25rem; color: var(--muted); font-size: 0.8rem; }
.nav-gap { height: 1rem; }
.checks { display: flex; align-items: flex-end; gap: 6px; height: 2.5rem; margin: 0; padding: 0; list-style: none; }
.checks li { flex: 0 0 14px; height: 100%; background: var(--line); border-radius: 3px; display: flex; align-items: flex-end; }
.checks span { display: block; width: 100%; background: var(--push); border-radius: 3px; }
.check-result { margin: 1rem 0; }
.causes { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.75rem 0; padding: 0; border: 0; }
.causes legend { margin-bottom: 0.4rem; }
.unsure { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: 0.75rem; color: var(--muted); }
.variant-note, .pair-note { margin: 0.5rem 0; }
.replay-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.replay-choices button { flex: 1 1 8rem; min-height: 3rem; font-size: 1.05rem; }
.cards.board { font-size: 1.05rem; gap: 3px; }
.center .cards.board { margin-bottom: 0.4rem; }

.main { padding: 2rem 2.5rem 4rem; max-width: 1120px; min-width: 0; }

/* ---------- Kennzahl-Kacheln ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1.25rem 2rem;
  margin-bottom: 2.5rem;
}

.stat-value { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em; }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.stat-trend { font-size: 0.85rem; }

/* ---------- Karten ---------- */
.cards { display: inline-flex; gap: 3px; vertical-align: middle; }

.card {
  display: inline-grid;
  place-items: center;
  width: 1.55em;
  height: 2.1em;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.card small { font-size: 0.7em; font-weight: 600; }
.card.s { background: var(--spade); color: var(--bg); }
.card.h { background: var(--heart); }
.card.d { background: var(--diamond); }
.card.c { background: var(--club); }
.cards.big { font-size: 2.1rem; gap: 6px; }
.cards.big .card { border-radius: 6px; }

/* ---------- Spot-Karte: Tisch ---------- */
.spot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.table { position: relative; aspect-ratio: 16 / 10; max-width: 46rem; }

.felt {
  position: absolute;
  inset: 12% 10%;
  border-radius: 50%;
  background: var(--felt);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 10px var(--bg), inset 0 0 0 11px var(--line);
}

.center {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}

.pot { color: var(--muted); font-size: 1.05rem; }
.pot strong { color: var(--text); font-weight: 600; }
.pot-antes { color: var(--muted); font-size: 0.8rem; }

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 6.2rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  line-height: 1.3;
}

.seat-pos { font-weight: 600; }
.seat-bb { color: var(--muted); font-size: 0.9rem; }
.seat-state { color: var(--muted); font-size: 0.8rem; }
.seat.folded > * { opacity: 0.4; }
.seat.raiser { border-color: var(--push); }
.seat.raiser .seat-state { color: var(--push); }
.seat.hero { background: var(--raised); border: 2px solid var(--text); }
.seat.hero .seat-state { color: var(--text); }
.seat .cards { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -6px); }

.bet, .dealer { position: absolute; transform: translate(-50%, -50%); }

.bet {
  --chip: #cfd6df;
  --chip-edge: #7d8795;
  display: inline-flex;
  align-items: flex-end;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.bet small { color: var(--muted); font-weight: 400; }
.bet.all-in { --chip: var(--push); --chip-edge: #1f6b47; color: var(--push); }
.bet.all-in small { color: var(--push); }

.seat.hero .bet {
  left: 100%;
  bottom: calc(100% + 6px);
  margin-left: 0.5rem;
  transform: none;
}

/* A chip stack seen from the side; the top chip shows its edge spots. */
.chips { position: relative; flex: none; width: 1.6rem; height: calc(0.7rem + (var(--count) - 1) * 0.28rem); }

.chip {
  position: absolute;
  left: 0;
  bottom: calc(var(--i) * 0.28rem);
  width: 1.6rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--chip);
  border: 1px solid var(--chip-edge);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.chip:last-child {
  background: repeating-conic-gradient(var(--chip) 0 30deg, var(--chip-edge) 30deg 45deg);
}

.dealer.on-seat { left: -0.5rem; top: 50%; transform: translate(-100%, -50%); }

.dealer {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Range-Grid ---------- */
.grid {
  --size: 2.15rem;
  display: grid;
  grid-template-columns: repeat(13, var(--size));
  gap: 2px;
  font-size: calc(var(--size) * 0.3);
}

.grid.mini { --size: 1.05rem; gap: 1px; font-size: 0; }

.cell {
  position: relative;
  display: block;
  height: var(--size);
  border-radius: 2px;
  background: var(--raised);
  overflow: hidden;
  text-decoration: none;
}

.cell .fill {
  position: absolute;
  inset: auto 0 0 0;
  height: calc(var(--weight) * 100%);
  background: var(--push);
  opacity: 0.85;
}

.grid.call .cell .fill { background: var(--call); }
.cell .name { position: relative; padding: 2px 3px; color: rgba(230, 233, 238, 0.55); line-height: 1; }
.cell.filled .name { color: rgba(20, 25, 32, 0.8); }

.cell .mark {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: calc(var(--size) * 0.42);
  font-weight: 700;
  line-height: 1;
}

.cell .mark.ok { color: var(--text); }
.cell.filled .mark.ok { color: var(--bg); }
.cell .mark.miss { color: var(--mistake); text-shadow: 0 0 2px var(--bg); }
.cell.hero { outline: 2px solid var(--text); outline-offset: 0; z-index: 1; overflow: visible; }
a.cell:hover { outline: 1px solid var(--text); z-index: 1; }

.grid-caption, .grid-legend { margin-top: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.grid-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* ---------- Leaks ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.segmented a {
  padding: 0.45rem 1rem;
  color: var(--muted);
  text-decoration: none;
}

.segmented.wrap { flex-wrap: wrap; max-width: 100%; }
.segmented.wrap a { white-space: nowrap; }

.segmented a[aria-current="true"] { background: var(--line); color: var(--text); }

.leaks { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2.5rem; align-items: start; }

.matrix { border-collapse: separate; border-spacing: 3px; }
.matrix th { padding: 0 0.5rem; color: var(--muted); font-weight: 400; text-align: left; }
.matrix thead th { padding-bottom: 0.25rem; text-align: center; }
.matrix td { width: 7rem; height: 3.6rem; padding: 0; border-radius: var(--radius); }
.matrix td.empty { border: 1px dashed var(--line); }

.matrix td a {
  display: block;
  height: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
}

.matrix td a[aria-current="true"] { border-color: var(--text); }
.matrix .loss { font-size: 1.05rem; font-weight: 600; }
.matrix .count { color: var(--muted); font-size: 0.8rem; }
.matrix .hot .count { color: rgba(255, 255, 255, 0.75); }

.top-leaks { margin-top: 2.5rem; max-width: 40rem; }
.top-leaks ol { margin: 0; padding: 0; list-style: none; }
.top-leaks li { padding: 0.55rem 0; border-top: 1px solid var(--line); }
.top-leaks a { text-decoration: none; }
.drill { max-width: calc(13 * 2.15rem + 24px); }
.drill .muted { margin-bottom: 0.9rem; font-size: 0.9rem; }

/* ---------- Listen ---------- */
.rows { width: 100%; border-collapse: collapse; }
.rows th { color: var(--muted); font-weight: 400; text-align: left; }
.rows th, .rows td { padding: 0.5rem 1rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.rows .num { text-align: right; }
.rows tr[data-href] { cursor: pointer; }
.rows tbody tr:hover td { background: var(--surface); }
.rows a { text-decoration: none; }

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: end; margin-bottom: 1.5rem; }
.filters label { display: grid; gap: 0.2rem; color: var(--muted); font-size: 0.85rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1.25rem; }
.pager a { text-decoration: none; }

.grade-mistake { color: var(--mistake); }
.grade-close { color: var(--close); }
.grade-correct { color: var(--push); }
.grade-away { color: var(--muted); }

/* ---------- Hand ---------- */
.hand-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 1rem; }
.main:has(.hand-body) { max-width: 1480px; }
.hand-nav { display: flex; align-items: baseline; gap: 1rem; }
.hand-nav a { text-decoration: none; }
/* Table beside its verdict, ranges beside the review: two rows that use the width. */
.hand-body { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 2.5rem; align-items: center; margin-bottom: 2.5rem; }
.hand-verdict .verdict { max-width: 46rem; }
.hand-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(20rem, 1fr); gap: 2.5rem; align-items: start; margin-bottom: 2.5rem; }
.hand-bottom .ranges { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem 2rem; }
.hand-bottom .ranges section { container-type: inline-size; }
/* Two caption lines keep both grids level when one caption wraps. */
.hand-bottom .ranges .muted { min-height: 2lh; }
/* Cells fill the column: 13 cells and 12 gaps of 2px. */
.hand-bottom .ranges .grid { --size: calc((100cqi - 24px) / 13); }
.hand-raw summary { cursor: pointer; color: var(--muted); }
.hand-raw[open] summary { margin-bottom: 0.75rem; color: var(--text); }
.ranges { display: grid; gap: 1.75rem; }
.ranges .grid { --size: 1.8rem; }
.ranges .muted { margin-bottom: 0.6rem; font-size: 0.85rem; }
.reason { margin: 0.5rem 0 0.75rem; }
.reason p + p { margin-top: 0.4rem; }
.reason .sum { padding-top: 0.5rem; border-top: 1px solid var(--line); }
.term { position: relative; text-decoration: underline dotted color-mix(in srgb, var(--text) 50%, transparent); text-underline-offset: 0.2em; cursor: help; }
.term .tip {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 0;
  z-index: 10;
  width: max-content;
  max-width: min(18rem, 80vw);
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.35);
  display: none;
}
.term:hover .tip, .term:focus .tip { display: block; }
.reason-details { margin-top: 0.75rem; color: var(--muted); font-size: 0.9rem; }
.reason-details summary { margin: 0; font-weight: 400; }
.reason-details[open] summary { margin-bottom: 0.35rem; color: var(--text); }
.verdict { padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--surface); border-left: 3px solid var(--push); }
.verdict.mistake { border-left-color: var(--mistake); }
.verdict.close { border-left-color: var(--close); }
.verdict.away { border-left-color: var(--muted); }
.verdict p + p { margin-top: 0.35rem; }
.verdict-title { margin-bottom: 0.35rem; font-size: 1.1rem; font-weight: 600; }
.raw {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- Bankroll ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.form-error {
  margin-bottom: 1.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--mistake) 55%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--mistake) 10%, var(--surface));
}

.green { --light: var(--push); }
.yellow { --light: var(--close); }
.red { --light: var(--mistake); }

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
  margin-bottom: 3rem;
}

.balance { font-size: 3.4rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.account > .muted { margin-top: 0.6rem; }
.in-euro { color: var(--muted); font-size: 1.1rem; font-weight: 400; letter-spacing: 0; }

.check { display: grid; gap: 0.4rem; margin-top: 1.5rem; max-width: 26rem; }
.check label { color: var(--muted); font-size: 0.85rem; }
.check.prompt label { color: var(--text); }
.check-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.check-field:focus-within { border-color: var(--muted); }
.check.prompt .check-field { border-color: color-mix(in srgb, var(--close) 60%, var(--line)); }
.check-field .unit { padding-right: 0.4rem; color: var(--muted); }
.check-field input { flex: 1; min-width: 0; padding: 0.55rem 0.4rem 0.55rem 0.7rem; border: 0; background: none; font-size: 1.05rem; }
.check-field input:focus-visible { outline: none; }
.check-field button { margin: 0.25rem; }
.check .rate { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.check .rate input { width: 5.5rem; padding: 0.2rem 0.4rem; text-align: right; }

.overview button, .entry button, .rules button {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.overview button:hover, .entry button:hover, .rules button:hover { background: #fff; }

.signal {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: help;
}

.lamps {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.lamp {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lamp) 16%, var(--raised));
}
.lamp.red { --lamp: var(--mistake); }
.lamp.yellow { --lamp: var(--close); }
.lamp.green { --lamp: var(--push); }

.signal.red .lamp.red,
.signal.yellow .lamp.yellow,
.signal.green .lamp.green {
  background: var(--lamp);
  box-shadow: 0 1px 6px color-mix(in srgb, var(--lamp) 60%, transparent);
  animation: lamp-on 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lamp-on {
  from { opacity: 0.35; }
}

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

.ladder { grid-column: 1 / -1; }
.ladder-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.75rem; }
.ladder-head h2 { margin: 0; }
.ladder-share { color: var(--light); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }

.track {
  position: relative;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--mistake) 14%, var(--raised)) 50%,
    var(--raised) 50%
  );
}
.track .fill { position: absolute; inset-block: 0; border-radius: 999px; background: var(--light); }
.track .zero { position: absolute; left: 50%; inset-block: -0.3rem; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); }

.ladder-scale { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 0.5rem; font-size: 0.85rem; }
.ladder-scale span:nth-child(2) { text-align: center; }
.ladder-scale span:nth-child(3) { text-align: right; }
.ladder-scale small { display: block; color: var(--muted); font-size: 0.8rem; }
.ladder-text { margin-top: 0.6rem; color: var(--muted); }

.mix { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.mix-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.mix-head h3 { margin: 0; }
.mix-rows { display: grid; gap: 0.7rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.mix-row { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 10rem; align-items: center; gap: 1rem; }
.mix-stake { font-weight: 600; }
.mix-track { position: relative; height: 0.45rem; border-radius: 999px; background: var(--raised); }
.mix-fill { position: absolute; inset-block: 0; left: 0; min-width: 2px; border-radius: 999px; background: color-mix(in srgb, var(--text) 75%, var(--raised)); }
.mix-limit { position: absolute; inset-block: -0.25rem; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--push); }
.mix-value { text-align: right; line-height: 1.25; }
.mix-value small { display: block; color: var(--muted); font-size: 0.8rem; }
.mix-row.over .mix-fill { background: var(--mistake); }
.mix-row.over .mix-value, .mix-row.over .mix-value small { color: var(--mistake); }

.curve { margin-bottom: 2.5rem; }
.chart { margin: 0; }
.plot { position: relative; height: 20rem; margin: 2.5rem 0 2rem 3.75rem; }
.plot:focus-visible { outline-offset: 6px; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot line, .plot path { vector-effect: non-scaling-stroke; }
.plot .grid-line { stroke: var(--line); stroke-width: 1; }
.plot .day-line { stroke: var(--line); stroke-width: 1; }
.plot .area { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.plot .series { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }

.y-label, .x-label, .guide-label { position: absolute; font-size: 0.75rem; white-space: nowrap; }
.y-label { right: calc(100% + 0.6rem); color: var(--muted); transform: translateY(-50%); }
.x-label { top: calc(100% + 0.45rem); padding-left: 0.3rem; color: var(--muted); border-left: 1px solid var(--line); }

.guide-label {
  left: 0;
  right: 0;
  padding: 0 0.1rem 0.15rem;
  border-bottom: 1px dashed var(--guide);
  color: var(--guide);
  text-align: right;
  transform: translateY(calc(1px - 100%));
}
.floor { --guide: var(--close); }
.target { --guide: var(--push); }

.edges { position: absolute; right: 0; display: flex; flex-direction: column; align-items: end; gap: 0.3rem; }
.edges.top { bottom: calc(100% + 0.5rem); flex-direction: row; }
.edges.bottom { bottom: 0.4rem; }
.edge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--guide) 45%, var(--line));
  border-radius: 999px;
  background: var(--bg);
  color: var(--guide);
  font-size: 0.75rem;
  white-space: nowrap;
}
.edge::before { content: ""; border: 0.3rem solid transparent; }
.edges.top .edge::before { margin-top: -0.3rem; border-bottom-color: var(--guide); }
.edges.bottom .edge::before { margin-bottom: -0.3rem; border-top-color: var(--guide); }

.dot { position: absolute; width: 0.65rem; height: 0.65rem; border: 2px solid var(--bg); border-radius: 50%; background: var(--text); transform: translate(-50%, -50%); }
.crosshair { position: absolute; inset-block: 0; width: 1px; background: var(--muted); }
.plot [hidden] { display: none; }
.chart figcaption { font-size: 0.85rem; }

.tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 0.1rem;
  min-width: 11rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  pointer-events: none;
  transform: translate(0.9rem, -50%);
}
.tooltip.flip { transform: translate(calc(-100% - 0.9rem), -50%); }
.tooltip strong { font-size: 1rem; }

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem 2rem;
  margin: 0 0 3rem;
  padding: 1.25rem 0;
  border-block: 1px solid var(--line);
}
.figures dt { color: var(--muted); font-size: 0.85rem; }
.figures dd { margin: 0; }
.figures .figure { font-size: 1.35rem; font-weight: 600; }
.figures .note { color: var(--muted); font-size: 0.8rem; }

.places { display: flex; gap: 4px; align-items: end; height: 4.2rem; margin: 0.3rem 0 0; padding: 0; list-style: none; }
.places li { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; width: 1.1rem; height: 100%; }
.places .bar { align-self: end; width: 0.7rem; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--fold); }
.places .bar.paid { background: var(--push); }
.places .count { font-size: 0.7rem; font-weight: 600; line-height: 1.2; }
.places .place { color: var(--muted); font-size: 0.7rem; line-height: 1.3; }

.results { margin-bottom: 2.5rem; }
.scope { margin-bottom: 1rem; font-size: 0.85rem; }
.stakes tbody tr[aria-current="true"] td { background: var(--surface); }
.stakes tbody tr[aria-current="true"] td:first-child a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.stakes tfoot td { border-bottom: 0; font-weight: 600; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.results-head h2 { margin: 0; }
.sub-title { margin-top: 1.75rem; margin-bottom: 0.6rem; }
.more { margin-top: 0.75rem; }
.results .rows td:first-child { white-space: nowrap; }

.booking-form { margin-bottom: 1rem; }
.booking-form summary { display: inline-block; margin-bottom: 0; color: var(--muted); font-weight: 400; }
.booking-form summary:hover, .booking-form[open] summary { color: var(--text); }
.entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
  margin-top: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
}
.entry label, .panel label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.85rem; }
.entry input, .entry select, .panel input { width: 100%; background: var(--bg); }
.entry button { justify-self: start; }

.panel { display: grid; gap: 0.75rem; align-content: start; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); }
.panel button { justify-self: start; }

button.link { padding: 0; border: 0; background: none; color: var(--muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { color: var(--mistake); }
td form { display: inline; }
details summary { cursor: pointer; font-weight: 600; margin-bottom: 1rem; }
.rules { max-width: 28rem; }

/* ---------- Einstellungen ---------- */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 2rem;
  margin: 0;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.import { margin-top: 2.5rem; }

.import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.import-head h2 { margin: 0; }
.rows .file { overflow-wrap: anywhere; }

/* ---------- Heute ---------- */
a.button {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

button.primary, a.button.primary {
  padding: 0.5rem 1.1rem;
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

button.primary:hover, a.button.primary:hover { background: #fff; }

.section { margin-bottom: 3rem; }
.lead { max-width: 44rem; margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.25rem; }
.hand-review form { display: grid; gap: 0.6rem; max-width: 40rem; }
.hand-review button { justify-self: start; }
.hand-review > p { margin-top: 0.6rem; }
.hand-bottom .hand-review { padding: 1.25rem 1.4rem; border-radius: var(--radius); background: var(--surface); }
.hand-bottom .hand-review h2 { margin-top: 0; }
.hand-bottom .hand-review textarea { background: var(--bg); }
.lesson-cost { max-width: 40rem; margin-bottom: 1rem; }
.lesson-note { font-size: 1.15rem; font-weight: 600; }

.review-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-bottom: 1.25rem; padding: 0.6rem 1rem; border-radius: var(--radius); background: var(--surface); }
.review-bar a { text-decoration: none; }
.review-steps { display: flex; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.review-steps a { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 0.85rem; }
.review-steps a.done { border-color: var(--push); color: var(--push); }
.review-steps a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.review-bar-nav { display: flex; gap: 1rem; margin-left: auto; }

.focus { max-width: 44rem; margin-bottom: 2.5rem; }
.focus-label { margin-bottom: 0.5rem; color: var(--muted); }

.focus-sentence {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.focus-why { margin-top: 0.75rem; color: var(--muted); font-size: 1.05rem; }

/* ---------- Heute: der Tag als Spur ---------- */
/* Spacing on a 4px base: 4/8 inside a group, 16/24 between its parts, 32 between blocks. */
.day-head { display: grid; gap: 2px; margin: -1rem 0 2rem; }
.date { color: var(--muted); }
.day-summary a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 3px;
}
.day-summary a:hover { color: var(--text); text-decoration-color: currentColor; }
/* The link's underline already marks it; a second, dotted one would clutter. */
.day-summary a .term { text-decoration: none; }

.day { display: grid; gap: 2rem; }

.stage-card {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.day-steps {
  display: grid;
  align-content: start;
  gap: 1.5rem;
  margin: 0;
  padding: 1.5rem;
  border-right: 1px solid var(--line);
  list-style: none;
}

.day-step {
  position: relative;
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  align-items: center;
}

/* The connector runs from this mark down to the next one. */
.day-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: -1.25rem;
  left: calc(0.55rem - 1px);
  width: 2px;
  border-radius: 1px;
  background: var(--line);
}
.day-step.done:not(:last-child)::after { background: color-mix(in srgb, var(--push) 55%, var(--line)); }

.mark { position: relative; width: 1.1rem; height: 1.1rem; border: 2px solid var(--line); border-radius: 50%; }
.day-step.done .mark { border-color: var(--push); background: var(--push); }
.day-step.done .mark::after {
  content: "";
  position: absolute;
  left: 0.26rem;
  top: 0.1rem;
  width: 0.25rem;
  height: 0.45rem;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.day-step.current .mark { border-color: var(--text); }
.day-step.current .mark::after { content: ""; position: absolute; inset: 0.18rem; border-radius: 50%; background: var(--text); }
.day-step.skip .mark { border-style: dashed; }

.day-step-name { font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.day-step-note { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 0.5rem; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.day-step:is(.upcoming, .skip) .day-step-name { color: var(--muted); }
.day-step-note:has(.sub) { flex-direction: column; }
.sub.done { color: color-mix(in srgb, var(--push) 75%, var(--muted)); }
.sub.current { color: var(--text); }

.stage { display: flex; flex-direction: column; align-items: start; min-width: 0; padding: 1.5rem 2rem 2rem; }
.stage h2 { margin-bottom: 1rem; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.stage .focus-sentence { max-width: 24ch; }
.stage .focus-why { margin-top: 0.5rem; }
.stage-lead { max-width: 40rem; font-size: 1.05rem; }
.stage-sub { margin: 1.75rem 0 0.4rem; font-size: 1.05rem; font-weight: 600; }
.stage-go { margin-top: 1.5rem; font-weight: 600; }

.stage-action { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1.5rem; }
form.stage-action:has(textarea) { display: grid; justify-items: start; gap: 0.5rem; width: 100%; }
.stage-action textarea { width: min(100%, 40rem); margin-bottom: 0.5rem; }
.stage-action .primary { padding: 0.65rem 1.5rem; font-size: 1.05rem; }

.quiz-progress { align-self: stretch; max-width: 40rem; height: 0.4rem; margin-top: 1.5rem; border-radius: 999px; background: var(--raised); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; border-radius: 999px; background: var(--text); }
.progress-label { margin-top: 0.5rem; color: var(--muted); font-size: 0.85rem; }

.compact-rows { margin-top: 1rem; }
.compact-rows td { padding-block: 0.3rem; }
.compact-rows .num { white-space: nowrap; }
.compact-rows .state { color: var(--muted); text-align: right; white-space: nowrap; }
.compact-rows .checked .state { color: var(--push); }
.compact-rows .checked td:not(.state) { opacity: 0.55; }
.row-note { font-size: 0.85rem; }

.standing { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.standing h2 { grid-column: 1 / -1; margin: 0; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); font-size: 1rem; }

.gauge { display: grid; grid-template-rows: auto auto 3.75rem auto; align-content: start; padding: 1rem 1.5rem 0; }
.gauge:nth-of-type(1) { padding-left: 0; }
.gauge + .gauge { border-left: 1px solid var(--line); }
.gauge h3 { margin: 0; font-size: 0.85rem; font-weight: 500; }
.gauge h3 a { color: var(--muted); text-decoration: none; }
.gauge h3 a:hover { color: var(--text); }
.gauge-value { margin-top: 0.25rem; font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.gauge-value small { color: var(--muted); font-size: 0.85rem; font-weight: 400; letter-spacing: 0; }
.gauge-value.tentative { color: var(--muted); }
.gauge-value.red { color: var(--mistake); }
.gauge-visual { display: flex; flex-direction: column; justify-content: center; }
.gauge-text { color: var(--muted); font-size: 0.875rem; line-height: 1.45; }
.gauge-text a { color: var(--text); }
.gauge-mix { display: block; margin-top: 0.2rem; }
.gauge .track { height: 0.45rem; }
.gauge .track .zero { inset-block: -0.2rem; }

.weeks {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  height: 2.25rem;
  margin: 0.25rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.week { position: relative; display: flex; align-items: end; }
.week .bar { width: 100%; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--fold) 70%, var(--raised)); transform-origin: bottom; }
.week.now .bar { background: var(--text); }
.week-label { position: absolute; top: calc(100% + 2px); left: 0; right: 0; color: var(--muted); font-size: 0.7rem; text-align: center; }
.goal { position: absolute; left: 0; right: 0; z-index: 1; border-top: 1px dashed var(--push); pointer-events: none; }

.compare { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.compare-label { color: var(--muted); font-size: 0.75rem; }
.compare span:not(.compare-label) { height: 0.4rem; border-radius: 999px; background: var(--mistake); transform-origin: left; }
.compare .then { background: color-mix(in srgb, var(--mistake) 30%, var(--raised)); }

.routine { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.routine li { flex: 1; max-width: 0.85rem; aspect-ratio: 1; border-radius: 2px; background: var(--raised); }
.routine li.on { background: color-mix(in srgb, var(--text) 80%, var(--raised)); }
.routine li.today { outline: 1px solid var(--muted); outline-offset: 1px; }

.sessions { display: grid; gap: 0.25rem; }
.sessions h2 { margin: 0; font-size: 1rem; }
.sessions-summary { margin: 0 0 0.75rem; }
.sessions-tables { margin: 0; font-size: 0.85rem; }
.sessions-chart { position: relative; height: 5rem; margin: 0.75rem 0 1.5rem 2.75rem; }
.axis-label { position: absolute; right: calc(100% + 0.5rem); transform: translateY(50%); color: var(--muted); font-size: 0.7rem; white-space: nowrap; }
.trend {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--count), 3.5rem);
  height: 100%;
  border-bottom: 1px solid var(--line);
}
.trend svg { position: absolute; inset-block: 0; left: 0; width: calc(var(--count) * 3.5rem); height: 100%; overflow: visible; pointer-events: none; }
.trend polyline { fill: none; stroke: var(--muted); stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trend :is(.trend-top, .trend-mean) { position: absolute; left: 0; right: 0; pointer-events: none; }
.trend .trend-top { border-top: 1px solid var(--line); }
.trend .trend-mean { border-top: 1px dashed var(--muted); }
.session { position: relative; z-index: 1; text-decoration: none; }
.session:hover { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.session .trend-dot {
  position: absolute;
  left: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--muted);
  transform: translate(-50%, 50%);
}
.session.now .trend-dot { width: 0.75rem; height: 0.75rem; background: var(--text); }
/* Few spots: the share swings with a single hand, so the dot is only a hint. */
.session.thin .trend-dot { background: var(--bg); box-shadow: inset 0 0 0 2px var(--muted); }
.session-value { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.session-label { position: absolute; top: calc(100% + 4px); left: 0; right: 0; color: var(--muted); font-size: 0.7rem; text-align: center; }

/* While checking hands, the list gets the room; the standing shows numbers only. */
.day.compact { gap: 1rem; }
.day.compact .gauge { grid-template-rows: auto auto; padding-top: 0.75rem; }
.day.compact :is(.gauge-visual, .gauge-text) { display: none; }
.day.compact .gauge-value { font-size: 1.15rem; }
.day.compact .standing h2 { display: none; }
.day.compact .sessions { display: none; }
.day.compact .gauge { border-top: 1px solid var(--line); }
.day.compact .stage { padding-block: 1.25rem 1.5rem; }

@media (prefers-reduced-motion: no-preference) {
  .standing :is(.track .fill, .compare span:not(.compare-label)) { animation: grow 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
  .standing .week .bar { animation: rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both; }
  .standing .track .fill { transform-origin: left; }
  @keyframes grow { from { transform: scaleX(0); } }
  @keyframes rise { from { transform: scaleY(0); } }
}

@media (max-width: 1080px) {
  .standing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge:nth-of-type(3) { padding-left: 0; border-left: 0; }
  .gauge:nth-of-type(n + 3) { border-top: 1px solid var(--line); margin-top: 1rem; }
  .day.compact .standing { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .day.compact .gauge:nth-of-type(3) { padding-left: 1.5rem; border-left: 1px solid var(--line); }
  .day.compact .gauge:nth-of-type(n + 3) { border-top: 0; margin-top: 0; }
}

/* ---------- Tisch-Hülle (Quiz, Replay, Simulator) ---------- */
/* The table leads, the dock beside it holds whatever the moment asks for. */
.main:has(.desk) { max-width: 1480px; }
.desk { display: grid; grid-template-columns: minmax(0, 34rem) minmax(18rem, 27rem); gap: 1.5rem 2.5rem; align-items: start; }
.desk-stage .spot-meta { gap: 0.25rem 1.25rem; }
.desk-line { min-height: 1.5em; margin-top: 0.5rem; font-weight: 600; text-align: center; text-wrap: balance; }
.desk-view .hand-table { transition: opacity 0.2s; }
.desk-view[data-moment="hand"] .hand-table { opacity: 0.4; }
.desk-hint { margin-top: 0.4rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
.desk-dock { display: grid; gap: 1.25rem; }
.desk-bar-title { margin-bottom: 0.6rem; font-weight: 600; }
.desk-choices { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.desk-choices .answer { flex: 1 1 auto; min-height: 3.25rem; padding: 0.75rem 1rem; font-size: 1.1rem; white-space: nowrap; }
.desk-choices .answer kbd { margin-right: 0.5rem; }
.desk.is-sent .desk-choices { opacity: 0.5; pointer-events: none; }
.desk-bar .unsure { min-height: 2.75rem; margin: 0.35rem 0 -0.5rem; }
.primary kbd { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
.desk-next { margin-top: 1rem; }
.desk-dock :is(.desk-end, .desk-next .button, .desk-next button, .desk-skip button) { display: flex; justify-content: center; align-items: center; gap: 0.5rem; width: 100%; min-height: 3rem; }
.desk-skip button { color: var(--muted); }

/* States, set by the page's script: feedback first, then the hand plays, then hero acts. */
.desk-skip, .desk-next:has([data-play]) { display: none; }
.js .desk[data-state="feedback"] .desk-next:has([data-play]) { display: block; }
.desk[data-state="play"] .desk-skip { display: block; }
.desk:is([data-state="feedback"], [data-state="play"]) .desk-bar { display: none; }
.desk[data-state="play"] .desk-sheet { opacity: 0.55; }
.desk.is-picking .desk-bar { display: none; }
.js .desk[data-state="play"] .desk-sheet[data-after] { display: none; }

.desk-steps { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.75rem; font-size: 0.9rem; }
.desk-steps a { color: var(--muted); text-underline-offset: 3px; }
.desk-steps a:hover { color: var(--text); }
.replay-won { margin: 0.25rem 0 0; padding-left: 1.1rem; }

.desk-history summary { margin: 0; color: var(--muted); font-weight: 400; }
.desk-history[open] summary { margin-bottom: 0.5rem; color: var(--text); }
.desk-history ol { margin: 0; padding-left: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.desk-sheet .ranges { margin-top: 1.75rem; }

@media (prefers-reduced-motion: no-preference) {
  .desk-view .seat.acted { animation: seat-acted 700ms cubic-bezier(0.16, 1, 0.3, 1); }
  .desk-view .seat.folded.acted > * { animation: seat-fold 280ms ease-out; }
  .desk-view .bet.acted { animation: bet-in 340ms cubic-bezier(0.16, 1, 0.3, 1); }
  .desk-view[data-moment="street"] .board:has(.card:nth-child(3):last-child) .card,
  .desk-view[data-moment="street"] .board .card:nth-child(n + 4):last-child,
  .desk-view[data-moment="showdown"] .seat:not(.hero) .cards { animation: card-in 320ms cubic-bezier(0.16, 1, 0.3, 1); }
  .desk-view[data-moment="deal"] .seat.hero .cards { animation: card-in 320ms cubic-bezier(0.16, 1, 0.3, 1); }
  .desk-sheet .verdict { animation: reveal 160ms ease-out; }
  @keyframes seat-acted { from { border-color: var(--text); background: var(--raised); } }
  @keyframes seat-fold { from { opacity: 1; } }
  @keyframes bet-in { from { opacity: 0; scale: 0.6; } }
  @keyframes card-in { from { opacity: 0; translate: 0 -6px; } }
  @keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
}

@media (hover: none) {
  .desk-dock kbd { display: none; }
}

/* On the phone the moment's controls sit at the bottom, in reach of the thumb. */
@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; gap: 1rem; }
  .main:has(.desk) > h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .js .desk { padding-bottom: 7rem; }

  .js :is(.desk-bar, .desk-skip, .desk-sheet) {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }

  .js .desk-sheet {
    display: flex;
    flex-direction: column;
    max-height: 62vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 12px 12px 0 0;
    background: var(--surface);
    box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35);
  }

  /* The way on stays in reach however long the explanation runs. */
  .js .desk-sheet .desk-next {
    position: sticky;
    bottom: calc(-0.75rem - env(safe-area-inset-bottom));
    margin: 1rem -1rem calc(-0.75rem - env(safe-area-inset-bottom));
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
    order: 1;
    z-index: 1;
  }

  .js .desk-sheet .verdict { padding: 0.25rem 0 0 0.9rem; border-radius: 0; }
  .js .desk:is([data-state="act"], [data-state="play"]) .desk-sheet[data-feedback] { display: none; }
  .js .desk-bar-title { display: none; }
  .desk-choices .answer { min-height: 3.5rem; font-size: 1.05rem; }
  .desk-steps a { padding: 0.75rem 0; }
}

/* ---------- Quiz ---------- */

.quiz-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
  margin-bottom: 0.5rem;
}
.spoiler { filter: blur(5px); cursor: help; user-select: none; transition: filter 0.15s; }
.spoiler:hover, .spoiler:focus { filter: none; outline: none; }

.progress { height: 3px; margin-bottom: 1.5rem; border-radius: 2px; background: var(--line); }
.progress div { height: 100%; border-radius: 2px; background: var(--text); }
.desk-line.question { font-size: 1.25rem; }

.answer {
  min-width: 12rem;
  padding: 1.1rem 1.6rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.answer.push { border-color: color-mix(in srgb, var(--push) 55%, var(--line)); }
.answer.call { border-color: color-mix(in srgb, var(--call) 55%, var(--line)); }
.answer:hover { background: var(--raised); }
.answer:disabled { opacity: 0.4; cursor: default; }
.answer.chosen { opacity: 1; background: var(--raised); border-color: var(--text); }

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.3em;
  border-radius: 3px;
  background: var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 0.85em;
  text-align: center;
}

.answer kbd { margin-right: 0.6rem; }

.starts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem 3rem; max-width: 52rem; margin-bottom: 2rem; }
.start-option { display: grid; gap: 0.75rem; align-content: start; justify-items: start; }
.start-option h2 { margin: 0; }
.keys kbd { margin: 0 0.15rem; }
.result { margin-bottom: 2rem; font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }


/* ---------- Simulator ---------- */
.sim-resume { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; margin-bottom: 1.5rem; }

.sim-start { max-width: 62rem; }
.sim-settings { margin-bottom: 1.25rem; }

.sim-settings summary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 400;
  list-style: none;
}

.sim-settings summary::-webkit-details-marker { display: none; }
.sim-settings summary:hover, .sim-settings[open] summary { border-color: var(--muted); }
.sim-settings-edit { color: var(--muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; }
.sim-settings-body { display: grid; gap: 1.25rem; margin-top: 0.75rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); }

.choice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; padding: 0; border: 0; }
.choice legend { margin-bottom: 0.4rem; padding: 0; color: var(--muted); font-size: 0.85rem; }

.choice label {
  position: relative;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice label:hover { color: var(--text); }
.choice label:has(:checked) { border-color: var(--text); background: var(--raised); color: var(--text); }
.choice label:has(:focus-visible) { outline: 2px solid var(--call); outline-offset: 2px; }
.choice-hint { flex-basis: 100%; margin-top: 0.2rem; color: var(--muted); font-size: 0.85rem; }

.sim-entries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }

.sim-entry {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: start;
  gap: 0.15rem;
  min-height: 11.5rem;
  padding: 1rem 1.1rem 1.1rem;
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}

.sim-entry:hover:not(:disabled) { border-color: var(--muted); background: var(--raised); }
.sim-entry:active:not(:disabled) { translate: 0 1px; }
.sim-entry:disabled { opacity: 0.45; cursor: not-allowed; }
.sim-entry-table { width: 5.5rem; height: 4.5rem; margin: -0.25rem 0 0.5rem -0.35rem; overflow: visible; }
.sim-entry-table ellipse { fill: var(--felt); stroke: var(--line); stroke-width: 1.5; }
.sim-entry-table circle { fill: var(--fold); transition: fill 0.15s; }
.sim-entry-table circle.hero { fill: var(--text); }
.sim-entry:hover:not(:disabled) .sim-entry-table circle:not(.hero) { fill: var(--muted); }
.sim-entry:hover:not(:disabled) .sim-entry-table ellipse { fill: var(--bg); }
.sim-entry-label { font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
.sim-entry-note { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.sim-entry-count { padding-top: 0.75rem; color: var(--muted); font-size: 0.8rem; }

.sim-about { max-width: 44rem; margin-top: 2rem; }
.sim-about summary { color: var(--muted); font-weight: 400; }
.sim-about[open] summary { color: var(--text); margin-bottom: 0.6rem; }
.sim-about p + p { margin-top: 0.5rem; }
.sim-recent-title { margin-top: 2.5rem; }

.sim-picker { padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--surface); }
.sim-picker-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; margin: 0.6rem 0 0.75rem; }
.sim-picker-options button { min-height: 2.75rem; }
.sim-picker-options .is-current { border-color: var(--text); background: var(--raised); }
.sim-picker .muted { font-size: 0.85rem; }

.seat-note { margin-top: 0.1rem; color: var(--muted); font-size: 0.72rem; line-height: 1.2; }
.seat-link { position: absolute; inset: -1px; border-radius: inherit; }
.seat-link:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.seat:has(.seat-link) .seat-note { text-decoration: underline dotted; text-underline-offset: 2px; }

.sim-summary { margin-bottom: 2.5rem; }
.sim-metric { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; color: var(--muted); font-size: 1.05rem; }
.sim-metric-value { color: var(--text); font-size: 2.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.sim-sample { margin-top: 0.35rem; color: var(--muted); }
.sim-place { margin-top: 1rem; }
.sim-section { max-width: 52rem; margin-bottom: 2.25rem; }
.sim-section h2 .muted, .sim-section summary .muted { margin-left: 0.35rem; font-weight: 400; }
details.sim-section summary { font-size: 1.1rem; }
.sim-note { margin-top: 0.6rem; font-size: 0.9rem; }
.sim-decisions { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }

.sim-decisions a {
  display: grid;
  grid-template-columns: auto 4.5rem 7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.sim-decisions a:hover { background: var(--surface); }
.sim-d-what { display: contents; }
.sim-d-hand { color: var(--muted); }
.sim-d-loss { color: var(--muted); text-align: right; white-space: nowrap; }
.sim-d-loss.bad { color: var(--mistake); }
.sim-types { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.sim-types li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.sim-twin { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.sim-again { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

@media (max-width: 1080px) {
  .sim-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .sim-entries { gap: 0.75rem; }
  .sim-entry { min-height: 10rem; padding: 0.85rem 0.9rem 0.9rem; }
  .sim-entry-label { font-size: 1.1rem; }
  .sim-settings summary { display: flex; justify-content: space-between; }
  .sim-metric-value { font-size: 2.2rem; }
  .sim-decisions a { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "cards what what" "cards grade loss"; gap: 0.1rem 0.75rem; }
  .sim-decisions .cards { grid-area: cards; }
  .sim-d-what { display: flex; gap: 0.5rem; grid-area: what; }
  .sim-d-grade { grid-area: grade; font-size: 0.9rem; }
  .sim-d-loss { grid-area: loss; font-size: 0.9rem; }
}

/* ---------- Gesperrt ---------- */
.locked {
  max-width: 34rem;
  margin: 20vh auto 0;
  padding: 0 1rem;
  text-align: center;
}

.locked p { color: var(--muted); }

/* ---------- Anmelden ---------- */
.login {
  display: grid;
  gap: 1.25rem;
  max-width: 20rem;
  margin: 20vh auto 0;
  padding: 0 1rem;
}

.login .brand { padding: 0; font-size: 1.25rem; }
.login form { display: grid; gap: 0.6rem; }
.login label { color: var(--muted); }
.login input { padding: 0.55rem 0.7rem; font: inherit; }
.login-error { color: var(--mistake); }

/* ---------- Mobile ---------- */
@media (max-width: 1080px) {
  .hand-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .leaks, .hand-body { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .nav {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 0.5rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .brand { padding: 0 0.75rem 0 0; }
  .nav-group, .nav-gap { display: none; }
  .main { padding: 1.25rem 1rem 3rem; }
  .facts { grid-template-columns: 1fr; gap: 0.2rem; }
  .facts dd { margin-bottom: 0.6rem; }
  .grid { --size: calc((100vw - 2rem - 24px) / 13); }
  .matrix td { width: auto; min-width: 3.6rem; }
  .table { aspect-ratio: 1 / 1.05; font-size: 0.8rem; }
  .felt { inset: 13% 6%; }
  .seat { width: 4.8rem; padding: 0.25rem 0.3rem; }
  .cards.big { font-size: 1.6rem; }
  .bet { gap: 0.2rem; font-size: 0.75rem; }
  .chips, .chip { width: 1.2rem; }
  .hide-sm { display: none; }
  .day-head { margin: -0.75rem 0 1.5rem; }
  .day { gap: 1.5rem; }
  .stage-card { grid-template-columns: 1fr; }
  .day-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; padding: 1rem 1rem 1.25rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .day-step { grid-template-columns: 1fr; align-items: start; }
  .day-step .mark { margin-bottom: 0.25rem; }
  .day-step-note { grid-column: 1; }
  .day-step-note:has(.sub) { flex-direction: row; }
  .day-step:not(:last-child)::after { top: calc(0.55rem - 1px); bottom: auto; left: 1.6rem; right: 0.25rem; width: auto; height: 2px; }
  .stage { padding: 1.25rem 1rem 1.5rem; }
  .standing, .day.compact .standing { grid-template-columns: 1fr; }
  .gauge, .gauge:nth-of-type(n) { padding: 1rem 0; border-left: 0; margin-top: 0; }
  .gauge + .gauge { border-top: 1px solid var(--line); }
  .gauge { grid-template-rows: auto auto auto auto; gap: 0.5rem; }
  .gauge-value { margin-top: 0; }
  .day.compact .gauge:nth-of-type(n) { padding: 0.5rem 0; border-left: 0; }
  .overview { grid-template-columns: 1fr; gap: 1.75rem; }
  .signal { order: -1; justify-self: start; }
  .balance { font-size: 2.8rem; }
  .plot { height: 15rem; margin-left: 3.25rem; }
  .ladder-scale small { font-size: 0.7rem; }
  .mix-row { grid-template-columns: 3rem minmax(0, 1fr) 8.5rem; gap: 0.75rem; }
  .answer { flex: 1; min-width: 0; }
}
