:root {
  color-scheme: light;
  --bg: #f5f2eb;
  --surface: #fffdf8;
  --surface-2: #f0eee7;
  --text: #252822;
  --muted: #777a70;
  --line: #e5e1d7;
  --accent: #567447;
  --accent-dark: #3f5d33;
  --accent-soft: #e4ebdd;
  --orange: #c7804c;
  --blue: #57798c;
  --rose: #a46567;
  --shadow: 0 18px 55px rgba(65, 60, 48, 0.08);
  --sidebar-width: 268px;
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); padding: 30px 20px 20px;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--accent); font: 700 22px serif; box-shadow: 0 10px 24px rgba(86,116,71,.25); }
.brand strong { display: block; font-size: 20px; letter-spacing: .08em; }
.brand span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.sidebar-close { display: none !important; margin-left: auto; }
.nav-list { display: grid; gap: 7px; }
.nav-item { width: 100%; min-height: 50px; padding: 0 14px; display: flex; align-items: center; gap: 13px; border: 0; border-radius: 14px; background: transparent; color: #66695f; text-align: left; cursor: pointer; transition: .2s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav-item.active { color: #fff; background: var(--accent); box-shadow: 0 10px 22px rgba(86,116,71,.2); }
.nav-icon { width: 25px; font-size: 21px; text-align: center; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 700; }
.nav-item.active .nav-badge { color: var(--accent); background: #fff; }
.sidebar-footer { margin-top: auto; padding: 18px 6px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sync-state { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.sync-state span { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #67a75a; box-shadow: 0 0 0 4px rgba(103,167,90,.1); }
.import-label { min-height: 40px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 12px; cursor: pointer; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 0 4.5vw 60px; }
.topbar { height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-leading, .topbar-actions, .module-actions { display: flex; align-items: center; gap: 12px; }
.theme-picker { position: relative; }
.theme-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 25; width: 260px; padding: 10px;
  border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 22px 65px rgba(45, 43, 35, .18);
  opacity: 0; visibility: hidden; transform: translateY(-7px) scale(.98); transform-origin: top right; transition: .2s ease;
}
.theme-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.theme-menu-title { padding: 8px 10px 11px; border-bottom: 1px solid var(--line); }
.theme-menu-title strong, .theme-menu-title span { display: block; }
.theme-menu-title strong { font-size: 13px; }
.theme-menu-title span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.theme-option { width: 100%; min-height: 50px; padding: 7px 9px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.theme-option:hover { background: var(--surface-2); }
.theme-option > span:nth-child(2) { flex: 1; }
.theme-option strong, .theme-option small { display: block; }
.theme-option strong { font-size: 12px; }
.theme-option small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.theme-option i { color: var(--accent); font-style: normal; font-weight: 800; opacity: 0; }
.theme-option.active { background: var(--accent-soft); }
.theme-option.active i { opacity: 1; }
.theme-swatch { flex: 0 0 31px; width: 31px; height: 31px; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.light-swatch { background: linear-gradient(135deg, #f5f2eb 50%, #567447 50%); }
.dark-swatch { background: linear-gradient(135deg, #242721 50%, #8ba977 50%); }
.macaron-swatch { background: linear-gradient(135deg, #ffcad4 0 33%, #bde0fe 33% 66%, #cdeac0 66%); }
.morandi-swatch { background: linear-gradient(135deg, #9aa69a 0 50%, #c5aaa2 50%); }
.ocean-swatch { background: linear-gradient(135deg, #dceff1 50%, #397b82 50%); }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; letter-spacing: .05em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; transition: .2s; }
.icon-button:hover { background: var(--surface-2); transform: translateY(-1px); }
.menu-button { display: none; }
.primary-button, .ghost-button, .text-button { border: 0; cursor: pointer; transition: .2s ease; }
.primary-button { min-height: 44px; padding: 0 18px; border-radius: 12px; color: #fff; background: var(--accent); font-weight: 650; box-shadow: 0 8px 18px rgba(86,116,71,.18); }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.ghost-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: transparent; }
.ghost-button:hover { background: var(--surface-2); }
.text-button { padding: 7px 0; color: var(--accent); background: transparent; font-size: 13px; font-weight: 650; }
.full-width { width: 100%; }

.view { display: none; animation: enter .35s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
.hero-card { min-height: 270px; padding: 42px clamp(28px, 5vw, 62px); display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; position: relative; border: 1px solid rgba(86,116,71,.15); border-radius: var(--radius-lg); background: linear-gradient(135deg, #e5ecdE 0%, #f1eee0 66%, #e7d8c8 120%); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; width: 270px; height: 270px; right: -80px; top: -110px; border: 42px solid rgba(255,255,255,.3); border-radius: 50%; }
.hero-copy { position: relative; z-index: 1; max-width: 650px; }
.soft-label, .section-kicker { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero-copy h2 { max-width: 600px; margin: 14px 0 12px; font: 700 clamp(28px, 4vw, 44px)/1.2 Georgia, "Songti SC", serif; letter-spacing: -.04em; }
.hero-copy p { margin-bottom: 24px; color: #6a6e63; font-size: 15px; }
.hero-actions { display: flex; align-items: center; gap: 22px; }
.progress-ring { --progress: 0deg; position: relative; z-index: 1; flex: 0 0 150px; width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), rgba(255,255,255,.6) 0); }
.progress-ring::before { content: ""; position: absolute; inset: 10px; border-radius: inherit; background: #eef0e5; }
.progress-ring div { position: relative; text-align: center; }
.progress-ring strong { display: block; font: 700 30px Georgia, serif; }
.progress-ring span { color: var(--muted); font-size: 11px; }

.stat-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { min-height: 120px; padding: 21px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.stat-icon { flex: 0 0 43px; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; font-size: 20px; }
.stat-icon.sage { color: var(--accent); background: var(--accent-soft); }
.stat-icon.orange { color: var(--orange); background: #f4e7da; }
.stat-icon.blue { color: var(--blue); background: #e1eaed; }
.stat-icon.rose { color: var(--rose); background: #f0e2e2; }
.stat-card p { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 19px; }
.stat-card small { color: #aaa89f; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.panel { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.panel-header { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-header h3 { margin: 5px 0 0; font-size: 19px; }
.preview-row { min-height: 58px; padding: 10px 0; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.preview-row:last-child { border-bottom: 0; }
.check-button { flex: 0 0 23px; width: 23px; height: 23px; border: 1.5px solid #b8b9b0; border-radius: 7px; background: transparent; cursor: pointer; }
.check-button.done { color: #fff; border-color: var(--accent); background: var(--accent); }
.preview-main { min-width: 0; flex: 1; }
.preview-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.preview-main span { color: var(--muted); font-size: 11px; }
.preview-main.done strong { color: var(--muted); text-decoration: line-through; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.habit-check { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: 21px; cursor: pointer; }
.habit-check.done { color: #fff; border-color: var(--accent); background: var(--accent); }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 10px; font-size: 30px; }

.module-toolbar { margin: 8px 0 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.module-description { margin: 0; color: var(--muted); font-size: 14px; }
.search-box { height: 44px; min-width: 230px; padding: 0 13px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.record-card { min-height: 180px; padding: 22px; position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: .2s; }
.record-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.record-card h3 { margin: 15px 0 8px; font-size: 17px; line-height: 1.45; }
.record-card p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.card-top, .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-bottom { margin-top: auto; padding-top: 15px; color: var(--muted); font-size: 11px; }
.tag, .status-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 700; }
.status-pill.high { color: #a2583e; background: #f5e0d6; }
.card-menu { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 19px; }
.card-actions { display: flex; gap: 8px; }
.mini-button { padding: 5px 8px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 11px; }
.mini-button.delete:hover { color: #a44; background: #f5dddd; }
.todo-list { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.todo-row { min-height: 76px; padding: 13px 18px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.todo-row:last-child { border: 0; }
.todo-row:hover { background: rgba(86,116,71,.025); }
.todo-meta { display: flex; align-items: center; gap: 8px; }
.habit-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.habit-card { min-height: 210px; padding: 22px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.habit-card .habit-emoji { font-size: 35px; }
.habit-card h3 { margin: 18px 0 5px; }
.habit-streak { color: var(--orange); font-size: 12px; }
.week-dots { margin: 22px 0; display: flex; justify-content: space-between; gap: 5px; }
.day-dot { width: 25px; text-align: center; color: var(--muted); font-size: 9px; }
.day-dot i { width: 23px; height: 23px; margin: 5px auto 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-style: normal; }
.day-dot.checked i { color: #fff; border-color: var(--accent); background: var(--accent); }
.habit-card .primary-button { width: 100%; }
.habit-card .primary-button.checked { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.checkin-color { width: 11px; height: 38px; flex: 0 0 11px; border-radius: 7px; background: var(--event-color); }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 18px; align-items: start; }
.calendar-panel, .day-agenda { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.calendar-header { min-height: 86px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.calendar-header h2 { margin: 5px 0 0; font-size: 22px; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.calendar-controls .ghost-button { min-height: 37px; }
.calendar-controls .icon-button { width: 37px; height: 37px; font-size: 22px; }
.calendar-weekdays { height: 37px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day { min-width: 0; min-height: 112px; padding: 8px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day:hover { background: var(--surface-2); }
.calendar-day.outside { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); color: var(--muted); }
.calendar-day.outside .calendar-event-chip { opacity: .58; }
.calendar-day.selected { background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day-number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 700; }
.calendar-day.today .calendar-day-number { color: #fff; background: var(--accent); }
.calendar-event-stack { min-width: 0; display: grid; gap: 4px; }
.calendar-event-chip { min-width: 0; height: 22px; padding: 0 6px; overflow: hidden; display: flex; align-items: center; gap: 5px; border-radius: 6px; color: var(--text); background: color-mix(in srgb, var(--event-color) 14%, var(--surface)); font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-chip i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: var(--event-color); }
.calendar-more { padding-left: 5px; color: var(--muted); font-size: 9px; }
.calendar-legend { min-height: 45px; padding: 12px 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--event-color); }
.calendar-legend .legend-hint { opacity: .8; }
.day-agenda { position: sticky; top: 18px; }
.day-agenda-header { min-height: 120px; padding: 20px; display: flex; align-items: start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.day-agenda-header h3 { margin: 6px 0 5px; font-size: 17px; }
.day-agenda-header p { margin: 0; color: var(--muted); font-size: 10px; }
.agenda-add { flex: 0 0 39px; width: 39px; height: 39px; color: #fff; border-color: var(--accent); background: var(--accent); font-size: 21px; }
.agenda-list { max-height: 570px; overflow: auto; }
.agenda-item { position: relative; padding: 16px 15px 16px 21px; display: grid; grid-template-columns: 4px 1fr; gap: 11px; border-bottom: 1px solid var(--line); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-color { width: 4px; height: 100%; min-height: 44px; border-radius: 4px; background: var(--event-color); }
.agenda-item-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.agenda-item-top strong { font-size: 13px; line-height: 1.45; }
.agenda-item-top span { flex: 0 0 auto; padding: 3px 7px; border-radius: 7px; color: var(--event-color); background: color-mix(in srgb, var(--event-color) 13%, var(--surface)); font-size: 9px; font-weight: 700; }
.agenda-item p { margin: 7px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.agenda-empty { min-height: 260px; display: grid; place-content: center; color: var(--muted); text-align: center; }
.agenda-empty span { font-size: 34px; }
.agenda-empty p { font-size: 11px; line-height: 1.8; }

.modal { width: min(540px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: 0 30px 100px rgba(30,30,25,.25); }
.modal::backdrop { background: rgba(31,34,28,.45); backdrop-filter: blur(5px); }
.modal form { padding: 27px; }
.modal-header { display: flex; align-items: start; justify-content: space-between; }
.modal-header h2 { margin: 7px 0 0; }
.form-fields { margin: 25px 0; display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--text); background: var(--bg); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(86,116,71,.1); }
.field textarea { min-height: 105px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 60; padding: 11px 18px; border-radius: 12px; color: #fff; background: #30342c; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sidebar-scrim { display: none; }

body[data-theme="dark"] { color-scheme: dark; --bg: #1b1d19; --surface: #242721; --surface-2: #2d302a; --text: #f1f0ea; --muted: #a5a79f; --line: #383c34; --accent: #8ba977; --accent-dark: #759761; --accent-soft: #35432f; --shadow: 0 18px 55px rgba(0,0,0,.2); }
body[data-theme="dark"] .hero-card { background: linear-gradient(135deg, #31402c, #302f29 66%, #44352d); }
body[data-theme="dark"] .progress-ring::before { background: #30352c; }

body[data-theme="macaron"] { --bg: #fff8f5; --surface: #fffefd; --surface-2: #f9eeee; --text: #4d4648; --muted: #8f8186; --line: #eedfe2; --accent: #d9879a; --accent-dark: #c86f85; --accent-soft: #f8dce3; --orange: #e5a272; --blue: #78a9c7; --rose: #ca829c; --shadow: 0 18px 55px rgba(177,108,129,.11); }
body[data-theme="macaron"] .hero-card { background: linear-gradient(135deg, #fbdde5 0%, #e5f2ed 54%, #dcecf8 100%); border-color: #edd5dc; }
body[data-theme="macaron"] .progress-ring::before { background: #fff4f5; }

body[data-theme="morandi"] { --bg: #efefeb; --surface: #f8f7f3; --surface-2: #e8e6e0; --text: #434743; --muted: #7f817c; --line: #dcdad2; --accent: #718276; --accent-dark: #5f7165; --accent-soft: #dce3dc; --orange: #b98d72; --blue: #778e9b; --rose: #a77e7d; --shadow: 0 18px 55px rgba(79,85,79,.1); }
body[data-theme="morandi"] .hero-card { background: linear-gradient(135deg, #dce3dc 0%, #e9e5dc 60%, #dfd0cb 100%); border-color: #d3d4cc; }
body[data-theme="morandi"] .progress-ring::before { background: #ebece6; }

body[data-theme="ocean"] { --bg: #eef6f7; --surface: #fbfefe; --surface-2: #e4f0f1; --text: #263e42; --muted: #6f8588; --line: #d5e6e8; --accent: #397b82; --accent-dark: #2e686f; --accent-soft: #d5e9e9; --orange: #c89068; --blue: #4f88a1; --rose: #a66f7c; --shadow: 0 18px 55px rgba(45,101,109,.1); }
body[data-theme="ocean"] .hero-card { background: linear-gradient(135deg, #d4eaeb 0%, #edf2e8 58%, #d9e9f1 100%); border-color: #cae1e3; }
body[data-theme="ocean"] .progress-ring::before { background: #edf7f7; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .record-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .habit-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 980px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .day-agenda { position: static; }
  .agenda-list { max-height: none; }
}

@media (max-width: 780px) {
  .sidebar { width: min(84vw, 330px); padding-top: max(24px, env(safe-area-inset-top)); transform: translateX(-102%); transition: transform .28s ease; box-shadow: 30px 0 80px rgba(20,20,16,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid !important; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(25,27,23,.45); backdrop-filter: blur(3px); }
  .sidebar-scrim.show { display: block; }
  .main-content { margin-left: 0; padding: 0 18px calc(35px + env(safe-area-inset-bottom)); }
  .topbar { height: auto; min-height: 94px; padding-top: env(safe-area-inset-top); }
  .topbar-leading { gap: 10px; }
  .topbar-actions .primary-button { width: 42px; padding: 0; font-size: 0; }
  .topbar-actions .primary-button span { font-size: 20px; }
  .hero-card { min-height: 350px; padding: 31px 25px; align-items: flex-start; }
  .progress-ring { position: absolute; right: 22px; bottom: 22px; width: 92px; height: 92px; flex-basis: 92px; }
  .progress-ring strong { font-size: 21px; }
  .progress-ring span { font-size: 9px; }
  .hero-copy { padding-bottom: 85px; }
  .hero-copy p { line-height: 1.7; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .module-toolbar { align-items: stretch; flex-direction: column; }
  .module-actions { width: 100%; }
  .search-box { min-width: 0; flex: 1; }
}

@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .eyebrow { font-size: 10px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 124px; padding: 16px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .stat-icon { width: 35px; height: 35px; flex-basis: 35px; border-radius: 10px; }
  .stat-card strong { font-size: 16px; }
  .record-grid, .habit-grid { grid-template-columns: 1fr; }
  .record-card { min-height: 165px; }
  .panel { padding: 20px 17px; }
  .module-actions .primary-button { padding: 0 13px; }
  .field-row { grid-template-columns: 1fr; }
  .todo-row { padding: 13px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 6px; }
  .calendar-header { min-height: 78px; padding: 14px 12px; }
  .calendar-header h2 { font-size: 18px; }
  .calendar-controls { gap: 4px; }
  .calendar-controls .ghost-button { padding: 0 9px; font-size: 11px; }
  .calendar-controls .icon-button { width: 34px; height: 34px; }
  .calendar-weekdays span { font-size: 0; }
  .calendar-weekdays span::after { content: attr(data-short); font-size: 10px; }
  .calendar-day { min-height: 79px; padding: 5px 3px; gap: 3px; }
  .calendar-day-number { width: 21px; height: 21px; font-size: 10px; }
  .calendar-event-stack { gap: 2px; }
  .calendar-event-chip { height: 16px; padding: 0 3px; gap: 2px; border-radius: 4px; font-size: 7px; }
  .calendar-event-chip i { display: none; }
  .calendar-more { font-size: 7px; }
  .calendar-legend { padding: 10px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
