:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  background: #0b0c13;
  color: #f8f7fd;
  font-synthesis: none;
  --text: #f8f7fd;
  --muted: #adaabe;
  --line: #2c2d3d;
  --surface: #1a1b28;
  --accent: #c7aeff;
  --accent-soft: #33284c;
  --deep: #a684fb;
  --light: #6f79df;
  --rem: #8fc7fb;
  --awake: #f0b188;
  --lime: #c8e99c;
  --coral: #f6a69b;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(100%, 540px); margin: auto; min-height: 100dvh; background: #11121b; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px; min-height: 74px; }
.brand { display: flex; min-width: 0; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -.55px; }
.brand-name { white-space: nowrap; line-height: 1.15; }
.brand-name small { display: block; margin-top: 5px; color: #bbb7ca; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.top-meta { display: grid; justify-items: end; gap: 5px; }
.top-meta time { font-size: 14px; font-weight: 660; color: #dcd5e9; font-variant-numeric: tabular-nums; }
.sample { color: #c1bacd; font-size: 13px; border: 1px solid #383447; border-radius: 20px; padding: 6px 10px; }
.watch { position: relative; display: grid; place-items: center; width: 48px; height: 59px; flex: 0 0 48px; }
.watch::before { content: ""; position: absolute; inset: 0 11px; border-radius: 6px; background: repeating-linear-gradient(180deg,#363745 0 2px,#21212d 2px 5px); box-shadow: inset 0 0 0 1px #75768750; }
.watch-case { position: relative; display: block; width: 45px; height: 45px; border-radius: 50%; border: 2px solid #8f91a0; background: #151722; box-shadow: inset 0 0 0 2px #303147, 1px 2px 6px #0006; }
.watch-case::after { content: ""; position: absolute; right: -4px; top: 10px; height: 7px; width: 3px; border-radius: 2px; background: #e8a18e; box-shadow: 0 11px #7a7b88; }
.watch-dial { position: absolute; inset: 4px; border-radius: 50%; background: repeating-conic-gradient(from -1deg,#b0abc1 0deg 2deg,transparent 2deg 30deg); mask-image: radial-gradient(circle,transparent 61%,black 62%); }
.watch-hand, .watch-pin { position: absolute; display: block; left: 50%; bottom: 50%; width: 2px; border-radius: 2px; transform-origin: 50% 100%; color: #f3eef9; background: currentColor; }
.watch-hand.hour { height: 9px; transform: translateX(-50%) rotate(var(--hour, 0deg)); }
.watch-hand.minute { height: 12px; transform: translateX(-50%) rotate(var(--minute, 0deg)); }
.watch-hand.second { width: 1px; height: 14px; color: #ffb19b; transform: translateX(-50%) rotate(var(--second, 0deg)); }
.watch-pin { width: 3px; height: 3px; transform: translate(-50%,50%); }
#app { padding: 8px 18px calc(100px + env(safe-area-inset-bottom)); min-width: 0; }
.screen { --current: var(--accent); }
.screen[data-tab="workouts"] { --current: var(--lime); }
.screen[data-tab="heart"] { --current: var(--coral); }
.title-row { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 2px 0 15px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(33px, 9vw, 48px); letter-spacing: -.055em; line-height: 1.04; font-weight: 760; }
h2 { font-size: 19px; line-height: 1.24; letter-spacing: -.025em; }
h3 { font-size: 16px; line-height: 1.3; }
.scope { display: flex; background: #1c1c2a; border: 1px solid #2c2b3c; border-radius: 12px; padding: 3px; }
.scope button { border: 0; background: transparent; border-radius: 8px; min-height: 34px; padding: 0 10px; font-size: 14px; color: var(--muted); }
.scope [aria-pressed="true"] { background: #373044; color: #f5edff; }
.period { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 9px; }
.period h2 { color: var(--muted); font-size: 14px; font-weight: 550; }
.period-switch { display: flex; align-items: center; gap: 11px; }
.period-switch button { background: none; border: 0; padding: 6px 0; min-height: 36px; color: var(--muted); font-size: 14px; }
.period-switch [aria-pressed="true"] { color: var(--current); font-weight: 700; }
.dates { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-bottom: 14px; touch-action: pan-y; }
.date { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 51px; border-radius: 12px; border: 1px solid #282939; background: #181925; color: #b5b2c5; padding: 4px 1px; }
.date span { font-size: 12px; }
.date strong { font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.date[aria-pressed="true"] { color: #171225; background: var(--current); border-color: var(--current); }
.date:disabled { opacity: .65; cursor: default; }
.card { background: var(--surface); border: 1px solid #2e2e40; border-radius: 19px; overflow: hidden; }
.stack { display: grid; gap: 10px; }
.sleep-main { padding: 15px 14px 3px; border-color: #423657; background: radial-gradient(ellipse at 96% 3%, #352954 0%, #1c1a2e 58%, #191827 100%); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.card-head .sub { color: #bfb4d0; font-size: 13px; white-space: nowrap; }
.icon { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.card-head .icon { color: var(--current); }
details { border-top: 1px solid #77708b40; }
summary { list-style: none; display: flex; align-items: center; width: 100%; gap: 8px; min-height: 53px; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; border-radius: 11px; width: 34px; height: 34px; flex: 0 0 34px; background: var(--avatar-bg); color: var(--avatar-fg); font-size: 14px; font-weight: 760; }
.identity { flex: 1; min-width: 0; font-size: 15px; font-weight: 680; }
.identity small { font-size: 13px; display: block; color: #b9afc9; font-weight: 450; margin-top: 2px; }
.total { font-size: 19px; letter-spacing: -.04em; white-space: nowrap; font-weight: 720; font-variant-numeric: tabular-nums; }
.chev { width: 7px; height: 7px; flex: 0 0 7px; transform: rotate(45deg); border-right: 1.7px solid #bfb5d3; border-bottom: 1.7px solid #bfb5d3; margin: 0 4px 4px 2px; transition: transform .2s; }
details[open] .chev { transform: rotate(225deg); margin-top: 7px; }
.phase-bar { display: flex; gap: 2px; height: 6px; width: 100%; margin: 0 0 10px; border-radius: 5px; overflow: hidden; background: #242237; }
.phase-bar i { height: 100%; background: var(--phase-color); border-radius: 3px; transform-origin: left; animation: grow .3s ease-out both; }
.phase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.phase { display: flex; flex-direction: column; gap: 4px; border: 1px solid #62577c45; border-radius: 10px; padding: 7px 8px; background: #1716265e; }
.phase span { font-size: 13px; color: #c7bfd7; white-space: nowrap; }
.phase span::before { content: ""; display: inline-block; background: var(--phase-color); width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; }
.phase b { font-size: 16px; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 5px; margin: 9px 0 12px; color: var(--muted); font-size: 13px; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; background: var(--phase-color); }
.hint { font-size: 13px; line-height: 1.45; color: var(--muted); }
.inner { padding: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.stat { display: grid; align-content: start; gap: 4px; min-width: 0; background: #242434; border-radius: 12px; padding: 9px 7px; }
.stat strong { font-size: clamp(18px, 5.2vw, 24px); font-weight: 720; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; line-height: 1.15; color: #c4bed1; }
.pulse-stats { margin-top: 8px; }
.pulse-stats .stat { text-align: left; }
.stat .stat-short { display: none; }
.stat-button { position: relative; border: 1px solid #976b704f; background: #362930; padding: 8px 6px; }
.stat-button i, .table-peak small { font-style: normal; color: var(--coral); font-size: 11px; }
.stat-button i { position: absolute; right: 6px; top: 5px; }
.stat-button:active, .table-peak:active { background: #49333b; }
.pulse-note { margin-top: 7px; }
.pulse-title { min-height: 42px; }
.pulse-title .hint { margin-top: 3px; }
.pulse-motif { display: flex; align-items: center; gap: 3px; flex-shrink: 0; color: var(--coral); }
.pulse-mark { display: block; width: 63px; height: 24px; stroke: #c9808f70; fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.pulse-mark .pulse-sweep { stroke: currentColor; stroke-width: 2; stroke-dasharray: 24 100; animation: pulse-sweep 2.6s linear infinite; }
.pulse-heart { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #d6818d25; animation: pulse-beat 2.6s ease-out infinite; }
.pulse-heart .icon { width: 17px; height: 17px; fill: #e294a026; }
.pulse-card { background: radial-gradient(ellipse at 100% 0%,#322431 0%,#1a1b28 65%); }
.pulse-insight { margin-top: 10px; padding: 9px 10px; border-radius: 10px; background: #392b34; color: #e2cdd1; font-size: 13px; line-height: 1.4; }
.pulse-insight strong { color: #ffc5b8; margin-right: 4px; }
.sleep-pulse { margin: 2px 0 13px; padding-top: 4px; border-top: 1px solid #77708b40; }
.sleep-pulse .pulse-title { margin-bottom: 3px; }
.sleep-pulse .pulse-motif, .heart-night .pulse-motif { color: #d4b5ff; }
.sleep-pulse .pulse-heart, .heart-night .pulse-heart { background: #b08aea28; }
.sleep-pulse .pulse-mark, .heart-night .pulse-mark { stroke: #aa84df65; }
.sleep-pulse .pulse-mark .pulse-sweep, .heart-night .pulse-mark .pulse-sweep { stroke: #d4b5ff; }
.night-pulse-person { border-top: 1px solid #3c3b4d; padding: 10px 0 12px; }
.night-pulse-person:last-child { padding-bottom: 0; }
.night-pulse-person .night-timing { margin-left: auto; font-variant-numeric: tabular-nums; }
.workout-pulse { margin-top: 11px; }
.insight { margin-top: 12px; border: 1px solid #6c8052; border-radius: 14px; padding: 12px; background: linear-gradient(125deg,#26352a,#242d2b 65%,#24302b); }
.insight-head { display: flex; gap: 8px; align-items: center; color: #e3f1ce; }
.insight-head > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--lime); background: #546a393e; }
.insight-head h3 { margin: 0; font-size: 16px; }
.insight-head p { font-size: 13px; color: #c3d1b9; }
.insight-primary { margin-top: 10px; color: #d9e7cc; font-size: 20px; font-variant-numeric: tabular-nums; }
.insight-primary strong { color: #e4f6c8; }
.insight-primary span { font-size: 14px; }
.insight-copy { margin: 5px 0 7px; line-height: 1.45; color: #dee6d7; font-size: 14px; }
.insight-load { line-height: 1.45; font-size: 13px; color: #c5d6bc; }
.insight-load span { margin-right: 4px; color: #d2eab8; font-weight: 700; }
.profile { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile span { color: var(--muted); }
.picks { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 12px; }
.pick { background: #222231; border: 1px solid #3a3849; color: #d7d1e1; border-radius: 9px; padding: 7px 10px; min-height: 38px; font-size: 14px; }
.pick[aria-pressed="true"] { background: #332b42; border-color: var(--current); color: #f9f4ff; }
.week-chart { --person: #c7aeff; display: grid; grid-template-columns: repeat(7, 1fr); column-gap: 4px; align-items: end; padding: 8px 0 0; }
.week-day { padding: 0 2px; display: grid; justify-items: center; gap: 5px; border: 0; background: none; border-radius: 8px; color: var(--muted); font-size: 12px; }
.week-day strong { min-height: 15px; font-size: 12px; color: #ddd5e9; white-space: nowrap; }
.week-track { display: flex; width: min(100%, 27px); height: 104px; align-items: end; border-radius: 6px; overflow: hidden; background: #272536; }
.week-track i { width: 100%; background: var(--person); border-radius: 6px 6px 0 0; transform-origin: bottom; animation: lift .32s ease-out both; }
.week-day[aria-current="date"] .week-track { outline: 1px solid var(--person); outline-offset: 2px; }
.comparison { margin-top: 12px; }
.comparison .stat { background: #242a30; }
.comparison .card-head { margin-top: 12px; }
.action { border: 1px solid #677551; color: #e5f7c8; background: #303b29; border-radius: 11px; min-height: 43px; padding: 8px 12px; font-size: 14px; font-weight: 680; }
.action[aria-expanded="true"] { background: #394730; }
.workout-card h3 { margin-top: 10px; }
.workout-card .action { margin-top: 10px; }
.line-chart { width: 100%; height: 157px; display: block; touch-action: pan-y; border-radius: 8px; }
.chart-value { min-height: 19px; margin-top: 6px; font-size: 13px; color: #ddd7e6; font-variant-numeric: tabular-nums; }
.night-list { margin-top: 10px; }
.night-list .night-row { min-height: 46px; border-top: 1px solid #3b384955; display: flex; align-items: center; gap: 8px; }
.night-row strong { margin-left: auto; white-space: nowrap; }
.night-row small { color: var(--muted); font-weight: 450; font-size: 13px; }
.heart-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.heart-table th, .heart-table td { padding: 8px 3px; text-align: right; border-bottom: 1px solid #3b384955; }
.heart-table th:first-child { text-align: left; }
.heart-table thead th { color: var(--muted); font-size: 13px; font-weight: 500; }
.heart-table tbody tr:last-child > * { border-bottom: 0; }
.heart-table th small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.table-peak { min-width: 48px; min-height: 38px; padding: 5px 6px; border: 1px solid #936b7866; border-radius: 8px; background: #352a35; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.table-peak small { margin-left: 3px; }
dialog { position: fixed; inset: auto 0 0; width: min(100%, 540px); max-width: 100%; max-height: 86dvh; margin: 0 auto; padding: 0; color: var(--text); background: #22212e; border: 1px solid #494253; border-bottom: 0; border-radius: 22px 22px 0 0; }
dialog::backdrop { background: #090910b5; backdrop-filter: blur(4px); }
.sheet { padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 8px; }
.sheet-close { width: 41px; height: 41px; border: 1px solid #555062; border-radius: 50%; background: #343040; font-size: 25px; line-height: 1; }
.peak-number { margin: 7px 0 3px; color: #ffc0b4; font-size: 42px; font-weight: 760; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.peak-number span { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.peak-date { font-size: 15px; }
.peak-repeat { margin-top: 5px; }
.peak-context { margin-top: 15px; border-radius: 12px; padding: 11px; background: #2e2b3b; }
.peak-context p { margin-top: 4px; color: #d7d1e2; font-size: 14px; line-height: 1.45; }
.dock { position: fixed; z-index: 3; inset: auto 0 0; width: min(100%, 540px); margin: auto; padding: 6px 12px max(7px, env(safe-area-inset-bottom)); background: #171823f5; backdrop-filter: blur(18px); border-top: 1px solid #363444; }
.dock nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.dock button { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 51px; border: 0; border-radius: 11px; background: none; color: #bcb8cb; font-size: 13px; }
.dock [aria-current="page"] { color: var(--nav-accent); background: #2b263b; font-weight: 680; }
.dock .icon { width: 21px; height: 21px; }
@keyframes grow { from { transform: scaleX(.15); opacity: .55; } }
@keyframes lift { from { transform: scaleY(.15); opacity: .6; } }
@keyframes pulse-sweep { from { stroke-dashoffset: 123; } to { stroke-dashoffset: 0; } }
@keyframes pulse-beat { 0%, 47%, 72%, 100% { transform: scale(1); } 55% { transform: scale(1.13); } 63% { transform: scale(1.06); } }
@media (min-width: 550px) { .shell { box-shadow: 0 0 90px #0008; } #app { padding-inline: 22px; } }
@media (max-width: 350px) { #app { padding-inline: 12px; } .top { padding-inline: 12px; } .scope button { padding-inline: 8px; } .card-head .sub { font-size: 12px; } .sleep-main { padding-inline: 11px; } .stat .stat-long { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; } .stat .stat-short { display: inline; } .pulse-mark { width: 50px; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
