:root {
  color-scheme: light dark;
  --green: #16845b; --green-strong: #0d6d49; --green-soft: #e7f5ee;
  --ink: #17211c; --muted: #66736c; --surface: #ffffff; --surface-2: #f5f7f5;
  --line: #dde4df; --warning: #9b5b10; --warning-soft: #fff4df; --danger: #b43d43;
  --radius: 20px; --small-radius: 13px; --shadow: 0 14px 35px rgba(24, 45, 34, .08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --green: #49ba88; --green-strong: #65c99b; --green-soft: #163629; --ink: #f1f5f2; --muted: #9ca9a2; --surface: #151a17; --surface-2: #0e1210; --line: #2a332e; --warning: #efb45f; --warning-soft: #332716; --danger: #ff8d92; --shadow: none; }
}
* { box-sizing: border-box; }
html { background: var(--surface-2); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--surface-2); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button, label.action-button { -webkit-tap-highlight-color: transparent; }
.app-icon { width: 21px; height: 21px; flex: none; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 12px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.primary-button, .secondary-button { min-height: 52px; border: 0; border-radius: 16px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; cursor: pointer; }
.primary-button { background: var(--green); color: white; }
.primary-button:hover { background: var(--green-strong); }
.primary-button:disabled { opacity: .4; cursor: default; }
.secondary-button { background: var(--surface-2); color: var(--ink); }
.icon-button { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); cursor: pointer; }
.text-button { border: 0; background: transparent; font-weight: 700; cursor: pointer; }
.invisible { visibility: hidden; }

/* Shared navigation */
.mode-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 15px; background: var(--surface-2); }
.mode-nav button { min-height: 42px; padding: 0 12px; border: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; }
.mode-nav button.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(20, 40, 30, .06); }

/* Desktop */
.desktop-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(760px, 1fr); }
.desktop-sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 34px; }
.brand-mark { display: flex; align-items: center; gap: 12px; }
.brand-mark > span { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: white; background: var(--green); }
.brand-mark div { display: grid; gap: 2px; }
.brand-mark strong { font-size: 17px; }
.brand-mark small { color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.desktop-sidebar .mode-nav { grid-template-columns: 1fr; }
.privacy-note { margin-top: auto; padding: 16px; border-radius: 16px; background: var(--green-soft); }
.privacy-note strong { color: var(--green); font-size: 13px; }
.privacy-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dashboard-main { min-width: 0; padding: 34px clamp(28px, 4vw, 64px) 70px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.dashboard-header h1 { margin: 0; font-size: clamp(25px, 2.3vw, 36px); letter-spacing: -.035em; }
.range-presets { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.range-presets button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.range-presets button:hover { color: var(--green); background: var(--green-soft); }
.range-controls { margin-top: 18px; display: flex; align-items: end; gap: 10px; }
.range-controls label, .mobile-range-inputs label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.range-controls input, .mobile-range-inputs input { min-height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); }
.range-controls > span { padding-bottom: 11px; color: var(--muted); font-size: 12px; }
.range-controls > small { padding-bottom: 10px; color: var(--muted); font-size: 11px; }
.week-switch { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.week-switch button { height: 38px; min-width: 42px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.week-switch button:nth-child(2) { padding: 0 13px; font-weight: 700; }
.action-bar { margin: 26px 0 20px; display: flex; flex-wrap: wrap; gap: 9px; }
.action-spacer { flex: 1; }
.action-button { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.action-button .app-icon { width: 18px; }
.action-button.quiet { color: var(--muted); }
.conflict-banner { width: 100%; margin-bottom: 16px; padding: 13px 16px; border: 0; border-radius: 13px; display: flex; align-items: center; gap: 10px; color: var(--warning); background: var(--warning-soft); text-align: left; cursor: pointer; }
.conflict-banner .app-icon:last-child { margin-left: auto; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; }
.kpi-grid article { min-height: 102px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.kpi-grid span { color: var(--muted); font-size: 12px; }
.kpi-grid strong { font-size: 22px; letter-spacing: -.025em; }
.week-card { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.week-card-heading { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.week-card-heading h2 { margin: 0; font-size: 18px; }
.week-card-heading p, .week-card-heading > span { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.week-table-wrap { overflow-x: auto; }
.week-table { width: 100%; min-width: 940px; border-collapse: collapse; table-layout: fixed; }
.week-table th, .week-table td { padding: 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.week-table thead th { height: 43px; padding: 0 12px; color: var(--muted); background: var(--surface-2); font-size: 11px; font-weight: 700; }
.week-table thead th:first-child { width: 104px; }
.week-table tbody th { padding: 12px; }
.week-table tbody th strong, .week-table tbody th span { display: block; }
.week-table tbody th strong { font-size: 13px; }
.week-table tbody th span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.week-table td button { width: 100%; min-height: 64px; padding: 10px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.week-table td button:hover { background: var(--green-soft); }
.week-table td strong, .week-table td small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-table td strong { font-size: 13px; }
.week-table td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.week-table tr.today-row { box-shadow: inset 3px 0 var(--green); }
.warning-text { color: var(--warning) !important; }

/* Right panel */
.panel-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(10, 18, 14, .28); backdrop-filter: blur(2px); }
.day-panel { position: fixed; z-index: 21; top: 0; right: 0; width: min(430px, 92vw); height: 100vh; overflow-y: auto; padding: 24px; background: var(--surface); box-shadow: -18px 0 45px rgba(14, 27, 20, .12); }
.day-panel > header { display: flex; align-items: center; justify-content: space-between; }
.day-panel header p { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
.day-panel header h2 { margin: 0; }
.day-panel section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.day-panel h3 { margin: 0; font-size: 15px; }
.panel-heading { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading button { border: 0; background: transparent; color: var(--green); display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; font-weight: 700; }
.panel-heading .app-icon { width: 16px; }
.panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.panel-grid button { padding: 12px; border: 0; border-radius: 13px; background: var(--surface-2); text-align: left; cursor: pointer; }
.panel-grid span, .panel-grid strong { display: block; }
.panel-grid span { margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.panel-grid strong { font-size: 13px; }
.panel-list { display: grid; gap: 8px; }
.workout-row { min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; gap: 10px; background: var(--surface); }
.workout-row.pending { border-color: var(--warning); background: var(--warning-soft); }
.source-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.source-dot.healthAutoExport { background: #5687dd; }
.workout-row div { min-width: 0; flex: 1; }
.workout-row strong, .workout-row small { display: block; }
.workout-row strong { font-size: 13px; }
.workout-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.workout-row > button { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.workout-row > button .app-icon { width: 17px; }
.empty-copy { margin: 0; color: var(--muted); font-size: 13px; }
.sleep-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sleep-compare div { padding: 13px; border-radius: 13px; background: var(--surface-2); }
.sleep-compare span, .sleep-compare strong { display: block; }
.sleep-compare span { color: var(--muted); font-size: 11px; }
.sleep-compare strong { margin-top: 6px; font-size: 14px; }
.weight-panel-value { padding: 14px; border-radius: 13px; background: var(--surface-2); display: flex; align-items: baseline; justify-content: space-between; }
.weight-panel-value small { color: var(--muted); }

/* Mobile home */
.mobile-home { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: 22px 18px calc(40px + env(safe-area-inset-bottom)); background: var(--surface-2); }
.mobile-header { display: flex; align-items: flex-end; justify-content: space-between; }
.mobile-header h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.mobile-header > span { color: var(--muted); font-size: 13px; }
.mobile-home > .mode-nav { margin-top: 20px; }
.mobile-hero { margin: 18px 0 12px; padding: 22px; border-radius: 22px; color: white; background: linear-gradient(145deg, #146b4b, #1d9366); }
.mobile-hero p, .mobile-hero h2 { margin: 0; }
.mobile-hero p { opacity: .75; font-size: 12px; }
.mobile-hero h2 { margin-top: 6px; font-size: 23px; }
.hero-status { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 7px; }
.hero-status span { padding: 6px 9px; border-radius: 99px; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; gap: 4px; font-size: 10px; }
.hero-status .app-icon { width: 13px; }
.quick-actions { display: grid; gap: 10px; }
.quick-card { width: 100%; min-height: 78px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 18px; display: flex; align-items: center; gap: 13px; background: var(--surface); text-align: left; cursor: pointer; }
.quick-card > .app-icon:first-child { width: 25px; height: 25px; color: var(--green); }
.quick-card > .app-icon:last-child { margin-left: auto; color: var(--muted); }
.quick-card span { display: grid; gap: 4px; }
.quick-card strong { font-size: 15px; }
.quick-card small { color: var(--muted); font-size: 11px; }
.mobile-section { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.section-heading { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.week-transfer p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.week-transfer .primary-button { width: 100%; margin-top: 10px; }
.week-transfer h2 { margin: 2px 0 12px; font-size: 17px; }
.range-presets.mobile { width: 100%; margin: 8px 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); }
.range-presets.mobile button { min-height: 40px; }
.mobile-range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mobile-range-inputs input { width: 100%; min-width: 0; font-size: 12px; }
.transfer-week { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; }
.transfer-week > button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); cursor: pointer; }
.transfer-week > button:disabled { opacity: .35; }
.transfer-week h2 { margin: 0; font-size: 16px; }
.transfer-week .eyebrow { margin-bottom: 3px; font-size: 9px; }
.local-footnote { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.recent-mobile { margin-top: 18px; }
.recent-date-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.recent-mobile button { min-height: 54px; padding: 7px 0; border: 1px solid var(--line); border-radius: 13px; display: grid; place-items: center; background: var(--surface); cursor: pointer; }
.recent-mobile button.done { border-color: var(--green); background: var(--green-soft); }
.recent-mobile strong, .recent-mobile small { display: block; }
.recent-mobile strong { font-size: 14px; }
.recent-mobile small { color: var(--muted); font-size: 10px; }
.history-date-button { position: relative; min-height: 44px; margin-top: 9px; border: 1px dashed var(--line); border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--green); background: var(--surface); font-size: 12px; font-weight: 700; overflow: hidden; cursor: pointer; }
.history-date-button .app-icon { width: 17px; }
.history-date-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

/* Check-in flow */
.flow-screen, .completion-screen, .editor-screen { width: min(100%, 600px); min-height: 100vh; margin: 0 auto; padding: 14px 20px calc(30px + env(safe-area-inset-bottom)); background: var(--surface); }
.flow-header { min-height: 54px; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; }
.flow-header > :last-child { justify-self: end; }
.date-label { position: relative; padding: 0; border: 0; background: transparent; display: grid; justify-items: center; cursor: pointer; overflow: hidden; }
.date-label strong { font-size: 14px; }
.date-label span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.date-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.question-progress { margin: 8px 0 42px; display: flex; align-items: center; justify-content: center; gap: 13px; }
.question-progress > div { display: flex; gap: 7px; }
.question-progress span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.question-progress span.done { background: #86b9a1; }
.question-progress span.current { width: 20px; border-radius: 99px; background: var(--green); }
.question-progress small { color: var(--muted); }
.question-content h1 { max-width: 450px; margin: 0 auto 28px; font-size: clamp(27px, 7vw, 38px); line-height: 1.18; letter-spacing: -.04em; text-align: center; }
.main-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.main-choice-list { display: grid; gap: 10px; }
.main-choice { min-height: 68px; padding: 0 20px; border: 1px solid var(--line); border-radius: 17px; display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); font-size: 17px; font-weight: 720; cursor: pointer; }
.main-choice-grid .main-choice { min-height: 104px; justify-content: center; }
.main-choice[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.expanded-details { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-group { margin: 0 0 20px; }
.detail-group h3, .editor-content h2 { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.compact-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.compact-choice, .add-tags-button, .duration-chips button, .type-grid button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.compact-choice[aria-pressed="true"], .duration-chips button[aria-pressed="true"], .type-grid button[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.compact-choice { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.compact-choice .app-icon { width: 14px; }
.expanded-details .primary-button { width: 100%; margin-top: 8px; }
.add-tags-button { margin-top: 15px; display: flex; align-items: center; gap: 7px; color: var(--green); }
.skip-button { width: 100%; margin-top: 22px; border: 0; background: transparent; color: var(--muted); min-height: 44px; cursor: pointer; }
.completion-screen { padding-top: 30px; text-align: center; }
.completion-mark { width: 72px; height: 72px; margin: 80px auto 20px; border-radius: 50%; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.completion-mark .app-icon { width: 38px; height: 38px; }
.completion-screen h1 { margin: 14px 0 8px; }
.completion-screen > p { color: var(--muted); }
.summary-card { margin: 28px 0 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.summary-card button { width: 100%; min-height: 54px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; background: var(--surface); cursor: pointer; }
.summary-card button:last-child { border-bottom: 0; }
.summary-card strong { margin-left: auto; }
.summary-card .app-icon { margin-left: 8px; }
.completion-screen > .primary-button { width: 100%; }

/* Workout and sleep editors */
.editor-content { padding: 25px 0; }
.editor-content > h1 { margin: 0 0 26px; font-size: 30px; text-align: center; }
.segment-control { margin-bottom: 28px; padding: 4px; border-radius: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); }
.segment-control button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; cursor: pointer; }
.segment-control button[aria-pressed="true"] { color: var(--green); background: var(--surface); box-shadow: 0 2px 8px rgba(20,40,30,.06); }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 30px; }
.type-grid button { min-height: 50px; }
.duration-display { margin: 12px 0 18px; display: flex; align-items: center; justify-content: center; gap: 32px; }
.duration-display button { width: 52px; height: 52px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--green); background: var(--green-soft); cursor: pointer; }
.duration-display strong { min-width: 130px; font-size: 45px; text-align: center; }
.duration-display strong small { margin-left: 5px; color: var(--muted); font-size: 13px; }
.duration-chips { margin-bottom: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.editor-content > .primary-button { width: 100%; }
.sleep-editor .editor-content, .weight-editor .editor-content { text-align: center; }
.sleep-illustration { width: 72px; height: 72px; margin: 30px auto 18px; border-radius: 50%; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.sleep-illustration .app-icon { width: 34px; height: 34px; }
.sleep-editor .editor-content > p, .weight-editor .editor-content > p { color: var(--muted); }
.sleep-duration strong { min-width: 180px; font-size: 28px; }
.weight-input-row { margin: 32px 0; display: flex; align-items: center; justify-content: center; gap: 20px; }
.weight-input-row > button { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--green); background: var(--green-soft); cursor: pointer; }
.weight-input-row label { min-width: 170px; display: flex; align-items: baseline; justify-content: center; gap: 7px; }
.weight-input-row input { width: 125px; padding: 0; border: 0; border-bottom: 2px solid var(--line); color: var(--ink); background: transparent; font-size: 42px; font-weight: 750; text-align: center; outline: none; }
.weight-input-row input:focus { border-color: var(--green); }
.weight-input-row span { color: var(--muted); font-weight: 700; }

/* Optional emotional-event record */
.reflection-intro { margin: 18px 0 30px; display: flex; align-items: center; gap: 14px; }
.reflection-intro > .app-icon { width: 48px; height: 48px; padding: 11px; border-radius: 16px; color: var(--green); background: var(--green-soft); }
.reflection-intro h1 { margin: 0; font-size: 26px; line-height: 1.25; }
.reflection-intro p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.reflection-moods { margin-bottom: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reflection-moods .compact-choice { min-height: 54px; justify-content: center; font-size: 15px; }
.reflection-editor .compact-grid { margin-bottom: 28px; }
.reflection-note { margin: 0 0 28px; display: grid; gap: 8px; }
.reflection-note > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.reflection-note textarea { width: 100%; min-height: 86px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface-2); font: inherit; line-height: 1.55; resize: none; outline: none; }
.reflection-note textarea:focus { border-color: var(--green); }
.reflection-note small { justify-self: end; color: var(--muted); font-size: 10px; }
.reflection-panel { padding: 14px; border-radius: 13px; background: var(--surface-2); }
.reflection-panel strong, .reflection-panel span, .reflection-panel small { display: block; }
.reflection-panel span, .reflection-panel small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.reflection-panel p { margin: 10px 0 0; line-height: 1.55; font-size: 13px; }

/* Import modal and notices */
.modal-backdrop { position: fixed; inset: 0; z-index: 40; padding: 30px; overflow-y: auto; background: rgba(8, 14, 11, .55); backdrop-filter: blur(4px); display: grid; place-items: center; }
.import-modal { width: min(650px, 100%); max-height: calc(100vh - 60px); overflow-y: auto; padding: 24px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.import-modal > header { display: flex; align-items: center; justify-content: space-between; }
.import-modal h2 { margin: 0; }
.import-stats { margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.import-stats div { padding: 14px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.import-stats strong, .import-stats span { display: block; }
.import-stats strong { font-size: 22px; }
.import-stats span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.notice-box { padding: 13px; border-radius: 13px; background: var(--warning-soft); color: var(--warning); }
.import-conflicts { margin-top: 20px; }
.import-conflicts h3 { margin-bottom: 8px; }
.import-conflicts > p { color: var(--muted); font-size: 12px; }
.conflict-item, .workout-conflict { padding: 13px 0; border-bottom: 1px solid var(--line); }
.conflict-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.conflict-item button, .workout-conflict button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.conflict-item button[aria-pressed="true"] { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.workout-conflict strong, .workout-conflict small { display: block; }
.workout-conflict small { margin: 4px 0 10px; color: var(--muted); }
.workout-conflict div { display: flex; flex-wrap: wrap; gap: 6px; }
.import-modal details { margin-top: 18px; color: var(--muted); font-size: 12px; }
.import-modal footer { margin-top: 24px; display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 30px; transform: translateX(-50%); min-height: 46px; padding: 0 16px; border-radius: 99px; display: flex; align-items: center; gap: 8px; color: white; background: #18241e; box-shadow: var(--shadow); font-size: 13px; }
.error-banner { position: fixed; z-index: 61; top: 18px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 36px); min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; display: flex; align-items: center; gap: 8px; color: white; background: var(--danger); }
.fatal-error { padding: 80px 20px; text-align: center; }
.copy-backup { width: 100%; margin-top: 9px; }
.cloud-gate { width: min(100% - 32px, 460px); min-height: 100vh; margin: 0 auto; padding: 16vh 8px 40px; text-align: center; }
.cloud-gate > div { width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 22px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.cloud-gate > div .app-icon { width: 36px; height: 36px; }
.cloud-gate h1 { margin: 8px 0 12px; font-size: 30px; }
.cloud-gate > p:not(.eyebrow) { margin: 0 auto 26px; color: var(--muted); line-height: 1.7; }
.cloud-gate .primary-button { width: 100%; text-decoration: none; }
.cloud-gate small { display: block; margin-top: 14px; color: var(--muted); }

@media (max-width: 899px) {
  .desktop-shell { display: block; }
  .desktop-sidebar { position: static; width: auto; height: auto; padding: 18px; border-right: 0; }
  .desktop-sidebar .mode-nav, .privacy-note { display: none; }
  .dashboard-main { padding: 20px 16px 50px; }
  .dashboard-header { align-items: flex-start; }
  .dashboard-header h1 { font-size: 23px; }
  .action-spacer { display: none; }
  .action-button { flex: 1 1 45%; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .week-card-heading > span { display: none; }
}
@media (max-width: 430px) {
  .mobile-home { padding-left: 14px; padding-right: 14px; }
  .main-choice-grid { grid-template-columns: 1fr 1fr; }
  .question-content h1 { font-size: 28px; }
  .compact-choice { padding: 0 11px; }
  .modal-backdrop { padding: 12px; align-items: end; }
  .import-modal { max-height: 92vh; padding: 20px; border-radius: 22px 22px 12px 12px; }
  .conflict-item { align-items: flex-start; flex-direction: column; }
  .import-stats { grid-template-columns: repeat(2, 1fr); }
  .weight-input-row { gap: 10px; }
  .reflection-moods { grid-template-columns: repeat(2, 1fr); }
  .reflection-intro h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: no-preference) {
  .day-panel { animation: panel-in .22s ease-out; }
  .toast { animation: toast-in .22s ease-out; }
  @keyframes panel-in { from { transform: translateX(18px); opacity: .6; } }
  @keyframes toast-in { from { transform: translate(-50%, 8px); opacity: 0; } }
}
