* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
  min-height: 100dvh;               /* skutečná výška okna na mobilu (bez adresního řádku) */
  overscroll-behavior-y: none;      /* žádné „pull-to-refresh“ přetažení */
  -webkit-font-smoothing: antialiased;
}

/* Dotyková odezva: každé tlačítko se při doteku lehce zmáčkne */
button { touch-action: manipulation; }
button:active { transform: scale(0.97); }

.hidden { display: none !important; }
.field-off { display: none !important; }   /* pole karty, které k druhu cviku nepatří */

.screen {
  max-width: 480px;
  margin: 0 auto;
  /* bezpečné okraje kvůli výřezu (notch) a spodní navigaci */
  padding: calc(20px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
           calc(96px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  text-align: center;
}

h1 { font-size: 1.5rem; color: #fff; margin-bottom: 6px; }
.subtitle { font-size: 0.9rem; color: #888; margin-bottom: 24px; }
.section-label { font-size: 0.8rem; color: #666; margin: 24px 0 8px; text-transform: uppercase; letter-spacing: 1px; }

/* ===== Přihlášení ===== */
.user-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.user-list button {
  padding: 14px; border: 1px solid #2a2a3e; border-radius: 12px;
  background: #1a1a2e; color: #fff; font-size: 1rem; cursor: pointer;
}
.user-list button:hover { border-color: #4a6cf7; }
.login-name { font-size: 1.1rem; color: #fff; margin-bottom: 10px; }
.link { color: #6c8cff; font-size: 0.85rem; margin-top: 12px; cursor: pointer; }

input, select {
  width: 100%; padding: 13px 12px; border-radius: 10px;
  border: 1px solid #333; background: #1a1a2e; color: #fff;
  font-size: 16px; margin-bottom: 10px;   /* 16px = na iOS se pole při klepnutí nepřiblíží */
}
input::placeholder { color: #555; }

.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #4a6cf7, #6c8cff);
  color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn-primary:disabled { opacity: 0.4; }
.btn-secondary {
  width: 100%; padding: 12px; border: 1px solid #333; border-radius: 12px;
  background: transparent; color: #ccc; font-size: 0.95rem; cursor: pointer;
}
.error-msg { color: #ff8080; font-size: 0.95rem; margin-top: 14px; min-height: 18px; }
.error-msg:not(:empty) {
  background: rgba(244, 68, 68, 0.12);
  border: 1px solid rgba(244, 68, 68, 0.5);
  border-radius: 10px;
  padding: 12px;
}
.ok-msg { color: #4caf50; font-size: 0.85rem; margin-top: 8px; min-height: 18px; }

/* Verze aplikace — nenápadná, ale vždy k nalezení */
.version-tag {
  font-size: 0.78rem; color: #555; margin-top: 18px;
  letter-spacing: 0.5px; text-align: center;
}
.card .version-tag { margin-top: 0; margin-bottom: 8px; color: #6c8cff; font-size: 0.95rem; }
header .header-right { text-align: right; }
header .version-tag { display: block; margin-top: 2px; font-size: 0.72rem; text-align: right; }

/* ===== Hlavní obrazovka ===== */
header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; font-size: 0.9rem; color: #888;
}
#app-user { color: #fff; font-weight: 600; }

/* Mikrofon */
.mic-container { position: relative; margin: 16px auto; width: 110px; height: 110px; }
.mic-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(74, 108, 247, 0.3); transition: all 0.3s;
}
.mic-ring.active { border-color: #f44; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.5; }
}
.mic-btn {
  position: absolute; inset: 10px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #4a6cf7, #6c8cff); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(74,108,247,0.4); transition: all 0.3s;
}
.mic-btn svg { width: 40px; height: 40px; }
.mic-btn.recording {
  background: linear-gradient(135deg, #f44, #ff6b6b);
  box-shadow: 0 4px 24px rgba(244,68,68,0.4);
}
.mic-btn:active { transform: scale(0.95); }
/* Mikrofon se drží, takže pod prstem nesmí rolovat stránka ani naskočit
   výběr textu či nabídka po dlouhém stisku. Totéž pro mikrofon v dialogu. */
.mic-btn, #btn-chat-mic {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#btn-chat-mic.recording { background: #f44; color: #fff; }

.status { font-size: 0.9rem; color: #888; min-height: 22px; margin-bottom: 12px; }

/* Přepínač Telefon / Gemini pod mikrofonem — dvojtlačítko, vybraná půlka svítí */
.mic-mode {
  display: inline-flex; margin: 0 auto 14px;
  border: 1px solid #2c2c44; border-radius: 18px; overflow: hidden;
}
.mic-mode button {
  padding: 7px 16px; border: none; background: transparent;
  color: #8a93a3; font-size: 0.85rem; cursor: pointer;
}
.mic-mode button + button { border-left: 1px solid #2c2c44; }
.mic-mode button.on { background: #2a3a7a; color: #fff; font-weight: 600; }
.mic-mode button:disabled, .field-toggles button:disabled { opacity: 0.35; cursor: default; }
.status.recording { color: #f44; }
.status.success { color: #4caf50; }
.status.error { color: #f44; }

.text-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.text-input-row input { margin-bottom: 0; font-size: 16px; }
.text-input-row button {
  padding: 0 20px; min-height: 48px; border: none; border-radius: 10px;
  background: #2a2a3e; color: #fff; font-size: 1.1rem; cursor: pointer;
}

/* Karty */
.card {
  background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 14px;
  padding: 16px; margin-bottom: 16px; text-align: left;
}
.card-title { font-size: 0.85rem; color: #6c8cff; margin-bottom: 10px; font-weight: 600; }
.card label { display: block; font-size: 0.8rem; color: #aaa; margin-bottom: 6px; }
.card label input, .card label select { margin-top: 4px; }
.raw-text { font-size: 0.85rem; color: #777; font-style: italic; margin-bottom: 10px; }
.alt-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.alt-choices button {
  padding: 8px 14px; border: 1px solid #4a6cf7; border-radius: 20px;
  background: transparent; color: #6c8cff; font-size: 0.85rem; cursor: pointer;
}
.alt-choices button.selected, .alt-choices button:hover {
  background: rgba(74, 108, 247, 0.2); color: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ===== Plovoucí okno (potvrzení / úprava / dialog) ===== */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 8, 16, 0.82);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* dole bez odsazení: lišta Uložit/Zrušit se lepí ke spodnímu okraji
     overlaye a odsazení by pod ní nechalo prosvítat obsah */
  padding: calc(8px + env(safe-area-inset-top)) 10px 0;
  display: flex; align-items: flex-start; justify-content: center;
}
.overlay-inner { width: 100%; max-width: 460px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.overlay .card { box-shadow: 0 12px 48px rgba(0,0,0,0.6); }

/* ===== Hlasový vstup u polí ===== */
.voice-wrap { position: relative; display: block; }
.voice-wrap input { padding-right: 48px; }
.voice-mic {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: none; border-radius: 9px;
  background: #2a2a3e; color: #9ab; font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.voice-mic:hover { background: #35354e; color: #fff; }
.voice-mic.recording { background: #f44; color: #fff; animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ===== Editor katalogu cviků ===== */
.ex-list { max-height: 320px; overflow-y: auto; }
.ex-list button {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid #2a2a3e; border-radius: 10px; background: #14141f;
  color: #ddd; font-size: 0.87rem; cursor: pointer; margin-bottom: 6px;
}
.ex-list button:hover { border-color: #4a6cf7; color: #fff; }
.ex-list button .grp { color: #666; font-size: 0.75rem; margin-left: 6px; }
.ex-list button .en { display: block; color: #555; font-size: 0.72rem; margin-top: 2px; }

/* Filtry katalogu — partie a nářadí */
.ex-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.ex-filters button {
  padding: 4px 9px; border-radius: 12px; border: 1px solid #2c2c44;
  background: #1a1a2e; color: #8a93a3; font-size: 0.73rem; cursor: pointer;
}
.ex-filters button:hover { border-color: #4a6cf7; color: #fff; }
.ex-filters button.on { background: #2a3a7a; border-color: #4a6cf7; color: #fff; }

.sub-title { font-size: 0.78rem; color: #6c8cff; margin: 14px 0 6px; font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: #aaa; font-size: 0.85rem; margin-bottom: 10px; }
.checkbox-row input { width: auto; margin: 0; }

/* ===== Karta záznamu: větší písmo =====
   Čte se v posilovně na stojáka a často bez brýlí, proto má proti zbytku
   aplikace vlastní, výrazně větší měřítko. Čísla jsou navíc vycentrovaná
   a tučná, ať jdou přečíst jedním pohledem. */
/* Písmo zůstává velké, ale mezery jsou úsporné — celá karta se má vejít
   na displej telefonu, ať se k Uložit nemusí rolovat. */
#confirm-card { padding: 14px 14px 8px; }
#confirm-card .card-title { font-size: 1.05rem; margin-bottom: 6px; }
#confirm-card .raw-text { font-size: 1rem; line-height: 1.4; margin-bottom: 10px; }
#confirm-card label { font-size: 1rem; color: #b4bdcb; margin-bottom: 8px; }
#confirm-card input, #confirm-card select {
  font-size: 20px; padding: 11px 12px; margin-bottom: 0;
}
#confirm-card input[type="number"] { text-align: center; font-weight: 700; letter-spacing: 0.5px; }
/* tři pole vedle sebe se při větším písmu nevejdou — po dvou je to čitelné */
#confirm-card .entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
/* Pole se čísly jsou nízká (čísla zůstávají velká a tučná), ať karta
   nezabírá zbytečně výšku displeje. */
#confirm-card .entry-fields label { font-size: 0.92rem; margin-bottom: 6px; }
#confirm-card .entry-fields input { font-size: 19px; padding: 6px 4px; }
#confirm-card .entry-fields .stepper { margin-top: 2px; }
#confirm-card .entry-fields .step-btn { font-size: 1.3rem; }
#confirm-card .row2 { gap: 10px; }
#confirm-card .sub-title { font-size: 0.95rem; margin: 8px 0 6px; }
#confirm-card .more-fields { margin: 0 0 4px; padding: 6px 0; text-align: left; }

/* Uložit / Zrušit se drží u spodního okraje displeje, takže jsou na dosah
   i ve chvíli, kdy se karta celá nevejde (malý telefon, zvětšené písmo). */
#confirm-card .actions {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0 -14px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #1a1a2e; border-top: 1px solid #2a2a3e;
  grid-template-columns: 1.6fr 1fr;   /* „Uložit změny“ je delší než „Zrušit“ */
}
#confirm-card .actions button { padding-left: 8px; padding-right: 8px; }

#confirm-card .picker-button { font-size: 1.05rem; padding: 12px 12px; }
#confirm-card .picker-panel input { font-size: 18px; padding: 13px 12px; }
#confirm-card .picker-list button { font-size: 1rem; padding: 12px 12px; }
#confirm-card .picker-list button .en { font-size: 0.82rem; }
#confirm-card .picker-list button .eq { font-size: 0.82rem; }
#confirm-card .picker-list .grp-head { font-size: 0.8rem; }

#confirm-card .ex-search-row { margin-bottom: 10px; }
#confirm-card .ex-search-row input { font-size: 18px; padding: 10px 12px; }
#confirm-card .ex-search-results button { font-size: 1rem; }
#confirm-card .ex-search-results button .meta { font-size: 0.82rem; }
#confirm-card .ex-search-results button .en { font-size: 0.8rem; }
#confirm-card .ex-search-empty { font-size: 0.92rem; }

#confirm-card .variant-row { gap: 8px; }
#confirm-card .variant-row .lbl { font-size: 0.9rem; }
#confirm-card .variant-row button { font-size: 0.92rem; padding: 9px 13px; }
#confirm-card .alt-choices { gap: 6px; margin-bottom: 10px; }
#confirm-card .alt-choices button { font-size: 1rem; padding: 8px 15px; }

#confirm-card .rpe-scale { gap: 5px; }
#confirm-card .rpe-scale button { font-size: 1.02rem; padding: 11px 0; font-weight: 600; }
#confirm-card .rpe-hint { font-size: 0.95rem; margin-top: 6px; }
#confirm-card .rpe-set { font-size: 0.9rem; padding: 5px 7px 5px 11px; }
#confirm-card .rpe-set button { min-width: 36px; font-size: 1.02rem; padding: 7px 0; font-weight: 600; }

#confirm-card .btn-primary, #confirm-card .btn-secondary { font-size: 1.1rem; padding: 15px; }
#confirm-card .btn-link { font-size: 1rem; padding: 12px 0; }
#confirm-card .btn-secondary.danger { margin-top: 4px; }

/* ===== Našeptávač cviku (katalog má stovky položek) ===== */
.picker { position: relative; }
.picker-button {
  width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px;
  border: 1px solid #2c2c44; background: #1a1a2e; color: #eee; font-size: 0.95rem; cursor: pointer;
}
.picker-button:hover { border-color: #4a6cf7; }
.picker-button.empty { color: #777; }
.picker-panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: #16162a; border: 1px solid #2c2c44; border-radius: 10px;
  padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.picker-panel input { margin-bottom: 6px; }
.picker-list { max-height: 46vh; overflow-y: auto; }
.picker-list .grp-head {
  font-size: 0.7rem; color: #6c8cff; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 8px 6px 4px; font-weight: 600;
}
.picker-list button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: none;
  background: none; color: #ddd; font-size: 0.88rem; border-radius: 7px; cursor: pointer;
}
.picker-list button:hover { background: #22223a; color: #fff; }
.picker-list button.on { background: #2a3a7a; color: #fff; }
.picker-list button .en { display: block; color: #666; font-size: 0.72rem; margin-top: 1px; }
.picker-list button .eq { color: #777; font-size: 0.72rem; margin-left: 6px; }
.picker-empty { padding: 12px 8px; color: #777; font-size: 0.85rem; }

/* ===== Varianty téhož cviku ===== */
.variant-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.variant-row .lbl { font-size: 0.72rem; color: #777; margin-right: 2px; }
.variant-row button {
  padding: 5px 10px; border-radius: 13px; border: 1px solid #2c2c44;
  background: #1a1a2e; color: #9aa4b2; font-size: 0.76rem; cursor: pointer;
}
.variant-row button:hover { border-color: #4a6cf7; color: #fff; }
.variant-row button.on { background: #2a3a7a; border-color: #4a6cf7; color: #fff; }

/* ===== Editor cviku: které údaje se zapisují ===== */
.field-toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.field-toggles button {
  padding: 7px 12px; border-radius: 14px; border: 1px solid #2c2c44;
  background: #1a1a2e; color: #8a93a3; font-size: 0.85rem; cursor: pointer;
}
.field-toggles button:hover { border-color: #4a6cf7; color: #fff; }
.field-toggles button.on { background: #2a3a7a; border-color: #4a6cf7; color: #fff; }

/* Záznam posledního nahrávání (ladění rozpoznávání řeči) */
.stt-log summary { color: #6c8cff; font-size: 0.82rem; cursor: pointer; }
.stt-log pre {
  margin-top: 6px; padding: 8px; border-radius: 8px; background: #14141f;
  color: #9aa4b2; font-size: 0.72rem; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto;
}
.stt-log .btn-secondary { margin-top: 6px; }

/* Export dat — tlačítka pod sebou, ať se vejde celý popisek */
.export-row { display: flex; flex-direction: column; gap: 8px; }
.export-row button { text-align: center; }

/* ===== Volba dne, do kterého se zapisuje ===== */
.day-picker {
  text-align: left; margin-bottom: 14px;
  border: 1px solid #2a2a3e; border-radius: 12px; padding: 10px 12px; background: #14141f;
}
.day-picker .lbl { font-size: 0.78rem; color: #777; display: block; margin-bottom: 6px; }
.day-picker-row { display: flex; gap: 8px; align-items: stretch; }
.day-picker input[type="date"] {
  flex: 1; margin: 0; font-size: 17px; padding: 11px 12px;
  color-scheme: dark;                 /* nativní kalendář v tmavém provedení */
}
.day-picker button {
  flex: 0 0 auto; padding: 0 16px; border-radius: 10px;
  border: 1px solid #4a6cf7; background: transparent; color: #6c8cff;
  font-size: 0.92rem; cursor: pointer;
}
.day-picker button:hover { background: rgba(74,108,247,0.16); color: #fff; }
/* zpětný zápis musí být vidět, ať do včerejška nespadne dnešní série */
.day-picker.past { border-color: rgba(255,171,64,0.55); background: rgba(255,171,64,0.07); }
.day-picker.past .lbl { color: #ffab40; font-weight: 600; }

/* ===== Číselné pole s tlačítky − / + =====
   Systémové šipky číselného pole jsou ~12 px vysoké — v rukavicích a bez
   brýlí nepoužitelné. Skryjeme je a dáme vedle pole pořádná tlačítka. */
.entry-fields input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.entry-fields input[type="number"]::-webkit-outer-spin-button,
.entry-fields input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.stepper { display: flex; align-items: stretch; gap: 4px; margin-top: 4px; }
.stepper input { flex: 1; min-width: 0; margin: 0 !important; }
.step-btn {
  flex: 0 0 40px; border: 1px solid #2c2c44; border-radius: 10px;
  background: #22223a; color: #b9c2cf; font-size: 1.45rem; line-height: 1;
  cursor: pointer; padding: 0;
}
.step-btn:hover { border-color: #4a6cf7; background: #2a2a45; color: #fff; }

/* ===== Hledání cviku přímo v kartě ===== */
.ex-search-row { margin-bottom: 12px; }
.ex-search-row input { margin-bottom: 0; }
.ex-search-results {
  margin-top: 6px; max-height: 34vh; overflow-y: auto;
  border: 1px solid #2c2c44; border-radius: 10px; background: #16162a; padding: 6px;
}
.ex-search-results button {
  display: block; width: 100%; text-align: left; padding: 10px 11px; border: none;
  background: none; color: #ddd; border-radius: 8px; cursor: pointer;
}
.ex-search-results button:hover { background: #22223a; color: #fff; }
.ex-search-results button.on { background: #2a3a7a; color: #fff; }
.ex-search-results button .meta { display: block; color: #7d8798; margin-top: 2px; }
.ex-search-results button .en { display: block; color: #5d6472; margin-top: 1px; }
.ex-search-empty { padding: 10px 8px; color: #777; margin: 0; }

/* ===== Náročnost série (RPE 1–10) ===== */
.rpe-block { margin-bottom: 10px; }
.rpe-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rpe-scale button {
  padding: 9px 0; border-radius: 8px; border: 1px solid #2c2c44;
  background: #1a1a2e; color: #9aa4b2; font-size: 0.82rem; cursor: pointer;
}
.rpe-scale button:hover { border-color: #4a6cf7; color: #fff; }
.rpe-scale button.on { color: #fff; font-weight: 600; border-color: transparent; }
/* zelená (lehké) → žlutá → červená (selhání) */
.rpe-scale button.on.l1 { background: #2e7d32; }
.rpe-scale button.on.l2 { background: #9e8c1e; }
.rpe-scale button.on.l3 { background: #c75b1e; }
.rpe-scale button.on.l4 { background: #c62828; }
.rpe-hint { font-size: 0.75rem; color: #777; margin: 6px 0 0; line-height: 1.4; }

.rpe-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rpe-set {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 6px 4px 9px; border-radius: 14px; background: #22223a;
  color: #888; font-size: 0.74rem;
}
.rpe-set button {
  min-width: 26px; padding: 3px 0; border-radius: 9px; border: 1px solid #2c2c44;
  background: #1a1a2e; color: #bbb; font-size: 0.76rem; cursor: pointer;
}
.rpe-set button:hover { border-color: #4a6cf7; color: #fff; }
/* série, která se liší od hlavní hodnoty, musí být vidět na první pohled */
.rpe-set.custom button { border-color: #6c8cff; color: #9db4ff; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 14px; background: #22223a;
  color: #bbb; font-size: 0.78rem;
}
.chip button { background: none; border: none; color: #666; cursor: pointer; padding: 0; font-size: 0.9rem; }
.chip button:hover { color: #f44; }

.btn-secondary.danger { border-color: rgba(244,68,68,0.4); color: #ff8080; }
.btn-secondary.danger:hover { background: rgba(244,68,68,0.1); }

/* ===== Dialog o cviku ===== */
.btn-link {
  width: 100%; padding: 10px; margin-top: 8px; border: none; background: none;
  color: #6c8cff; font-size: 0.85rem; cursor: pointer; text-align: center;
}
.btn-link:hover { text-decoration: underline; }

/* Dialog o cviku má stejně velké písmo jako karta záznamu — čte a píše se
   v posilovně, často bez brýlí. */
#chat-card .card-title { font-size: 1.05rem; margin-bottom: 12px; }
#chat-card .chat-msg { font-size: 1.02rem; line-height: 1.55; }
#chat-card .chat-msg .who { font-size: 0.82rem; }
#chat-card .chat-msg .bubble { padding: 11px 14px; }
#chat-card .chat-input-row input { font-size: 18px; padding: 14px 12px; }
#chat-card .chat-input-row button { font-size: 1.15rem; padding: 0 18px; min-height: 54px; }
#chat-card .proposal .p-name { font-size: 1.12rem; }
#chat-card .proposal .p-row { font-size: 0.95rem; }
#chat-card .btn-primary, #chat-card .btn-secondary { font-size: 1.1rem; padding: 15px; }
#chat-card .btn-link { font-size: 1rem; padding: 12px 0; }

.chat-log { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.chat-msg { margin-bottom: 10px; font-size: 0.87rem; line-height: 1.5; }
.chat-msg .who { font-size: 0.7rem; color: #666; margin-bottom: 3px; }
.chat-msg.me .bubble {
  background: rgba(74,108,247,0.16); border: 1px solid rgba(74,108,247,0.35);
  color: #dde; padding: 9px 12px; border-radius: 12px 12px 4px 12px; margin-left: 30px;
}
.chat-msg.ai .bubble {
  background: #14141f; border: 1px solid #2a2a3e;
  color: #ccc; padding: 9px 12px; border-radius: 12px 12px 12px 4px; margin-right: 30px;
}
.chat-msg.thinking .bubble { color: #666; font-style: italic; }

.chat-input-row { display: flex; gap: 6px; }
.chat-input-row input { margin-bottom: 0; font-size: 16px; }
.chat-input-row button {
  padding: 0 16px; min-height: 48px; border: none; border-radius: 10px;
  background: #2a2a3e; color: #fff; font-size: 1rem; cursor: pointer;
}
.chat-input-row button.recording { background: #f44; }

.proposal {
  background: rgba(76,175,80,0.08); border: 1px solid rgba(76,175,80,0.35);
  border-radius: 12px; padding: 12px; margin-bottom: 12px;
}
.proposal .p-name { color: #fff; font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.proposal .p-row { font-size: 0.8rem; color: #aaa; padding: 2px 0; }
.proposal .p-row b { color: #ddd; font-weight: 500; }
.proposal .row2 { margin-top: 10px; }

/* Záznamy */
.summary { font-size: 0.9rem; color: #6c8cff; margin: 8px 0 12px; font-weight: 600; }
.entries { text-align: left; }
.entry {
  display: flex; justify-content: space-between; align-items: center;
  background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.entry .info { flex: 1; cursor: pointer; }
.entry .info:hover .name { color: #6c8cff; }
.entry .info .name { color: #fff; font-size: 0.95rem; font-weight: 600; }
.entry .info .detail { color: #888; font-size: 0.8rem; margin-top: 2px; }
.entry .del {
  background: none; border: none; color: #555; font-size: 1.2rem;
  cursor: pointer; margin-left: 4px; padding: 8px;
  min-width: 40px; min-height: 40px;
}
.entry .del:hover { color: #f44; }
/* Tlačítko „další série" — nejčastější akce na řádku, proto je výrazné.
   Odznak RPE, který tu dřív stál vedle, se přesunul do řádku s hodnotami. */
.entry .copy {
  background: none; border: none; color: #7d8798;
  cursor: pointer; margin-left: 6px; padding: 8px;
  min-width: 48px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.entry .copy svg { width: 27px; height: 27px; }
.entry .copy:hover { color: #6c8cff; }

/* Historie */
.history-day { margin-bottom: 14px; text-align: left; }
.history-day .day-head {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; color: #fff; font-weight: 600;
  padding: 8px 4px; cursor: pointer;
}
.history-day .day-head .day-sum { color: #9aa4b2; font-weight: 400; font-size: 0.85rem; }
.history-day .day-entries { font-size: 0.85rem; color: #aaa; padding-left: 8px; }
.history-day .day-entries div { padding: 3px 0; border-bottom: 1px solid #1a1a2e; }

/* ===== Statistiky ===== */
.period-picker { display: flex; gap: 6px; margin-bottom: 14px; }
.period-picker button {
  flex: 1; padding: 8px 4px; border: 1px solid #2a2a3e; border-radius: 8px;
  background: #1a1a2e; color: #888; font-size: 0.8rem; cursor: pointer;
}
.period-picker button.active { border-color: #4a6cf7; background: rgba(74,108,247,0.18); color: #fff; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.kpi {
  background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 12px;
  padding: 12px 14px; text-align: left;
}
.kpi .val { font-size: 1.35rem; color: #fff; font-weight: 600; }
.kpi .val small { font-size: 0.85rem; color: #888; font-weight: 400; margin-left: 3px; }
.kpi .lbl { font-size: 0.75rem; color: #777; margin-top: 2px; }

.stat-card {
  background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 14px;
  padding: 16px; margin-bottom: 14px; text-align: left;
}
.stat-card h3 { font-size: 0.9rem; color: #fff; margin-bottom: 4px; }
.stat-card .hint { font-size: 0.75rem; color: #666; margin-bottom: 12px; line-height: 1.45; }

/* vodorovné pruhy (partie) */
.bar-row { margin-bottom: 10px; }
.bar-row.clickable { cursor: pointer; padding: 4px; margin: -4px -4px 6px; border-radius: 8px; }
.bar-row.clickable:hover { background: rgba(74,108,247,0.07); }
.bar-row .chevron { color: #6c8cff; font-size: 0.7rem; }

.bar-detail { margin-top: 10px; padding-left: 12px; border-left: 2px solid #2a2a3e; }
.detail-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid #1f1f30;
}
.detail-item:last-child { border-bottom: none; }
.detail-item .dname { display: block; color: #ddd; font-size: 0.82rem; }
.detail-item .dmeta { display: block; color: #777; font-size: 0.72rem; margin-top: 1px; }
.detail-item .dvol { color: #9aa4b2; font-size: 0.75rem; white-space: nowrap; margin-left: 10px; }
.bar-detail > .dmeta { color: #666; font-size: 0.75rem; padding: 6px 0; }
.bar-head { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 4px; }
.bar-head .name { color: #ddd; }
.bar-head .meta { color: #777; font-size: 0.76rem; }
.bar-track { height: 8px; background: #14141f; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #4a6cf7, #6c8cff); border-radius: 4px; }
.bar-fill.warn { background: linear-gradient(90deg, #f7a14a, #ffc46c); }

/* svislé sloupce (týdny) */
.weeks { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-bottom: 6px; }
.weeks .wk { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.weeks .wk .col { background: #4a6cf7; border-radius: 3px 3px 0 0; min-height: 2px; }
.weeks .wk.empty .col { background: #23233a; }
.weeks .wk.current .col { background: linear-gradient(180deg, #6c8cff, #4a6cf7); }
.weeks-labels { display: flex; gap: 3px; font-size: 0.62rem; color: #555; }
.weeks-labels span { flex: 1; text-align: center; }

/* tabulka cviků */
.ex-table { width: 100%; font-size: 0.82rem; border-collapse: collapse; }
.ex-table th { color: #6c8cff; font-weight: 600; text-align: right; padding: 4px 0; font-size: 0.72rem; }
.ex-table th:first-child { text-align: left; }
.ex-table td { padding: 7px 0; border-top: 1px solid #22223a; text-align: right; color: #bbb; }
.ex-table td:first-child { text-align: left; color: #fff; }
.ex-table td .sub { display: block; color: #666; font-size: 0.72rem; }

.rest-tag { font-size: 0.7rem; padding: 2px 7px; border-radius: 10px; background: #23233a; color: #999; }
.rest-tag.fresh { background: rgba(76,175,80,0.15); color: #7ec87e; }
.rest-tag.due { background: rgba(247,161,74,0.15); color: #ffb46c; }

/* Spodní navigace */
nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: #14141f; border-top: 1px solid #2a2a3e;
  max-width: 480px; margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);   /* nad home indikátor */
}
nav button {
  flex: 1; min-height: 52px; padding: 12px 4px; background: none; border: none;
  color: #777; font-size: 0.85rem; cursor: pointer;
}
nav button.active { color: #6c8cff; font-weight: 600; }
nav button:active { transform: none; }           /* u navigace bez zmáčknutí */

/* ===== Velmi úzké telefony ===== */
@media (max-width: 360px) {
  h1 { font-size: 1.35rem; }
  /* trojice polí (série/opakování/váha) se na úzkém displeji rozloží po dvou */
  .row3 { grid-template-columns: 1fr 1fr; }
  nav button { font-size: 0.8rem; }
}

/* široká tabulka cviků ve statistikách jde vodorovně odscrollovat */
.stat-card { overflow-x: auto; }
