:root {
    color-scheme: light;
    font: 16px/1.5 system-ui, sans-serif;
    color: #253750;
    background: #f6f7fb;
    --ink: #253750;
    --muted: #536379;
    --brand: #484383;
    --line: #dbe1ed;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #7065c8; outline-offset: 3px; }
.shell { width: min(1080px, calc(100% - 2rem)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #fff; }
.top-inner, nav, .actions, .row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.top-inner { min-height: 70px; gap: 1.25rem; padding-block: .75rem; }
.top-inner nav { flex: 1; }
.top-inner nav a { padding: .35rem .55rem; text-decoration: none; }
.top-inner nav a[aria-current] { background: #eeedfa; border-radius: 7px; font-weight: 700; }
.brand { text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.brand span { font-size: 1.45rem; vertical-align: middle; }
main { padding: 2rem 0 4rem; }
h1, h2, h3, p { margin: 0 0 .7rem; }
h1 { line-height: 1.15; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
h2 { font-size: 1.35rem; }
small, .muted { color: var(--muted); }
.heading { justify-content: space-between; margin-bottom: 1.4rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.4rem); margin-bottom: 1rem; min-width: 0; }
.narrow { max-width: 480px; margin-inline: auto; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: .8rem; align-items: end; }
.stack { display: grid; gap: .75rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: .75rem; min-width: 0; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: .55rem .65rem; background: #fcfcff; color: var(--ink); border: 1px solid #b9c2d6; border-radius: 7px; }
textarea { min-height: 80px; resize: vertical; }
button, .button { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: .54rem .82rem; background: var(--brand); color: white; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #37316b; }
.quiet { color: var(--brand); background: #fff; border-color: var(--line); }
.quiet:hover { color: var(--brand); background: #eeedfa; }
.notice { padding: .85rem 1rem; border: 1px solid #b9d4c1; background: #eaf6ee; border-radius: 9px; margin-bottom: 1rem; }
.notice.error { border-color: #e5b8bf; background: #fff2f3; }
.notice ul { margin-block: .25rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .45rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.clean { padding: 0; margin: 0; list-style: none; }
.clean > li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.clean > li:last-child { border-bottom: 0; }
.chat { max-height: 55vh; overflow-y: auto; display: grid; gap: .65rem; margin: 1rem 0; }
.bubble { max-width: min(80%, 38rem); background: #f3f4fa; padding: .65rem .85rem; border-radius: 10px; overflow-wrap: anywhere; }
.bubble.mine { justify-self: end; background: #eeedfa; }
.bubble p, .preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 1fr) 3fr 4.5rem; align-items: center; gap: .5rem; margin: .25rem 0; font-size: .88rem; }
progress { width: 100%; accent-color: var(--brand); }
.latency progress { accent-color: #187675; }
details { margin-top: .7rem; }
summary { cursor: pointer; color: var(--brand); }
.pagination > nav { justify-content: space-between; margin-top: .8rem; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } .top-inner nav { flex-basis: 100%; order: 1; } main { padding-top: 1.2rem; } }

.tracking-baby { padding-block: 1rem; border-top: 1px solid #e4e2ee; }
.sleep-tracks { display: grid; gap: .6rem; }
.sleep-track { padding: .7rem 1rem; border-inline-start: 4px solid #a86439; border-radius: .5rem; background: #f8f5f0; }
.sleep-track-nap { border-inline-start-color: #458477; background: #edf7f5; }
.sleep-track-night { border-inline-start-color: #7256aa; background: #f1edf9; }
.sleep-track small { display: block; margin-inline-start: .7rem; }

input[aria-invalid="true"] { border-color: #a92942; }
.field-error { color: #a92942; display: block; font-weight: 650; }

.coach-signup form { margin-top: 1.5rem; gap: 1rem; }
.coach-signup #password-hint { margin-top: -.7rem; color: var(--muted); }
.coach-signup summary { cursor: pointer; color: var(--brand); }
.signup-languages { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; margin-top: .75rem; }
.coach-signup altcha-widget { display: block; min-height: 3.25rem; --altcha-max-width: 100%; }
.signup-login { text-align: center; }
