/* ===== Přístupnost: viditelný focus ring (klávesnice) ===== */
/* Jen :focus-visible → myš/dotyk focus ring neukazují, klávesnice ano.
 * Akcentový obrys (ink) je viditelný v dark i light. Inputy mají vlastní
 * box-shadow focus ve formulářové sekci níže. */
:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* prvky s vlastním box-shadow focusem (formuláře, toggle) outline nepřebíjíme dvakrát */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
input[type="checkbox"]:focus-visible { outline: none; }

/* ===== Hlavička obrazovky ===== */
.hlavicka {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.hlavicka .akce { display: flex; gap: 10px; }

/* ===== Tlačítka ===== */
.ikobtn {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--card); color: var(--text); border: 1px solid var(--border-hairline);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease-out, transform .12s ease-out;
}
.ikobtn:hover { background: var(--card2); }
.ikobtn:active { transform: scale(0.92); filter: brightness(0.94); }
.btn {
  font-family: inherit; font-size: var(--fs-h3); font-weight: 510;
  border: none; border-radius: var(--r-md); padding: 0 16px; min-height: 40px;
  background: var(--card2); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.965); filter: brightness(0.94); }

/* řádek ikona + text (inline zarovnání) */
.ikona-radek { display: inline-flex; align-items: center; gap: 6px; }
.akcent { color: var(--accent-ink); }

/* vyhledávací pole se search ikonou vlevo */
.search-field { position: relative; display: flex; align-items: center; }
.search-field .ic { position: absolute; left: 12px; color: var(--text-tertiary); pointer-events: none; }
.search-field input { padding-left: 38px; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn.sm { padding: 0 12px; min-height: 32px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }

/* ===== Karty ===== */
.card {
  background: var(--surface-card); border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-4); margin-bottom: 12px;
}
/* klikací karty: hover o stupeň světlejší + active scale (afordance) */
.card.tlac { cursor: pointer; transition: background .15s ease-out, transform .12s ease-out, border-color .15s ease-out; }
.card.tlac:hover { background: var(--surface-control); border-color: var(--border-strong); }
.card.tlac:active { transform: scale(0.99); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ===== Formuláře ===== */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  font-family: inherit; font-size: 16px;
  background: var(--surface-control); color: var(--text);
  border: 1px solid var(--border-hairline); border-radius: var(--r-md);
  padding: 0 12px; min-height: 40px; width: 100%;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
textarea { resize: vertical; min-height: 64px; padding: 10px 12px; line-height: 1.5; }
.num { text-align: center; }

/* Datum/čas: hodnota zarovnaná vlevo (jinak ji iOS hází na střed → vypadá divně),
 * kalendář/hodiny ikona vpravo. Konzistentní s ostatními poli. */
input[type="date"], input[type="time"] { text-align: left; }
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { opacity: .6; }

/* focus ring v akcentu */
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* select – vlastní šipka (chevron), bez nativního vzhledu */
select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}

/* toggle switch (nahrazuje checkboxy) */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  width: 44px; min-width: 44px; height: 26px; min-height: 26px; padding: 0;
  border-radius: 999px; background: var(--surface-control);
  border: 1px solid var(--border-strong); position: relative; flex: 0 0 auto;
  transition: background .18s ease-out, border-color .18s ease-out;
}
input[type="checkbox"]::after {
  content: ""; position: absolute; top: 50%; left: 3px; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; background: var(--text);
  transition: transform .18s cubic-bezier(.22,1,.36,1), background .18s ease-out;
}
input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
input[type="checkbox"]:checked::after { transform: translate(18px, -50%); background: var(--accent-text); }
input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* ===== Chip / štítky ===== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: var(--card2); color: var(--muted);
  border: 1px solid var(--line); cursor: pointer;
}
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip.warmup.on { background: var(--warn); border-color:var(--warn); color:var(--surface-canvas); }
.chip.dropset.on { background: var(--type-dropset); border-color:var(--type-dropset); color:var(--surface-canvas); }
.chip.failure.on { background: var(--danger); border-color:var(--danger); color:var(--text); }
.tag { display:inline-block; font-size:12px; padding:3px 9px; border-radius:var(--r-lg);
       background: var(--card2); color: var(--muted); margin: 0 4px 4px 0; }
.pr-badge { background: var(--accent); color: var(--accent-text); font-weight:700;
            font-size:11px; padding:2px 8px; border-radius:var(--r-md); }

/* ===== Spodní navigace ===== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  max-width: 520px; margin: 0 auto; z-index: 20;
}
.tab {
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); display: flex; flex-direction: column;
  align-items: center; gap: 3px; flex: 1; padding: 4px 0;
  min-height: 44px; /* jistota tap-cíle (≥44px) na všech zařízeních */
  font-size: var(--fs-micro); font-family: inherit;
  transition: color .15s ease-out;
}
.tab.aktivni { color: var(--accent-ink); }
.tab .tab-ikona { display: flex; }

/* ===== Banner (rest timer) ===== */
.banner {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: var(--accent); color: var(--accent-text);
  border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700;
  animation: banner-in var(--dur) var(--ease-out) both;
}
@keyframes banner-in { from { opacity: 0; transform: translateY(-8px); } }
.banner .cas { font-size: 22px; font-variant-numeric: tabular-nums; }
.banner button { background: rgba(0,0,0,0.15); color: inherit; border: none;
                 border-radius: 10px; padding: 6px 12px; font-weight:700; cursor: pointer; }

/* ===== Série v aktivním tréninku ===== */
.set-row {
  display: grid; grid-template-columns: 28px 1fr 1fr 44px; gap: 8px;
  align-items: center; margin-bottom: 8px;
}
.set-row.hotovo input { opacity: .55; }
.set-row .idx { color: var(--muted); font-weight: 700; text-align: center; }
.set-row .ok {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--muted); font-size: 18px; cursor: pointer;
  transform-origin: center;
  transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.set-row.hotovo .ok { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.set-hlavicka { display: grid; grid-template-columns: 28px 1fr 1fr 44px; gap: 8px;
                font-size: 12px; color: var(--muted); margin-bottom: 6px; padding: 0 2px; }

/* ===== Drobnosti ===== */
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card2); color: var(--text); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: var(--r-md); opacity: 0;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  z-index: 50; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-akce { display: flex; align-items: center; gap: 14px; }
.toast .toast-btn {
  background: none; border: none; color: var(--accent-ink);
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  padding: 4px 6px; min-height: 32px; flex-shrink: 0;
}

/* ===== Modal (potvrzení / vstup) ===== */
/* Glass: blur JEN na overlay nad obsahem; vždy solid fallback níže. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
@supports not (backdrop-filter: blur(1px)) {
  .modal-overlay { background: rgba(0,0,0,.62); }
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px; width: 100%; max-width: 360px;
  transform: scale(.96); transition: transform var(--dur) var(--ease-out);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-nadpis { margin: 0 0 8px; font-size: 18px; }
.modal-text { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-akce { display: flex; gap: 10px; }
.modal-akce .btn { flex: 1; min-width: 0; padding: 8px 10px; height: auto; min-height: 40px;
  font-size: 13.5px; line-height: 1.2; white-space: normal; }

/* ===== Chyba při startu (seed) ===== */
.seed-chyba {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.big-num { font-size: 40px; font-weight: 800; line-height: 1; }
.big-num span { font-size: 16px; color: var(--muted); font-weight: 600; }
