:root {
  color-scheme: light dark;
  --bg: #f6f7f5;
  --paper: #ffffff;
  --surface: #edf0ec;
  --ink: #252e28;
  --muted: #647067;
  --line: #dce2dc;
  --green: #45634b;
  --on-green: #ffffff;
  --active: #e2ebdf;
  --warning-bg: #fff2de;
  --warning-ink: #755217;
  --danger: #a63c38;
  --heat-0: #edf0ec;
  --heat-1: #c9dfbe;
  --heat-2: #91bc7b;
  --heat-3: #5a914b;
  --heat-4: #326239;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171b19;
    --paper: #202622;
    --surface: #282f2a;
    --ink: #e6ece5;
    --muted: #acb8ae;
    --line: #39423b;
    --green: #accda8;
    --on-green: #1b301f;
    --active: #354736;
    --warning-bg: #392e1d;
    --warning-ink: #edcb8f;
    --danger: #f1a5a0;
    --heat-0: #282f2a;
    --heat-1: #304a36;
    --heat-2: #47754a;
    --heat-3: #73a960;
    --heat-4: #b1d890;
  }
}
* { box-sizing: border-box; }
body, p, h1, h2, h3 { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; cursor: pointer; touch-action: manipulation; min-height: 44px; }
button:disabled { opacity: .4; cursor: default; }
button:hover:not(:disabled) { color: var(--green); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }
.icon { width: 20px; height: 20px; vertical-align: middle; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px; background: var(--green); color: var(--on-green); }
.skip-link:focus { top: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 650; letter-spacing: -.8px; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 30px; height: 30px; padding: 7px; border-radius: 8px; background: var(--green); }
.brand-mark i { background: var(--on-green); border-radius: 1px; }
.app-shell { min-height: 100vh; }
html { scrollbar-gutter: stable; }
body:has(dialog[open]) { overflow: hidden; }
.app-tools { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0 16px; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); background: var(--paper); color: var(--muted); font-size: 12px; }
.app-tools:has(> :not([hidden])) { border-bottom: 1px solid var(--line); }
.app-tools p { line-height: 1.6; padding-block: 8px; }
#connection-status { margin-right: auto; color: var(--warning-ink); }
#install-help { flex-basis: 100%; }
.update-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; }
.login-screen { padding-top: max(24px, env(safe-area-inset-top)); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 208px; padding: 30px 20px; border-right: 1px solid var(--line); }
.desktop-nav { display: grid; gap: 8px; margin-top: 40px; }
.nav-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 9px; color: var(--muted); font-size: 14px; text-align: left; }
.nav-button.active { background: var(--active); color: var(--green); font-weight: 600; }
.nav-button:hover { background: var(--surface); }
.main-shell { margin-left: 208px; }
.topbar { display: flex; align-items: center; gap: 20px; min-height: 48px; padding: 4px 36px; border-bottom: 1px solid var(--line); }
.topbar strong { font-size: 14px; font-weight: 500; color: var(--muted); }
.header-title { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; }
.app-version { font-size: 10px; font-weight: 400; color: var(--muted); opacity: .75; white-space: nowrap; }
.text-button { font-size: 13px; color: var(--muted); }
.mobile-brand, .mobile-nav { display: none; }
#main { max-width: 1200px; margin: auto; padding: 16px 36px 60px; }
.page-heading { margin-bottom: 24px; }
h1 { font-size: 30px; letter-spacing: -.7px; font-weight: 650; line-height: 1.3; }
.page-description { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.date-toolbar, .date-selector { display: flex; align-items: center; gap: 6px; }
.date-toolbar { flex-wrap: wrap; margin-bottom: 8px; }
.date-selector { position: relative; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 8px; color: var(--muted); flex-shrink: 0; }
.icon-button:hover { background: var(--surface); }
.selected-date { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 14px; }
.selected-date small { padding: 3px 6px; background: var(--active); color: var(--green); border-radius: 4px; font-size: 11px; }
.date-picker-input { position: absolute; left: 44px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.today-link { margin-left: auto; color: var(--green); font-size: 13px; padding: 0 6px; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0; margin-bottom: 16px; border-block: 1px solid var(--line); }
.summary-item { display: flex; align-items: center; gap: 8px; }
.summary-item > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.summary-icon { color: var(--muted); }
.summary-label { font-size: 12px; color: var(--muted); }
.summary-value { font-size: 14px; font-weight: 600; line-height: 1.5; }
.content-grid { display: grid; grid-template-columns: minmax(270px, .85fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.cards-panel, .timeline-panel { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-heading h2, .insight-card h2 { font-size: 17px; font-weight: 600; }
.subtle-button { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 12px; padding: 0 4px; }
.subtle-button .icon { width: 16px; height: 16px; }
.view-intro { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.quick-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; align-content: center; text-align: left; padding: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.quick-card:hover { border-color: var(--green); background: var(--surface); }
.quick-card:active { transform: scale(.97); background: var(--active); border-color: var(--green); }
.quick-card { transition: transform 90ms ease, background-color 90ms ease; }
.activity-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--tile, var(--surface)); color: var(--accent, var(--green)); }
.emoji-icon { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-size: 23px; line-height: 1; overflow: hidden; max-width: 100%; }
.sage { --tile: #e4ecdf; --accent: #4d6841; }
.amber { --tile: #f5ead2; --accent: #876625; }
.rose { --tile: #f4e2de; --accent: #945d4b; }
.blue { --tile: #e0ebf1; --accent: #456c81; }
.lavender { --tile: #ebe3f1; --accent: #75578e; }
@media (prefers-color-scheme: dark) {
  .sage { --tile: #354631; --accent: #b8d3a6; }
  .amber { --tile: #4a3e26; --accent: #e7c47f; }
  .rose { --tile: #4c3430; --accent: #e1aea0; }
  .blue { --tile: #2c404a; --accent: #a0c7df; }
  .lavender { --tile: #41344c; --accent: #cbb0df; }
}
.quick-card .activity-icon { grid-row: span 2; align-self: center; width: 30px; height: 30px; border-radius: 8px; }
.quick-card .emoji-icon, .library-card .emoji-icon { font-size: 20px; }
.quick-name { font-size: 14px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.quick-duration { color: var(--muted); font-size: 12px; line-height: 1.5; }
.new-card { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 10px; border: 1px dashed var(--line); border-radius: 9px; color: var(--green); font-size: 13px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: start; }
.timeline-item { content-visibility: auto; contain-intrinsic-size: auto 104px; }
.timeline-time { padding-top: 19px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-card { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 14px 10px 14px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.entry-body { flex: 1; min-width: 0; }
.entry-title { font-size: 14px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.entry-meta { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 4px; }
.entry-note { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-edit { display: grid; place-items: center; width: 36px; padding: 0; flex-shrink: 0; color: var(--muted); }
.entry-edit .icon { width: 17px; height: 17px; }
.empty-state { display: grid; justify-items: center; gap: 12px; padding: 48px 20px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.empty-state > .icon { color: var(--muted); width: 28px; height: 28px; }
.empty-state h3 { font-size: 15px; font-weight: 500; }
.empty-state p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.library-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; min-width: 0; }
.library-card .activity-icon { grid-row: span 2; align-self: center; width: 30px; height: 30px; border-radius: 8px; }
.library-card h3 { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.library-card > p { font-size: 12px; line-height: 1.5; color: var(--muted); }
.library-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.library-actions button { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--green); padding: 0 4px; }
.library-actions .icon { width: 15px; height: 15px; }
.library-add { display: flex; min-height: 122px; align-items: center; justify-content: center; gap: 8px; border-style: dashed; background: none; color: var(--green); }
.heatmap-heading, .heatmap-year { display: flex; align-items: center; gap: 4px; }
.heatmap-heading { justify-content: space-between; margin-bottom: 4px; }
.heatmap-year { font-size: 13px; color: var(--muted); }
.review-week, .review-day { margin-top: 20px; }
.review-day > .section-heading h2 { font-size: 15px; }
.review-period { display: flex; align-items: center; gap: 4px; margin: 8px 0; }
.review-period h2 { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; text-align: center; }
.review-period > .subtle-button { margin-left: auto; flex-shrink: 0; }
.review-summary { font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.review-summary > span { color: var(--muted); padding-inline: 4px; }
.review-help { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.heatmap-scroll { position: relative; overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: thin; }
.heatmap-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.heatmap-grid { display: grid; grid-template-columns: 24px repeat(var(--weeks), minmax(10px, 1fr)); grid-template-rows: 20px repeat(7, 12px); gap: 3px; min-width: 720px; }
.heatmap-month, .heatmap-weekday { font-size: 10px; color: var(--muted); line-height: 12px; }
.heatmap-month { align-self: start; white-space: nowrap; }
.heatmap-day { min-height: 0; padding: 0; border: 1px solid #0001; border-radius: 2px; }
.heatmap-day.duration-unknown { border: 1px dashed var(--green); }
.heatmap-day:hover:not(:disabled), .heatmap-day[aria-pressed=true] { outline: 2px solid var(--green); outline-offset: 1px; }
.heatmap-day:disabled { opacity: .3; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.heatmap-swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid #0001; border-radius: 2px; }
.heat-0 { background: var(--heat-0); }
.heat-1 { background: var(--heat-1); }
.heat-2 { background: var(--heat-2); }
.heat-3 { background: var(--heat-3); }
.heat-4 { background: var(--heat-4); }
.week-summary { display: flex; align-items: center; gap: 8px; }
.week-summary .review-summary { flex: 1; margin-bottom: 0; }
.week-summary > button { flex-shrink: 0; }
.week-range-label { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.week-table { --slot-height: clamp(12px, calc(420px / var(--visible-rows, 48)), 28px); width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px 1px; font-size: 12px; }
.week-time-column { width: 38px; }
.week-table th, .week-table td { padding: 0; text-align: center; font-weight: 400; vertical-align: middle; }
.week-table th:first-child { text-align: left; padding-right: 6px; }
.week-table thead th { color: var(--muted); font-size: 11px; }
.week-table tbody th { vertical-align: top; font-size: 9px; color: var(--muted); line-height: var(--slot-height); }
.week-table tbody tr { height: var(--slot-height); }
.week-table tfoot th { padding-top: 3px; font-size: 9px; color: var(--muted); }
.week-date { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 100%; padding: 4px 0; font-size: 11px; }
.week-date strong { font-size: 12px; }
.week-date.is-today { color: var(--green); background: var(--active); border-radius: 6px; }
.week-date[aria-pressed=true] { box-shadow: inset 0 -2px var(--green); }
.week-slot { position: relative; display: flex; align-items: center; width: 100%; height: calc(var(--slot-height) * var(--span, 1) + (var(--span, 1) - 1) * 1px); min-height: 0; padding: 0 2px; border-radius: 2px; background: var(--surface); font-size: 9px; line-height: 1.2; color: var(--muted); text-align: left; overflow: hidden; }
.week-slot.has-records { background: var(--tile); color: var(--accent); }
.slot-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-slot.is-merged .slot-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; }
.slot-point { position: absolute; top: 0; right: 2px; font-size: 10px; line-height: var(--slot-height); }
.week-slot:disabled { opacity: .25; }
.week-slot.unavailable { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 2px, var(--line) 2px, var(--line) 3px); }
.distribution-card { margin-top: 24px; }
.distribution-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: center; }
.distribution-donut { width: 180px; max-width: 100%; justify-self: center; }
.distribution-base, .distribution-slice { fill: none; stroke-width: 14; }
.distribution-base { stroke: var(--surface); }
.distribution-slice { stroke: var(--accent); }
.donut-label, .donut-total { text-anchor: middle; fill: var(--muted); font-size: 8px; }
.donut-total { fill: var(--ink); font-size: 10px; font-weight: 600; }
.distribution-bars { min-width: 0; }
.distribution-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 5px 8px; align-items: center; margin-bottom: 14px; }
.distribution-row:last-child { margin-bottom: 0; }
.distribution-row .activity-icon { width: 26px; height: 26px; border-radius: 7px; grid-row: span 2; }
.distribution-row .icon { width: 16px; height: 16px; }
.distribution-row .emoji-icon { font-size: 17px; }
.distribution-name { font-size: 12px; overflow-wrap: anywhere; }
.distribution-value { font-size: 11px; color: var(--muted); text-align: right; }
.distribution-track { grid-column: 2 / -1; height: 7px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.distribution-fill { height: 100%; width: var(--width); background: var(--accent); border-radius: 4px; }
.review-timeline { margin-top: 24px; }
.review-timeline > h2 { font-size: 17px; margin-bottom: 12px; }
.insight-card { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.insight-card .view-intro { margin-top: 8px; }
.stat-row { display: grid; grid-template-columns: 38px minmax(60px, 1fr) minmax(20px, 1.5fr) minmax(80px, 1fr); gap: 12px; align-items: center; margin-top: 22px; }
.stat-name { font-size: 13px; overflow-wrap: anywhere; }
.stat-track { height: 7px; background: var(--surface); border-radius: 5px; overflow: hidden; }
.stat-fill { height: 100%; width: var(--width); background: var(--accent); border-radius: 5px; }
.stat-value { font-size: 12px; text-align: right; }
.count-note { color: var(--muted); margin-top: 4px; }
.insight-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 28px; }
.insight-empty { color: var(--muted); padding: 40px 0; font-size: 14px; }
.export-button { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; margin-top: 16px; }
.account-strip { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 44px; }
.account-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-copy > .icon { width: 17px; height: 17px; color: var(--green); }
.account-copy strong { display: block; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.account-copy > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.account-copy p { color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.account-actions button { padding: 6px 10px; font-size: 12px; color: var(--green); }
.account-strip[data-status=error] { background: var(--warning-bg); }
.account-strip[data-status=error] .account-copy p { color: var(--warning-ink); }
dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); overscroll-behavior: contain; overflow-y: auto; scroll-padding-block: 20px; }
dialog::backdrop { background: #0008; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sheet-header h2 { font-size: 22px; font-weight: 600; }
.form-field { margin-bottom: 20px; min-width: 0; }
.form-field label, .field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 550; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.7; font-weight: 400; }
p.field-help { margin-top: 8px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 16px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); opacity: 1; }
.form-field textarea { resize: vertical; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duration-options, .icon-options, .color-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.duration-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.duration-chip.active, .icon-option.active { background: var(--active); border-color: var(--green); color: var(--green); }
.icon-option { display: grid; place-items: center; width: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.color-option { width: 44px; border-radius: 50%; background: var(--tile); border: 2px solid transparent; }
.color-option.active { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--paper); }
.entry-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.entry-preview strong { font-size: 15px; }
.entry-preview p { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 4px; }
.form-error, .storage-warning, .login-status { color: var(--warning-ink); background: var(--warning-bg); font-size: 13px; line-height: 1.7; padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.sheet-actions { display: flex; gap: 12px; margin-top: 24px; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; background: var(--green); color: var(--on-green); border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 550; }
.primary-button:hover:not(:disabled) { color: var(--on-green); opacity: .9; }
.delete-button { width: 44px; color: var(--danger); }
.toast { position: fixed; bottom: 24px; left: calc(50% + 104px); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 16px; width: max-content; max-width: min(640px, calc(100vw - 32px)); padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 4px 24px #0002; font-size: 13px; }
.toast-message, .toast-actions { display: flex; align-items: center; gap: 10px; }
.toast-message { min-width: 0; overflow-wrap: anywhere; line-height: 1.6; }
.toast-message > .icon { color: var(--green); width: 17px; height: 17px; }
.toast-actions { flex-shrink: 0; }
.toast-actions button { font-size: 12px; padding: 0 2px; color: var(--green); }
.toast-close { display: grid; place-items: center; width: 32px; }
.toast-close .icon { width: 16px; height: 16px; }
.login-screen { min-height: 100dvh; padding: 30px 36px; display: flex; flex-direction: column; }
.login-header { margin-bottom: 32px; }
.login-panel { width: min(100%, 400px); margin: auto; padding-block: 30px 60px; }
.login-panel h1 { font-size: 36px; }
.login-description { font-size: 16px; color: var(--muted); line-height: 1.8; margin-top: 16px; }
.google-sign-in { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px; margin-top: 32px; border: 1px solid var(--line); background: var(--paper); border-radius: 9px; font-size: 14px; font-weight: 550; }
.google-sign-in svg { width: 20px; height: 20px; }
.login-sync-note { font-size: 12px; color: var(--muted); line-height: 1.8; margin-top: 12px; }
.login-status { margin-top: 16px; }
.login-footer { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 16px; }
.login-footer button { font-size: 14px; color: var(--green); padding: 0; }
.login-footer p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.noscript { padding: 24px; }
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; gap: 28px; }
  .summary-icon { display: none; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { padding: max(4px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 4px max(20px, env(safe-area-inset-left)); flex-wrap: wrap; gap: 0 12px; }
  .mobile-brand { display: flex; font-size: 18px; }
  #breadcrumb { display: none; }
  #main { padding: 12px max(20px, env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  h1 { font-size: 28px; }
  .page-heading { margin-bottom: 18px; }
  .page-description { font-size: 13px; }
  .account-strip { flex: 1 1 200px; gap: 8px; }
  .account-actions { max-width: 130px; justify-content: flex-end; gap: 4px; }
  .account-actions button { padding: 4px; }
  .selected-date { font-size: 13px; gap: 6px; }
  .date-selector { gap: 0; }
  .selected-date > .icon { display: none; }
  .summary-label { font-size: 11px; line-height: 1.5; }
  .section-heading h2 { font-size: 16px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 20; display: flex; justify-content: space-around; padding: 6px 12px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
  .mobile-nav .nav-button { flex-direction: column; gap: 5px; width: 30%; padding: 8px; font-size: 11px; text-align: center; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; font-size: 12px; gap: 8px; padding: 6px 10px; }
  .toast-message { gap: 6px; }
  .toast-actions { gap: 8px; }
  dialog { max-height: calc(100dvh - 24px); width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; padding: 20px 20px max(24px, env(safe-area-inset-bottom)); }
  .insight-card { padding: 18px; }
  .week-card { padding: 12px; }
  .week-date { font-size: 10px; }
  .week-table { --slot-height: clamp(10px, calc(340px / var(--visible-rows, 48)), 24px); }
  .week-slot { font-size: 8px; }
  .distribution-layout { grid-template-columns: 1fr; gap: 20px; }
  .stat-row { grid-template-columns: 32px minmax(50px, 1fr) minmax(20px, .8fr) minmax(76px, 1fr); gap: 8px; }
  .stat-row .activity-icon { width: 32px; height: 32px; }
  .stat-name, .stat-value { font-size: 12px; }
  .login-screen { padding: 24px; }
  .login-panel h1 { font-size: 32px; }
  .entry-edit { min-width: 44px; }
}
@media (max-width: 365px) {
  #main { padding-inline: 14px; }
  .topbar { padding-inline: 14px; }
  .selected-date small { display: none; }
  .timeline-item { grid-template-columns: 36px minmax(0, 1fr); gap: 7px; }
  .entry-card { padding: 12px 6px 12px 10px; gap: 7px; }
  .entry-card > .activity-icon { width: 30px; height: 30px; }
  .entry-edit { width: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
