:root {
  color-scheme: light;
  --bg: #f8f5fd;
  --surface: #fffefe;
  --field: #faf8fe;
  --ink: #231845;
  --muted: #615570;
  --purple: #64339e;
  --purple-strong: #502185;
  --purple-fill: #7546ae;
  --lavender: #eee5fc;
  --lavender-strong: #e7d9fa;
  --line: #e7def1;
  --sage: #def3e4;
  --sage-ink: #135632;
  --sage-fill: #226a45;
  --peach: #faebdb;
  --peach-ink: #7c431c;
  --blue: #e6e9ff;
  --blue-ink: #374690;
  --rose: #fce8ea;
  --red: #a5313f;
  --shadow: 0 8px 26px #4222750a;
  --radius: 22px;
  --font: system-ui, 'Segoe UI', sans-serif;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #171223;
  --surface: #211931;
  --field: #2a203a;
  --ink: #f6edff;
  --muted: #c5b6d4;
  --purple: #d1b3fa;
  --purple-strong: #e3cbff;
  --purple-fill: #7850a8;
  --lavender: #33244a;
  --lavender-strong: #46305e;
  --line: #443351;
  --sage: #263f34;
  --sage-ink: #c1f1d1;
  --sage-fill: #2d7550;
  --peach: #472f2c;
  --peach-ink: #f3c7a7;
  --blue: #2d3457;
  --blue-ink: #c6cdff;
  --rose: #4c2939;
  --red: #ffb0bb;
  --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--purple); outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.85px; font-weight: 750; }
h2 { font-size: 20px; letter-spacing: -.4px; font-weight: 750; }
h3 { font-size: 15px; }
.icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -90px; left: 16px; padding: 10px; background: var(--surface); z-index: 100; }
.skip-link:focus { top: 12px; }
.loading { min-height: 70vh; display: grid; gap: 16px; place-content: center; text-align: center; }
.loading .brand-mark { margin: auto; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.65; }
.sage { background: var(--sage); color: var(--sage-ink); }
.peach { background: var(--peach); color: var(--peach-ink); }
.blue { background: var(--blue); color: var(--blue-ink); }
.lavender { background: var(--lavender); color: var(--purple-strong); }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.sidebar { width: 224px; position: fixed; inset: 0 auto 0 0; background: var(--surface); border-right: 1px solid var(--line); padding: 26px 16px; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--purple-strong); text-decoration: none; white-space: nowrap; font-size: 24px; font-weight: 800; letter-spacing: -1px; }
.brand-mark { width: 40px; height: 40px; flex: none; display: grid; place-items: center; color: var(--sage-ink); background: var(--sage); border-radius: 15px; }
.brand-mark .icon { width: 27px; height: 27px; stroke-width: 1.55; }
.brand-heart { color: #9b63d8; font-size: .83em; }
.sidebar nav { display: grid; gap: 7px; margin-top: 38px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 13px; border-radius: 14px; color: var(--muted); font-weight: 650; text-align: left; }
.nav-item .icon { width: 21px; height: 21px; }
.nav-item:hover, .nav-item.active { background: var(--lavender); color: var(--purple-strong); }
.nav-item.active[data-view='accueil'] { background: var(--sage); color: var(--sage-ink); }
.local-status { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 11px; }
.local-status .icon { width: 16px; height: 16px; }
.workspace { margin-left: 224px; }
.topbar { min-height: 73px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; padding: 12px max(28px, calc((100% - 1120px)/2)); background: var(--surface); }
.topbar .brand { display: none; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.connection { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.connection i { width: 6px; height: 6px; border-radius: 50%; background: var(--sage-fill); }
.connection.offline i { background: #af772b; }
.icon-button { width: 43px; height: 43px; display: inline-grid; place-items: center; flex: none; background: var(--field); color: var(--purple); border: 1px solid var(--line); border-radius: 14px; }
.icon-button .icon { width: 19px; height: 19px; }
main { width: 100%; max-width: 1190px; margin: auto; padding: 32px 34px 18px; }
.page-footer { max-width: 1190px; margin: auto; padding: 18px 34px 32px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.page-footer .icon { width: 15px; height: 15px; }
.bottom-nav { display: none; }
.page-heading, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-heading { margin-bottom: 20px; }
.section-title { margin-bottom: 10px; }
.section-title > span { color: var(--muted); font-size: 11px; }
.home-grid { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); gap: 22px 26px; align-items: start; }
.home-actions h1 { margin-bottom: 15px; font-size: 24px; }
.start-card { min-height: 184px; border-radius: 25px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 23px 25px; color: var(--sage-ink); background: radial-gradient(ellipse at 88% 0%, var(--surface), transparent 55%), linear-gradient(150deg,var(--sage),#bde9cd); border: 1px solid #7fbd933b; }
[data-theme='dark'] .start-card { background: radial-gradient(ellipse at 90% 0%,#34523d,transparent 55%),var(--sage); }
.start-card > div > .icon { width: 52px; height: 52px; stroke-width: 1.4; margin-bottom: 8px; }
.start-card h2 { font-size: 25px; color: var(--ink); }
.start-card p { margin-top: 4px; color: var(--ink); }
.start-control { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; min-height: 75px; color: #124d30; background: linear-gradient(165deg,#fff,#e6f6e9); border-radius: 999px; box-shadow: 0 6px 13px #22533636; font-size: 28px; font-weight: 850; white-space: nowrap; }
.start-control .icon, .stop-control .icon { fill: currentColor; stroke-width: 1.9; }
.start-control .icon { width: 27px; height: 27px; color: #226f46; }
.start-side { display: flex; align-items: center; gap: 12px; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 8px 0; }
.side-picker { display: flex; gap: 7px; }
.side-picker button { min-width: 66px; min-height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; }
.side-picker button.chosen { color: var(--sage-ink); background: var(--sage); border-color: #79a98d; }
.side-picker small { color: var(--muted); margin-left: 4px; font-weight: 500; }
.quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.quick-actions:has(.sleep-active) .sleep-active { grid-column: 1/-1; }
.quick-action { display: flex; align-items: center; gap: 8px; justify-content: space-between; width: 100%; min-height: 60px; padding: 10px 13px; border-radius: 20px; text-align: left; font-weight: 750; }
.quick-action > .icon { width: 28px; height: 28px; }
.quick-action span { flex: 1; color: var(--ink); }
.quick-action i { display: grid; place-items: center; height: 32px; width: 32px; flex: none; background: var(--surface); border-radius: 50%; }
.quick-action i .icon { height: 17px; width: 17px; }
.section-link { display: flex; align-items: center; width: 100%; justify-content: space-between; gap: 10px; min-height: 40px; margin-bottom: 12px; text-align: left; }
.section-link span { color: var(--muted); font-size: .85em; font-weight: 650; }
.section-link .icon { color: var(--purple); width: 18px; height: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.summary-card { display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; gap: 2px; padding: 15px 5px; min-height: 126px; border-radius: 17px; }
.summary-card > .icon { width: 27px; height: 27px; margin-bottom: 3px; }
.summary-card > strong { color: var(--ink); font-weight: 800; font-size: clamp(17px,2vw,25px); white-space: nowrap; letter-spacing: -.45px; }
.summary-card span { font-size: 12px; font-weight: 750; }
.summary-card small { font-size: 11px; }
.recent-section { grid-column: 1/-1; }
.empty-state { border: 1px dashed var(--line); background: var(--field); padding: 17px; text-align: center; color: var(--muted); border-radius: 17px; }
.empty-state .icon { color: var(--purple); margin-bottom: 5px; }
.empty-state h3 { color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty-state p { font-size: 12px; }
.activity-list { overflow: hidden; }
.recent-section .activity-list { background: var(--lavender); }
.activity-row { display: grid; width: 100%; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { background: var(--field); }
.activity-row > .icon { width: 17px; height: 17px; color: var(--purple); }
.round-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; flex: none; }
.entry-description { min-width: 0; }
.entry-description > strong { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; }
.meal-label { color: var(--purple); font-size: 11px; }
.entry-description > span, .entry-description > small, .entry-time small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.entry-time { text-align: right; font-size: 13px; font-weight: 750; }
.entry-time small { font-size: 10px; font-weight: 500; white-space: nowrap; }

.session-layout { max-width: 730px; margin: 0 auto; display: grid; gap: 16px; }
.session-card, .receipt-card { padding: 23px 28px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.session-heading { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 45px; margin-bottom: 14px; text-align: center; }
.session-heading .icon-button { position: absolute; left: 0; }
.session-heading h1 { font-size: 26px; }
.clock-dial { position: relative; isolation: isolate; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 8px; width: min(100%,320px); aspect-ratio: 1; margin: 0 auto 5px; color: var(--sage-ink); }
.clock-dial::before { content: ''; position: absolute; z-index: -1; inset: 0; border-radius: 50%; background: conic-gradient(from 224deg,#d5ead9 0deg,#bfe1c4 136deg,#78b78a 137deg,#92c59e 272deg,transparent 273deg); mask: radial-gradient(farthest-side,transparent calc(100% - 12px),black calc(100% - 11px)); }
.clock-dial.paused::before { background: conic-gradient(from 224deg,#c6abd9 0deg,#a988ce 272deg,transparent 273deg); }
.clock-dial > .icon { width: 49px; height: 49px; stroke-width: 1.35; }
.meal-pill { background: var(--lavender); color: var(--purple-strong); border-radius: 99px; padding: 4px 15px; font-weight: 750; }
.big-timer { font-size: clamp(39px, 8vw, 58px); line-height: 1.12; font-variant-numeric: tabular-nums; letter-spacing: -1.7px; font-weight: 850; }
.clock-dial p { font-size: 13px; font-weight: 650; }
.current-side { display: flex; align-items: center; gap: 10px; border-radius: 17px; padding: 10px 12px; font-size: 12px; }
.current-side .round-icon { background: var(--surface); }
.current-side strong { display: block; color: var(--ink); font-size: 17px; }
.side-switch { margin-left: auto; padding: 6px 12px; min-height: 44px; border-radius: 99px; background: var(--lavender-strong); font-size: 12px; font-weight: 800; }
.side-switch .icon { width: 17px; height: 17px; margin-right: 2px; }
.session-card > .side-picker { justify-content: center; margin-top: 8px; }
.timer-controls { display: flex; justify-content: center; align-items: stretch; gap: 10px; margin: 15px 0; }
.stop-control { display: grid; place-content: center; gap: 2px; min-width: min(60%,260px); padding: 11px 18px; min-height: 74px; border-radius: 999px; background: linear-gradient(155deg,#c74952,#a92e3b); color: white; box-shadow: 0 6px 14px #a82f3b26; font-weight: 750; }
.stop-control strong { font-size: 25px; line-height: 1.2; }
.stop-control .icon { width: 19px; height: 19px; margin-right: 4px; }
.stop-control span { font-size: 12px; }
.pause-button { min-width: 69px; padding: 8px; border-radius: 17px; background: var(--lavender); color: var(--purple-strong); display: grid; justify-items: center; align-content: center; gap: 4px; font-size: 12px; font-weight: 700; }
.pause-button .icon { width: 18px; height: 18px; }
.session-context { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); background: var(--field); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 17px; }
.session-context > div { display: grid; justify-items: center; gap: 3px; padding: 9px 7px; text-align: center; font-size: 11px; color: var(--muted); }
.session-context > div + div { border-left: 1px solid var(--line); }
.session-context .icon { width: 18px; height: 18px; color: var(--purple); }
.session-context strong { color: var(--ink); overflow-wrap: anywhere; }
.forgotten { color: var(--peach-ink); background: var(--peach); padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; font-size: 12px; }
.sleep-active { padding: 16px; }
.sleep-active h2 .icon { color: var(--purple); }
.sleep-timer { text-align: center; font-size: 34px; font-variant-numeric: tabular-nums; color: var(--purple); margin: 8px 0 12px; font-weight: 750; }
.sleep-active details { margin-bottom: 10px; }

.receipt-check { display: grid; place-items: center; color: white; background: var(--sage-fill); border-radius: 50%; width: 37px; height: 37px; flex: none; }
.receipt-summary { display: flex; gap: 11px; align-items: center; padding: 10px; border-radius: 18px; }
.receipt-summary > div:nth-child(2) { flex: 1; min-width: 0; }
.receipt-summary strong { font-size: 17px; display: block; color: var(--ink); }
.receipt-summary small { display: block; font-size: 12px; }
.receipt-duration { text-align: center; border-radius: 14px; padding: 8px 13px; }
.receipt-sides { margin: 16px 0; }
.receipt-sides h2, .observation-area h2 { font-size: 16px; margin-bottom: 8px; }
.observation-area h2 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.observation-group { padding: 9px 0; border-bottom: 1px solid var(--line); }
.observation-group > div:first-child { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 13px; }
.observation-group > div:first-child .icon { width: 16px; height: 16px; color: var(--purple); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; gap: 4px; align-items: center; justify-content: center; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink); font-size: 12px; line-height: 1.3; }
.chip .icon { width: 14px; height: 14px; }
.chip.selected { background: var(--sage-fill); border-color: transparent; color: white; }
summary { padding: 8px 0; cursor: pointer; color: var(--purple); font-weight: 700; }
.sensor-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notes-link, .privacy-link { display: flex; align-items: center; width: 100%; gap: 10px; padding: 12px 14px; text-align: left; border-radius: 14px; }
.notes-link { background: var(--lavender); color: var(--purple-strong); margin: 12px 0; min-height: 45px; font-weight: 750; }
.notes-link > span, .privacy-link > span { flex: 1; }
.saved-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-actions .secondary-button { width: auto; flex: 1; }
.done-button { width: 100%; background: var(--sage-fill) !important; margin-top: 10px; }

.primary-button, .secondary-button, .text-button, .danger-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border-radius: 13px; padding: 8px 13px; font-size: 13px; font-weight: 750; }
.primary-button { background: var(--purple-fill); color: white; }
.primary-button.danger { background: #a92e3b; }
.secondary-button { background: var(--lavender); color: var(--purple-strong); width: 100%; }
.text-button { color: var(--purple); padding: 4px 2px; }
.text-button:hover, .danger-link { text-decoration: underline; }
.danger-link { color: var(--red); }
.primary-button .icon, .secondary-button .icon, .text-button .icon { width: 17px; height: 17px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; color: var(--ink); font-size: 13px; font-weight: 650; min-width: 0; }
.field :is(input,select,textarea), .date-select input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); padding: 9px 11px; font-size: 14px; font-weight: 500; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field-pair, .field-triple { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.field-triple { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field-title { font-weight: 750; margin: 10px 0 7px; }
.filter-bar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; padding: 15px; margin-bottom: 16px; }
.filter-bar .field { margin: 0; }
.date-step { display: flex; gap: 5px; align-items: end; }
.date-step .icon-button { background: var(--lavender); }
.journal-group { margin: 12px 0 20px; }
.journal-group h2 { text-transform: capitalize; font-size: 17px; }
.timeline-card { padding: 16px; margin-bottom: 16px; }
.timeline-labels { display: flex; justify-content: space-between; margin: 10px 0 5px 69px; color: var(--muted); font-size: 10px; }
.timeline-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.timeline-row > span { width: 61px; font-size: 11px; }
.timeline-track { flex: 1; position: relative; height: 21px; border-radius: 7px; background: repeating-linear-gradient(to right,var(--field),var(--field) calc(25% - 1px),var(--line) calc(25% - 1px),var(--line) 25%); }
.timeline-event { position: absolute; top: 3px; height: 15px; min-width: 4px; border-radius: 5px; }
.timeline-event.nursing { background: #70b190; }
.timeline-event.sleep { background: #a986d6; }
.timeline-event.bottle { background: #dca783; }

.stats-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.segmented { display: inline-flex; gap: 3px; align-items: center; padding: 3px; background: var(--field); border: 1px solid var(--line); border-radius: 13px; }
.segmented button { border-radius: 10px; min-height: 40px; padding: 6px 14px; font-size: 13px; color: var(--purple-strong); font-weight: 700; }
.segmented button.selected { background: linear-gradient(155deg,#8b58c8,var(--purple-fill)); color: white; box-shadow: 0 2px 4px #49227729; }
.date-select { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.date-select input { width: auto; }
.period-label { margin: 10px 0 15px; color: var(--muted); font-size: 12px; }
.stats-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 15px; margin: 16px 0; }
.chart-card, .insights, .cross-card, .distribution { padding: 18px; }
.chart-tabs { margin: 0 0 12px; }
.bar-chart { display: flex; align-items: stretch; gap: 8px; height: 155px; margin: 9px 0 8px; overflow: auto; padding: 4px 1px; }
.bar-column { flex: 1; min-width: 20px; display: flex; align-items: center; flex-direction: column; gap: 4px; color: var(--muted); font-size: 10px; }
.bar-column > small { white-space: nowrap; font-size: 10px; }
.bar-track { flex: 1; width: min(72%,36px); border-radius: 8px; background: var(--field); display: flex; flex-direction: column-reverse; overflow: hidden; }
.bar { width: 100%; background: linear-gradient(#b38fe5,#8555bb); }
.feed-bar { background: #ecb58f; }
.bottle-bar { background: #83aadf; }
.chart-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.chart-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #ecb58f; }
.chart-legend span + span::before { background: #83aadf; }
.insights dl { margin: 10px 0; }
.insights dl > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.insights dt { font-size: 13px; }
.insights dt small { color: var(--muted); display: block; }
.insights dd { margin: 0; text-align: right; font-weight: 750; }
.cross-card { margin-bottom: 16px; }
.cross-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.table-scroll { overflow: auto; margin: 10px 0 14px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--lavender); color: var(--purple-strong); }
.analysis-note { display: flex; gap: 9px; border-radius: 13px; padding: 12px; background: var(--lavender); color: var(--purple-strong); margin-bottom: 10px; }
.analysis-note .icon { width: 19px; height: 19px; }
.analysis-note p { margin-top: 3px; font-size: 12px; }
.distribution-body { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.donut { flex: none; width: 115px; height: 115px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--slices)); }
.donut strong { display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: var(--surface); font-size: 13px; }
.distribution ul { list-style: none; padding: 0; margin: 0; min-width: 150px; flex: 1; }
.distribution li { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 3px 0; }
.distribution li span { flex: 1; overflow-wrap: anywhere; }
.distribution li i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }

.settings-tabs { margin-bottom: 15px; }
.settings-tabs .icon { width: 16px; height: 16px; margin-right: 5px; }
.settings-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.settings-layout.routines { display: grid; grid-template-columns: minmax(0,680px); }
.settings-card { padding: 17px; }
.settings-card h2 { margin-bottom: 10px; }
.settings-card h2 .icon { color: var(--purple); }
.settings-card .section-title h2 { margin-bottom: 0; }
.settings-card > p { color: var(--muted); margin: 7px 0; font-size: 13px; }
.settings-card .privacy-divider { border-top: 1px solid var(--line); margin-top: 10px; }
.status-line { color: var(--sage-ink); margin-top: 10px; font-size: 12px; }
.status-line .icon { width: 15px; height: 15px; }
.toggle-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row > span:first-child { flex: 1; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { color: var(--muted); font-size: 12px; }
.toggle-row input { position: absolute; right: 0; width: 44px; height: 44px; opacity: 0; }
.switch { flex: none; position: relative; width: 40px; height: 23px; background: var(--line); border-radius: 20px; pointer-events: none; }
.switch::before { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: white; }
input:checked + .switch { background: var(--sage-fill); }
input:checked + .switch::before { transform: translateX(17px); }
input:focus-visible + .switch { outline: 3px solid var(--purple); outline-offset: 3px; }
.inline-field { flex-direction: row; align-items: center; justify-content: space-between; margin: 7px 0; }
.inline-field input { max-width: 85px; }
.settings-card > .field-pair { margin-top: 9px; }
.editable-list { list-style: none; padding: 0; margin: 0; }
.editable-list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); gap: 4px; }
.editable-list li span { flex: 1; overflow-wrap: anywhere; }
.editable-list .icon, .editable-chips .icon { width: 15px; height: 15px; }
.editable-list button, .editable-chip button { color: var(--purple); width: 34px; min-height: 39px; }
.editable-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.editable-chip { display: inline-flex; max-width: 100%; align-items: center; background: var(--lavender); padding-left: 8px; border-radius: 13px; font-size: 12px; overflow-wrap: anywhere; }
.export-buttons { display: grid; gap: 7px; }
.privacy-link small { display: block; font-size: 12px; }
.badge { color: var(--purple-strong) !important; background: var(--lavender); border-radius: 99px; padding: 4px 8px; font-size: 11px; }

.demo-banner, .error-banner, .active-banner { border-radius: 14px; padding: 9px 12px; margin: 0 0 15px; font-size: 13px; }
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; background: var(--lavender); color: var(--purple-strong); }
.demo-banner button { min-height: 33px; font-weight: 750; }
.demo-banner .icon { width: 16px; height: 16px; }
.error-banner { background: var(--rose); color: var(--red); }
.active-banner { display: flex; align-items: center; justify-content: space-between; gap: 9px; background: var(--sage); color: var(--sage-ink); min-height: 44px; width: 100%; font-weight: 750; }
.toast { position: fixed; left: calc(50% + 112px); bottom: 18px; transform: translateX(-50%); z-index: 1000; color: var(--surface); background: var(--ink); border-radius: 13px; padding: 11px 14px; pointer-events: none; opacity: 0; width: max-content; max-width: min(90vw,480px); font-size: 13px; box-shadow: 0 8px 23px #23184536; }
.toast.visible { opacity: 1; }
dialog { width: min(540px,calc(100% - 26px)); max-height: 90dvh; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 19px 23px; overflow: auto; }
dialog::backdrop { background: #25193f7a; backdrop-filter: blur(3px); }
.dialog-top { margin-bottom: 6px; }
dialog h2 { font-size: 23px; margin-bottom: 9px; }
dialog > p { margin-bottom: 10px; }
dialog form { margin-top: 12px; }
.form-kind, .sleep-duration, .volume-result { display: flex; align-items: center; gap: 8px; border-radius: 13px; padding: 9px 11px; font-weight: 750; margin-bottom: 11px; }
.form-kind .icon { width: 19px; height: 19px; }
.sleep-duration, .volume-result { justify-content: space-between; }
.volume-result { background: var(--peach); color: var(--peach-ink); }
.volume-result strong { font-size: 20px; }
.quick-volumes { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.quick-volumes button { background: var(--field); border: 1px solid var(--line); min-height: 36px; padding: 5px 8px; border-radius: 99px; font-size: 12px; }
.form-error { color: var(--red); margin: 8px 0; }
.form-error:empty { display: none; }
.form-notes { margin-top: 10px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.dialog-actions .primary-button { flex: 1; }
.manual-choices { display: grid; gap: 8px; }
.manual-choices button { justify-content: flex-start; }
.manual-choices button .icon:last-child { margin-left: auto; }

@media (min-width: 901px) {
  .daily-overview .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .daily-overview .summary-card { min-height: 121px; }
  .session-card, .receipt-card { padding-inline: 64px; }
}
@media (max-width: 900px) {
  .sidebar { width: 74px; padding: 17px 9px; align-items: center; }
  .sidebar .brand { font-size: 0; gap: 0; }
  .sidebar .brand-heart, .sidebar .nav-item span { display: none; }
  .sidebar .nav-item { justify-content: center; }
  .local-status { font-size: 0; }
  .workspace { margin-left: 74px; }
  .toast { left: calc(50% + 37px); }
  main { padding: 24px 20px 16px; }
  .home-grid { grid-template-columns: minmax(0,1fr); gap: 15px; }
}
@media (max-width: 650px) {
  body { background: var(--bg); }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 62px; justify-content: space-between; padding: max(8px,env(safe-area-inset-top)) 15px 8px; border-bottom: 0; background: transparent; }
  .topbar .brand { display: inline-flex; }
  .brand { font-size: 24px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 13px; }
  .brand-mark .icon { width: 24px; height: 24px; }
  .top-actions { gap: 6px; }
  .top-actions .connection { font-size: 0; gap: 0; }
  .top-actions .connection i { width: 7px; height: 7px; }
  .top-actions .icon-button { width: 37px; height: 37px; }
  main { padding: 10px 15px 15px; }
  .page-footer { padding: 10px 15px calc(86px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .bottom-nav .nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 0; font-size: 10px; text-align: center; min-height: 52px; }
  .bottom-nav .icon { width: 20px; height: 20px; }
  .home-actions h1 { font-size: 22px; margin: 3px 0 12px; }
  .start-card { min-height: 153px; padding: 15px; gap: 8px; border-radius: 21px; }
  .start-card > div > .icon { width: 39px; height: 39px; margin-bottom: 4px; }
  .start-card h2 { font-size: 21px; }
  .start-card p { font-size: 12px; }
  .start-control { min-height: 61px; font-size: 23px; gap: 7px; padding: 7px 13px; }
  .start-control .icon { width: 21px; height: 21px; }
  .start-side { gap: 7px; font-size: 11px; padding: 6px 0; }
  .side-picker button { min-height: 37px; min-width: 57px; padding-inline: 8px; }
  .quick-action { min-height: 52px; border-radius: 17px; padding: 6px 9px; gap: 5px; font-size: 13px; }
  .quick-action > .icon { width: 23px; height: 23px; }
  .quick-action i { width: 27px; height: 27px; }
  .section-link { margin-bottom: 5px; min-height: 34px; }
  h2 { font-size: 18px; }
  .summary-grid { gap: 6px; }
  .summary-card { padding: 7px 2px; min-height: 101px; border-radius: 14px; }
  .summary-card > .icon { width: 23px; height: 23px; }
  .summary-card > strong { font-size: 18px; }
  .summary-card span { font-size: 10px; }
  .summary-card small { font-size: 10px; }
  .recent-section .section-title { margin-bottom: 3px; }
  .activity-row { padding: 11px; gap: 7px; }
  .activity-row .round-icon { width: 34px; height: 34px; }
  .entry-description > span,.entry-description > small { font-size: 11px; }
  .page-heading { margin-bottom: 12px; }
  .session-card,.receipt-card { padding: 11px 13px 15px; border-radius: 19px; }
  .session-heading { margin-bottom: 9px; gap: 6px; }
  .session-heading h1 { font-size: 22px; }
  .session-heading .icon-button { width: 35px; height: 35px; }
  .clock-dial { width: min(100%,276px); gap: 6px; }
  .clock-dial > .icon { width: 39px; height: 39px; }
  .big-timer { font-size: clamp(37px,12vw,50px); }
  .timer-controls { margin: 11px 0; }
  .session-context { margin-bottom: 12px; }
  .receipt-summary strong { font-size: 15px; }
  .receipt-check { width: 31px; height: 31px; }
  .filter-bar { padding: 10px; gap: 8px; }
  .date-step { flex: 1; }
  .date-step .field { flex: 1; }
  .stats-layout, .settings-layout { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .chart-card, .insights, .cross-card, .distribution, .settings-card { padding: 13px; border-radius: 16px; }
  .date-select { margin-left: auto; }
  .settings-tabs { display: flex; }
  .settings-tabs button { flex: 1; padding: 4px 5px; font-size: 11px; }
  .settings-tabs .icon { width: 14px; height: 14px; margin-right: 3px; }
  .toast { left: 50%; bottom: calc(69px + env(safe-area-inset-bottom)); }
  dialog { width: calc(100% - 18px); max-height: 93dvh; padding: 13px; }
  .field :is(input,select,textarea), .date-select input { font-size: 16px; }
  .field input[type='datetime-local'] { font-size: 13px; padding: 7px 4px; }
  .field-triple input { padding: 6px; }
}
@media (max-width: 365px) {
  .home-actions h1 { font-size: 20px; }
  .start-card h2 { font-size: 19px; }
  .start-control { font-size: 19px; }
  .start-control .icon { width: 17px; height: 17px; }
  .brand { font-size: 22px; }
  .summary-card > strong { font-size: 16px; }
  .quick-action { font-size: 12px; }
  .quick-action > .icon { width: 19px; height: 19px; }
  .cross-controls { grid-template-columns: 1fr; }
}
