/* ❤️ Ranní tep — okno rychlého zápisu + záložka v Regeneraci (ranni-tep.js, 11. 11. 2026)
   Barvy textu jen přes --mu-* tokeny → tmavý režim i bílé okno (.mu-modal-card) vyjdou samy.
   Červená #ef4444 jen na plochách a rámečcích (tep = červená, stejně jako v grafu). */

/* ── Okno ─────────────────────────────────────────────────── */
/* Na telefonu okno nahoře, ne uprostřed: klávesnice vyjede přes spodek
   obrazovky a pole by skončilo pod ní (docs/pravidla/mobil.md). */
@media (max-width: 640px) {
  .mu-modal:has(.mrt-card) { align-items: flex-start; }
}
.mrt-card { max-width: 400px; }
.mrt-title { margin: 0 0 2px; font-size: 1.25rem; color: hsl(var(--mu-text)); }
.mrt-sub { margin: 0 0 12px; font-size: 0.85rem; color: hsl(var(--mu-text-muted)); }

.mrt-days { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mrt-day { position: relative; border: 1px solid hsl(var(--mu-border)); background: hsl(var(--mu-card));
  border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 0.85rem; font-weight: 700;
  color: hsl(var(--mu-text-muted)); cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; }
.mrt-day.is-on { background: #ef4444; border-color: #ef4444; color: #fff; }
.mrt-day--pick { overflow: hidden; }
/* nativní výběr data leží neviditelně přes celý štítek → klepnutí otevře kalendář telefonu */
.mrt-day--pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 16px; }

.mrt-inp { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 10px 12px;
  border: 2px solid hsl(var(--mu-border)); border-radius: 16px; background: hsl(var(--mu-subtle)); cursor: text; }
.mrt-inp:focus-within { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.mrt-inp input { width: 3.2ch; min-width: 0; border: 0; background: transparent; outline: none; text-align: center;
  font-family: 'Montserrat', sans-serif; font-size: 3rem; font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: hsl(var(--mu-text)); padding: 0; }
.mrt-inp input::placeholder { color: hsl(var(--mu-text-muted) / 0.45); }
.mrt-inp span { font-size: 0.9rem; font-weight: 700; color: hsl(var(--mu-text-muted)); white-space: nowrap; }

.mrt-cmp { margin: 10px 0 0; min-height: 1.2em; font-size: 0.85rem; line-height: 1.45; color: hsl(var(--mu-text)); }
.mrt-err { margin: 8px 0 0; font-size: 0.85rem; font-weight: 700; color: hsl(var(--mu-danger-text)); }
.mrt-save { margin-top: 12px; }
.mrt-del { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 1px solid hsl(var(--mu-danger-border));
  border-radius: 12px; background: hsl(var(--mu-danger-soft)); color: hsl(var(--mu-danger-text));
  font: inherit; font-weight: 700; cursor: pointer; }
.mrt-del[hidden] { display: none; }
.mrt-link { display: block; width: 100%; margin-top: 10px; padding: 8px; border: 0; background: none; font: inherit;
  font-size: 0.88rem; font-weight: 700; color: hsl(var(--mu-accent-text)); cursor: pointer; }

.mrt-how { margin-top: 12px; font-size: 0.85rem; color: hsl(var(--mu-text)); }
.mrt-how > summary { cursor: pointer; font-weight: 700; color: hsl(var(--mu-accent-text)); padding: 4px 0; }
.mrt-steps { margin: 6px 0 0; padding-left: 20px; line-height: 1.5; }
.mrt-steps li { margin: 4px 0; }

.mrt-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 1300; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px;
  background: hsl(150 30% 14%); color: #fff; font-size: 0.88rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }

/* ── Záložka Regenerace → Ranní tep ───────────────────────── */
.mrt { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mrt-cardbox { min-width: 0; }
.mrt-h { margin: 0 0 4px; }
.mrt-lead { margin: 0 0 12px; }

.mrt-today { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px; border-radius: 14px;
  background: rgba(239, 68, 68, 0.07); border: 1px solid rgba(239, 68, 68, 0.22); }
.mrt-today__v { text-align: center; min-width: 78px; }
.mrt-today__v b { display: block; font-family: 'Montserrat', sans-serif; font-size: 2.6rem; font-weight: 800; line-height: 1;
  color: #ef4444; font-variant-numeric: tabular-nums; }
.mrt-today__v span { font-size: 0.75rem; font-weight: 700; color: hsl(var(--mu-text-muted)); }
.mrt-today__t { flex: 1 1 180px; min-width: 0; }
.mrt-today__l { font-weight: 800; color: hsl(var(--mu-text)); margin-bottom: 6px; }
.mrt-today__c { font-size: 0.85rem; line-height: 1.45; color: hsl(var(--mu-text)); margin: 6px 0; }
.mrt-today__c.is-err, #mrt-q-cmp.is-err { color: hsl(var(--mu-danger-text)); font-weight: 700; }

.mrt-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mrt-quick input { width: 88px; min-width: 0; padding: 8px 10px; border: 2px solid hsl(var(--mu-border)); border-radius: 12px;
  background: hsl(var(--mu-card)); color: hsl(var(--mu-text)); font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem; font-weight: 800; text-align: center; outline: none; }
.mrt-quick input:focus { border-color: #ef4444; }
.mrt-quick span { font-size: 0.85rem; font-weight: 700; color: hsl(var(--mu-text-muted)); }

.mrt-btn { border: 1px solid hsl(var(--mu-border)); background: hsl(var(--mu-card)); color: hsl(var(--mu-text));
  border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer; min-height: 40px; }
.mrt-btn--pri { background: #ef4444; border-color: #ef4444; color: #fff; }
.mrt-linkbtn { border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px; color: hsl(var(--mu-accent-text)); cursor: pointer; text-align: left; }

.mrt-srcbox { margin: 4px 0 12px; }
.mrt-srcbox__h { font-size: 0.8rem; font-weight: 800; color: hsl(var(--mu-text)); margin-bottom: 6px; }
.mrt-srcbox__h small { font-weight: 600; color: hsl(var(--mu-text-muted)); }
.mrt-srcs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mrt-src { border: 1px solid hsl(var(--mu-border)); background: hsl(var(--mu-card)); color: hsl(var(--mu-text-muted));
  border-radius: 10px; padding: 8px 4px; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  min-height: 40px; line-height: 1.25; }
.mrt-src small { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 999px;
  background: hsl(var(--mu-subtle)); color: hsl(var(--mu-text-muted)); font-size: 0.72rem; }
.mrt-src.is-on { background: hsl(var(--mu-accent)); border-color: transparent; color: #fff; }
.mrt-src.is-on small { background: rgba(255, 255, 255, 0.25); color: #fff; }
@media (max-width: 420px) { .mrt-srcs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mrt-srcnow { margin: 8px 0 0; font-size: 0.8rem; line-height: 1.45; color: hsl(var(--mu-text-muted)); }
.mrt-srcnow b { color: hsl(var(--mu-text)); }
.mrt-hint { margin: 8px 0 0; font-size: 0.8rem; line-height: 1.45; color: hsl(var(--mu-text-muted)); }
.mrt-hint--warn { padding: 8px 10px; border-radius: 10px; background: hsl(var(--mu-gold-soft));
  border: 1px solid hsl(var(--mu-gold-border)); color: hsl(var(--mu-gold-text)); }

.mrt-empty { margin: 8px 0 0; padding: 14px; border-radius: 12px; background: hsl(var(--mu-subtle));
  font-size: 0.88rem; line-height: 1.45; color: hsl(var(--mu-text)); }
.mrt-verdict { margin: 10px 0 0; font-size: 0.88rem; font-weight: 700; line-height: 1.45; color: hsl(var(--mu-accent-text)); }
.mrt-verdict.is-warn { color: hsl(var(--mu-gold-text)); }

.mrt-list { list-style: none; margin: 6px 0 0; padding: 0; }
.mrt-list li + li { border-top: 1px solid hsl(var(--mu-border)); }
.mrt-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 2px; border: 0; background: none;
  font: inherit; color: hsl(var(--mu-text)); cursor: pointer; text-align: left; min-height: 44px; }
.mrt-row__d { flex: 1; min-width: 0; font-size: 0.9rem; }
.mrt-row__v { font-family: 'Montserrat', sans-serif; font-size: 1.05rem; font-weight: 800; color: #ef4444; white-space: nowrap; }
.mrt-row__v small { font-size: 0.7rem; color: hsl(var(--mu-text-muted)); font-weight: 700; }
.mrt-row__e { opacity: 0.55; font-size: 0.85rem; }
.mrt-row:hover .mrt-row__e { opacity: 1; }

details.mrt-how.mu-card > summary { font-size: 0.95rem; }

/* Hub na mobilu vnucuje políčkům 16px (!important, proti přiblížení na iPhonu).
   Velké číslo tepu je větší než 16 px, takže iPhone nepřibližuje — přebíjíme přes id. */
.mu-body #mrt-bpm { font-size: 3rem !important; width: 3.2ch; }
.mu-body #mrt-q-bpm { font-size: 1.6rem !important; }

/* ── 📈 Moderní graf — ranní tep i HRV (11. 11. 2026) ─────────
   Barvy přes třídy (ne atributy), ať tokeny --mu-* fungují i v SVG a v tmavém režimu.
   Barva metriky = --mrt-c (tep červená, HRV modrá), nastaví ji ranni-tep.js. */
.mrt-chart { --mrt-c: #ef4444; position: relative; width: 100%; min-width: 0; margin: 6px 0 2px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.mrt-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mrt-grid { stroke: hsl(var(--mu-border)); stroke-width: 1; stroke-dasharray: 2 5; opacity: .9; }
.mrt-ax { fill: hsl(var(--mu-text-muted)); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mrt-band { fill: color-mix(in srgb, var(--mrt-c) 9%, transparent); stroke: color-mix(in srgb, var(--mrt-c) 30%, transparent); stroke-width: 1; stroke-dasharray: 4 4; }
.mrt-band__l { fill: hsl(var(--mu-text-muted)); font-size: 12px; font-weight: 700; }
.mrt-area.is-anim { animation: mrtFade 1s ease both; }
.mrt-line { fill: none; stroke: var(--mrt-c); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--mrt-c) 40%, transparent)); }
.mrt-dot.is-hi { fill: #f59e0b; stroke: hsl(var(--mu-card)); stroke-width: 2; }
.mrt-last { fill: var(--mrt-c); stroke: hsl(var(--mu-card)); stroke-width: 3; }
.mrt-last.is-hi { fill: #f59e0b; }
.mrt-last__halo { fill: color-mix(in srgb, var(--mrt-c) 24%, transparent); transform-box: fill-box; transform-origin: center; }
.mrt-last__halo.is-hi { fill: rgba(245, 158, 11, 0.26); }
.mrt-bubble rect { fill: var(--mrt-c); }
.mrt-bubble.is-hi rect { fill: #f59e0b; }
.mrt-bubble text { fill: #fff; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mrt-cross line { stroke: hsl(var(--mu-text-muted)); stroke-width: 1; stroke-dasharray: 3 3; }
.mrt-cross circle { fill: var(--mrt-c); stroke: hsl(var(--mu-card)); stroke-width: 3; }
.mrt-cross circle.is-hi { fill: #f59e0b; }
.mrt-hit { fill: transparent; cursor: crosshair; }
@media (prefers-reduced-motion: no-preference) {
  .mrt-last__halo { animation: mrtPulse 2.2s ease-out infinite; }
}
@keyframes mrtPulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes mrtFade { from { opacity: 0; } to { opacity: 1; } }

.mrt-tip { position: absolute; z-index: 2; pointer-events: none; min-width: 120px; padding: 9px 12px; border-radius: 12px;
  background: hsl(var(--mu-text)); color: hsl(var(--mu-card)); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 1.35; white-space: nowrap; }
.mrt-tip[hidden] { display: none; }
.mrt-tip b { font-family: 'Montserrat', sans-serif; font-size: 1.3rem; font-weight: 800; }
.mrt-tip b i { font-style: normal; font-size: .72rem; font-weight: 700; opacity: .7; }
.mrt-tip__d { opacity: .75; font-weight: 600; }
.mrt-tip__n { opacity: .85; }
.mrt-tip__n.is-hi { color: #fbbf24; opacity: 1; font-weight: 700; }
.mrt-tip__h { opacity: .85; }

.mrt-leg { --mrt-c: #ef4444; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; font-size: 12px; color: hsl(var(--mu-text-muted)); }
.mrt-leg span { display: inline-flex; align-items: center; gap: 6px; }
.mrt-leg i { display: inline-block; flex-shrink: 0; }
.mrt-leg__dot.is-hi { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; }
.mrt-leg__ln { width: 20px; height: 4px; border-radius: 4px; background: var(--mrt-c); }
.mrt-leg__band { width: 18px; height: 11px; border-radius: 3px; background: color-mix(in srgb, var(--mrt-c) 12%, transparent); border: 1px dashed color-mix(in srgb, var(--mrt-c) 45%, transparent); }

.mrt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mrt-stat { position: relative; padding: 12px 14px; border-radius: 16px; background: hsl(var(--mu-subtle)); border: 1px solid hsl(var(--mu-border)); min-width: 0; }
.mrt-stat small { display: block; font-size: 11px; font-weight: 700; color: hsl(var(--mu-text-muted)); text-transform: uppercase; letter-spacing: .04em; line-height: 1.3; }
.mrt-stat b { display: block; margin-top: 6px; font-family: 'Montserrat', sans-serif; font-size: 1.9rem; font-weight: 800; line-height: 1; color: hsl(var(--mu-text)); font-variant-numeric: tabular-nums; }
.mrt-stat b i { font-style: normal; font-size: .75rem; font-weight: 700; margin-left: 3px; color: hsl(var(--mu-text-muted)); }
.mrt-stat > span { display: block; margin-top: 4px; font-size: 11px; color: hsl(var(--mu-text-muted)); }
.mrt-stat em { position: absolute; top: 10px; right: 10px; padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 800; }
.mrt-stat em.is-up { background: hsl(var(--mu-gold-soft)); color: hsl(var(--mu-gold-text)); }
.mrt-stat em.is-down { background: hsl(var(--mu-accent-soft)); color: hsl(var(--mu-accent-text)); }
@media (max-width: 400px) {
  .mrt-stats { gap: 6px; }
  .mrt-stat { padding: 9px; }
  .mrt-stat b { font-size: 1.45rem; }
  .mrt-stat small, .mrt-stat > span { font-size: 10px; }
  .mrt-stat em { position: static; display: inline-block; margin-top: 5px; }
}
