:root {
  --bg: #070b1f;
  --card: rgba(16, 24, 58, 0.84);
  --card-strong: rgba(21, 31, 78, 0.96);
  --line: rgba(151, 178, 255, 0.25);
  --text: #eef4ff;
  --muted: #9dacd2;
  --accent: #75d8ff;
  --accent-2: #b36cff;
  --good: #7cffcb;
  --warn: #ffd479;
  --danger: #ff7aa8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(117,216,255,.24), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(179,108,255,.26), transparent 28%),
    linear-gradient(145deg, #050817 0%, #0b1026 48%, #130922 100%);
}
button, select, input { font: inherit; }
button { cursor: pointer; }
a.pill-button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px 30px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.eyebrow, .label { margin: 0 0 6px; color: var(--accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.test-tag { margin-left: 6px; color: var(--warn); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 6vw, 1.9rem); line-height: 1.05; }
h2 { margin-bottom: 6px; font-size: clamp(1.7rem, 8vw, 2.45rem); line-height: 1; }
h3 { margin-bottom: 0; font-size: 1.85rem; }
.test-banner {
  margin-bottom: 14px; padding: 11px 13px; border-radius: 15px;
  color: var(--warn); border: 1px solid rgba(255,212,121,.3);
  background: rgba(255,212,121,.08); font-size: .76rem; line-height: 1.45; font-weight: 650;
}
.phone-frame { position: relative; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.06); backdrop-filter: blur(20px); }
.tab { border: 0; border-radius: 999px; padding: 11px 8px; color: var(--muted); background: transparent; font-weight: 800; font-size: .84rem; }
.tab.active { color: #061022; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 28px rgba(117,216,255,.24); }
.page { display: none; }
.active-page { display: block; }
.card, .hero-card { border: 1px solid var(--line); border-radius: 28px; padding: 18px; margin-bottom: 14px; background: var(--card); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.neon-card { background: linear-gradient(145deg, rgba(117,216,255,.13), transparent 42%), linear-gradient(315deg, rgba(179,108,255,.16), transparent 38%), var(--card-strong); }
.row { display: flex; align-items: center; gap: 14px; }
.between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.timezone-box { flex: 1; min-width: 0; }
.small-row { color: var(--muted); font-size: .84rem; font-weight: 700; }
.muted { color: var(--muted); }
.select { width: 100%; max-width: 250px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; color: var(--text); background: rgba(2,8,30,.72); }
.live-time { min-width: 66px; text-align: right; font-size: 1.35rem; font-weight: 900; color: var(--good); }
.rhythm-title-block { margin: 28px 0 14px; }
.guidance { margin-bottom: 0; color: #dfe8ff; line-height: 1.55; }
.progress-wrap { margin-top: 20px; }
.progress-track { width: 100%; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.08); }
.progress-fill { width: 0%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 250ms linear; }
.tracker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 16px 0 11px; }
.segment { min-height: 48px; border-radius: 16px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.055); font-weight: 900; }
.segment.active-segment { color: #061022; background: linear-gradient(135deg, var(--good), var(--accent)); box-shadow: 0 12px 30px rgba(117,216,255,.24); }
.locked-line { margin: 0; color: var(--muted); font-size: .76rem; text-align: center; font-weight: 800; }
.controls-card { display: grid; gap: 12px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: #e7eeff; font-weight: 800; }
input[type="checkbox"] { width: 48px; height: 28px; accent-color: var(--accent); }
.audio-status { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.mode-card { min-height: 118px; border: 1px solid var(--line); border-radius: 22px; padding: 14px; text-align: left; color: var(--text); background: rgba(255,255,255,.06); }
.mode-card span, .mode-card small { display: block; color: var(--muted); font-weight: 800; }
.mode-card strong { display: block; margin: 10px 0 6px; font-size: 1.35rem; }
.active-mode { border-color: rgba(117,216,255,.8); background: linear-gradient(145deg, rgba(117,216,255,.18), rgba(179,108,255,.12)); }
.big-timer { margin: 8px 0 16px; font-size: clamp(3rem, 17vw, 5.4rem); line-height: .96; text-align: center; font-weight: 950; letter-spacing: -.06em; }
.timer-meta { margin-top: 12px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.button-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.primary-button, .secondary-button, .pill-button, .ghost-button { border: 0; border-radius: 999px; padding: 12px 14px; font-weight: 900; }
.primary-button, .pill-button { color: #061022; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.secondary-button { color: var(--text); background: rgba(255,255,255,.09); border: 1px solid var(--line); }
.ghost-button { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.pill-button { white-space: nowrap; padding: 10px 12px; font-size: .82rem; }
.diagnostics-card { margin-top: 4px; border-color: rgba(255,212,121,.30); }
.diagnostic-title { font-size: 1.15rem; }
.mini-badge { border-radius: 999px; padding: 7px 11px; font-size: .72rem; font-weight: 900; color: var(--good); border: 1px solid rgba(124,255,203,.35); background: rgba(124,255,203,.09); }
.mini-badge.hidden { color: var(--warn); border-color: rgba(255,212,121,.35); background: rgba(255,212,121,.08); }
.diag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 16px 0; }
.diag-item { min-height: 63px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.045); }
.diag-item span { display: block; color: var(--muted); font-size: .68rem; margin-bottom: 6px; }
.diag-item strong { display: block; font-size: .78rem; word-break: break-word; }
.diagnostic-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.diagnostic-note { color: var(--warn); font-size: .72rem; line-height: 1.45; margin-bottom: 12px; }
.log-list { max-height: 235px; overflow-y: auto; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.2); padding: 8px; }
.log-entry { padding: 7px 6px; border-bottom: 1px solid rgba(151,178,255,.10); font-size: .69rem; line-height: 1.45; color: #dce5ff; }
.log-entry:last-child { border-bottom: 0; }
.log-entry.good { color: var(--good); }
.log-entry.warn { color: var(--warn); }
.log-entry.bad { color: var(--danger); }
@media (max-width: 380px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .card, .hero-card { border-radius: 24px; padding: 15px; }
  .button-grid, .mode-grid, .diagnostic-buttons { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
}
