:root {
  color-scheme: light;
  --ink: #292642;
  --muted: #66627a;
  --paper: #faf8f4;
  --line: #ebe6e1;
  --white: #fffefc;
  --purple: #64518d;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .56; cursor: progress; }
button, a, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid #7755bb; }
button svg, .icon-chip svg, .date svg, .brand-mark svg, .avatar svg { width: 19px; height: 19px; vertical-align: middle; }
button > span[data-icon] { display: inline-flex; align-items: center; }
button > :is(.avatar, .icon-chip)[data-icon] { display: grid; place-items: center; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .brand { letter-spacing: -.04em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.25rem); line-height: 1.08; font-weight: 760; }
h2 { font-size: 1.32rem; font-weight: 720; }
h3 { font-size: 1.07rem; font-weight: 720; }
p, small { color: var(--muted); }
.layout { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 32px 20px 24px; background: #fffdfa; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; margin: 0 7px 33px; color: var(--ink); text-decoration: none; font-size: 1.48rem; line-height: 1; font-weight: 790; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #faf7ff; background: #6a559d; border-radius: 13px; }
.brand-mark svg { fill: currentColor; width: 22px; height: 22px; }
.brand-dot { margin-left: -8px; color: #896eb6; }
.profile { margin-bottom: 29px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); display: grid; grid-template-columns: 40px minmax(0, 1fr) 14px; align-items: center; min-height: 68px; gap: 10px; padding: 9px; text-align: left; width: 100%; }
.profile > span:nth-child(2) { overflow: hidden; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: .91rem; }
.profile small { font-size: .73rem; }
.profile-arrow svg { width: 15px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fae5df; color: #9b4d53; }
.avatar svg { width: 22px; height: 22px; }
.nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 0 13px; border: 0; border-radius: 11px; background: transparent; color: #605971; text-align: left; font-size: .88rem; font-weight: 650; }
.nav-item:hover, .nav-item.selected { background: #eee8f7; color: #5c4588; }
.sidebar-footer { display: flex; align-items: center; margin: auto 8px 0; gap: 8px; color: var(--muted); font-size: .75rem; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #5b8b72; flex: 0 0 auto; }
.main { width: min(100%, 1280px); margin: 0 auto; padding: 36px clamp(28px, 4vw, 68px) 55px; }
.masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 26px; }
.masthead p:last-child { margin-top: 7px; }
.date { display: flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 650; margin-bottom: 8px; }
.date svg { width: 16px; height: 16px; }
.outline, .primary, .action-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px; padding: 0 14px; font-weight: 680; white-space: nowrap; }
.outline { border: 1px solid #ddd4e7; background: #fffdfb; color: #59477a; font-size: .86rem; }
.outline:hover { background: #f2edf9; }
.masthead .invite { margin-bottom: 4px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.action-card { padding: 22px 25px; min-height: 210px; border-radius: 21px; overflow: hidden; position: relative; isolation: isolate; }
.sleep-card { color: #fffaff; background: linear-gradient(120deg, #3b3159 8%, #493769 70%, #604984); }
.feed-card { color: #254b3b; background: linear-gradient(115deg, #e7f0e7 15%, #dcebdc 100%); border: 1px solid #d7e7db; }
.action-label { display: flex; align-items: center; gap: 7px; font-weight: 710; font-size: .88rem; }
.action-label svg { width: 19px; height: 19px; vertical-align: middle; }
.timer, .latest-feed { margin-top: 8px; font-size: clamp(2rem, 4vw, 2.65rem); font-weight: 760; line-height: 1.12; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.action-card p { min-height: 22px; margin: 4px 0 17px; font-size: .84rem; }
.sleep-card p { color: #ece3f7; }
.feed-card p { color: #3e6250; }
.action-button { border: 0; font-size: .9rem; }
.sleep-button { color: #453465; background: #f7effc; }
.sleep-button:hover { background: #fff; }
.feed-button { color: #fff; background: #305943; }
.feed-button:hover { background: #224632; }
.orbit { position: absolute; z-index: -1; inset: 0 0 0 auto; width: clamp(135px, 44%, 230px); pointer-events: none; }
.orbit-ring { width: 205px; height: 205px; border: 1px solid #dcc8f447; position: absolute; border-radius: 50%; top: -6px; right: -25px; }
.orbit-ring.inner { width: 174px; height: 174px; top: 10px; right: -10px; }
.illustration-moon { position: absolute; width: 83px; height: 83px; border-radius: 50%; top: 42px; right: 45px; transform: rotate(-24deg); box-shadow: -17px 12px 0 0 #dfcaee; opacity: .92; }
.star { position: absolute; color: #e5cef6; }
.star.first { top: 30px; right: 42px; font-size: 22px; }
.star.second { top: 111px; right: 22px; font-size: 20px; }
.star.third { top: 146px; right: 138px; font-size: 12px; }
.feed-art { position: absolute; z-index: -1; width: 172px; height: 172px; top: 15px; right: 9px; display: grid; place-items: center; border-radius: 50%; background: #f4f9ed91; border: 1px solid #ffffff9c; }
.feed-art svg { width: 113px; height: 113px; transform: rotate(23deg); color: #7da48a; stroke-width: .62; fill: #e8f1dc; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.overview, .activity-preview { margin-top: 27px; }
.range select { min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--muted); padding: 0 10px; font-size: .8rem; font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.metric, .routine, .list, .group-summary { border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.metric { min-height: 111px; padding: 13px; }
.metric-label { font-size: .77rem; font-weight: 660; display: flex; gap: 8px; align-items: center; color: #58516c; line-height: 1.14; }
.icon-chip { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; }
.metric .icon-chip { width: 29px; height: 29px; }
.icon-chip svg { width: 17px; height: 17px; }
.lavender { color: #715395; background: #f0e9f8; }
.green { color: #35634d; background: #e5f0e5; }
.peach { color: #9b5147; background: #f9e7e2; }
.gold { color: #825c37; background: #f8efdb; }
.metric strong { display: block; margin-top: 7px; font-size: clamp(1.12rem, 2.2vw, 1.53rem); line-height: 1.17; white-space: nowrap; letter-spacing: -.045em; }
.metric p { margin-top: 3px; font-size: .74rem; }
.routine { margin-top: 12px; padding: 14px 18px; }
.routine-heading { margin-bottom: 5px; }
.routine-heading p { font-size: .77rem; }
.pattern { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.pattern div { display: grid; place-items: center; min-width: 0; }
.pattern svg { max-width: 100%; }
.pattern span { min-height: 16px; white-space: nowrap; font-size: .67rem; color: var(--muted); }
.bar-fill { fill: #ac95cf; }
.bar-empty { fill: #e8e0f0; }
.text-button { display: flex; align-items: center; gap: 6px; min-height: 44px; background: none; border: 0; color: #654e91; font-size: .84rem; font-weight: 700; }
.text-button svg { width: 16px; height: 16px; }
.list { overflow: hidden; }
.event { display: flex; align-items: center; gap: 11px; padding: 10px 14px; min-height: 58px; }
.event + .event { border-top: 1px solid var(--line); }
.event-info { min-width: 0; flex: 1; }
.event-info strong { font-size: .9rem; display: block; }
.event-info small, .event time { font-size: .77rem; color: var(--muted); }
.event time { white-space: nowrap; }
.empty { padding: 17px; font-size: .9rem; }
.group-summary { display: flex; align-items: center; gap: 12px; padding: 14px; }
.group-summary div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.group-summary p { font-size: .86rem; }
.group-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.people-title { margin-top: 25px; }
.notice { margin: -6px 0 18px; padding: 10px 12px; background: #f5ecd9; color: #674c24; border-radius: 10px; font-size: .86rem; }
dialog { width: min(420px, calc(100% - 28px)); max-height: calc(100dvh - 30px); border: 1px solid var(--line); border-radius: 19px; padding: 0; color: var(--ink); background: var(--white); box-shadow: 0 20px 70px #2113344d; }
dialog::backdrop { background: #231a3b69; }
.modal-body { padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-intro { margin: 4px 0 15px; font-size: .89rem; }
.modal-body label { display: block; font-size: .86rem; font-weight: 700; margin: 11px 0 5px; }
.modal-body input:not([type=checkbox]) { width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid #dcd3e6; border-radius: 9px; background: #fff; color: var(--ink); }
.modal-body .check { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.check input { width: 18px; height: 18px; accent-color: #6a559d; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.presets button, .icon-button { min-height: 44px; border: 1px solid var(--line); border-radius: 9px; color: #59477a; background: #f9f6fb; }
.icon-button { min-width: 44px; display: grid; place-items: center; }
.presets button[aria-pressed=true] { background: #eae0f7; border-color: #a38abd; }
.primary { border: 0; background: #654d90; color: #fff; }
.primary:hover { background: #563c82; }
.full { width: 100%; margin-top: 12px; }
.form-error { font-size: .85rem; color: #a1363d; margin-top: 10px; }
.toast { position: fixed; z-index: 4; inset: auto 20px 18px auto; max-width: calc(100% - 40px); padding: 10px 15px; background: #3b3159; color: #fff; border-radius: 10px; font-size: .87rem; }
.sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 191px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .feed-art { width: 134px; height: 134px; right: -9px; }
  .feed-art svg { width: 92px; height: 92px; }
  .orbit { opacity: .74; }
}
@media (max-width: 720px) {
  .layout { display: block; }
  .sidebar { position: static; padding: 12px 16px 0; height: auto; border: 0; background: transparent; flex-direction: row; justify-content: space-between; align-items: center; gap: 9px; }
  .brand { margin: 0; font-size: 1.2rem; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .profile { margin: 0; width: auto; max-width: 47%; min-height: 44px; grid-template-columns: 26px minmax(0, 1fr) 12px; gap: 6px; padding: 4px 6px; }
  .profile .avatar { width: 26px; height: 26px; border-radius: 7px; }
  .profile .avatar svg { width: 16px; height: 16px; }
  .profile small { font-size: .64rem; }
  .profile strong { font-size: .77rem; }
  .sidebar-footer { display: none; }
  .nav { position: fixed; z-index: 2; inset: auto 0 0; background: #fffdfa; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px 10px max(5px, env(safe-area-inset-bottom)); }
  .nav-item { flex-direction: column; justify-content: center; gap: 2px; font-size: .7rem; text-align: center; padding: 4px 3px; }
  .nav-item svg { width: 17px; height: 17px; }
  .main { padding: 21px 16px calc(77px + env(safe-area-inset-bottom)); }
  .masthead { align-items: flex-start; margin-bottom: 17px; }
  .masthead .invite { margin: 0; align-self: flex-end; padding-inline: 8px; font-size: .72rem; gap: 5px; }
  .masthead .invite svg { width: 15px; height: 15px; }
  .masthead p:last-child { font-size: .82rem; }
  .actions { gap: 9px; }
  .action-card { padding: 14px 11px; min-height: 174px; border-radius: 14px; }
  .action-card p { font-size: .72rem; min-height: 34px; margin-bottom: 8px; }
  .action-label { font-size: .76rem; gap: 4px; }
  .action-label svg { width: 15px; height: 15px; }
  .timer, .latest-feed { font-size: clamp(1.5rem, 6vw, 2.15rem); }
  .action-button { font-size: .78rem; padding: 0 9px; gap: 4px; }
  .action-button svg { width: 15px; height: 15px; }
  .orbit { opacity: .37; transform: scale(.62); transform-origin: top right; }
  .feed-art { opacity: .55; width: 78px; height: 78px; right: -17px; top: 19px; }
  .feed-art svg { width: 54px; height: 54px; }
  .overview, .activity-preview { margin-top: 17px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 93px; padding: 9px; }
  .metric p { font-size: .69rem; }
  .routine { padding: 11px; }
  .toast { bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Warm cream and plum themes shared by the dashboard, forms, and settings. */
:root {
  --ink: #361128;
  --muted: #785768;
  --paper: #fbf5ef;
  --line: #e8d5d7;
  --white: #fffaf6;
  --sidebar: #fff9f3;
  --accent: #f8a982;
  --accent-hover: #ffbc9b;
  --accent-ink: #341321;
  --soft-accent: #ffdcc9;
  --soft-plum: #f0e4f3;
  --sleep-bg: #e8d7f3;
  --lavender-ink: #6c3c7b;
  --bar: #ab80c9;
  --accent-outline: #b67b92;
  --surface-field: #f9f0ef;
  --toggle-off: #d6c4c9;
  --toggle-on: #70415b;
  font-family: ui-rounded, "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #fff1e6;
  --muted: #e3c4d6;
  --paper: #2a1427;
  --line: #724861;
  --white: #3c2035;
  --sidebar: #30172b;
  --accent: #ffad85;
  --accent-hover: #ffbf9d;
  --soft-accent: #5c344d;
  --soft-plum: #482840;
  --sleep-bg: #46223e;
  --lavender-ink: #f1d6ff;
  --bar: #c399e0;
  --accent-outline: #aa7f96;
  --surface-field: #492c43;
  --toggle-off: #7b6171;
  --toggle-on: #925270;
}
body { background: radial-gradient(ellipse at 58% -5%, var(--white), transparent 54%), var(--paper); }
.layout { grid-template-columns: 230px minmax(0, 1fr); }
.sidebar, .nav { background: var(--sidebar); }
.brand { font-size: 1.4rem; font-weight: 790; }
.brand-mark { background: none; color: #aa5f42; border-radius: 0; width: 32px; }
.brand-mark svg { fill: none; width: 30px; height: 30px; }
[data-theme="dark"] .brand-mark { color: #ffbf94; }
.avatar { background: var(--soft-accent); color: var(--ink); border-radius: 50%; }
.profile { background: transparent; }
.nav-item { color: var(--muted); border-radius: 13px; }
.nav-item:hover, .nav-item.selected { background: var(--soft-accent); color: var(--ink); }
.main { width: min(100%, 1080px); }
.masthead { align-items: center; margin-bottom: 22px; }
.masthead h1 { font-weight: 790; }
.masthead h1:focus { outline: none; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-actions .icon-button { position: relative; }
.header-actions .icon-button, .modal-head .icon-button { background: transparent; color: var(--ink); }
#inbox-button { border-radius: 50%; padding: 0; width: 44px; }
.unread { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 3px; display: grid; place-items: center; background: #a82f57; color: #fff; border: 1px solid var(--paper); border-radius: 12px; font-size: .64rem; font-weight: 750; line-height: 1; }
.account-menu { position: relative; z-index: 4; }
.account-menu summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 8px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu[open] summary, .account-menu summary:hover { background: var(--white); border-color: var(--line); }
.account-avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; overflow: hidden; border: 1px solid var(--accent-outline); border-radius: 50%; background: var(--soft-accent); color: var(--ink); font-size: .76rem; font-weight: 750; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu-name { display: grid; text-align: left; line-height: 1.2; }
.account-menu-name strong { max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.account-menu-name small { font-size: .68rem; margin-top: 2px; }
.account-chevron { display: grid; place-items: center; transform: rotate(90deg); }
.account-chevron svg { width: 15px; height: 15px; }
.account-menu[open] .account-chevron { transform: rotate(-90deg); }
.account-menu-panel { position: absolute; inset: calc(100% + 6px) 0 auto auto; width: 194px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px #230a2426; }
.account-menu-panel button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; width: 100%; border: 0; border-radius: 8px; background: none; font-size: .88rem; font-weight: 650; text-align: left; }
.account-menu-panel button:hover, .account-menu-panel button:focus-visible { background: var(--soft-plum); }
.account-menu-panel .account-logout { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: #a12d56; }
[data-theme="dark"] .account-menu-panel .account-logout { color: #ffa6c0; }
.today-group { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; margin-bottom: 15px; border: 0; background: none; text-align: left; font-size: 1.04rem; }
.today-group .avatar { width: 43px; height: 43px; }
.centered-icon { display: grid; place-items: center; flex-shrink: 0; }
.centered-icon > [data-icon] { display: grid; place-items: center; width: 100%; height: 100%; line-height: 0; }
.centered-icon svg { display: block; }
.today-group strong { overflow-wrap: anywhere; }
.today-group > span:last-child { color: var(--muted); }
.action-card { border-radius: 22px; }
.sleep-card { color: var(--ink); background: linear-gradient(122deg, var(--sleep-bg), var(--soft-plum)); border: 1px solid var(--line); }
.feed-card { color: var(--ink); background: linear-gradient(115deg, var(--white), var(--soft-accent)); border-color: var(--line); }
.action-card p { color: var(--muted); }
.sleep-card .timer { font-size: clamp(2.9rem, 6vw, 4.2rem); }
.sleep-card .action-label { font-size: 1.08rem; }
.orbit { opacity: .46; }
.orbit-ring { border-color: var(--accent-outline); }
.illustration-moon { box-shadow: -17px 12px 0 0 var(--lavender-ink); }
.star { color: var(--lavender-ink); }
.feed-art { background: var(--soft-accent); border-color: var(--line); }
.feed-art svg { color: var(--accent-outline); fill: transparent; }
.primary, .action-button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 13px; }
.primary:hover, .action-button:hover { background: var(--accent-hover); }
.outline, .icon-button { background: var(--white); color: var(--ink); border-color: var(--line); }
.outline:hover, .icon-button:hover { background: var(--soft-plum); }
.text-button { color: var(--ink); }
.overview { margin-top: 0; }
.routine { background: var(--soft-plum); margin: 0 0 13px; padding: 16px 18px; }
.routine h3 { font-size: 1.18rem; }
.sleep-windows { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sleep-window { padding: 4px 11px; background: var(--white); border-radius: 10px; font-size: .85rem; font-weight: 670; }
.metrics { margin-bottom: 13px; }
.metric { background: var(--white); }
.metric-label { color: var(--ink); }
.bar-fill { fill: var(--bar); }
.bar-empty { fill: var(--accent-outline); opacity: .45; }
.lavender { background: var(--sleep-bg); color: var(--lavender-ink); }
.peach, .green, .gold { background: var(--soft-accent); color: var(--ink); }
.milk-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 9px; gap: 3px; text-align: center; }
.milk-chart div { display: grid; grid-template-rows: 20px 104px 20px; place-items: center; }
.milk-chart svg { max-width: 100%; }
.milk-chart span, .milk-chart strong { font-size: .72rem; white-space: nowrap; }
.timeline { background: none; border: 0; overflow: visible; display: grid; gap: 6px; }
.timeline .event { position: relative; padding: 8px 12px 8px 0; background: var(--soft-plum); margin-left: 17px; border: 0; border-radius: 13px; }
.timeline .event > .icon-chip { margin-left: -17px; border-radius: 50%; }
.timeline .edit-extra { flex-shrink: 0; padding: 0 6px; font-size: .76rem; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.edit-extra-total { margin-top: 9px; font-weight: 680; color: var(--ink); }
.timeline .event:not(:last-child)::after { content: ''; position: absolute; left: 0; top: 46px; width: 1px; height: 21px; background: var(--accent-outline); opacity: .55; }
.group-summary { background: var(--soft-plum); padding: 17px; }
.initials { background: var(--soft-plum); font-size: .86rem; font-weight: 700; }
.settings-view { max-width: 660px; }
.settings-card { background: var(--white); border: 1px solid var(--line); border-radius: 17px; padding: 17px; margin-bottom: 14px; }
.settings-card h2 { margin-bottom: 10px; }
.appearance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.account-photo-picker { display: grid; justify-items: center; gap: 8px; margin: 16px 0 22px; }
.account-photo-picker .account-avatar { width: 76px; height: 76px; font-size: 1.4rem; }
.account-photo-picker input[type="file"] { max-width: 100%; font-size: .84rem; }
.account-photo-picker input::file-selector-button { min-height: 38px; padding: 5px 10px; background: var(--soft-plum); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-form label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: 4px; }
.account-fields input { width: 100%; min-height: 44px; padding: 7px 11px; border: 1px solid var(--accent-outline); border-radius: 9px; background: var(--surface-field); color: var(--ink); }
.account-form .settings-note, #group-caregiver-name { margin-top: 9px; }
.account-display { display: grid; gap: 3px; margin: 15px 0; padding: 10px 12px; border-radius: 10px; background: var(--soft-plum); font-size: .85rem; }
.account-display strong { color: var(--ink); overflow-wrap: anywhere; font-size: 1rem; }
.account-form .primary { margin-top: 12px; }
@media (max-width: 460px) {
  .account-fields { grid-template-columns: minmax(0, 1fr); }
  .account-menu-name strong { max-width: 8ch; }
}
@media (max-width: 360px) {
  .account-menu-name { display: none; }
}
.appearance button { border: 0; background: none; border-radius: 9px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 2px; font-weight: 650; font-size: .9rem; }
.appearance button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.switch-row, .modal-body .switch-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 0; margin: 0; min-height: 52px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row strong, .switch-row small { display: block; }
.switch-row small, .settings-note { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.switch-row input { appearance: none; position: relative; width: 46px; height: 26px; margin: 0; border: 0; border-radius: 15px; background: var(--toggle-off); cursor: pointer; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff9f3; box-shadow: 0 1px 3px #270e2940; }
.switch-row input:checked { background: var(--toggle-on); }
.switch-row input:checked::after { left: 23px; background: #ffc19f; }
.settings-note { margin-top: 10px; }
.reminder-link { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; }
.reminder-link strong { flex: 1; }
.reminder-link:hover { background: var(--soft-plum); }
.reminder-back { padding-left: 0; margin-bottom: 9px; }
.reminder-back svg { transform: rotate(180deg); }
.reminder-group { margin-bottom: 14px; }
.reminder-card .switch-row { padding-top: 0; }
.reminder-card .switch-row strong { font-size: 1.26rem; }
.reminder-card > p { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.reminder-card > p svg { width: 18px; height: 18px; vertical-align: middle; }
.reminder-card .outline { margin-top: 9px; }
.reminder-field-label { color: var(--ink); font-size: .86rem; font-weight: 700; margin: 15px 0 5px; }
#reminder-form select { width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--accent-outline); border-radius: 9px; background: var(--surface-field); color: var(--ink); }
.reminder-preview { margin-top: 13px; color: var(--ink); font-weight: 630; }
.reminder-alert-body { text-align: center; }
.reminder-alert-body h2 { margin-top: 5px; }
.reminder-art { width: 132px; height: 100px; display: flex; align-items: center; justify-content: center; margin: 13px auto; border-radius: 40%; background: var(--soft-plum); color: var(--lavender-ink); }
.reminder-art span:first-child { transform: rotate(13deg); }
.reminder-art span:last-child { color: var(--accent-outline); transform: rotate(-13deg) translateY(9px); }
.reminder-art span:first-child svg { width: 60px; height: 60px; }
.reminder-art span:last-child svg { width: 33px; height: 33px; }
#reminder-alert-time { display: block; font-size: clamp(2rem, 10vw, 3rem); font-variant-numeric: tabular-nums; }
#reminder-alert-last { justify-content: center; margin-top: 10px; }
#reminder-dismiss { margin: 5px auto 0; }
dialog { background: var(--white); border-color: var(--line); width: min(430px, calc(100% - 28px)); }
dialog::backdrop { background: #2a102878; }
.modal-body h2 { font-size: 1.85rem; line-height: 1.14; }
.modal-body label { margin-top: 13px; }
.modal-body input:not([type=checkbox]) { background: var(--surface-field); border-color: var(--accent-outline); }
.modal-body input::placeholder { color: var(--muted); opacity: .83; }
.amount-field { display: flex; align-items: center; justify-content: center; background: var(--sleep-bg); border: 1px solid var(--line); border-radius: 15px; margin-bottom: 11px; gap: 8px; padding: 9px 12px; }
.amount-field #amount { border: 0; width: 2.5em; text-align: right; background: transparent; font-size: 2.6rem; font-weight: 780; padding: 0; appearance: textfield; }
.amount-field #amount::-webkit-inner-spin-button { appearance: none; }
.amount-field span { font-size: 2.35rem; font-weight: 760; padding-bottom: 2px; }
.presets button { background: var(--surface-field); color: var(--ink); border-color: var(--line); }
.presets button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.login-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 750; font-size: 1.18rem; }
.login-brand svg { color: var(--accent-outline); width: 26px; height: 26px; }
.auth-art { height: 130px; margin: -5px auto 12px; background: center / contain no-repeat; }
.moon-art { background-image: url("/bedtime-moon.png"); }
.bear-art { background-image: url("/bedtime-bear.png"); }
.invite-field { display: flex; gap: 5px; }
.invite-field input { min-width: 0; }
.access-screen { display: grid; place-items: center; min-height: 100svh; padding: 24px; }
.access-card { width: min(100%, 420px); padding: clamp(22px, 6vw, 32px); border-radius: 24px; background: var(--white); border: 1px solid var(--line); }
.access-card .login-brand { display: flex; justify-content: center; }
.access-card .auth-art { height: 155px; margin: 12px auto; }
.access-card h1 { font-size: clamp(1.85rem, 7vw, 2.35rem); margin-bottom: 9px; }
.access-card .primary { min-height: 49px; }
.access-card .text-button { margin: 8px auto 0; }
.access-choices { display: grid; gap: 12px; margin-top: 22px; }
.group-chooser .access-card { text-align: center; }
.group-chooser .access-card h1 { margin-top: 30px; }
.group-chooser .access-card .text-button { margin-top: 24px; text-decoration: underline; }
.choice-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 78px; width: 100%; padding: 12px; border: 1px solid var(--accent-outline); border-radius: 14px; background: var(--surface-field); text-align: left; }
.choice-card:hover { background: var(--soft-plum); }
.choice-card .icon-chip { width: 43px; height: 43px; }
.choice-card .icon-chip svg { width: 25px; height: 25px; }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 2px; line-height: 1.35; }
.login-entry .access-card {
  width: min(100%, 490px);
  padding: clamp(20px, 6vw, 38px);
  border-radius: clamp(20px, 5vw, 28px);
  background: color-mix(in srgb, var(--white) 77%, var(--paper));
}
.login-entry .login-brand { gap: 9px; font-size: clamp(1.15rem, 4.6vw, 1.45rem); }
.login-entry .login-brand svg { width: 1.25em; height: 1.25em; }
.login-entry .access-card .auth-art { height: clamp(138px, 35vw, 196px); margin: 17px auto 13px; }
.login-entry .access-card h1 { font-size: clamp(1.9rem, 7vw, 2.65rem); line-height: 1.05; margin: 0 0 15px; }
.login-entry .access-status {
  padding: clamp(15px, 4.6vw, 22px) clamp(16px, 5vw, 28px);
  border-radius: 19px;
  background: var(--sleep-bg);
  color: var(--ink);
  font-size: clamp(1.22rem, 5vw, 1.85rem);
  font-weight: 760;
  letter-spacing: -.02em;
  line-height: 1.15;
}
:root:not([data-theme="dark"]) .login-entry .access-status { background: #ebdaf6; }
.login-entry .access-card .primary { margin-top: 18px; min-height: 56px; }
.browser-help { color: var(--muted); }
.browser-help summary { width: fit-content; padding: 12px 0; min-height: 44px; font-size: .82rem; cursor: pointer; }
.browser-help p { font-size: .84rem; }
.access-url { width: 100%; margin-top: 8px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); }
.invite-confirmation { margin: 12px 0; }
.invite-illustration { display: grid; place-items: center; width: 90px; height: 90px; margin: 0 auto 10px; border-radius: 50%; background: var(--sleep-bg); color: var(--lavender-ink); }
.invite-illustration svg { width: 49px; height: 49px; }
.invite-confirmation p { justify-content: center; text-align: center; font-size: .85rem; }
@media (max-width: 480px) {
  .access-screen { padding: 15px; }
  .access-card { padding: 22px; }
}
.google-mark { font-weight: 800; }
.invite-group { display: flex; align-items: center; justify-content: space-between; border-radius: 14px; padding: 13px; background: var(--soft-plum); }
.invite-group p { font-size: .78rem; }
.invite-group strong { overflow-wrap: anywhere; }
.toast { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .form-error { color: #ffc1b9; }
[data-theme="dark"] .notice { color: var(--ink); background: var(--soft-plum); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 187px minmax(0, 1fr); }
  .actions { gap: 10px; }
  .action-card { padding-inline: 15px; }
  .feed-art { opacity: .62; }
}
@media (max-width: 720px) {
  .layout { display: block; }
  .sidebar { background: transparent; justify-content: center; min-height: 57px; padding: 8px 15px 0; }
  .sidebar .brand { font-size: 1.24rem; }
  .sidebar .profile { display: none; }
  .nav-item { min-height: 49px; font-size: .79rem; }
  .nav-item svg { width: 19px; height: 19px; }
  .main { padding-top: 13px; }
  .masthead { gap: 5px; align-items: flex-end; margin-bottom: 15px; }
  .masthead h1 { font-size: clamp(1.9rem, 7.5vw, 2.65rem); }
  .masthead .date { margin-bottom: 5px; }
  .header-actions { gap: 4px; }
  .header-actions .outline { padding-inline: 7px; font-size: .74rem; }
  .today-group { margin-bottom: 12px; font-size: .95rem; }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .action-card { min-height: 0; padding: 15px; }
  .sleep-card .timer { font-size: clamp(2.7rem, 11vw, 4rem); margin: 6px 0 0; }
  .sleep-card .action-label { font-size: .98rem; }
  .sleep-card p { min-height: 0; margin-bottom: 12px; }
  .action-card .action-button { width: 100%; font-size: .97rem; min-height: 46px; }
  .orbit { opacity: .26; transform: scale(.72); }
  .feed-card { padding: 0; border: 0; background: none; overflow: visible; }
  .feed-card :is(.feed-art, .action-label, .latest-feed, p) { display: none; }
  .feed-card .action-button { min-height: 51px; }
  .settings-card, .routine { padding: 13px; }
  .modal-body h2 { font-size: 1.72rem; }
}
@media (max-width: 350px) {
  .masthead { flex-wrap: wrap; }
  .header-actions { margin-left: auto; }
  .header-actions .icon-button { min-width: 44px; }
  .appearance button { font-size: .78rem; }
}

.actions { grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)); }
.actions > .diaper-button { min-height: 112px; flex-direction: column; gap: 7px; }
.diaper-button, .diaper-chip, .diaper-options label:has(:checked) {
  background: #c6dfb6;
  color: #30172a;
}
.diaper-button:hover { background: #b8d7a6; color: #30172a; }
.actions > .diaper-button svg { width: 42px; height: 42px; }
.diaper-types { margin: 15px 0; padding: 0; border: 0; }
.diaper-types legend { margin-bottom: 7px; font-weight: 700; }
.diaper-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.modal-body .diaper-options label {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 59px;
  margin: 0; padding: 8px; background: var(--soft-plum); border: 2px solid transparent;
  border-radius: 13px; color: var(--ink); cursor: pointer;
}
.modal-body .diaper-options label:has(:checked) { background: #c6dfb6; border-color: #618150; color: #30172a; }
.modal-body .diaper-options input[type="radio"] {
  flex: 0 0 15px; width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: #42633b;
}
.diaper-options svg { width: 19px; height: 19px; }
.modal-body #diaper-note {
  width: 100%; resize: vertical; margin: 0 0 12px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; font: inherit; color: var(--ink); background: var(--surface-field);
}
.diaper-note { margin-top: 4px; font-size: .84rem; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 1040px) {
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .sleep-card { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .actions .feed-card .action-button, .actions > .diaper-button { min-height: 91px; flex-direction: column; gap: 5px; }
  .actions .feed-card .action-button svg, .actions > .diaper-button svg { width: 31px; height: 31px; }
}
