:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #101317;
  --panel-raised: #13171a;
  --line: #272d30;
  --muted: #737c78;
  --text: #f0f2ee;
  --soft: #b5bbb5;
  --lime: #c4f27a;
  --recovery: #9ecab9;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
  --max: 940px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 82% 5%, rgba(166, 204, 106, .06), transparent 30%), var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.app-shell { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; color: var(--lime); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: 12px; font-weight: 700; letter-spacing: .17em; }
.brand-name span { margin-left: 5px; color: var(--lime); font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: 9px; color: #727a7a; font: 10px var(--mono); letter-spacing: .08em; }
.topbar-meta time { margin-left: 4px; color: #d7dad4; font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.live-dot, .permission-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 11px rgba(196, 242, 122, .55); }
main { padding-bottom: 35px; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 59px 0 33px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 17px; color: #8c958d; font: 10px var(--mono); letter-spacing: .13em; }
.eyebrow-line { width: 20px; height: 1px; background: var(--lime); }
h1 { margin: 0; font-size: clamp(39px, 6vw, 62px); font-weight: 500; letter-spacing: -.065em; line-height: 1.09; }
h1 em { color: var(--lime); font-style: normal; font-weight: 400; }
.intro-copy { margin: 18px 0 0; color: #89918b; font-size: 14px; letter-spacing: -.01em; }
.cycle-stamp { display: flex; align-items: center; gap: 12px; min-width: 120px; margin-bottom: 4px; padding: 11px 14px 11px 12px; border: 1px solid #2b3130; border-radius: 5px; }
.stamp-number { color: var(--lime); font: 24px var(--mono); letter-spacing: -.08em; }
.stamp-label { color: #8c958d; font: 9px/1.35 var(--mono); letter-spacing: .09em; }
.status-card { position: relative; display: grid; grid-template-columns: minmax(180px, .7fr) 1px minmax(300px, 1.3fr); gap: 25px; align-items: center; padding: 24px 25px 17px; border: 1px solid #292f32; border-radius: 7px; background: linear-gradient(115deg, #13171a, #101317); box-shadow: 0 14px 38px rgba(0, 0, 0, .16); }
.status-main { display: flex; flex-direction: column; gap: 18px; }
.status-heading { display: flex; align-items: center; gap: 13px; }
.phase-orb { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid rgba(196, 242, 122, .55); border-radius: 50%; }
.phase-orb span { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 17px rgba(196, 242, 122, .7); }
.phase-orb.is-rising { border-color: rgba(142, 195, 180, .6); }
.phase-orb.is-rising span { background: var(--recovery); box-shadow: 0 0 17px rgba(142, 195, 180, .6); }
.status-kicker { display: block; margin-bottom: 4px; color: #7f8781; font: 9px var(--mono); letter-spacing: .12em; }
.status-heading h2 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.04em; line-height: 1.15; }
.direction-chip { display: inline-flex; align-items: center; gap: 7px; width: max-content; padding: 5px 9px; border: 1px solid rgba(196, 242, 122, .2); border-radius: 99px; color: var(--lime); font: 10px var(--mono); }
.direction-chip span:first-child { font-size: 13px; }
.direction-chip.is-rising { border-color: rgba(142, 195, 180, .28); color: #a5d5c5; }
.status-divider { width: 1px; height: 59px; background: #303638; }
.next-event { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 16px; }
.next-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.next-copy strong { font-size: 15px; font-weight: 500; letter-spacing: -.02em; line-height: 1.35; }
.next-time { color: #868f88; font: 10px var(--mono); }
.countdown { color: #f0f2ee; font: clamp(23px, 3.5vw, 32px) var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.065em; white-space: nowrap; }
.status-note { grid-column: 1 / -1; margin: 0; color: #656d69; text-align: right; font: 9px var(--mono); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.035em; }
.small-eyebrow { margin: 0 0 5px; color: #7f8980; font-size: 9px; letter-spacing: .15em; }
.wave-duration { color: #929a91; font: 10px var(--mono); letter-spacing: .1em; }
.wave-card, .day-card { overflow: hidden; margin-top: 56px; padding: 23px 24px 18px; border: 1px solid #252b2f; border-radius: 7px; background: linear-gradient(135deg, rgba(21, 25, 28, .94), rgba(14, 17, 20, .92)); }
.wave-wrap { position: relative; height: 230px; margin-top: 20px; padding: 0 2px; }
.wave-svg { width: 100%; height: 100%; overflow: visible; }
.wave-baseline { stroke: #303639; stroke-dasharray: 3 7; stroke-width: 1; }
.wave-guide { stroke: #282f30; stroke-dasharray: 2 6; stroke-width: 1; }
.wave-path { fill: none; stroke: url(#waveGradient); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; vector-effect: non-scaling-stroke; }
.now-guide { stroke: rgba(196, 242, 122, .48); stroke-dasharray: 3 5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.now-halo { fill: rgba(196, 242, 122, .14); stroke: rgba(196, 242, 122, .22); stroke-width: 1; vector-effect: non-scaling-stroke; }
.now-point { fill: var(--lime); stroke: #101317; stroke-width: 2; vector-effect: non-scaling-stroke; }
.wave-label { position: absolute; z-index: 1; display: flex; align-items: center; gap: 7px; color: #89918a; font: 9px var(--mono); letter-spacing: .1em; }
.wave-label-top { top: 0; left: 0; }
.wave-label-bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.phase-symbol { color: var(--lime); font-size: 14px; }
.trough-symbol { color: var(--recovery); }
.wave-axis { display: flex; justify-content: space-between; margin-top: 5px; color: #707975; font: 8px var(--mono); letter-spacing: .1em; }
.wave-axis span:nth-child(2) { transform: translateX(7px); }
.wave-footer { display: flex; justify-content: space-between; margin-top: 17px; padding-top: 11px; border-top: 1px solid #292f32; color: #727b76; font: 8px var(--mono); letter-spacing: .11em; }
.wave-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.day-card { margin-top: 20px; }
.day-wave-wrap { height: 175px; margin-top: 18px; }
.day-svg { width: 100%; height: 100%; overflow: visible; }
.day-grid { stroke: #303639; stroke-dasharray: 2 6; stroke-width: 1; }
.day-path { opacity: .88; stroke-width: 1.7; }
.day-axis { display: flex; justify-content: space-between; margin-top: 8px; color: #707975; font: 8px var(--mono); letter-spacing: .08em; }
.day-axis span { white-space: nowrap; }
.day-axis span:last-child { margin-right: -2px; }
.controls-section { margin-top: 39px; }
.alerts-section { margin-top: 34px; }
.controls-heading { margin-bottom: 13px; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: #97a18f; cursor: pointer; font: 10px var(--mono); transition: color .18s; }
.text-button:hover { color: var(--lime); }
.text-button span { margin-left: 4px; font-size: 14px; }
.settings-card { padding: 0 17px; border: 1px solid #272d30; border-radius: 6px; background: var(--panel); }
.setting-row { display: flex; min-height: 64px; align-items: center; gap: 14px; cursor: pointer; }
.setting-icon, .alert-glyph { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border: 1px solid #2b3230; border-radius: 50%; color: #9ca69a; font-size: 19px; }
.setting-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.setting-copy strong { color: #e5e9e2; font-size: 12px; font-weight: 500; }
.setting-copy small { color: #777f79; font-size: 10px; line-height: 1.35; }
.setting-value { display: flex; align-items: center; gap: 8px; color: #8d958e; font: 10px var(--mono); }
.setting-value input, .setting-value select { max-width: 120px; padding: 7px 5px; border: 1px solid transparent; border-radius: 4px; outline: none; appearance: none; background: transparent; color: #e5eadf; text-align: right; font: 12px var(--mono); }
.setting-value input:focus, .setting-value select:focus { border-color: #657a4c; background: #151a17; }
.setting-value input[type="number"] { width: 48px; }
.setting-value input[type="time"] { min-width: 95px; }
.select-value { position: relative; }
.setting-value select { min-width: 125px; padding-right: 18px; text-align: left; cursor: pointer; }
.setting-value select option { background: #111519; color: var(--text); }
.select-caret { position: absolute; right: 5px; color: var(--lime); font-size: 14px; pointer-events: none; }
.setting-divider { height: 1px; margin-left: 44px; background: #272d30; }
.alert-actions { display: flex; align-items: center; gap: 8px; }
.test-sound-button, .permission-button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #333b35; border-radius: 4px; background: #111714; cursor: pointer; font: 9px var(--mono); transition: background .2s, border-color .2s, color .2s; }
.test-sound-button { color: #aab2aa; background: #121619; }
.test-sound-button:hover, .permission-button:hover { border-color: #64794f; background: #182019; }
.permission-button { color: #c5dca5; }
.permission-button.is-denied { border-color: #58352e; color: #d5a397; }
.permission-dot { background: #8f9790; box-shadow: none; }
.permission-dot.granted { background: var(--lime); box-shadow: 0 0 8px rgba(196, 242, 122, .5); }
.permission-dot.denied { background: #da8878; }
.alerts-card { padding: 0 17px; }
.alert-row { cursor: default; }
.alert-glyph { font-size: 15px; }
.peak-glyph { color: var(--lime); }
.trough-glyph { color: #a6d4c1; }
.switch { position: relative; width: 37px; height: 21px; flex: none; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: absolute; inset: 0; border: 1px solid #414846; border-radius: 99px; background: #202526; transition: background .2s, border-color .2s; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #858d87; content: ""; transition: transform .2s, background .2s; }
.switch input:checked + .switch-track { border-color: #728e52; background: #344326; }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--lime); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--lime); outline-offset: 3px; }
.sound-note { margin: 11px 0 0; color: #87937f; font-size: 10px; line-height: 1.5; }
.alert-footnote { margin: 7px 0 0; color: #68716c; font-size: 10px; line-height: 1.5; }
.footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 37px; padding: 14px 0; border-top: 1px solid #24292d; color: #646c68; font: 8px var(--mono); letter-spacing: .1em; }
.footer span:nth-child(2) { font: 10px var(--sans); letter-spacing: .02em; text-transform: none; }
.toast { position: fixed; z-index: 10; bottom: 25px; left: 50%; max-width: min(520px, calc(100% - 36px)); padding: 12px 16px; border-radius: 5px; background: #d2edaf; box-shadow: 0 8px 30px #0008; color: #151a12; font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .app-shell { width: min(calc(100% - 34px), var(--max)); }
  .topbar { height: 65px; }
  .topbar-meta { font-size: 8px; }
  .topbar-meta time { font-size: 11px; }
  .intro-row { gap: 16px; padding: 44px 0 26px; }
  .intro-copy { max-width: 290px; font-size: 12px; }
  .cycle-stamp { min-width: 88px; gap: 8px; padding: 8px 9px; }
  .stamp-number { font-size: 20px; }
  .stamp-label { font-size: 7px; }
  .status-card { grid-template-columns: 1fr; gap: 15px; padding: 19px 17px; }
  .status-main { flex-direction: row; align-items: center; justify-content: space-between; }
  .status-heading { gap: 10px; }
  .phase-orb { width: 33px; height: 33px; }
  .status-heading h2 { font-size: 18px; }
  .status-divider { width: 100%; height: 1px; }
  .next-event { gap: 10px; }
  .countdown { font-size: 25px; }
  .wave-card { margin-top: 45px; padding: 19px 15px 14px; }
  .wave-wrap { height: 196px; margin-top: 17px; }
  .wave-label { font-size: 8px; }
  .wave-axis { font-size: 7px; }
  .day-card { padding: 19px 15px 14px; }
  .day-wave-wrap { height: 145px; margin-top: 14px; }
  .day-axis { font-size: 7px; }
  .wave-footer { margin-top: 13px; }
  .controls-section { margin-top: 32px; }
  .setting-row { min-height: 61px; gap: 10px; }
  .setting-icon, .alert-glyph { width: 27px; height: 27px; font-size: 16px; }
  .setting-copy strong { font-size: 11px; }
  .setting-copy small { font-size: 9px; }
  .setting-value input, .setting-value select { font-size: 11px; }
  .setting-value select { min-width: 116px; }
  .settings-card, .alerts-card { padding-right: 12px; padding-left: 12px; }
  .permission-button, .test-sound-button { padding: 7px 8px; font-size: 8px; }
  .footer { flex-wrap: wrap; }
  .footer span:nth-child(2) { order: 3; width: 100%; }
}

@media (max-width: 390px) {
  .app-shell { width: calc(100% - 26px); }
  h1 { font-size: 37px; }
  .cycle-stamp { transform: scale(.92); transform-origin: right bottom; }
  .setting-copy small { max-width: 175px; }
  .next-copy strong { font-size: 13px; }
  .countdown { font-size: 21px; }
  .next-time { font-size: 9px; }
  .status-card { padding-right: 13px; padding-left: 13px; }
  .alert-actions { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
