/*
 * Pitíčko – styly aplikace.
 * Vizuální směr: „kuchyňský sešit“ (risografický tisk, papír + inkoust + 2 akcenty).
 * Mobile first, světlý i tmavý režim, lokální fonty Fraunces + Work Sans.
 */

/* ---------- Lokální fonty (@font-face) ---------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/app/fonts/fraunces-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/app/fonts/fraunces-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/app/fonts/work-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/app/fonts/work-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/app/fonts/work-sans-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/app/fonts/work-sans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Barvy: světlý režim (výchozí) ---------- */
:root {
  color-scheme: light dark;
  --paper: #F5F0E6;
  --ink: #1E2A3A;
  --accent-1: #2BA7B5;
  --accent-2: #FF6A4D;
  --card: #FFFBF3;
  --on-accent: #1E2A3A;

  --bg: var(--paper);
  --surface: var(--card);
  --text: var(--ink);
  --border: var(--ink);
  --radius: 8px;
  --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Work Sans', system-ui, -apple-system, sans-serif;
  --bottom-h: 88px;
}
[data-theme="light"] { color-scheme: light; }

/* ---------- Tmavý režim: ruční volba ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141B26;
  --ink: #F5F0E6;
  --accent-1: #5FD3DF;
  --accent-2: #FF8A70;
  --card: #1E2836;
  --on-accent: #141B26;
}

/* ---------- Tmavý režim: podle systému ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]),
  [data-theme="system"] {
    --paper: #141B26;
    --ink: #F5F0E6;
    --accent-1: #5FD3DF;
    --accent-2: #FF8A70;
    --card: #1E2836;
    --on-accent: #141B26;
  }
}

/* ---------- Základ ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-1);
  text-decoration-thickness: 2.5px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--accent-2); }
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0;
}
p { margin: 0 0 .55em; }
p:last-child { margin-bottom: 0; }
:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus {
  left: 8px; top: 8px; z-index: 100;
  background: var(--surface); border: 2px solid var(--ink); padding: 10px 14px;
}
.muted { color: var(--text); }
.note { color: var(--text); font-size: 16px; }
.icon { width: 22px; height: 22px; flex: none; }
.noscript { padding: 24px; text-align: center; }

/* ---------- Záměrný posun tisku (misregistration) ---------- */
.view-title,
.misreg {
  text-shadow: 2.5px 2px 0 var(--accent-1);
}
[data-theme="dark"] .view-title,
[data-theme="dark"] .misreg {
  text-shadow: 2.5px 2px 0 rgba(95, 211, 223, 0.38);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .view-title,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .misreg,
  [data-theme="system"] .view-title,
  [data-theme="system"] .misreg {
    text-shadow: 2.5px 2px 0 rgba(95, 211, 223, 0.38);
  }
}

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  font-family: var(--font-body); font-weight: 600; font-size: 17px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform 150ms ease;
}
.btn:hover { transform: translate(-1px, -1px); }
.btn:active { transform: translate(2px, 2px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary {
  background: var(--accent-1);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
}
.btn-danger {
  background: var(--accent-2);
  color: var(--on-accent);
}
.btn-text {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-color: var(--accent-1);
  text-decoration-thickness: 2px;
}
.btn-small { min-height: 48px; padding: 8px 16px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--ink);
  color: var(--text); cursor: pointer;
  transition: transform 150ms ease;
}
.icon-btn:hover { background: var(--accent-1); color: var(--on-accent); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: .4; cursor: default; background: var(--paper); transform: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- Rozvržení a sešitové karty ---------- */
.shell { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.topbar {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 2px 12px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 16px;
}
.view-title { font-size: 32px; }
.view-sub {
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 0;
}
.view {
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px) + 18px);
  outline: none;
}

/* Nadpis sekce s ručním podtržením jako fixou */
.section-title {
  font-size: 21px;
  margin: 0 0 14px;
  display: inline-block;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  height: 4px;
  margin-top: 2px;
  background: var(--accent-2);
  border-radius: 3px;
  transform: rotate(-0.7deg);
}

.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 18px;
  margin-bottom: 18px;
  animation: card-settle 240ms ease-out;
}
@keyframes card-settle {
  from { opacity: 0.85; transform: translateY(4px) rotate(-0.3deg); }
  to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

/* ---------- Spodní ovládací panel (záložky + tlačítko Přidat) ---------- */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.bottom > * { max-width: 608px; margin-left: auto; margin-right: auto; }
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: stretch;
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; padding: 6px 4px;
  border-radius: var(--radius); border: 2px solid transparent;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.tabs a[aria-current="page"] {
  background: var(--accent-1);
  color: var(--on-accent);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; padding: 6px 6px;
  font-family: var(--font-head); font-size: 15px; font-weight: 800;
  background: var(--accent-2); color: var(--on-accent);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 150ms ease;
}
.btn-add:hover { transform: translate(-1px, -1px); }
.btn-add:active { transform: translate(2px, 2px); }

/* ---------- Hlavní obrazovka: ukazatel jako nádoba ---------- */
.status-card {
  display: flex; align-items: center; gap: 18px;
  position: relative;
  background-image: radial-gradient(var(--accent-1) 1.1px, transparent 1.1px);
  background-size: 10px 10px;
  background-repeat: repeat-x;
  background-position: 0 0;
  padding-top: 24px;
}
/* Zakrytí teček pod samotným obsahem karty (halftone je jen v horním proužku) */
.status-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 12px; bottom: 0;
  background: var(--surface);
  border-top: 2px solid var(--ink);
  border-radius: 0 0 6px 6px;
  z-index: 0;
}
.status-card > * { position: relative; z-index: 1; }

.vessel {
  width: 148px; height: 156px; flex: none;
  overflow: visible;
}
.vessel-misreg { fill: var(--accent-1); opacity: 0.35; }
.vessel.is-near .vessel-misreg,
.vessel.is-over .vessel-misreg { fill: var(--accent-2); opacity: 0.4; }
.vessel-paper { fill: var(--paper); }
.vessel-liquid { fill: var(--accent-1); }
.vessel.is-near .vessel-liquid,
.vessel.is-over .vessel-liquid { fill: var(--accent-2); }
.vessel-dot { fill: var(--ink); opacity: 0.18; }
.vessel.is-near .vessel-dot,
.vessel.is-over .vessel-dot { opacity: 0.28; }
.vessel-meniscus { fill: none; stroke: var(--ink); stroke-width: 2; }
.vessel-overflow {
  fill: var(--accent-2);
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
}
.vessel-outline {
  fill: none; stroke: var(--ink); stroke-width: 3.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.vessel-rim { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.vessel-tick { stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.vessel-label-bg {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2.2;
}
.vessel-big {
  font-family: var(--font-head);
  font-size: 25px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  fill: var(--text);
}
.vessel-small {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  fill: var(--text);
}

/* Jemné vlnění hladiny (vypne se při prefers-reduced-motion) */
@keyframes wave-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-80px); }
}
.vessel-wave {
  animation: wave-drift 3.4s linear infinite;
}

.status-text { flex: 1; min-width: 0; }
.status-main {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 600; font-size: 16px; margin: 4px 0 0;
}
.badge-icon { font-family: var(--font-head); font-weight: 800; }
.badge.is-ok,
.badge.is-reached { background: var(--accent-1); color: var(--on-accent); }
.badge.is-near,
.badge.is-over { background: var(--accent-2); color: var(--on-accent); }

@media (max-width: 400px) {
  .status-card { flex-direction: column; text-align: center; }
}

/* ---------- Rychlá tlačítka jako razítka / samolepky ---------- */
.quick { margin-bottom: 18px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-stamp {
  min-height: 64px;
  padding: 6px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  position: relative;
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: transform 150ms ease;
}
.stamp-1 { transform: rotate(-0.8deg); }
.stamp-2 { transform: rotate(0.7deg); }
.stamp-3 { transform: rotate(0.5deg); }
.stamp-4 { transform: rotate(-0.6deg); background: var(--paper); }
.stamp-inner {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px;
  border: 1.5px dashed var(--accent-1);
  border-radius: 5px;
  padding: 4px 8px;
}
.btn-quick-custom .stamp-inner { border-color: var(--accent-2); }
.btn-stamp:hover { background: var(--accent-1); color: var(--on-accent); }
.btn-stamp:hover .stamp-inner { border-color: var(--on-accent); }
.btn-stamp:active,
.btn-stamp.is-stamped {
  transform: scale(0.94) rotate(0deg);
}
@media (min-width: 520px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }

/* Letící kapka z tlačítka do nádoby */
.fly-drop {
  position: fixed;
  width: 24px; height: 28px;
  pointer-events: none;
  z-index: 60;
  fill: var(--accent-1);
  stroke: var(--ink);
  stroke-width: 2;
  transition: transform 320ms cubic-bezier(.2, .8, .3, 1), opacity 320ms ease-in;
}

/* ---------- Seznam záznamů jako linkovaný sešit ---------- */
.entries {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}
.entry {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1.5px dashed var(--ink);
}
.entry:last-child { border-bottom: none; }
.entry-time {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 68px;
}
.entry-amount {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.entry-actions { display: flex; gap: 6px; }
.entries-total {
  text-align: right;
  font-family: var(--font-head);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 10px 4px 0;
}

/* Prázdný stav s tiskovou ilustrací */
.empty-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: 16px;
}
.empty-illust { width: 88px; height: 56px; flex: none; }
.empty-illust-accent { fill: var(--accent-1); opacity: 0.45; }
.empty-illust-ink { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.empty-illust-accent-stroke { fill: var(--accent-2); stroke: var(--ink); stroke-width: 1.8; }
.empty-text { font-family: var(--font-head); font-size: 18px; font-weight: 800; margin: 0; }

/* ---------- Instalace ---------- */
.install-card { border-style: dashed; }
.install-title { font-family: var(--font-head); font-weight: 800; font-size: 19px; }
.ios-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.ios-step { counter-increment: s; margin-bottom: 14px; }
.ios-step p::before { content: counter(s) ". "; font-family: var(--font-head); font-weight: 800; }
.ios-step-img {
  width: 100%; height: auto;
  border-radius: var(--radius); border: 2px solid var(--ink);
  background: var(--paper); display: block; margin-bottom: 6px;
}

/* ---------- Statistiky a grafy s halftone výplní ---------- */
.stats-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.stats-head .section-title { margin: 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper-label {
  font-family: var(--font-head);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 7.5em; text-align: center; font-size: 16px;
}
.chart { width: 100%; height: auto; display: block; margin: 6px 0 8px; overflow: visible; }
.chart-axis { stroke: var(--ink); stroke-width: 2; }
.chart-pat-bg1 { fill: var(--accent-1); }
.chart-pat-bg2 { fill: var(--accent-2); }
.chart-pat-dot { fill: var(--ink); opacity: 0.35; }
.chart-pat-hatch { stroke: var(--ink); stroke-width: 1.3; opacity: 0.45; }
.chart-bar { stroke: var(--ink); stroke-width: 1.8; }
.chart-ref { stroke: var(--ink); stroke-width: 2.2; stroke-dasharray: 4 3; }
.chart-avg { stroke: var(--accent-2); stroke-width: 2; stroke-dasharray: 9 5; }
.chart-label {
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 800;
  fill: var(--text);
}
.chart-value {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  fill: var(--text);
}
.chart-mark {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  fill: var(--text);
}
.legend { font-size: 14px; margin-bottom: 10px; }
.summary { list-style: none; padding: 0; margin: 0 0 14px; }
.summary li { padding: 8px 0; border-top: 1.5px dashed var(--ink); }
.summary li:first-child { border-top: none; }

/* ---------- Nastavení ---------- */
.settings-card .btn { margin-top: 4px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 160px; margin: 0; }

/* Tři velká tlačítka vzhledu s ikonou */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  min-height: 54px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--paper); color: var(--text);
  border: 2px solid var(--ink); border-radius: var(--radius);
  font-weight: 600; cursor: pointer; font-size: 15px; text-align: center;
}
.segmented input:checked + label {
  background: var(--accent-1);
  color: var(--on-accent);
  box-shadow: 2px 2px 0 var(--ink);
}
.segmented input:focus-visible + label {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

.check { display: flex; gap: 12px; align-items: center; min-height: 48px; cursor: pointer; margin: 6px 0; }
.check input { width: 24px; height: 24px; accent-color: var(--accent-1); flex: none; }
.warn-box {
  background: var(--paper);
  color: var(--text);
  border: 2px solid var(--ink);
  border-left: 6px solid var(--accent-2);
  padding: 10px 12px; border-radius: var(--radius); font-size: 16px; margin: 10px 0;
}
.disclaimer {
  font-size: 16px; color: var(--text);
  background: var(--paper);
  border: 2px dashed var(--ink);
  padding: 12px 14px; border-radius: var(--radius);
}
.export-buttons { display: grid; gap: 10px; }

/* ---------- Formuláře ---------- */
.field { margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: 16px; }
.input {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  min-height: 52px; padding: 8px 14px; width: 100%;
  background: var(--paper); color: var(--text);
  border: 2px solid var(--ink); border-radius: var(--radius);
}
.input:focus { outline: 3px solid var(--accent-1); outline-offset: 1px; }
.form-error {
  color: var(--text);
  background: var(--accent-2);
  color: var(--on-accent);
  border: 2px solid var(--ink);
  padding: 6px 10px; border-radius: var(--radius);
  font-weight: 600; font-size: 16px;
}
.times-editor { display: grid; gap: 10px; margin-bottom: 12px; }
.time-row { display: flex; gap: 8px; align-items: center; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 4px 0 14px; }
.chip {
  background: var(--accent-1); color: var(--on-accent);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 6px 14px;
  font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums;
}

/* ---------- Dialogy ---------- */
.modal {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 0; width: min(92vw, 460px); max-height: 88vh;
  background: var(--surface); color: var(--text);
  box-shadow: 6px 6px 0 var(--ink);
}
.modal::backdrop { background: rgba(20, 27, 38, .65); }
.modal form { padding: 22px; }
.modal-title { font-size: 24px; margin-bottom: 10px; }
.modal-text { color: var(--text); }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal-actions .btn { width: 100%; }

/* ---------- Toast jako tmavý lístek ---------- */
.toast {
  position: fixed; left: 50%; z-index: 50;
  bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px) + 12px);
  transform: translate(-50%, 16px) rotate(-0.6deg); opacity: 0;
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--paper);
  padding: 8px 10px 8px 16px; border-radius: var(--radius); min-height: 52px;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}
.toast.show { transform: translate(-50%, 0) rotate(-0.6deg); opacity: 1; }
.toast-msg { padding: 6px 6px 6px 0; font-weight: 600; }
.toast-btn {
  font-family: var(--font-head); font-weight: 800; font-size: 16px;
  min-height: 44px; min-width: 72px; padding: 0 14px;
  background: var(--accent-2); color: var(--on-accent);
  border: 2px solid var(--paper); border-radius: 6px; cursor: pointer;
}

/* ---------- Úvodní obrazovka: vstupenky ---------- */
.onboarding {
  min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.ob-inner { width: 100%; max-width: 520px; }
.ob-logo {
  display: block; margin: 4px 0 14px;
  border-radius: 12px;
}
.ob-title { font-size: 32px; margin-bottom: 10px; }
.ob-text { color: var(--text); margin-bottom: 20px; }
.ob-form { display: grid; gap: 12px; margin-top: 8px; }
.ob-links { margin-top: 14px; }

.mode-cards { display: grid; gap: 16px; margin-bottom: 22px; }
.ticket-card {
  display: flex; align-items: stretch; gap: 0; text-align: left;
  font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 0; min-height: 124px;
  overflow: hidden;
  transition: transform 200ms ease;
}
.ticket-card:hover { transform: translate(-2px, -2px) rotate(-0.4deg); }
.ticket-card.is-picked { transform: translate(4px, 2px) rotate(1.5deg) scale(0.98); }
.ticket-stub {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: 68px; flex: none;
  padding: 14px 8px;
  background: var(--accent-1);
  color: var(--on-accent);
  border-right: 2px dashed var(--ink);
}
.ticket-card:nth-child(2) .ticket-stub { background: var(--accent-2); }
.ticket-num {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
}
.ticket-icon { width: 34px; height: 34px; }
.ticket-main {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 16px 18px;
}
.mode-card-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.mode-card-desc { color: var(--text); font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .stamp-1, .stamp-2, .stamp-3, .stamp-4, .toast, .toast.show {
    transform: none !important;
  }
  .toast.show { transform: translate(-50%, 0) !important; }
}
