/* Apnea Lab — styl „głęboki ocean”, mobile-first */
:root {
  --bg: #06121f;
  --bg2: #081a2c;
  --card: #0c2135;
  --card2: #10294180;
  --line: rgba(148, 190, 230, 0.12);
  --line2: rgba(148, 190, 230, 0.22);
  --text: #e6f1fb;
  --muted: #8aa4bd;
  --accent: #22d3ee;
  --accent2: #38bdf8;
  --breathe: #2dd4bf;
  --hold: #818cf8;
  --recover: #4ade80;
  --warn: #fbbf24;
  --gold: #fbbf24;
  --danger: #f87171;
  --radius: 18px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(34, 211, 238, 0.10), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(129, 140, 248, 0.10), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
a { color: var(--accent2); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.82rem; }
.eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); font-weight: 600; }
.mt { margin-top: 12px; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.big { width: 34px; height: 34px; color: var(--accent); opacity: 0.9; }
.hidden { display: none !important; }

/* ---------- Układ ---------- */
.app { min-height: 100vh; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(6, 18, 31, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 0.64rem; font-weight: 500; }
.nav a.active { color: var(--accent); }
.nav .brand, .nav .nav-set { display: none; }
.view { padding: calc(18px + var(--safe-t)) 16px calc(var(--nav-h) + var(--safe-b) + 24px); max-width: 1180px; margin: 0 auto; }

@media (min-width: 900px) {
  .nav { top: 0; right: auto; width: 230px; height: auto; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 0.92rem; }
  .nav a:hover { background: rgba(148, 190, 230, 0.06); color: var(--text); }
  .nav a.active { background: rgba(34, 211, 238, 0.10); }
  .nav .brand { display: flex; color: var(--text); font-weight: 800; font-size: 1.1rem; margin-bottom: 18px; }
  .nav .brand svg { width: 32px; height: 32px; }
  .nav .nav-set { display: flex; margin-top: auto; }
  .view { margin-left: 230px; padding: 34px 36px 60px; }
}
@media (max-width: 899px) {
  .nav a[data-r="settings"] { display: flex; }
}

.page-head { margin-bottom: 20px; }
.page-head p { max-width: 760px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 760px) {
  .g2 { grid-template-columns: 1fr 1fr; }
  .g-dash { grid-template-columns: 1fr 1fr 1fr; }
  .g-garmin { grid-template-columns: 1fr 2fr; }
  .span2 { grid-column: span 2; }
  .span3 { grid-column: 1 / -1; }
  .g2 .span2 { grid-column: 1 / -1; }
}

/* ---------- Karty ---------- */
.card { background: linear-gradient(180deg, rgba(16, 41, 65, 0.85), rgba(12, 33, 53, 0.85)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card-h h3 { display: flex; align-items: center; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 22px 10px; font-size: 0.92rem; }
.empty.tall { padding: 80px 10px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); margin-bottom: 14px; }
.banner .ic { color: var(--warn); }
.banner div { flex: 1; font-size: 0.9rem; }
@media (max-width: 560px) { .banner { flex-wrap: wrap; } }
.tip { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(34, 211, 238, 0.07); border: 1px solid rgba(34, 211, 238, 0.2); font-size: 0.9rem; }

/* ---------- Przyciski ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(148, 190, 230, 0.07); color: var(--text); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; white-space: nowrap; transition: transform 0.08s, background 0.15s; touch-action: manipulation; }
.btn:hover { background: rgba(148, 190, 230, 0.13); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn.primary { background: linear-gradient(135deg, #22d3ee, #3b82f6); border-color: transparent; color: #04121f; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn.sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 10px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.lg { padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.btn.xl { padding: 18px 26px; font-size: 1.1rem; border-radius: 16px; min-width: 150px; }
.btn.full { width: 100%; }
.btn.icon { width: 38px; height: 38px; padding: 0; font-size: 1.2rem; }
.btn.icon .ic { width: 18px; height: 18px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.row-btns.center { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; background: rgba(148, 190, 230, 0.08); color: var(--muted); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
.chip.ok { background: rgba(74, 222, 128, 0.12); color: var(--recover); }
.chip.miss { background: rgba(248, 113, 113, 0.10); color: var(--danger); }
.okc { color: var(--recover); }
.bad { color: var(--danger); }
.gold { color: var(--gold); }

/* ---------- Pozycje planu ---------- */
.items { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: rgba(6, 18, 31, 0.45); border: 1px solid var(--line); }
.item.done { opacity: 0.7; }
.item-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgba(34, 211, 238, 0.10); color: var(--accent); }
.item-txt { flex: 1; min-width: 0; }
.item-t { font-weight: 600; font-size: 0.93rem; }
.item-s { color: var(--muted); font-size: 0.8rem; }
.item-r { flex: none; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis.mini { margin: 14px 0; }
.kpi { background: rgba(6, 18, 31, 0.45); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.card > .kpis .kpi, .summary .kpi { background: rgba(6, 18, 31, 0.5); }
.kpis.span3 .kpi { background: linear-gradient(180deg, rgba(16, 41, 65, 0.85), rgba(12, 33, 53, 0.85)); }
.kpi-l { color: var(--muted); font-size: 0.76rem; }
.kpi-v { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 2px 0; }
.kpi-v.sm { font-size: 1.15rem; }
.kpi-s { color: var(--muted); font-size: 0.74rem; }
.bar { height: 6px; border-radius: 9px; background: rgba(148, 190, 230, 0.1); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--hold)); border-radius: 9px; transition: width 0.4s; }

/* ---------- Gotowość ---------- */
.ready-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.ready-list { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 150px; }
.ready-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.ready-list li span { color: var(--muted); }
.gauge { position: relative; flex: none; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-bg { fill: none; stroke: rgba(148, 190, 230, 0.1); stroke-width: 8; }
.g-fg { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.6s; }
.g-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-v { font-size: 1.6rem; font-weight: 800; }
.g-s { font-size: 0.72rem; color: var(--muted); }
.rules { padding-left: 18px; margin: 6px 0; font-size: 0.9rem; }
.rules li { margin: 5px 0; }
.safety .ic { color: var(--warn); }

/* ---------- Wykresy ---------- */
.chart-box { position: relative; height: 240px; margin-top: 6px; }
.chart-box.tall { height: 340px; }
@media (max-width: 560px) { .chart-box.tall { height: 280px; } }
.legend-note { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.sw.hold { background: rgba(129, 140, 248, 0.45); }

/* ---------- Plan ---------- */
.plan-sum { margin-bottom: 14px; }
.plan { display: flex; flex-direction: column; gap: 12px; }
.day.is-today { border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 10px 40px -20px rgba(34, 211, 238, 0.5); scroll-margin-top: 16px; }
.day.is-past { opacity: 0.72; }
.day.is-course { border-color: rgba(251, 191, 36, 0.5); }
.day-h { display: flex; gap: 14px; align-items: flex-start; }
.day-date { flex: none; width: 54px; text-align: center; padding: 6px 0; border-radius: 12px; background: rgba(6, 18, 31, 0.5); display: flex; flex-direction: column; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; }
.day-date b { font-size: 1.35rem; color: var(--text); line-height: 1.1; }
.day-t { flex: 1; min-width: 0; }
.day-t p { margin: 4px 0 0; font-size: 0.86rem; }
.day-p { flex: none; font-weight: 700; color: var(--muted); font-size: 0.85rem; }

/* ---------- Trening ---------- */
.adj { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.adj span { color: var(--muted); font-size: 0.85rem; flex: 1; }
.adj b { min-width: 60px; text-align: center; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.big-num { font-size: 3rem; font-weight: 800; text-align: center; margin: 18px 0 6px; font-variant-numeric: tabular-nums; }
.big-num span { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.list-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-radius: 14px; background: rgba(6, 18, 31, 0.45); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.list-btn:hover { border-color: var(--line2); }
.list-btn span { display: block; color: var(--muted); font-size: 0.8rem; }
.list-btn .ic { color: var(--accent); }
.steps { padding-left: 20px; margin: 10px 0; font-size: 0.88rem; }
.steps li { margin: 4px 0; }
.steps span { color: var(--muted); font-variant-numeric: tabular-nums; float: right; }

/* ---------- Garmin ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 14px; border: 1.5px dashed var(--line2); border-radius: 16px; cursor: pointer; transition: 0.15s; }
.drop span { color: var(--muted); font-size: 0.8rem; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(34, 211, 238, 0.05); }
.howto { margin: 14px 0; font-size: 0.87rem; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--accent2); }
.howto ol { padding-left: 18px; }
.howto li { margin: 6px 0; }
.acts { display: flex; flex-direction: column; gap: 8px; }
.act { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: rgba(6, 18, 31, 0.45); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.act.sel { border-color: var(--accent); background: rgba(34, 211, 238, 0.07); }
.act span { display: block; color: var(--muted); font-size: 0.78rem; }
.act-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.act-tags i { font-style: normal; font-size: 0.66rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.t-hr { background: rgba(251, 113, 133, 0.15); color: #fb7185; }
.t-sp { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.t-d { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.t-s { background: rgba(74, 222, 128, 0.15); color: #4ade80; }

/* ---------- Formularze ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 480px) { .form { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: rgba(6, 18, 31, 0.6); border: 1px solid var(--line2); border-radius: 11px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(34, 211, 238, 0.5); outline-offset: 0; }
input[type="date"] { min-height: 44px; }
.switch { flex-direction: row; align-items: center; gap: 12px; font-size: 0.92rem; color: var(--text); margin: 10px 0; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 44px; height: 26px; border-radius: 20px; background: rgba(148, 190, 230, 0.2); position: relative; flex: none; transition: 0.2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: 0.2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 21px; }

/* ---------- Dziennik ---------- */
.journal { max-height: 460px; overflow-y: auto; }
.j-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.j-d { flex: none; width: 52px; color: var(--muted); font-size: 0.8rem; }
.j-t { flex: 1; min-width: 0; font-size: 0.88rem; }
.j-t span { display: block; color: var(--muted); font-size: 0.8rem; }

/* ---------- Teoria ---------- */
.topics { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .topics { grid-template-columns: 1fr 1fr; } }
.topic-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: linear-gradient(180deg, rgba(16, 41, 65, 0.85), rgba(12, 33, 53, 0.85)); border: 1px solid var(--line); color: var(--text); }
.topic-card > div:nth-child(2) { flex: 1; }
.topic-card span { color: var(--muted); }
.topic-card.read { opacity: 0.75; }
.quiz-cta { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.quiz-cta > div:nth-child(2) { flex: 1; min-width: 180px; }
.back { display: inline-block; margin-bottom: 12px; font-size: 0.9rem; }
.topic { max-width: 780px; }
.topic h1 { margin: 6px 0 14px; }
.topic h3 { margin: 20px 0 6px; color: var(--accent2); }
.topic ul, .topic ol { padding-left: 20px; }
.topic li { margin: 7px 0; }
.topic .lead { font-size: 1.05rem; }
.mini { border-collapse: collapse; margin: 10px 0; font-size: 0.9rem; width: 100%; }
.mini th, .mini td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.mini th { color: var(--muted); font-weight: 500; }
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li::before { content: '☐ '; color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; max-width: 780px; flex-wrap: wrap; }
.pager .btn { white-space: normal; text-align: left; }
.quiz { max-width: 720px; }
.quiz.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 18px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; }
.quiz h2 { margin: 16px 0; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt { text-align: left; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line2); background: rgba(6, 18, 31, 0.5); color: var(--text); font: inherit; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.right { border-color: var(--recover); background: rgba(74, 222, 128, 0.12); }
.opt.wrong { border-color: var(--danger); background: rgba(248, 113, 113, 0.12); }
.opt:disabled { cursor: default; }
.explain { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; }
.explain.ok { background: rgba(74, 222, 128, 0.08); }
.explain.bad { background: rgba(248, 113, 113, 0.08); }

/* ---------- Ekran sesji ---------- */
.runner { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 35%, #0d2a45, #050f1a 70%); display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 16px calc(16px + var(--safe-b)); overflow-y: auto; transition: background 0.8s; }
.runner[data-phase="hold"] { background: radial-gradient(circle at 50% 35%, #1a1f4d, #050a1a 70%); }
.runner[data-phase="recover"] { background: radial-gradient(circle at 50% 35%, #0d3a2c, #05140f 70%); }
.runner-top { display: flex; justify-content: space-between; align-items: center; max-width: 560px; width: 100%; margin: 0 auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(148, 190, 230, 0.06); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.runner-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; max-width: 560px; width: 100%; margin: 0 auto; text-align: center; padding: 8px 0; }
.round { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.ring-wrap, .breath { position: relative; width: min(74vw, 320px); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(148, 190, 230, 0.10); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--breathe); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.12s linear, stroke 0.5s; }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.phase { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.runner[data-phase="breathe"] .phase { color: var(--breathe); }
.runner[data-phase="hold"] .phase { color: var(--hold); }
.runner[data-phase="recover"] .phase { color: var(--recover); }
.time { font-size: clamp(3.4rem, 15vw, 4.8rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.05; }
.time.big { margin: 10px 0; }
.sub { color: var(--muted); font-size: 0.9rem; min-height: 1.3em; }
.dots { display: flex; gap: 8px; justify-content: center; min-height: 12px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(148, 190, 230, 0.18); }
.dots i.cur { background: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25); }
.dots i.ok { background: var(--recover); }
.dots i.fail { background: var(--danger); }
.hint { color: #b8cadb; font-size: 0.95rem; max-width: 460px; min-height: 3em; margin: 0; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; width: 100%; }
.btn.contr { background: rgba(244, 114, 182, 0.15); border-color: rgba(244, 114, 182, 0.45); color: #f9a8d4; flex: 1; max-width: 220px; min-height: 76px; }
.btn.stop { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.45); color: #fecaca; flex: 1; max-width: 220px; min-height: 76px; white-space: normal; }
.b-circle { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(45, 212, 191, 0.55), rgba(34, 211, 238, 0.18) 60%, rgba(34, 211, 238, 0.05)); box-shadow: 0 0 60px rgba(34, 211, 238, 0.25); transform: scale(0.55); will-change: transform; }
.b-circle[data-ph="out"] { background: radial-gradient(circle at 40% 35%, rgba(129, 140, 248, 0.5), rgba(99, 102, 241, 0.15) 60%, rgba(99, 102, 241, 0.04)); }
.breath .time { font-size: 3rem; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); font: inherit; padding: 9px 16px; cursor: pointer; }
.seg button.on { background: rgba(34, 211, 238, 0.15); color: var(--accent); font-weight: 600; }
.routine { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.routine .bar { width: 100%; max-width: 360px; }
.summary { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.sum-big { font-size: 4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.sum-cap { color: var(--muted); }
.summary .tbl { text-align: left; }
.rpe { text-align: left; font-size: 0.92rem; color: var(--text); }
.rpe input { padding: 0; accent-color: var(--accent); border: 0; background: none; }
.rpe-scale { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--muted); }
.rpe-scale i { font-style: normal; }
.summary textarea { resize: vertical; }

/* ---------- Modal i toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(2, 8, 15, 0.75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-box { background: var(--card); border: 1px solid var(--line2); border-radius: 22px; padding: 24px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-box h2 { margin-bottom: 8px; }
.modal-ic { margin-bottom: 6px; }
.modal-ic .ic { color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70; background: #0f2b45; border: 1px solid var(--line2); padding: 11px 18px; border-radius: 14px; font-size: 0.9rem; max-width: calc(100vw - 32px); transition: 0.25s; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(74, 222, 128, 0.5); }
.toast.err { border-color: rgba(248, 113, 113, 0.6); }
@media (min-width: 900px) { .toast { bottom: 24px; left: calc(50% + 115px); } }

/* ---------- Tętno na żywo ---------- */
.live-hr { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; min-height: 36px; width: 100%; }
.live-hr .hr-spark { flex: 0 0 100%; display: flex; justify-content: center; }
.live-hr canvas { width: 100%; max-width: 300px; height: 40px; display: block; }
.hr-now { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.hr-now b { font-size: 1.9rem; font-weight: 800; line-height: 1; color: #fecdd3; }
.hr-now small { color: var(--muted); font-size: 0.8rem; }
.hr-dot { width: 10px; height: 10px; border-radius: 50%; background: #fb7185; align-self: center; animation: hrpulse 1s ease-in-out infinite; }
@keyframes hrpulse { 0%, 100% { transform: scale(0.75); opacity: 0.6; } 50% { transform: scale(1.1); opacity: 1; } }
.hr-x { color: #b8cadb; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.hr-dev { color: var(--muted); font-size: 0.72rem; flex-basis: 100%; }
.hr-st { color: var(--muted); font-size: 0.88rem; display: inline-flex; align-items: center; gap: 6px; }
.hr-st .ic, .hr-btn .ic { width: 16px; height: 16px; color: #fb7185; }
.runner.has-hr .ring-wrap { width: min(62vw, 270px); }
.hr-live-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.steps.plain li { margin: 8px 0; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .hr-dot { animation: none; } }

/* ---------- Trąbki Eustachiusza ---------- */
.et-video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #020a14; border: 1px solid var(--line2); margin: 12px 0 10px; }
.et-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.et-poster { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: radial-gradient(circle at 50% 40%, rgba(34, 211, 238, 0.14), transparent 70%); border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 16px; text-align: center; }
.et-poster .ic { width: 48px; height: 48px; color: var(--accent); }
.et-poster span { font-weight: 600; }
.et-poster small { color: var(--muted); font-size: 0.75rem; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip-b { background: rgba(148, 190, 230, 0.08); border: 1px solid var(--line2); color: var(--text); border-radius: 99px; padding: 6px 11px; font: inherit; font-size: 0.78rem; cursor: pointer; }
.chip-b b { color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 3px; }
.chip-b:hover { border-color: var(--accent); }
.et-levels { display: grid; gap: 8px; margin: 6px 0 4px; }
.et-lvl { display: flex; gap: 12px; align-items: flex-start; font-size: 0.86rem; }
.et-lvl span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.et-bars, .et-meter { display: flex; align-items: flex-end; gap: 3px; flex: none; }
.et-bars i { width: 5px; border-radius: 2px; background: var(--line2); }
.et-bars i:nth-child(1), .et-meter i:nth-child(1) { height: 8px; }
.et-bars i:nth-child(2), .et-meter i:nth-child(2) { height: 12px; }
.et-bars i:nth-child(3), .et-meter i:nth-child(3) { height: 16px; }
.et-bars i:nth-child(4), .et-meter i:nth-child(4) { height: 20px; }
.et-bars i:nth-child(5), .et-meter i:nth-child(5) { height: 24px; }
.et-bars i.on { background: var(--accent); }
.et-safety { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.22); font-size: 0.84rem; margin: 12px 0; text-align: left; }
.et-safety .ic { color: var(--warn); flex: none; }
.et-safety div div + div { margin-top: 5px; }
.et-set { display: grid; grid-template-columns: auto auto; gap: 8px 14px; align-items: center; justify-content: start; margin: 12px 0; font-size: 0.86rem; color: var(--muted); }
.et-set .seg button { padding: 7px 13px; }
.et-hist { margin: 10px 0; }
.et-run .et-meter { justify-content: center; gap: 8px; margin: 22px 0 10px; }
.et-run .et-meter i { width: 22px; border-radius: 5px; background: var(--line2); transform-origin: bottom; transition: background 0.3s, transform 0.3s; }
.et-run .et-meter i:nth-child(1) { height: 24px; }
.et-run .et-meter i:nth-child(2) { height: 38px; }
.et-run .et-meter i:nth-child(3) { height: 52px; }
.et-run .et-meter i:nth-child(4) { height: 66px; }
.et-run .et-meter i:nth-child(5) { height: 80px; }
.et-run .et-meter i.past { background: rgba(34, 211, 238, 0.35); }
.et-run .et-meter i.cur { background: var(--accent); }
.et-run .et-meter.ph-press i.cur { background: var(--hold); box-shadow: 0 0 18px var(--hold); }
.et-run .et-ph.ph-press { color: var(--hold); }
.et-run .et-ph.ph-rest { color: var(--recover); }
.et-run .et-ph.ph-break { color: var(--breathe); }
.et-pain { margin-top: 18px; width: 100%; color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.et-sum .sum-big small { font-size: 0.4em; color: var(--muted); }
.et-form { text-align: left; max-width: 420px; margin: 16px auto; }
.et-form label { display: flex; flex-direction: column; gap: 4px; }
.et-form label.chk { flex-direction: row; align-items: center; gap: 8px; }
@media (max-width: 520px) { .et-set { grid-template-columns: 1fr; } }
.et-form label.chk { justify-content: flex-start; text-align: left; font-size: 0.9rem; color: var(--text); }
.et-form label.chk input { width: 20px; height: 20px; margin: 0; flex: none; }
.et-form select, .et-form textarea { width: 100%; }
