@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@600;700&family=Source+Sans+3:wght@400;500;600;700;800;900&display=swap");

:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --paper: #f5f5f7;
  --paper-deep: #e8e8ed;
  --card: rgba(255, 255, 255, 0.76);
  --line: rgba(29, 29, 31, 0.09);
  --sage: #68725c;
  --sage-light: #e8eee4;
  --amber: #b86b3d;
  --coral: #b86b3d;
  --blue: #6e8c98;
  --warm: #e9eef8;
  --accent: #0071e3;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Source Sans 3", "Noto Sans SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Source Sans 3", "Noto Sans SC", sans-serif;
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-move: cubic-bezier(0.25, 1, 0.5, 1);
  --mobile-nav-safe-bottom: env(safe-area-max-inset-bottom, env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 82% 4%, rgba(125,174,255,.18), transparent 30rem), radial-gradient(circle at 28% 72%, rgba(182,222,199,.18), transparent 34rem), var(--paper); color: var(--ink); font-family: var(--font-body); }
body[data-language="zh"] { letter-spacing: .01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .06; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }
.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 280ms var(--ease-enter); }
.sidebar { position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px; padding: 28px 20px 20px; display: flex; flex-direction: column; background: linear-gradient(155deg, rgba(41,49,44,.96), rgba(25,29,27,.97)); color: #f7f7f7; border: 1px solid rgba(255,255,255,.12); border-radius: 30px; box-shadow: 0 24px 70px rgba(21,25,23,.18); backdrop-filter: blur(28px) saturate(145%); }
.sidebar-toggle { position: absolute; z-index: 2; top: 29px; right: 14px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.055); color: rgba(255,255,255,.68); box-shadow: inset 0 1px 0 rgba(255,255,255,.055); backdrop-filter: blur(18px); transition: color 160ms ease, background-color 160ms ease, transform 220ms var(--ease-enter); }
.sidebar-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform 240ms var(--ease-enter); }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; padding: 0 42px 34px 8px; }
.brand-mark { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.24); display: grid; place-items: center; background: linear-gradient(145deg, #ffb34f, #df7e2f); color: #fff; font-family: var(--font-display); border-radius: 13px; box-shadow: 0 8px 22px rgba(184,107,61,.28), inset 0 1px 0 rgba(255,255,255,.34); }
.brand strong, .brand small { display: block; }
.brand strong { font-family: var(--font-display); letter-spacing: .02em; }
.brand small { color: rgba(255,255,255,.46); font: 10px/1.5 var(--font-body); letter-spacing: .19em; margin-top: 3px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { position: relative; border: 0; border-radius: 15px; background: transparent; color: rgba(255,255,255,.58); padding: 13px 14px; display: flex; align-items: center; gap: 13px; text-align: left; transition: color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-enter); }
.nav-item .nav-icon { width: 20px; flex: 0 0 20px; font-size: 17px; text-align: center; }
.nav-item .nav-label { width: auto; min-width: 0; font-size: inherit; text-align: left; white-space: nowrap; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.nav-item.active::before { position: absolute; left: 7px; top: 50%; width: 4px; height: 18px; border-radius: 999px; background: #65a9ff; content: ""; transform: translateY(-50%); }
.nav-item:active { transform: scale(.98); }
.sidebar-note { margin-top: auto; margin-bottom: 25px; padding: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.055); position: relative; backdrop-filter: blur(18px); }
.sidebar-note p { margin: 7px 0 0; color: rgba(255,255,255,.72); font-family: var(--font-display); font-size: 13px; line-height: 1.8; }
.sidebar-note small { display: block; margin-top: 7px; color: rgba(255,255,255,.36); font: 9px/1.4 Inter, sans-serif; letter-spacing: .08em; }
.pulse-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: #a8c5b1; box-shadow: 0 0 0 5px rgba(168,197,177,.08); }
.sidebar-long-term { min-height: 0; margin-top: auto; margin-bottom: 18px; padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.055); }
.sidebar-long-term header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: rgba(255,255,255,.48); font-size: 8px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-long-term header button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 9px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.68); }
#sidebarLongTermList { display: grid; gap: 3px; }
.sidebar-long-term-item { min-width: 0; width: 100%; display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: center; gap: 9px; padding: 7px 4px; border: 0; background: transparent; color: rgba(255,255,255,.78); text-align: left; }
.sidebar-long-term-item i { width: 7px; height: 7px; border-radius: 50%; background: #83b89a; box-shadow: 0 0 0 4px rgba(131,184,154,.08); }
.sidebar-long-term-item span { overflow: hidden; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-long-term-empty { margin: 4px 0 2px; color: rgba(255,255,255,.38); font-size: 8px; line-height: 1.5; }
.profile { border-top: 1px solid rgba(255,255,255,.09); padding-top: 20px; display: grid; grid-template-columns: 35px 1fr 32px; align-items: center; gap: 10px; }
.avatar { width: 35px; height: 35px; border-radius: 12px; background: rgba(217,183,119,.92); color: var(--ink); display: grid; place-items: center; }
.avatar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.profile strong, .profile small { display: block; }
.profile strong { font-size: 12px; }
.profile small { font-size: 10px; color: rgba(255,255,255,.42); margin-top: 3px; }
.main-content { min-width: 0; padding: 42px clamp(28px, 5vw, 76px) 70px; max-width: 1500px; width: 100%; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; margin-bottom: 42px; }
.eyebrow, .kicker { margin: 0; font: 500 10px/1.2 var(--font-body); letter-spacing: .18em; color: var(--sage); }
.topbar h1 { max-width: 760px; font: 700 clamp(25px, 2.7vw, 38px)/1.24 var(--font-display); margin: 0; letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance; }
body[data-active-view="timeline"] .topbar-copy { visibility: hidden; }
.top-actions, .date-jump { display: flex; align-items: center; gap: 9px; }
.mobile-toolbar-toggle { display: none; }
.save-mode { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 9px var(--font-body); }
.save-mode i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.save-mode.cloud i { background: var(--sage); box-shadow: 0 0 0 4px rgba(111,143,125,.1); }
.save-mode.syncing i { animation: syncDot 800ms ease infinite alternate; }
@keyframes syncDot { to { opacity: .35; transform: scale(.75); } }
.language-switcher { display: grid; grid-template-columns: auto auto; align-items: center; gap: 7px; min-height: 42px; padding: 4px 10px; border: 1px solid rgba(255,255,255,.62); border-radius: 15px; background: rgba(255,255,255,.64); box-shadow: 0 8px 24px rgba(29,29,31,.06), inset 0 1px 0 rgba(255,255,255,.92); backdrop-filter: blur(18px) saturate(150%); transition: border-color 180ms ease, background-color 180ms ease, transform 160ms var(--ease-enter), box-shadow 180ms ease; }
.language-switcher:focus-within { border-color: color-mix(in srgb, var(--amber) 70%, var(--line)); background: var(--card); }
.language-flag { font-size: 16px; line-height: 1; filter: saturate(.9); }
.language-label { color: var(--amber); font: 800 9px var(--font-body); letter-spacing: .1em; text-transform: uppercase; }
.language-switcher select { min-width: 72px; border: 0; outline: none; background: transparent; color: var(--ink); font: 700 11px var(--font-body); cursor: pointer; }
.date-jump { min-height: 42px; background: rgba(255,255,255,.64); border: 1px solid rgba(255,255,255,.62); padding: 8px 12px; border-radius: 15px; font: 12px var(--font-body); box-shadow: 0 8px 24px rgba(29,29,31,.05), inset 0 1px 0 rgba(255,255,255,.9); backdrop-filter: blur(18px) saturate(150%); }
.date-jump select { border: 0; background: transparent; outline: none; font-weight: 500; }
.primary-button, .secondary-button { min-height: 42px; border: 1px solid transparent; border-radius: 15px; padding: 11px 17px; font-weight: 700; font-size: 12px; transition: transform 140ms var(--ease-enter), background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.primary-button { background: var(--ink); color: #fff; box-shadow: 0 9px 24px rgba(29,29,31,.16), inset 0 1px 0 rgba(255,255,255,.14); }
.secondary-button { background: var(--paper-deep); }
.primary-button:active, .secondary-button:active, .round-button:active, .icon-button:active { transform: scale(.97); }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.42); color: inherit; transition: transform 140ms var(--ease-enter), background-color 160ms ease, box-shadow 160ms ease; }
.cloud-account-button[hidden] { display: none !important; }
.view { display: none; opacity: 0; transform: translateY(10px); }
.view.active { display: block; animation: viewIn 320ms var(--ease-enter) forwards; }
@keyframes viewIn { to { opacity: 1; transform: translateY(0); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 18px; }
.hero-card, .mood-card, .panel, .calendar-card, .daily-goals-card { border: 1px solid rgba(255,255,255,.66); background: var(--card); border-radius: 26px; box-shadow: 0 18px 55px rgba(29,29,31,.075), inset 0 1px 0 rgba(255,255,255,.88); backdrop-filter: blur(24px) saturate(145%); }
.hero-card { min-height: 270px; position: relative; overflow: hidden; padding: 38px 42px; display: flex; justify-content: space-between; align-items: center; border-radius: 30px; background: radial-gradient(circle at 78% 52%, rgba(65,137,255,.23), transparent 24rem), linear-gradient(135deg, #26312b, #202522 62%, #171a18); color: #fff; }
.hero-card::before { content: ""; position: absolute; width: 380px; height: 380px; right: -170px; top: -190px; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); box-shadow: 0 0 0 46px rgba(255,255,255,.025), 0 0 0 92px rgba(255,255,255,.02); }
.hero-copy { position: relative; z-index: 1; }
.date-chip { display: inline-block; color: #c6d9cc; font: 10px var(--font-body); letter-spacing: .12em; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 7px 10px; }
.hero-copy h2 { font: 700 clamp(24px, 3vw, 38px)/1.42 var(--font-display); letter-spacing: -.04em; margin: 25px 0 15px; }
.hero-copy p { color: rgba(255,255,255,.5); font-size: 12px; margin: 0; }
.quote-source { display: block; margin: -6px 0 14px; color: rgba(255,255,255,.42); font: 10px/1.4 Inter, sans-serif; letter-spacing: .08em; }
.section-quote-source { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.mood-note small { display: block; margin-top: 5px; opacity: .62; font-size: 10px; }
.progress-orbit { --p: calc(var(--progress) * 1%); width: 142px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; margin-left: 24px; position: relative; }
.progress-orbit-ring { position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(#a8c5b1 var(--p), rgba(255,255,255,.09) 0); transition: background 280ms var(--ease-enter); }
.progress-orbit-ring::after { content: ""; position: absolute; inset: 8px; border-radius: inherit; background: var(--ink); border: 1px solid rgba(255,255,255,.08); }
.progress-orbit div { position: relative; z-index: 1; text-align: center; }
.progress-orbit strong, .progress-orbit-label { display: block; }
.progress-orbit strong { display: flex; align-items: baseline; justify-content: center; gap: 5px; font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.progress-orbit strong b { font-size: 31px; font-weight: 650; line-height: 1; }
.progress-orbit strong small { color: rgba(255,255,255,.52); font-size: 14px; font-weight: 550; letter-spacing: -.02em; }
.progress-orbit-label { color: rgba(255,255,255,.44); font-size: 10px; margin-top: 5px; }
.mood-card { padding: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.section-heading { display: flex; justify-content: space-between; align-items: end; }
.section-heading h2, .section-heading h3 { font-family: "Noto Serif SC"; margin: 7px 0 0; }
.section-heading h3 { font-size: 18px; }
.mood-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 25px 0; }
.mood-options button { border: 1px solid var(--line); border-radius: 12px; background: transparent; padding: 15px 7px; font-size: 11px; transition: transform 140ms var(--ease-enter), background-color 160ms ease, border-color 160ms ease; }
.mood-options button span { display: block; font-size: 21px; margin-bottom: 7px; }
.mood-options button .mood-option-icon { width: 34px; height: 34px; margin: 0 auto 7px; display: grid; place-items: center; border-radius: 11px; }
.mood-option-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.05; stroke-linecap: round; stroke-linejoin: round; }
.mood-option-icon.mood-low { color: #2f80ed; background: rgba(47,128,237,.1); }
.mood-option-icon.mood-calm { color: #1fb76a; background: rgba(31,183,106,.1); }
.mood-option-icon.mood-good { color: #f4a900; background: rgba(244,169,0,.11); }
.mood-options button.selected { background: var(--sage-light); border-color: var(--sage); }
.mood-options button[data-mood="低落"].selected { color: #4f7fad; background: #eaf3fc; border-color: rgba(93,143,197,.46); }
.mood-options button[data-mood="平静"].selected { color: #567963; background: #edf5ef; border-color: rgba(100,138,113,.44); }
.mood-options button[data-mood="很好"].selected { color: #9b6c1d; background: #fff5d9; border-color: rgba(182,129,37,.42); }
.mood-options button:active { transform: scale(.96); }
.mood-options button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.mood-reason-summary { width: 100%; margin: -12px 0 18px; padding: 9px 11px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--sage) 22%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--sage-light) 46%, transparent); color: var(--muted); font-size: 10px; line-height: 1.45; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.mood-reason-summary[hidden] { display: none; }
.drawer-mood-reason { margin: 10px 0 0; }
.mood-note { font: 11px/1.7 "Noto Serif SC"; color: var(--muted); margin: 0; }
.habits-heading { margin: 44px 0 17px; }
.habits-heading h2 { font-size: 24px; }
.text-button { border: 0; background: transparent; font-size: 12px; color: var(--muted); }
.text-button span { margin-left: 5px; transition: transform 160ms var(--ease-enter); display: inline-block; }
.text-button:hover span { transform: translateX(3px); }
.habit-carousel { --habit-gap: 12px; min-width: 0; }
.habit-carousel-viewport { min-width: 0; overflow-x: auto; overflow-y: visible; border-radius: 23px; outline: none; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; }
.habit-carousel-viewport::-webkit-scrollbar { display: none; }
.habit-carousel-viewport:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 28%, transparent); }
.habit-carousel-viewport.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.habit-carousel-track { display: flex; align-items: stretch; }
.habit-page { min-width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--habit-gap); scroll-snap-align: start; scroll-snap-stop: always; }
.habit-carousel-nav { min-height: 38px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.habit-carousel-nav[hidden] { display: none; }
.habit-carousel-arrow { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: color-mix(in srgb, var(--card) 86%, transparent); color: var(--ink); box-shadow: 0 7px 20px rgba(29,29,31,.055); cursor: pointer; transition: transform 170ms var(--ease-enter), opacity 170ms ease, background-color 170ms ease; }
.habit-carousel-arrow:disabled { opacity: .28; cursor: default; }
.habit-carousel-pages { display: flex; align-items: center; gap: 5px; }
.habit-carousel-page { width: 18px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.habit-carousel-page span { width: 5px; height: 5px; border-radius: 99px; background: var(--line); transition: width 180ms var(--ease-enter), background-color 180ms ease; }
.habit-carousel-page.active span { width: 16px; background: var(--sage); }
.habit-carousel-status { min-width: 34px; color: var(--muted); font: 8px var(--font-body); text-align: center; }
.habit-card { position: relative; min-height: 172px; border: 1px solid var(--line); background: var(--card); border-radius: 17px; padding: 21px; cursor: pointer; overflow: hidden; transition: transform 180ms var(--ease-enter), border-color 180ms ease, background-color 180ms ease; }
.habit-card::after { content: ""; position: absolute; inset: auto -30px -54px auto; width: 100px; height: 100px; border-radius: 50%; background: var(--habit-soft); opacity: .55; }
.habit-card.completed { background: var(--habit-soft); border-color: var(--habit-color); }
.habit-card.future-locked { opacity: .48; cursor: not-allowed; filter: saturate(.55); }
.habit-card-top { display: flex; justify-content: space-between; align-items: center; }
.habit-icon { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; background: var(--habit-soft); color: var(--habit-color); }
.habit-check { width: 23px; height: 23px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: transparent; transition: transform 160ms var(--ease-enter), color 160ms ease, background-color 160ms ease; }
.habit-card.completed .habit-check { background: var(--habit-color); color: white; border-color: transparent; transform: scale(1.06); }
.habit-card h3 { font: 600 15px "Noto Serif SC"; margin: 22px 0 6px; }
.habit-card p { color: var(--muted); font-size: 10px; margin: 0; }
::view-transition-group(*) { animation-duration: 330ms; animation-timing-function: cubic-bezier(.22,1,.36,1); }
html.habit-reordering::view-transition-old(root),
html.habit-reordering::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.daily-planning-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.daily-goals-card { min-width: 0; min-height: 270px; padding: 25px; display: flex; flex-direction: column; box-shadow: 0 18px 60px rgba(16,35,29,.04); }
.tomorrow-goals-card { background: linear-gradient(145deg, rgba(125,174,255,.07), transparent 48%), var(--card); }
.daily-goals-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.daily-goals-heading h3 { margin: 6px 0 4px; font: 600 18px "Noto Serif SC"; }
.daily-goals-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.daily-goals-heading small { display: block; margin-top: 9px; color: var(--muted); font: 8px var(--font-body); letter-spacing: .04em; }
.daily-goals-heading > strong { color: var(--sage); font: 500 14px var(--font-body); }
.daily-goal-list { margin: 12px 0 18px; }
.daily-goal-form { margin-top: auto; }
.weekly-workspace { margin-top: 0; }
.weekly-heading { justify-content: flex-end; margin-bottom: 18px; }
.weekly-heading h2 { font-size: 24px; }
.week-navigator { display: grid; grid-template-columns: 36px minmax(160px, auto) 36px; align-items: stretch; gap: 7px; }
.week-nav-button, .week-current-button { border: 1px solid var(--line); background: rgba(255,255,255,.55); color: var(--ink); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-enter); }
.week-nav-button { border-radius: 11px; font-size: 14px; }
.week-nav-button:hover { transform: translateY(-1px); border-color: rgba(111,143,125,.45); background: var(--card); }
.week-current-button { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border-radius: 11px; padding: 8px 10px 8px 12px; text-align: left; }
.week-current-button strong { color: var(--ink); font: 9px/1.35 var(--font-body); }
.week-current-button span { border-radius: 99px; padding: 4px 7px; background: var(--ink); color: white; font: 8px var(--font-body); white-space: nowrap; }
.week-current-button.away span { background: var(--amber); color: var(--ink); }
.week-current-button.away:hover { border-color: rgba(215,168,76,.55); background: rgba(243,229,191,.28); }
.weekly-goals-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); min-height: 350px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: 0 18px 60px rgba(16,35,29,.055); }
.weekly-goals-card { min-height: 350px; padding: 28px; display: flex; flex-direction: column; }
.week-stamp-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 24px; font-family: var(--font-body); }
.week-stamp-row span:first-child { color: var(--sage); font-size: 20px; }.week-stamp-row span:last-child { color: var(--muted); font-size: 9px; }
.weekly-classical-image { min-width: 0; min-height: 350px; margin: 0; position: relative; overflow: hidden; background: var(--ink); }
.weekly-classical-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16,35,29,.18), transparent 42%), linear-gradient(0deg, rgba(16,35,29,.55), transparent 45%); pointer-events: none; }
.weekly-classical-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.weekly-classical-image figcaption { position: absolute; z-index: 1; left: 22px; bottom: 18px; color: rgba(255,255,255,.68); font: 9px var(--font-body); letter-spacing: .16em; }
.weekly-card-heading { display: flex; align-items: start; justify-content: space-between; }
.weekly-card-heading h3 { margin: 6px 0 0; font: 600 19px "Noto Serif SC"; }
.weekly-card-heading > strong { font: 500 11px var(--font-body); color: var(--sage); }
.weekly-goal-list { display: grid; gap: 7px; margin: 20px 0; }
.weekly-goal { display: grid; grid-template-columns: 23px 1fr 24px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.weekly-goal button { border: 0; background: transparent; }
.weekly-goal-check { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; color: transparent; transition: transform 140ms var(--ease-enter), background-color 160ms ease, color 160ms ease; }
.weekly-goal.done .weekly-goal-check { background: var(--ink); color: white; transform: scale(1.04); }
.weekly-goal.done .weekly-goal-text { color: var(--muted); text-decoration: line-through; }
.weekly-goal-text { font-size: 12px; text-align: left; }
.weekly-goal-delete { opacity: .35; font-size: 14px; }
.weekly-goal-empty { color: var(--muted); font: 12px/1.7 "Noto Serif SC"; padding: 15px 0; }
.weekly-goal-form { display: grid; grid-template-columns: 1fr 36px; gap: 8px; margin-top: auto; }
.weekly-goal-form input { min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: 11px; padding: 11px 13px; outline: none; font-size: 11px; }
.weekly-goal-form button { border: 0; border-radius: 11px; background: var(--ink); color: white; }
.weekly-writing-panel { margin-top: 16px; min-height: 390px; padding: 29px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(217,183,119,.12), transparent 48%), var(--card); box-shadow: 0 18px 60px rgba(16,35,29,.04); }
.weekly-writing-heading { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.weekly-writing-heading h3 { margin: 7px 0 4px; font: 600 20px "Noto Serif SC"; }.weekly-writing-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.weekly-writing-heading > div:last-child { text-align: right; }.weekly-writing-heading > div:last-child strong { display: block; margin-top: 8px; font: 9px var(--font-body); color: var(--muted); }
.weekly-writing-panel textarea { width: 100%; min-height: 250px; padding: 25px 2px; overflow-y: hidden; border: 0; outline: none; resize: none; background: transparent; font: 13px/2 "Noto Serif SC"; }
.weekly-writing-panel footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font: 9px var(--font-body); }
.calendar-embedded { margin-top: 58px; padding-top: 43px; border-top: 1px solid var(--line); }
.calendar-embedded .calendar-toolbar p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.calendar-toolbar, .review-intro, .settings-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.calendar-toolbar h2, .review-intro h2, .settings-intro h2 { font: 600 30px "Noto Serif SC"; margin: 7px 0 0; }
.review-intro p, .settings-intro p { color: var(--muted); margin: 8px 0 0; font-size: 12px; }
.calendar-controls, .calendar-month-nav { display: flex; align-items: center; gap: 8px; }
.calendar-view-switch { min-height: 50px; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--paper-deep) 72%, transparent); }
.calendar-view-switch button { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 650 9px var(--font-body); transition: color 160ms ease, background-color 160ms ease, box-shadow 180ms ease, transform 140ms var(--ease-enter); }
.calendar-view-switch button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.calendar-view-switch button.active { background: var(--card); color: var(--ink); box-shadow: 0 5px 16px rgba(29,29,31,.08), inset 0 1px 0 rgba(255,255,255,.75); }
.calendar-view-switch button:active { transform: scale(.97); }
.calendar-card { padding: 17px; overflow: hidden; position: relative; box-shadow: 0 18px 60px rgba(16,35,29,.06); }
.calendar-atmosphere { min-height: 108px; margin: -17px -17px 14px; padding: 23px 28px; position: relative; overflow: hidden; display: flex; align-items: end; justify-content: space-between; color: #f7f2e7; background: linear-gradient(115deg, #10231d, #29443a); }
.calendar-atmosphere > span { font: 500 52px var(--font-body); letter-spacing: -.08em; }
.calendar-atmosphere p { position: relative; z-index: 1; margin: 0; font: 10px var(--font-body); text-transform: uppercase; letter-spacing: .08em; }
.calendar-atmosphere p strong { display: block; font-size: 23px; margin-bottom: 5px; color: #d9b777; }
.month-orbit { position: absolute; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: 13%; top: -145px; box-shadow: 0 0 0 26px rgba(255,255,255,.025), 0 0 0 52px rgba(255,255,255,.018); }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays span { text-align: center; color: var(--muted); font: 10px var(--font-body); padding: 10px 0 16px; }
.calendar-day { min-width: 0; min-height: 124px; overflow: hidden; border-top: 1px solid var(--line); border-right: 1px solid var(--line); padding: 11px; background: transparent; text-align: left; position: relative; transition: background-color 150ms ease, transform 150ms var(--ease-enter); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { opacity: .28; }
.calendar-day.current-week { box-shadow: inset 0 0 0 1px rgba(217,183,119,.24); }
.calendar-day.today .day-number { background: var(--ink); color: white; }
.day-number { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 11px var(--font-body); }
.day-mood { width: 30px; height: 30px; position: absolute; right: 8px; top: 9px; display: grid; place-items: center; border-radius: 11px; }
.day-mood svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.05; stroke-linecap: round; stroke-linejoin: round; }
.calendar-grid[data-mode="mood"] .calendar-day.mood-low { background: linear-gradient(145deg, rgba(130,178,228,.2), rgba(130,178,228,.07)); }
.calendar-grid[data-mode="mood"] .calendar-day.mood-calm { background: linear-gradient(145deg, rgba(132,179,145,.19), rgba(132,179,145,.06)); }
.calendar-grid[data-mode="mood"] .calendar-day.mood-good { background: linear-gradient(145deg, rgba(239,195,91,.23), rgba(239,195,91,.07)); }
.day-mood.mood-low { color: #2f80ed; background: rgba(255,255,255,.58); }
.day-mood.mood-calm { color: #1fb76a; background: rgba(255,255,255,.56); }
.day-mood.mood-good { color: #f4a900; background: rgba(255,255,255,.6); }
.calendar-grid[data-mode="heatmap"] .calendar-day.heat-0 { background: color-mix(in srgb, var(--paper-deep) 28%, transparent); }
.calendar-grid[data-mode="heatmap"] .calendar-day.heat-1 { background: color-mix(in srgb, var(--sage) 10%, transparent); }
.calendar-grid[data-mode="heatmap"] .calendar-day.heat-2 { background: color-mix(in srgb, var(--sage) 20%, transparent); }
.calendar-grid[data-mode="heatmap"] .calendar-day.heat-3 { background: color-mix(in srgb, var(--sage) 31%, transparent); }
.calendar-grid[data-mode="heatmap"] .calendar-day.heat-4 { background: color-mix(in srgb, var(--sage) 44%, transparent); }
.day-percent { position: absolute; right: 10px; bottom: 22px; color: var(--muted); font: 8px var(--font-body); }
.calendar-legend { min-height: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px 18px; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 10px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-mood { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 8px; font-size: 11px; }
.legend-mood svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.legend-mood.mood-low { color: #2f80ed; background: rgba(47,128,237,.12); }
.legend-mood.mood-calm { color: #1fb76a; background: rgba(31,183,106,.12); }
.legend-mood.mood-good { color: #f4a900; background: rgba(244,169,0,.14); }
.legend-heat { width: 14px; height: 14px; display: inline-block; border-radius: 5px; border: 1px solid color-mix(in srgb, var(--sage) 18%, var(--line)); }
.legend-heat.heat-0 { background: color-mix(in srgb, var(--paper-deep) 38%, transparent); }
.legend-heat.heat-1 { background: color-mix(in srgb, var(--sage) 12%, transparent); }
.legend-heat.heat-2 { background: color-mix(in srgb, var(--sage) 24%, transparent); }
.legend-heat.heat-4 { background: color-mix(in srgb, var(--sage) 46%, transparent); }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 15px; }
.score-card { background: var(--card); border: 1px solid var(--line); border-radius: 17px; padding: 20px; transition: transform 220ms var(--ease-enter), border-color 180ms ease, box-shadow 220ms ease; }
.score-card-header { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.score-card strong { display: block; font: 500 30px var(--font-body); margin: 17px 0 8px; }
.score-card p { font-size: 10px; color: var(--muted); margin: 0; }
.review-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 15px; }
.panel { padding: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 24px; }
.panel-heading h3 { margin: 6px 0 0; font: 600 17px "Noto Serif SC"; }
.panel-meta, .autosave { color: var(--muted); font: 9px var(--font-body); }
.bar-chart { height: 180px; display: flex; align-items: end; gap: 4px; border-bottom: 1px solid var(--line); padding-top: 15px; }
.bar { flex: 1; min-width: 3px; background: var(--sage-light); border-radius: 3px 3px 0 0; transform-origin: bottom; animation: barGrow 500ms var(--ease-enter) both; }
.bar.high { background: var(--sage); }
@keyframes barGrow { from { transform: scaleY(.05); opacity: .2; } }
.week-row { display: grid; grid-template-columns: 72px 1fr 48px; align-items: center; gap: 12px; margin: 14px 0; font-size: 10px; }
.week-track { height: 7px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.week-fill { height: 100%; background: var(--coral); border-radius: inherit; transform-origin: left; animation: fillGrow 450ms var(--ease-enter) both; }
@keyframes fillGrow { from { transform: scaleX(0); } }
.week-result { text-align: right; color: var(--muted); }
.week-result.pass { color: var(--sage); font-weight: 700; }
.review-draft { margin-top: 15px; }
.review-draft textarea { width: 100%; min-height: 220px; border: 0; resize: vertical; outline: none; background: transparent; line-height: 1.9; font-size: 13px; }
.week-select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: var(--paper); font: 10px var(--font-body); outline: none; }
.week-review-meta { display: flex; align-items: baseline; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.week-review-meta strong { font: 600 18px "Noto Serif SC"; }.week-review-meta span { color: var(--muted); font: 9px var(--font-body); }
.week-review-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 22px; }
.week-review-columns section + section { border-left: 1px solid var(--line); padding-left: 28px; }
.week-review-columns h4 { margin: 6px 0 14px; font: 600 14px "Noto Serif SC"; }
.review-goal-item { display: flex; gap: 9px; align-items: center; padding: 7px 0; font-size: 11px; }
.review-goal-item i { width: 17px; height: 17px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 9px; }
.review-goal-item.done { color: var(--muted); text-decoration: line-through; }.review-goal-item.done i { background: var(--ink); color: white; }
.review-week-output { min-height: 90px; color: var(--muted); font: 11px/1.8 "Noto Serif SC"; white-space: pre-wrap; }
.habit-settings-list { display: grid; gap: 12px; }
.setting-row { display: grid; grid-template-columns: 48px 1.2fr .8fr .8fr 90px 40px; align-items: center; gap: 18px; padding: 17px 20px; border: 1px solid var(--line); background: var(--card); border-radius: 16px; transition: transform 220ms var(--ease-enter), border-color 180ms ease, box-shadow 220ms ease; }
.setting-row .habit-icon { width: 42px; height: 42px; }
.setting-main strong, .setting-main span { display: block; }
.setting-main strong { font: 600 14px "Noto Serif SC"; }
.setting-main span, .setting-cell span { color: var(--muted); font-size: 9px; margin-top: 4px; }
.setting-cell strong, .setting-cell span { display: block; }
.setting-cell strong { font-size: 11px; }
.status-pill { justify-self: start; color: #416353; background: var(--sage-light); border-radius: 999px; padding: 6px 9px; font-size: 9px; }
.day-drawer { position: fixed; z-index: 40; top: 0; right: 0; width: min(480px, 94vw); height: 100vh; background: #f9f6ee; box-shadow: -20px 0 70px rgba(16,35,29,.16); transform: translate3d(102%,0,0); transition: transform 300ms var(--ease-move); display: flex; flex-direction: column; }
.day-drawer.open { transform: translate3d(0,0,0); }
.drawer-backdrop { position: fixed; z-index: 39; inset: 0; background: rgba(6,18,14,.38); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease-enter); }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.day-drawer > header { display: flex; justify-content: space-between; align-items: start; padding: 30px 32px 23px; border-bottom: 1px solid var(--line); }
.day-drawer h2 { font: 600 28px "Noto Serif SC"; margin: 6px 0 0; }
.drawer-content { padding: 26px 32px; overflow-y: auto; flex: 1; }
.drawer-content section + section { margin-top: 32px; }
.drawer-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.drawer-section-title h3 { margin: 0; font: 600 14px "Noto Serif SC"; }
.drawer-section-title span { color: var(--muted); font: 9px var(--font-body); }
.drawer-habits { display: grid; gap: 8px; }
.drawer-habit { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 13px; text-align: left; }
.drawer-habit > span:first-child { display: flex; gap: 11px; align-items: center; }
.drawer-habit.done { background: var(--habit-soft); border-color: var(--habit-color); }
.drawer-habit .habit-check { flex: 0 0 auto; }
.mood-options.compact { margin: 0; }
.mood-options.compact button { padding: 10px 5px; }
#dayNote { width: 100%; min-height: 160px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.52); outline: none; padding: 14px; line-height: 1.7; font-size: 12px; }
.day-drawer > footer { padding: 18px 32px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.day-drawer > footer span { color: var(--muted); font-size: 9px; }
dialog { border: 0; border-radius: 20px; background: #f9f6ee; color: var(--ink); padding: 0; width: min(590px, calc(100vw - 32px)); box-shadow: 0 30px 100px rgba(16,35,29,.25); }
#habitDialog { max-height: min(900px, calc(100dvh - 24px)); overflow: auto; }
dialog::backdrop { background: rgba(6,18,14,.45); backdrop-filter: blur(3px); }
dialog[open] { animation: dialogIn 250ms var(--ease-enter); }
@keyframes dialogIn { from { opacity: 0; transform: scale(.95) translateY(8px); } }
dialog form > header, dialog form > footer { padding: 23px 26px; display: flex; justify-content: space-between; align-items: center; }
dialog form > header { border-bottom: 1px solid var(--line); }
dialog h2 { margin: 5px 0 0; font: 600 23px "Noto Serif SC"; }
.form-grid { padding: 25px 26px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { color: var(--muted); font-size: 10px; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: rgba(255,255,255,.55); margin-top: 6px; outline: none; }
.form-grid textarea { min-height: 72px; resize: vertical; font: 11px/1.55 var(--font-body); }
.tracking-mode-choice { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0; border: 0; }
.tracking-mode-choice legend { margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.tracking-mode-choice label { min-width: 0; display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--card) 72%, transparent); cursor: pointer; }
.tracking-mode-choice input { width: 16px; height: 16px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--sage-dark); }
.tracking-mode-choice span { min-width: 0; display: grid; gap: 3px; }
.tracking-mode-choice strong { color: var(--ink); font-size: 10px; }
.tracking-mode-choice small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.daily-score-choice { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.38); }
.daily-score-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--sage); }
.daily-score-choice span { display: grid; gap: 3px; color: var(--ink); }
.daily-score-choice strong { font-size: 11px; }
.daily-score-choice small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.habit-card .period-note, .drawer-habit .period-note { color: var(--coral); font-size: 8px; letter-spacing: .03em; }
.save-mode.auth { cursor: pointer; color: var(--coral); }
.save-mode.auth i { background: var(--coral); box-shadow: 0 0 0 4px rgba(217,120,97,.12); }
.form-hint { margin: 7px 26px 0; color: var(--muted); font-size: 10px; }
dialog form > footer { justify-content: flex-end; gap: 8px; }
.dialog-footer-spacer { flex: 1; }
.danger-button { border: 1px solid rgba(155,62,49,.28); border-radius: 10px; background: rgba(155,62,49,.06); color: #8f3e34; padding: 10px 14px; cursor: pointer; font: inherit; transition: 160ms ease; }
.danger-button:hover { background: #8f3e34; color: #fff; }
.danger-button[hidden] { display: none; }
.mood-reason-dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden; }
#moodReasonForm { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.mood-reason-body { min-height: 0; padding: 24px 26px 26px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; display: grid; gap: 17px; }
.mood-reason-selection { display: flex; align-items: center; gap: 13px; }
.mood-reason-selection > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; background: linear-gradient(145deg, color-mix(in srgb, var(--sage-light) 78%, white), var(--card)); color: var(--sage); font-size: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.mood-reason-selection > span svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.05; stroke-linecap: round; stroke-linejoin: round; }
.mood-reason-selection > span[data-mood="low"] { color: #2f80ed; background: linear-gradient(145deg, #eaf3ff, #d9eaff); }
.mood-reason-selection > span[data-mood="calm"] { color: #1fb76a; background: linear-gradient(145deg, #e6f8ed, #ccefdc); }
.mood-reason-selection > span[data-mood="good"] { color: #f4a900; background: linear-gradient(145deg, #fff7dc, #ffebad); }
.mood-reason-selection > div { display: grid; gap: 4px; }
.mood-reason-selection strong { font-size: 15px; }
.mood-reason-selection small { color: var(--muted); font: 9px var(--font-body); }
.mood-reason-body > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.mood-reason-body label { display: grid; gap: 8px; color: var(--muted); font-size: 10px; }
.mood-reason-body textarea { width: 100%; min-height: 150px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 18px; outline: none; resize: vertical; background: rgba(255,255,255,.52); font: 12px/1.75 var(--font-body); transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.mood-reason-body textarea:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--card); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent); }
.mood-photo-section { display: grid; gap: 12px; padding-top: 3px; }
.mood-photo-section[hidden] { display: none; }
.mood-photo-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mood-photo-heading > div { min-width: 0; display: grid; gap: 4px; }
.mood-photo-heading strong { font-size: 11px; }
.mood-photo-heading small, .mood-photo-heading > span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.mood-photo-heading > span { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.mood-photo-list { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mood-photo-thumb { position: relative; aspect-ratio: 1; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-deep); }
.mood-photo-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.mood-photo-thumb button { position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 10px; background: rgba(22,24,27,.68); color: white; font-size: 17px; backdrop-filter: blur(12px); }
.mood-photo-add { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px dashed color-mix(in srgb, var(--sage) 38%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--sage-light) 28%, transparent); color: var(--sage-dark); font-size: 10px; font-weight: 700; }
.mood-photo-add svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mood-photo-add:disabled { cursor: default; opacity: .46; }
.mood-photo-status { min-height: 16px; margin: -3px 0 0 !important; color: var(--muted); font-size: 9px !important; }
.mood-photo-status.error { color: #b64c3d; }
.drawer-memory-photos { margin-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.drawer-memory-photos[hidden] { display: none; }
.drawer-memory-photos img { width: 100%; height: 100%; aspect-ratio: 1; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 13px; background: var(--paper-deep); }
.drawer-memory-edit { width: 100%; min-height: 38px; margin-top: 10px; border: 1px solid color-mix(in srgb, var(--sage) 22%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--sage-light) 35%, transparent); color: var(--sage-dark); font-size: 9px; font-weight: 700; }
.drawer-memory-edit[hidden] { display: none; }

.timeline-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.timeline-intro h2 { margin: 6px 0 8px; font: 700 clamp(30px, 5vw, 52px)/1 var(--font-display); letter-spacing: -.045em; }
.timeline-intro p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.timeline-month-nav { min-width: min(320px, 40vw); display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.timeline-month-nav strong { min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--card) 76%, transparent); font-size: 11px; font-variant-numeric: tabular-nums; }
.timeline-summary { min-height: 34px; margin-bottom: 8px; color: var(--muted); font-size: 9px; text-align: right; }
.memory-timeline { position: relative; width: min(760px, 100%); margin: 0 auto; padding: 10px 0 32px 70px; display: grid; gap: 18px; }
.memory-timeline::before { position: absolute; top: 10px; bottom: 24px; left: 24px; width: 1px; content: ""; background: linear-gradient(var(--line), color-mix(in srgb, var(--line) 20%, transparent)); }
.memory-entry { --mood-color: var(--sage); position: relative; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: color-mix(in srgb, var(--card) 88%, transparent); box-shadow: 0 14px 38px rgba(28,32,30,.055); }
.memory-entry::before { position: absolute; left: -52px; top: 24px; width: 13px; height: 13px; border: 4px solid var(--paper); border-radius: 50%; content: ""; background: var(--mood-color); box-shadow: 0 0 0 1px color-mix(in srgb, var(--mood-color) 44%, var(--line)); }
.memory-entry.mood-good { --mood-color: #f4a900; }
.memory-entry.mood-calm { --mood-color: #1fb76a; }
.memory-entry.mood-low { --mood-color: #2f80ed; }
.memory-entry-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.memory-entry-date { display: grid; gap: 3px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.memory-entry-date strong { font: 700 17px var(--font-display); }
.memory-entry-date small { color: var(--muted); font-size: 8px; }
.memory-entry-mood { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 12px; background: color-mix(in srgb, var(--mood-color) 10%, transparent); color: var(--mood-color); font-size: 9px; font-weight: 700; }
.memory-entry-mood svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.memory-entry-reason { margin: 16px 0 0; color: var(--ink); font: 11px/1.75 var(--font-display); white-space: pre-wrap; }
.memory-entry-photos { width: 100%; margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.memory-entry-photo { min-width: 0; margin: 0; overflow: hidden; aspect-ratio: 1; border-radius: 16px; background: var(--paper-deep); }
.memory-entry-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.memory-entry-photos[data-count="1"] { width: min(100%, 620px); grid-template-columns: minmax(0, 1fr); }
.memory-entry-photos[data-count="1"] .memory-entry-photo { aspect-ratio: 16 / 10; }
.memory-entry-photos[data-count="3"] .memory-entry-photo:first-child { grid-column: span 2; aspect-ratio: 16 / 9; }
.memory-empty { min-height: 280px; display: grid; place-items: center; padding: 36px; border: 1px dashed var(--line); border-radius: 24px; color: var(--muted); text-align: center; }
.memory-empty div { max-width: 340px; }
.memory-empty svg { width: 38px; height: 38px; margin-bottom: 16px; fill: none; stroke: var(--sage); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.memory-empty strong, .memory-empty span { display: block; }
.memory-empty strong { color: var(--ink); font-size: 13px; }
.memory-empty span { margin-top: 8px; font-size: 9px; line-height: 1.6; }
.memory-loading { min-height: 280px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.reminder-dialog-content > header, .reminder-dialog-content > footer { padding: 23px 26px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.reminder-dialog-content > header { border-bottom: 1px solid var(--line); }
.reminder-dialog-content > footer { border-top: 1px solid var(--line); }
.reminder-body { padding: 24px 26px; display: grid; gap: 14px; }
.reminder-toggle { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.38); cursor: pointer; }
.reminder-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.reminder-toggle span, .reminder-status-card div { display: grid; gap: 4px; }
.reminder-toggle strong, .reminder-status-card strong { font-size: 12px; }
.reminder-toggle small, .reminder-status-card small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.reminder-time { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 2px; color: var(--muted); font-size: 11px; }
.reminder-time input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); }
.reminder-status-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-deep); }
.reminder-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 5px color-mix(in srgb, var(--muted) 12%, transparent); }
.reminder-status-dot.ready { background: var(--sage); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sage) 15%, transparent); }
.reminder-status-dot.blocked { background: var(--coral); box-shadow: 0 0 0 5px color-mix(in srgb, var(--coral) 13%, transparent); }
.reminder-caveat { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; display: flex; align-items: center; gap: 9px; background: var(--ink); color: white; padding: 11px 15px; border-radius: 999px; opacity: 0; transform: translate3d(-50%,8px,0); pointer-events: none; transition: opacity 180ms var(--ease-enter), transform 180ms var(--ease-enter); }
.toast.show { opacity: 1; transform: translate3d(-50%,0,0); }
.toast span { color: #a8c5b1; }.toast p { margin: 0; font-size: 11px; }

/* Editorial system inherited from the portfolio: restrained paper surfaces,
   literary typography, fine rules and a single terracotta accent. */
.section-heading h2,
.section-heading h3,
.mood-note,
.habit-card h3,
.daily-goals-heading h3,
.weekly-card-heading h3,
.weekly-goal-empty,
.weekly-writing-heading h3,
.weekly-writing-panel textarea,
.calendar-toolbar h2,
.review-intro h2,
.settings-intro h2,
.panel-heading h3,
.week-review-meta strong,
.week-review-columns h4,
.review-week-output,
.setting-main strong,
.day-drawer h2,
.drawer-section-title h3,
dialog h2,
.period-habit > strong {
  font-family: var(--font-display);
}

.habit-card,
.score-card,
.setting-row,
.weekly-goals-panel,
.weekly-writing-panel,
.drawer-habit,
.daily-score-choice {
  border-radius: 22px;
}

#dayNote,
.form-grid input,
.form-grid select,
.weekly-goal-form input,
.week-select {
  border-radius: 15px;
}

dialog { border-radius: 28px; }

.weekly-goals-panel,
.weekly-writing-panel,
.setting-row,
.score-card {
  border-color: rgba(255,255,255,.68);
  background-color: rgba(255,255,255,.74);
  box-shadow: 0 18px 55px rgba(29,29,31,.07), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(145%);
}

.habit-card { border-radius: 22px; box-shadow: 0 12px 38px rgba(29,29,31,.055), inset 0 1px 0 rgba(255,255,255,.85); }
.mood-options button { border-radius: 17px; background: rgba(255,255,255,.38); }
.weekly-goal-form button { border-radius: 13px; box-shadow: 0 8px 20px rgba(29,29,31,.13); }
.week-nav-button, .week-current-button { border-radius: 15px; backdrop-filter: blur(14px); }
.calendar-card { border-radius: 28px; }
.calendar-atmosphere { border-radius: 20px; }
.day-drawer { top: 12px; right: 12px; height: calc(100vh - 24px); border: 1px solid rgba(255,255,255,.74); border-radius: 30px; background: rgba(248,248,250,.86); backdrop-filter: blur(30px) saturate(150%); }
.drawer-backdrop { backdrop-filter: blur(8px); }

.weekly-writing-panel {
  background: linear-gradient(145deg, rgba(184,107,61,.08), transparent 50%), var(--card);
}

.calendar-atmosphere {
  background: radial-gradient(circle at 76% 40%, rgba(65,137,255,.22), transparent 15rem), linear-gradient(115deg, #283126, #202822);
}

.apple-interactive { position: relative; overflow: hidden; isolation: isolate; transform-style: preserve-3d; }
.apple-interactive > :not(.pointer-aura) { position: relative; z-index: 1; }
.pointer-aura { position: absolute; z-index: 0; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; background: radial-gradient(260px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255,255,255,.52), transparent 64%); transition: opacity 160ms ease; }
.hero-card .pointer-aura { background: radial-gradient(320px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(98,163,255,.2), transparent 68%); }
.apple-tilt { transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(0); transition: transform 180ms var(--ease-enter), border-color 160ms ease, box-shadow 180ms ease; }

.main-content,
.language-flag,
.language-label {
  transition: opacity 180ms ease, transform 220ms var(--ease-enter);
}

.language-changing .main-content {
  animation: languageRefresh 240ms var(--ease-enter);
}

@keyframes languageRefresh {
  from { opacity: .42; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.number-pop { animation: numberPop 360ms var(--ease-enter); }
@keyframes numberPop {
  0% { opacity: .42; transform: translateY(5px) scale(.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
  .apple-interactive:hover .pointer-aura { opacity: 1; }
  .apple-tilt:hover { transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-4px); border-color: rgba(255,255,255,.95); box-shadow: 0 24px 64px rgba(29,29,31,.12), inset 0 1px 0 rgba(255,255,255,.96); }
  .calendar-day:hover { z-index: 2; border-radius: 14px; background: rgba(255,255,255,.78); box-shadow: 0 9px 28px rgba(29,29,31,.09); transform: scale(1.018); }
  .primary-button:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(29,29,31,.2), inset 0 1px 0 rgba(255,255,255,.18); }
  .icon-button:hover { transform: translateY(-1px); background: rgba(255,255,255,.7); box-shadow: 0 8px 20px rgba(29,29,31,.08); }
  .language-switcher:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.9); box-shadow: 0 12px 30px rgba(29,29,31,.09), inset 0 1px 0 rgba(255,255,255,.95); }
  .habit-carousel-arrow:not(:disabled):hover { transform: translateY(-1px); background: var(--card); }
}
@media (max-width: 1050px) {
  .habit-page, .score-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .review-grid { grid-template-columns: 1fr; }
  .weekly-goals-panel, .week-review-columns { grid-template-columns: 1fr; }
  .weekly-classical-image { min-height: 240px; }
  .week-review-columns section + section { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 22px; }
  .mood-card { min-height: 230px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; height: 70px; margin: 0; padding: 8px 12px; display: block; border-radius: 24px; box-shadow: 0 18px 48px rgba(21,25,23,.24); }
  .brand, .sidebar-note, .sidebar-long-term, .profile { display: none; }
  .main-nav { grid-template-columns: repeat(5, 1fr); }
  .nav-item { display: grid; justify-items: center; gap: 2px; padding: 7px 2px; font-size: 9px; }
  .main-content { padding: 25px 16px 110px; }
  .topbar { display: block; margin-bottom: 27px; }
  .topbar h1 { max-width: 100%; font-size: clamp(27px, 9vw, 36px); }
  .top-actions { margin-top: 19px; justify-content: space-between; }
  .top-actions { flex-wrap: wrap; }
  .save-mode { order: 3; width: 100%; }
  .language-switcher { order: 1; }
  .date-jump { order: 2; }
  #todayButton { order: 4; width: 100%; }
  .hero-card { padding: 28px 22px; min-height: 300px; align-items: flex-start; }
  .hero-copy { min-width: 0; max-width: 100%; }
  .hero-copy h2 { max-width: calc(100% - 8px); overflow-wrap: anywhere; font-size: clamp(23px, 7.5vw, 33px); }
  .progress-orbit { width: 100px; position: absolute; right: 22px; bottom: 22px; }
  .habit-page { grid-template-columns: 1fr 1fr; }
  .habit-card { min-height: 154px; padding: 17px; }
  .calendar-card { padding: 7px; }
  .calendar-day { min-height: 82px; padding: 6px; }
  .day-percent { display: none; }
  .calendar-atmosphere { min-height: 90px; padding: 18px 20px; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .setting-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; }
  .setting-row .setting-cell, .setting-row .status-pill { display: none; }
  .review-intro, .settings-intro { align-items: flex-start; }
  .timeline-intro { align-items: stretch; flex-direction: column; gap: 18px; }
  .timeline-month-nav { width: 100%; min-width: 0; }
  .memory-timeline { padding-left: 44px; }
  .memory-timeline::before { left: 14px; }
  .memory-entry { padding: 17px; border-radius: 20px; }
  .memory-entry::before { left: -36px; }
  .memory-entry-photos[data-count="1"] { width: 100%; }
  .weekly-heading { display: block; }
  .week-navigator { width: 100%; margin-top: 0; grid-template-columns: 40px 1fr 40px; }
}

/* Focus timer: a compact daily ritual, not a separate productivity dashboard. */
.focus-overview-card {
  position: relative;
  min-width: 0;
  margin-top: 22px;
  padding: 24px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  align-items: center;
  gap: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.66);
  border-radius: 26px;
  background: linear-gradient(118deg, rgba(224,237,229,.74), rgba(232,238,248,.68)), var(--card);
  box-shadow: 0 18px 55px rgba(29,29,31,.065), inset 0 1px 0 rgba(255,255,255,.88);
  backdrop-filter: blur(24px) saturate(145%);
}
.focus-overview-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -118px; top: -150px; border: 1px solid rgba(104,114,92,.11); border-radius: 50%; box-shadow: 0 0 0 42px rgba(104,114,92,.035), 0 0 0 84px rgba(104,114,92,.025); pointer-events: none; }
.focus-overview-copy { position: relative; z-index: 1; }
.focus-overview-copy h2 { margin: 7px 0 5px; font: 700 22px/1.2 var(--font-display); letter-spacing: -.025em; }
.focus-overview-copy p { max-width: 330px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.focus-today-breakdown { max-width: 330px; margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.focus-today-breakdown[hidden], .focus-review-breakdown[hidden] { display: none; }
.focus-today-breakdown span { min-width: 0; padding: 6px 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--sage) 18%, var(--line)); border-radius: 999px; background: rgba(255,255,255,.34); }
.focus-today-breakdown b { max-width: 130px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.focus-today-breakdown small { color: var(--muted); font-size: 8px; }
.focus-quick-settings { margin-top: 17px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.focus-quick-settings > span { color: var(--muted); font-size: 8px; }
.focus-quick-presets { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255,255,255,.48); box-shadow: inset 0 0 0 1px var(--line); }
.focus-quick-presets button { min-width: 42px; min-height: 31px; padding: 5px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
.focus-quick-presets button.active { color: var(--ink); background: rgba(255,255,255,.88); box-shadow: 0 3px 10px rgba(29,29,31,.08); }
.focus-quick-presets button:disabled { opacity: .42; cursor: default; }
.focus-settings-button { min-height: 34px; padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.36); color: var(--muted); font-size: 8px; font-weight: 700; }
.focus-settings-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.focus-inline-timer { position: relative; z-index: 1; min-width: 0; min-height: 132px; padding: 16px; display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(104px, auto); align-items: center; gap: 12px; border: 1px solid rgba(255,255,255,.68); border-radius: 22px; background: rgba(255,255,255,.48); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.focus-inline-ring { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#6f8f7d calc(var(--focus-inline-progress) * 100%), rgba(104,114,92,.12) 0); }
.focus-inline-ring i { width: 64px; height: 64px; border-radius: inherit; background: color-mix(in srgb, white 82%, var(--sage-light)); box-shadow: inset 0 1px 0 rgba(255,255,255,.82); }
.focus-inline-copy { min-width: 0; display: grid; }
.focus-inline-copy > span { color: var(--sage); font: 600 8px var(--font-body); letter-spacing: .15em; text-transform: uppercase; }
.focus-inline-copy strong { margin: 5px 0 4px; font: 680 clamp(30px, 3.5vw, 44px)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.focus-inline-copy small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.focus-inline-actions { display: grid; gap: 7px; justify-items: stretch; }
.focus-inline-actions .primary-button, .focus-inline-actions .secondary-button { min-width: 118px; }
.focus-inline-actions .text-button { min-height: 30px; }

.focus-dialog { width: min(820px, calc(100vw - 28px)); max-height: min(900px, calc(100vh - 28px)); padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.72); border-radius: 30px; background: rgba(248,248,250,.97); box-shadow: 0 34px 110px rgba(29,29,31,.27); backdrop-filter: blur(34px) saturate(150%); }
.focus-dialog::backdrop { background: rgba(15,18,20,.43); backdrop-filter: blur(7px); }
.focus-dialog-content > header { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.focus-dialog-content > header h2 { margin: 5px 0 0; font: 700 20px/1.2 var(--font-display); letter-spacing: -.025em; }
.focus-dialog-body { padding: 24px 28px 26px; display: grid; grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.1fr); align-items: center; gap: 28px 34px; }
.focus-clock { --focus-progress: 0; position: relative; width: min(100%, 300px); aspect-ratio: 1; justify-self: center; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.72), rgba(232,238,248,.34) 59%, transparent 60%); }
.focus-clock::before { content: ""; position: absolute; inset: 12%; border-radius: inherit; background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.9), rgba(231,238,234,.75)); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 44px rgba(41,67,55,.08); }
.focus-clock svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-clock circle { fill: none; stroke-width: 7; }
.focus-clock-track { stroke: rgba(104,114,92,.12); }
.focus-clock-progress { stroke: #6f8f7d; stroke-linecap: round; stroke-dasharray: 716.29; stroke-dashoffset: calc(716.29 * (1 - var(--focus-progress))); transition: stroke-dashoffset 360ms linear; }
.focus-clock-copy { position: relative; z-index: 1; width: 68%; display: grid; text-align: center; }
.focus-clock-copy > span { color: var(--sage); font: 600 9px var(--font-body); letter-spacing: .16em; text-transform: uppercase; }
.focus-clock-copy strong { margin: 9px 0 7px; font: 650 clamp(42px, 6vw, 62px)/.95 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.focus-clock-copy small { min-height: 25px; color: var(--muted); font: 9px/1.4 var(--font-body); }
.focus-clock.focus-complete { animation: focusComplete 720ms var(--ease-enter); }
@keyframes focusComplete { 45% { transform: scale(1.035); filter: drop-shadow(0 0 24px rgba(111,143,125,.3)); } }
.focus-setup { min-width: 0; display: grid; gap: 13px; }
.focus-setup[hidden], .focus-custom-fields[hidden] { display: none; }
.focus-setup > label, .focus-custom-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; }
.focus-setup select, .focus-setup input[type="text"], .focus-setup input:not([type]) , .focus-custom-fields input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(255,255,255,.55); padding: 10px 12px; font-size: 11px; }
.focus-setup select:focus, .focus-setup input:focus { border-color: color-mix(in srgb, var(--accent) 46%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.focus-preset-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.focus-preset-group button { min-height: 58px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.34); }
.focus-preset-group button.active { border-color: color-mix(in srgb, var(--sage) 58%, var(--line)); background: color-mix(in srgb, var(--sage-light) 70%, white); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.focus-preset-group strong { font: 650 16px var(--font-display); }
.focus-preset-group small { color: var(--muted); font-size: 8px; }
.focus-custom-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.focus-options { display: flex; flex-wrap: wrap; gap: 7px; }
.focus-options label { min-height: 34px; padding: 7px 10px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); color: var(--muted); font-size: 8px; }
.focus-options input { accent-color: var(--sage); }
.focus-actions { grid-column: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.focus-actions .primary-button { flex: 1 1 140px; }
.focus-interrupt { color: #a24e40; }
.focus-caveat { grid-column: 1 / -1; margin: -8px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; text-align: center; }
.weekly-goal.focus-linked { grid-template-columns: 23px minmax(0,1fr) 30px 24px; }
.weekly-goal-focus { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border-radius: 9px !important; color: var(--sage); opacity: .68; transition: opacity 150ms ease, background-color 150ms ease, transform 150ms var(--ease-enter); }
.weekly-goal-focus svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.weekly-goal-focus:hover { opacity: 1; background: var(--sage-light); }

html[data-theme="dark"] .focus-overview-card { border-color: var(--edge-soft); background: linear-gradient(118deg, rgba(76,112,91,.14), rgba(74,101,143,.12)), var(--surface-1); box-shadow: 0 18px 52px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.055); }
html[data-theme="dark"] .focus-inline-timer,
html[data-theme="dark"] .focus-quick-presets,
html[data-theme="dark"] .focus-settings-button,
html[data-theme="dark"] .focus-preset-group button,
html[data-theme="dark"] .focus-options label,
html[data-theme="dark"] .focus-setup select,
html[data-theme="dark"] .focus-setup input { color: var(--ink); border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .focus-preset-group button.active { color: #e3f3e8; border-color: rgba(155,194,171,.45); background: #30443a; }
html[data-theme="dark"] .focus-quick-presets button.active { color: #fff; background: var(--surface-3); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 10px rgba(0,0,0,.22); }
html[data-theme="dark"] .focus-inline-ring { background: conic-gradient(#9bc2ab calc(var(--focus-inline-progress) * 100%), rgba(255,255,255,.1) 0); }
html[data-theme="dark"] .focus-inline-ring i { background: var(--surface-1); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
html[data-theme="dark"] .focus-clock { background: radial-gradient(circle, rgba(255,255,255,.035), rgba(125,183,255,.045) 59%, transparent 60%); }
html[data-theme="dark"] .focus-clock::before { background: radial-gradient(circle at 35% 28%, #30343a, #24282d); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 18px 44px rgba(0,0,0,.26); }
html[data-theme="dark"] .focus-clock-track { stroke: rgba(255,255,255,.1); }
html[data-theme="dark"] .focus-clock-progress { stroke: #9bc2ab; }

@media (max-width: 760px) {
  .focus-overview-card { margin-top: 18px; padding: 21px; grid-template-columns: 1fr; gap: 18px; border-radius: 22px; }
  .focus-overview-copy { padding-right: 0; }
  .focus-inline-timer { min-height: 0; padding: 16px; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .focus-inline-ring { width: 60px; height: 60px; }
  .focus-inline-ring i { width: 50px; height: 50px; }
  .focus-inline-copy strong { font-size: 31px; }
  .focus-inline-actions { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .focus-inline-actions .primary-button { min-width: 0; }
  .focus-inline-actions .secondary-button { min-width: 96px; }
  .focus-inline-actions .text-button { grid-column: 1 / -1; }
  .focus-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 26px; }
  .focus-dialog-content > header { padding: 18px; }
  .focus-dialog-content > header h2 { font-size: 17px; }
  .focus-dialog-body { max-height: calc(100dvh - 92px); padding: 18px; overflow-y: auto; grid-template-columns: 1fr; gap: 17px; }
  .focus-clock { width: min(66vw, 245px); }
  .focus-actions { grid-column: 1; position: sticky; bottom: -18px; z-index: 2; padding: 10px 0 18px; background: linear-gradient(transparent, rgba(248,248,250,.96) 25%); }
  html[data-theme="dark"] .focus-actions { background: linear-gradient(transparent, rgba(46,49,56,.97) 25%); }
  .focus-caveat { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .focus-review-day i, .focus-clock.focus-complete { animation: none; }
  .focus-clock-progress { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Adaptive appearance and richer controls — calendar and page structure stay unchanged. */
body { transition: color 240ms ease, background-color 320ms ease; }
:where(.sidebar, .hero-card, .mood-card, .daily-goals-card, .calendar-card, .panel, .weekly-goals-panel, .weekly-writing-panel, .setting-row, .score-card, .habit-card, .language-switcher, .date-jump, .theme-switcher, .icon-button, .week-nav-button, .week-current-button, .day-drawer, dialog, input, select, textarea) { transition-property: color, background-color, border-color, box-shadow, transform; transition-duration: 220ms; transition-timing-function: var(--ease-enter); }
.brand-mark svg { width: 27px; height: 27px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .brand-path { stroke: rgba(255,255,255,.68); }
.brand-mark .walker-limbs { stroke-width: 2.6; }
.theme-switcher { display: grid; grid-template-columns: auto minmax(72px, auto); align-items: center; gap: 6px; min-height: 42px; padding: 4px 9px; border: 1px solid rgba(255,255,255,.62); border-radius: 15px; background: rgba(255,255,255,.58); box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 8px 24px rgba(29,29,31,.05); backdrop-filter: blur(18px) saturate(150%); }
.theme-current-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.42); font-size: 13px; }
.theme-switcher select { min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: 700 10px var(--font-body); cursor: pointer; }
.lucide-icon { width: 19px; height: 19px; display: block; }
.inline-habit-label { display: inline-flex; align-items: center; gap: 7px; }
.inline-habit-label .lucide-icon { width: 14px; height: 14px; flex: 0 0 auto; }
.icon-picker-field { position: relative; }
.color-picker-field { position: relative; }
.icon-picker-trigger { width: 100%; min-height: 42px; margin-top: 6px; padding: 8px 10px; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.55); text-align: left; cursor: pointer; }
.icon-picker-trigger .lucide-icon { width: 20px; height: 20px; color: var(--sage); }
.icon-picker-trigger b { color: var(--muted); font-size: 10px; }
.icon-picker-popover { position: absolute; z-index: 10; top: calc(100% + 7px); left: 0; width: min(390px, 82vw); padding: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; border: 1px solid var(--line); border-radius: 19px; background: color-mix(in srgb, var(--paper) 88%, transparent); box-shadow: 0 22px 55px rgba(29,29,31,.18); backdrop-filter: blur(28px) saturate(150%); }
.icon-picker-popover[hidden] { display: none; }
.icon-choice { min-width: 0; padding: 10px 5px; display: grid; place-items: center; gap: 5px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-choice span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 8px; white-space: nowrap; }
.icon-choice.selected { color: var(--ink); border-color: var(--line); background: var(--card); box-shadow: 0 7px 18px rgba(29,29,31,.07); }
.color-picker-trigger { width: 100%; min-height: 42px; margin-top: 6px; padding: 8px 10px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.55); color: var(--ink); text-align: left; cursor: pointer; }
.color-picker-trigger > i { width: 18px; height: 18px; display: block; border: 3px solid color-mix(in srgb, currentColor 5%, transparent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(29,29,31,.1); }
.color-picker-trigger > span { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.color-picker-trigger > b { color: var(--muted); font-size: 10px; }
.color-picker-popover { position: absolute; z-index: 12; top: calc(100% + 7px); right: 0; width: min(270px, 82vw); padding: 8px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--paper) 92%, transparent); box-shadow: 0 22px 55px rgba(29,29,31,.18); backdrop-filter: blur(28px) saturate(150%); }
.color-picker-popover[hidden] { display: none; }
.color-choice { width: 100%; min-height: 40px; padding: 7px 9px; display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.color-choice > i { width: 20px; height: 20px; display: block; border-radius: 50%; background: var(--choice-color); box-shadow: 0 0 0 5px var(--choice-soft), 0 0 0 6px color-mix(in srgb, var(--choice-color) 20%, transparent); }
.color-choice > span { font-size: 10px; font-weight: 650; }
.color-choice > b { color: var(--sage); font-size: 11px; text-align: center; }
.color-choice.selected { border-color: var(--line); background: var(--card); }
.habit-live-preview { grid-column: 1 / -1; min-height: 74px; padding: 13px 14px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 24px; align-items: center; gap: 12px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--habit-color) 35%, var(--line)); border-radius: 16px; background: linear-gradient(110deg, color-mix(in srgb, var(--habit-soft) 70%, var(--card)), var(--card)); }
.habit-live-preview .habit-icon { width: 42px; height: 42px; }
.habit-live-preview > div { min-width: 0; display: grid; gap: 3px; }
.habit-live-preview small { color: var(--habit-color); font: 600 7px var(--font-body); letter-spacing: .13em; text-transform: uppercase; }
.habit-live-preview strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.habit-live-preview span { color: var(--muted); font-size: 9px; }
.habit-live-preview #habitPreviewNote { max-width: 100%; margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.habit-live-preview > i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--habit-color); color: #fff; font-size: 10px; font-style: normal; }
html[data-theme="dark"] .color-picker-trigger,
html[data-theme="dark"] .color-picker-popover { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .color-choice.selected { border-color: var(--edge-soft); background: var(--surface-3); }
html[data-theme="dark"] .habit-live-preview { background: linear-gradient(110deg, color-mix(in srgb, var(--habit-color) 10%, var(--surface-2)), var(--surface-1)); }
html[data-theme="dark"] .tracking-mode-choice label { border-color: var(--edge-soft); background: var(--surface-2); }
.export-dialog { max-height: min(860px, calc(100dvh - 28px)); overflow: auto; }
.export-dialog form { display: grid; }
.backup-intro { margin: 20px 26px 2px; padding: 15px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb, var(--sage) 36%, var(--line)); border-radius: 18px; background: color-mix(in srgb, var(--sage-light) 62%, transparent); }
.backup-intro-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--sage); color: white; font-size: 13px; }
.backup-intro div, .restore-file-button > span:last-child, .import-preview-copy > div { min-width: 0; display: grid; gap: 3px; }
.backup-intro strong, .restore-file-button strong, .import-preview-copy strong { font-size: 12px; }
.backup-intro small, .restore-file-button small, .import-preview-copy small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.backup-tabs { margin: 16px 26px 0; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper-deep); }
.backup-tabs button { min-height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: 700 11px var(--font-body); cursor: pointer; transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 140ms var(--ease-enter); }
.backup-tabs button:active { transform: scale(.985); }
.backup-tabs button.active { color: var(--ink); background: var(--card); box-shadow: 0 5px 15px rgba(29,29,31,.07), inset 0 1px 0 rgba(255,255,255,.64); }
.backup-section[hidden] { display: none !important; }
.backup-section { padding: 20px 26px 4px; }
.backup-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.backup-section-heading h3 { margin: 4px 0 0; font: 600 17px var(--font-display); }
.backup-section-heading > small { max-width: 230px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: right; }
.export-options { padding: 14px 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.export-options > label { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.38); cursor: pointer; }
.export-options input[type="radio"] { width: 17px; height: 17px; accent-color: var(--accent); }
.export-options span { display: grid; gap: 3px; }
.export-options strong { font-size: 12px; }
.export-options small { color: var(--muted); font-size: 9px; }
.media-backup-option { margin: 2px 0 14px; display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 17px; background: color-mix(in srgb, var(--accent) 7%, transparent); cursor: pointer; }
.media-backup-option[hidden] { display: none !important; }
.media-backup-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.media-backup-option span { display: grid; gap: 3px; }
.media-backup-option strong { font-size: 12px; }
.media-backup-option small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.media-backup-option:has(input:disabled) { opacity: .48; cursor: default; }
.export-date-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; }
.export-date-fields input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.export-date-fields input[hidden] { display: none; }
.restore-section { padding-bottom: 20px; }
.restore-file-button { width: 100%; margin-top: 14px; padding: 15px; display: flex; align-items: center; gap: 12px; border: 1px dashed color-mix(in srgb, var(--muted) 46%, transparent); border-radius: 18px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-enter); }
.restore-file-button:active { transform: scale(.99); }
.restore-file-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--paper-deep); color: var(--muted); font-size: 18px; }
.import-error { margin: 12px 0 0; padding: 11px 13px; border-radius: 13px; background: color-mix(in srgb, var(--coral) 13%, transparent); color: var(--coral); font-size: 10px; line-height: 1.5; }
.import-preview { margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.import-preview-copy { display: flex; align-items: center; gap: 12px; }
.import-file-badge { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--paper-deep); color: var(--sage); font: 600 9px var(--font-body); }
.import-preview-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.import-preview > p { margin: 11px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.undo-restore-button { margin-top: 12px; padding: 4px 0; cursor: pointer; }
.restore-file-button[hidden], .import-preview[hidden], .import-error[hidden], .undo-restore-button[hidden] { display: none !important; }
.profile-actions #exportButton svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .backup-intro { background: color-mix(in srgb, var(--sage-light) 56%, var(--surface-1)); }
html[data-theme="dark"] .export-options > label, html[data-theme="dark"] .restore-file-button { background: rgba(255,255,255,.025); }
html[data-theme="dark"] .backup-tabs { border-color: var(--edge-soft); background: #171a1f; }
html[data-theme="dark"] .backup-tabs button.active { color: #fff; background: #30343b; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 12px rgba(0,0,0,.22); }

@media (hover: hover) and (pointer: fine) {
  .restore-file-button:hover { border-color: var(--sage); background: color-mix(in srgb, var(--sage-light) 38%, transparent); }
}

@media (max-width: 560px) {
  .export-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 24px; }
  .export-dialog form > header, .export-dialog form > footer { padding: 19px 18px; }
  .backup-intro { margin: 16px 18px 0; }
  .backup-tabs { margin: 14px 18px 0; }
  .backup-section { padding: 18px 18px 2px; }
  .backup-section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .backup-section-heading > small { max-width: none; text-align: left; }
  .export-options { grid-template-columns: 1fr; }
  .export-date-fields { grid-column: auto; }
  .restore-section { padding-bottom: 18px; }
  .import-preview-actions { display: grid; grid-template-columns: 1fr; }
  .import-preview-actions button { width: 100%; }
}
.celebration { position: fixed; z-index: 80; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(67,139,255,.14), transparent 28rem); }
.celebration-ring { width: 90px; height: 90px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.88); color: #46705a; font-size: 34px; box-shadow: 0 25px 80px rgba(29,29,31,.2), 0 0 0 0 rgba(101,169,255,.3); backdrop-filter: blur(22px); transform: scale(.5); }
.celebration p { margin: 0; padding: 9px 14px; border-radius: 999px; background: rgba(29,29,31,.82); color: white; font-size: 12px; transform: translateY(8px); }
.celebration.show { animation: celebrateFade 1.9s var(--ease-enter) both; }
.celebration.show .celebration-ring { animation: celebrateRing 1.4s var(--ease-enter) both; }
.celebration.show p { animation: celebrateText 1.4s .08s var(--ease-enter) both; }
@keyframes celebrateFade { 0%,100% { opacity: 0; } 12%,72% { opacity: 1; } }
@keyframes celebrateRing { 0% { transform: scale(.45) rotate(-14deg); box-shadow: 0 25px 80px rgba(29,29,31,.2), 0 0 0 0 rgba(101,169,255,.32); } 34% { transform: scale(1.08) rotate(3deg); box-shadow: 0 25px 80px rgba(29,29,31,.2), 0 0 0 28px rgba(101,169,255,0); } 100% { transform: scale(1); } }
@keyframes celebrateText { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: #b7b9c1;
  --paper: #17191d;
  --paper-deep: #292c32;
  --card: #22252a;
  --line: rgba(255,255,255,.14);
  --sage: #9bc2ab;
  --sage-light: #30443a;
  --amber: #f0b96e;
  --coral: #ff9b87;
  --blue: #96c2d2;
  --warm: #2a3548;
  --accent: #7db7ff;
  --surface-base: #17191d;
  --surface-1: #202328;
  --surface-2: #292c32;
  --surface-3: #32363d;
  --edge-soft: rgba(255,255,255,.1);
  --edge-strong: rgba(255,255,255,.2);
}
html[data-theme="dark"] body { background: radial-gradient(circle at 80% -8%, rgba(75,126,205,.18), transparent 34rem), radial-gradient(circle at 15% 75%, rgba(87,139,106,.13), transparent 38rem), var(--surface-base); }
html[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .018; }
html[data-theme="dark"] .sidebar { background: linear-gradient(155deg, rgba(37,46,42,.98), rgba(25,28,31,.99)); border-color: var(--edge-soft); box-shadow: 0 26px 74px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.055); }
html[data-theme="dark"] .nav-item { color: rgba(245,245,247,.64); }
html[data-theme="dark"] .nav-item.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.12); }
html[data-theme="dark"] .sidebar-note { background: rgba(255,255,255,.06); border-color: var(--edge-soft); }
html[data-theme="dark"] .sidebar-note p { color: rgba(255,255,255,.82); }
html[data-theme="dark"] .sidebar-note small,
html[data-theme="dark"] .profile small { color: rgba(255,255,255,.52); }
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .kicker { color: #9bc2ab; }
html[data-theme="dark"] .language-switcher,
html[data-theme="dark"] .date-jump,
html[data-theme="dark"] .theme-switcher,
html[data-theme="dark"] .week-nav-button,
html[data-theme="dark"] .week-current-button,
html[data-theme="dark"] .icon-button { background: rgba(45,49,55,.88); border-color: var(--edge-soft); box-shadow: inset 0 1px 0 rgba(255,255,255,.065), 0 9px 24px rgba(0,0,0,.18); }
html[data-theme="dark"] .theme-current-icon { color: #fff; background: #3a3e46; box-shadow: 0 4px 14px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.1); }
html[data-theme="dark"] .language-label { color: #f0b96e; }
html[data-theme="dark"] .primary-button { background: var(--accent); color: #0b1725; border-color: rgba(255,255,255,.12); box-shadow: 0 10px 26px rgba(47,121,216,.24), inset 0 1px 0 rgba(255,255,255,.34); }
html[data-theme="dark"] .secondary-button { background: var(--surface-3); border-color: var(--edge-soft); }
html[data-theme="dark"] .hero-card { border-color: var(--edge-strong); background: radial-gradient(circle at 77% 45%, rgba(94,153,238,.22), transparent 24rem), linear-gradient(135deg, #303940, #293238 62%, #242a2e); box-shadow: 0 24px 66px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.1); }
html[data-theme="dark"] .progress-orbit-ring::after { background: #22292d; }
html[data-theme="dark"] .mood-card,
html[data-theme="dark"] .daily-goals-card,
html[data-theme="dark"] .calendar-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .weekly-goals-panel,
html[data-theme="dark"] .weekly-writing-panel,
html[data-theme="dark"] .setting-row,
html[data-theme="dark"] .score-card,
html[data-theme="dark"] .habit-card { background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 36%), var(--surface-1); border-color: var(--edge-soft); box-shadow: 0 18px 52px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.055); }
html[data-theme="dark"] .tomorrow-goals-card { background: linear-gradient(145deg, rgba(125,183,255,.09), transparent 48%), var(--surface-1); }
html[data-theme="dark"] .reminder-toggle,
html[data-theme="dark"] .reminder-time input,
html[data-theme="dark"] .reminder-status-card { background: var(--surface-2); border-color: var(--edge-soft); }
html[data-theme="dark"] .weekly-writing-panel { background: linear-gradient(145deg, rgba(240,185,110,.09), transparent 48%), var(--surface-1); }
html[data-theme="dark"] .mood-options button,
html[data-theme="dark"] .weekly-goal-form input,
html[data-theme="dark"] #dayNote,
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .icon-picker-trigger,
html[data-theme="dark"] .export-options > label,
html[data-theme="dark"] .daily-score-choice,
html[data-theme="dark"] .week-select { color: var(--ink); background: var(--surface-2); border-color: var(--edge-soft); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #858994; opacity: 1; }
html[data-theme="dark"] .mood-options button.selected { color: #ddf5e6; background: #30483c; border-color: rgba(155,194,171,.58); }
html[data-theme="dark"] .mood-options button[data-mood="低落"].selected { color: #b9dbff; background: rgba(93,143,197,.18); border-color: rgba(125,183,255,.42); }
html[data-theme="dark"] .mood-options button[data-mood="平静"].selected { color: #c0e1ca; background: rgba(100,138,113,.2); border-color: rgba(155,194,171,.42); }
html[data-theme="dark"] .mood-options button[data-mood="很好"].selected { color: #ffe2a2; background: rgba(182,129,37,.2); border-color: rgba(240,185,110,.42); }
html[data-theme="dark"] .mood-reason-summary { color: #b7bdc8; background: rgba(155,194,171,.07); border-color: rgba(155,194,171,.2); }
html[data-theme="dark"] .mood-reason-selection > span { color: #b6dcc3; background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
html[data-theme="dark"] .mood-reason-selection > span[data-mood="low"] { color: #5aa4ff; background: rgba(47,128,237,.18); }
html[data-theme="dark"] .mood-reason-selection > span[data-mood="calm"] { color: #43d785; background: rgba(31,183,106,.18); }
html[data-theme="dark"] .mood-reason-selection > span[data-mood="good"] { color: #ffc13a; background: rgba(244,169,0,.18); }
html[data-theme="dark"] .mood-reason-body textarea { color: var(--ink); background: var(--surface-2); border-color: var(--edge-soft); }
html[data-theme="dark"] .mood-reason-body textarea:focus { background: var(--surface-3); border-color: rgba(125,183,255,.48); box-shadow: 0 0 0 4px rgba(125,183,255,.08); }
html[data-theme="dark"] .mood-photo-thumb { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .mood-photo-add { color: #b6dcc3; border-color: rgba(155,194,171,.28); background: rgba(155,194,171,.065); }
html[data-theme="dark"] .drawer-memory-photos img { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .drawer-memory-edit { color: #b6dcc3; border-color: rgba(155,194,171,.24); background: rgba(155,194,171,.065); }
html[data-theme="dark"] .day-memory-status i,
html[data-theme="dark"] .day-calendar-status { border-color: var(--edge-soft); background: rgba(18,23,29,.68); }
html[data-theme="dark"] .memory-entry, html[data-theme="dark"] .timeline-month-nav strong { border-color: var(--edge-soft); background: var(--surface-1); }
html[data-theme="dark"] .memory-entry::before { border-color: var(--paper); }
html[data-theme="dark"] .habit-icon { color: color-mix(in srgb, var(--habit-color) 72%, white); background: color-mix(in srgb, var(--habit-color) 18%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--habit-color) 28%, transparent); }
html[data-theme="dark"] .habit-card::after { background: color-mix(in srgb, var(--habit-color) 28%, transparent); opacity: .62; }
html[data-theme="dark"] .habit-card.completed,
html[data-theme="dark"] .drawer-habit.done { background: color-mix(in srgb, var(--habit-color) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--habit-color) 62%, var(--edge-soft)); }
html[data-theme="dark"] .habit-check { background: rgba(0,0,0,.08); border-color: var(--edge-strong); }
html[data-theme="dark"] .calendar-atmosphere { border: 1px solid rgba(255,255,255,.1); background: radial-gradient(circle at 76% 40%, rgba(92,150,235,.24), transparent 15rem), linear-gradient(115deg, #29362f, #222c29); }
html[data-theme="dark"] .calendar-day { border-color: var(--edge-soft); }
html[data-theme="dark"] .calendar-day.current-week { box-shadow: inset 0 0 0 1px rgba(240,185,110,.25); }
html[data-theme="dark"] .calendar-day.today .day-number { background: var(--accent); color: #0b1725; box-shadow: 0 0 0 4px rgba(125,183,255,.12); }
html[data-theme="dark"] .week-track { background: #30343b; }
html[data-theme="dark"] .calendar-view-switch { border-color: var(--edge-soft); background: var(--surface-1); }
html[data-theme="dark"] .calendar-view-switch button.active { color: #f4f6f8; background: var(--surface-3); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 7px 18px rgba(0,0,0,.2); }
html[data-theme="dark"] .calendar-grid[data-mode="mood"] .calendar-day.mood-low { background: linear-gradient(145deg, rgba(93,143,197,.22), rgba(93,143,197,.07)); }
html[data-theme="dark"] .calendar-grid[data-mode="mood"] .calendar-day.mood-calm { background: linear-gradient(145deg, rgba(100,138,113,.22), rgba(100,138,113,.07)); }
html[data-theme="dark"] .calendar-grid[data-mode="mood"] .calendar-day.mood-good { background: linear-gradient(145deg, rgba(182,129,37,.24), rgba(182,129,37,.07)); }
html[data-theme="dark"] .day-mood { background: rgba(18,21,26,.28); }
html[data-theme="dark"] .day-mood.mood-low { color: #5aa4ff; }
html[data-theme="dark"] .day-mood.mood-calm { color: #43d785; }
html[data-theme="dark"] .day-mood.mood-good { color: #ffc13a; }
html[data-theme="dark"] .calendar-grid[data-mode="heatmap"] .calendar-day.heat-0 { background: rgba(255,255,255,.015); }
html[data-theme="dark"] .calendar-grid[data-mode="heatmap"] .calendar-day.heat-1 { background: rgba(143,182,160,.09); }
html[data-theme="dark"] .calendar-grid[data-mode="heatmap"] .calendar-day.heat-2 { background: rgba(143,182,160,.17); }
html[data-theme="dark"] .calendar-grid[data-mode="heatmap"] .calendar-day.heat-3 { background: rgba(143,182,160,.26); }
html[data-theme="dark"] .calendar-grid[data-mode="heatmap"] .calendar-day.heat-4 { background: rgba(143,182,160,.38); }
html[data-theme="dark"] .bar { background: #33463c; }
html[data-theme="dark"] .bar.high { background: #8fb6a0; }
html[data-theme="dark"] .status-pill { color: #d7f1df; background: #30483c; border: 1px solid rgba(155,194,171,.24); }
html[data-theme="dark"] .weekly-classical-image img { filter: brightness(.78) saturate(.84) contrast(1.04); }
html[data-theme="dark"] .weekly-classical-image::after { background: linear-gradient(90deg, rgba(12,16,18,.32), transparent 48%), linear-gradient(0deg, rgba(12,16,18,.7), transparent 52%); }
html[data-theme="dark"] .day-drawer,
html[data-theme="dark"] dialog { color: var(--ink); background: rgba(46,49,56,.97); border-color: var(--edge-strong); box-shadow: 0 34px 110px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.065); }
html[data-theme="dark"] dialog::backdrop,
html[data-theme="dark"] .drawer-backdrop { background: rgba(5,7,9,.68); }
html[data-theme="dark"] .icon-picker-popover { background: rgba(45,48,55,.98); border-color: var(--edge-strong); box-shadow: 0 28px 70px rgba(0,0,0,.46); }
html[data-theme="dark"] .celebration-ring { background: rgba(48,58,53,.94); color: #b8dfc6; border: 1px solid rgba(184,223,198,.2); }
html[data-theme="dark"] .toast { background: #eef2f0; color: #17191d; box-shadow: 0 14px 36px rgba(0,0,0,.34); }
html[data-theme="dark"] .toast span { color: #43705a; }
html[data-theme="dark"] .weekly-goal.done .weekly-goal-check,
html[data-theme="dark"] .review-goal-item.done i { background: var(--accent); color: #0b1725; border-color: transparent; }
html[data-theme="dark"] .danger-button { color: #ffae9d; background: rgba(255,111,91,.08); border-color: rgba(255,155,135,.28); }
html[data-theme="dark"] .pwa-install-button.ready { color: #9bc2ab; border-color: rgba(155,194,171,.45); box-shadow: 0 0 0 4px rgba(155,194,171,.08), inset 0 1px 0 rgba(255,255,255,.08); }

.profile { grid-template-columns: 35px minmax(0, 1fr) 34px 34px 34px; gap: 7px; }
.profile > .avatar { grid-column: 1; grid-row: 1; }
.profile > div:not(.avatar) { grid-column: 2 / -1; grid-row: 1; }
.profile > .reminder-button { grid-column: 3; grid-row: 2; }
.profile > .pwa-install-button { grid-column: 4; grid-row: 2; }
.profile > #exportButton { grid-column: 5; grid-row: 2; }
.profile .icon-button { width: 34px; height: 34px; }
.reminder-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.reminder-button.ready { color: #b9d8c4; border-color: rgba(185,216,196,.32); background: rgba(185,216,196,.1); }
.pwa-install-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pwa-install-button.ready { color: #65a9ff; }
.mobile-install-button { display: none; align-items: center; justify-content: center; gap: 8px; }
.mobile-install-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mobile-install-button.ready { border-color: color-mix(in srgb, var(--sage) 55%, var(--line)); }
@media (display-mode: standalone) { .pwa-install-button, .mobile-install-button { display: none !important; } }

@media (min-width: 761px) {
  body.sidebar-collapsed .app-shell { grid-template-columns: 88px minmax(0, 1fr); }
  body.sidebar-collapsed .sidebar { padding-inline: 11px; }
  body.sidebar-collapsed .sidebar-toggle { top: 78px; right: 50%; transform: translateX(50%); }
  body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  body.sidebar-collapsed .brand { justify-content: center; padding: 0 0 72px; }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .sidebar-note,
  body.sidebar-collapsed .sidebar-long-term,
  body.sidebar-collapsed .profile > div { display: none; }
  body.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 5px; }
  body.sidebar-collapsed .nav-item .nav-icon { width: 24px; }
  body.sidebar-collapsed .profile { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 9px; }
  body.sidebar-collapsed .profile .avatar { flex: 0 0 auto; }
}

@media (hover: hover) and (pointer: fine) {
  .sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.11); }
  html[data-theme="dark"] .nav-item:hover { color: #fff; background: rgba(255,255,255,.075); }
  html[data-theme="dark"] .calendar-day:hover { background: var(--surface-2); border-color: var(--edge-strong); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  html[data-theme="dark"] .icon-button:hover { color: #fff; background: var(--surface-3); border-color: var(--edge-strong); box-shadow: 0 9px 22px rgba(0,0,0,.25); }
  html[data-theme="dark"] .language-switcher:hover { border-color: var(--edge-strong); background: var(--surface-2); box-shadow: 0 12px 30px rgba(0,0,0,.24); }
  html[data-theme="dark"] .apple-tilt:hover { border-color: var(--edge-strong); box-shadow: 0 24px 64px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08); }
  html[data-theme="dark"] .primary-button:hover { box-shadow: 0 14px 32px rgba(47,121,216,.32), inset 0 1px 0 rgba(255,255,255,.36); }
}

@media (max-width: 760px) {
  .theme-switcher { order: 2; }
  .sidebar-toggle { display: none; }
  .daily-planning-grid { grid-template-columns: 1fr; }
  .icon-picker-popover { grid-template-columns: repeat(3, 1fr); }
  .mobile-install-button { display: inline-flex; order: 4; width: 100%; }
  #todayButton { order: 6; flex: 1 1 calc(50% - 5px); width: auto; }
  .main-content { padding-top: max(25px, env(safe-area-inset-top)); padding-bottom: max(110px, calc(92px + var(--mobile-nav-safe-bottom))); }
  .sidebar {
    bottom: max(10px, var(--mobile-nav-safe-bottom));
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Quiet interface pass: progressive disclosure and lower information density. */
.brand-mark { background: linear-gradient(145deg, #3f5d52, #24362f); box-shadow: 0 8px 22px rgba(19,42,34,.24), inset 0 1px 0 rgba(255,255,255,.24); }
.brand-mark .walker-body { stroke: #fff; stroke-width: 2.45; }
html[data-theme="dark"] .brand-mark { background: linear-gradient(145deg, #525a6d, #303641); }

.profile { grid-template-columns: 35px minmax(0, 1fr) 34px 34px; }
.profile > div:not(.avatar) { grid-column: 2 / -1; }
.profile > .pwa-install-button { grid-column: 3; grid-row: 2; }
.profile > #exportButton { grid-column: 4; grid-row: 2; }

.weekly-minimal-image { min-height: 320px; background: #ede9e1; }
.weekly-minimal-image::after { display: none; }
.weekly-minimal-image img { object-position: center; }
html[data-theme="dark"] .weekly-minimal-image img { filter: brightness(.72) saturate(.72) contrast(.96); }

.quiet-intro { align-items: center; margin-bottom: 18px; }
.review-year { display: block; margin-bottom: 6px; color: var(--muted); font: 500 12px var(--font-body); letter-spacing: .14em; }
.quiet-intro .kicker { display: block; }
.review-intro #reviewTitle { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.025em; }
.settings-intro.quiet-intro p { margin: 6px 0 0; font-size: 11px; }

.score-card { padding: 17px 18px; }
.score-card strong { margin: 12px 0 4px; }
.review-grid { margin-top: 2px; }
.week-row { grid-template-columns: minmax(72px, auto) 1fr 46px; margin: 11px 0; }

.monthly-reflection-panel { margin-top: 16px; }
.monthly-reflection-panel textarea { width: 100%; min-height: 360px; border: 0; resize: vertical; outline: none; background: transparent; font: 14px/1.9 var(--font-display); }
.reflection-actions { display: flex; align-items: center; gap: 10px; }
.reflection-actions .secondary-button { min-height: 36px; padding: 8px 12px; }

.review-week-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.review-week-card { min-width: 0; padding: 13px 14px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 15px; background: transparent; color: var(--ink); text-align: left; transition: background-color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-enter); }
.review-week-card strong { overflow: hidden; text-overflow: ellipsis; font: 600 11px var(--font-body); white-space: nowrap; }
.review-week-card span { color: var(--muted); font-size: 9px; }
.review-week-card.active { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.review-week-card:active { transform: scale(.98); }
.compact-week-detail { padding-top: 4px; }
.compact-week-detail .week-review-meta { padding: 14px 0; }
.compact-week-detail .review-week-output { min-height: 150px; padding: 4px 0; color: var(--ink); }

.habit-settings-list { gap: 9px; }
.setting-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 13px; padding: 14px 16px; }
.setting-row .habit-icon { width: 38px; height: 38px; }
.setting-main strong { font-size: 13px; }
.setting-main span { margin-top: 5px; font-size: 10px; }
.setting-main .setting-note { display: block; max-width: 56ch; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.setting-actions { display: flex; align-items: center; gap: 5px; justify-self: end; }
.setting-actions .edit-habit { width: 32px; height: 32px; }

.week-stamp-row { display: none; }
.weekly-writing-heading > div:last-child strong { display: none; }

html[data-theme="dark"] .review-week-card { border-color: var(--edge-soft); }
html[data-theme="dark"] .review-week-card.active { background: rgba(125,183,255,.11); border-color: rgba(125,183,255,.42); }

@media (hover: hover) and (pointer: fine) {
  .review-week-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, transparent); }
}

@media (max-width: 760px) {
  .tracking-mode-choice { grid-template-columns: 1fr; }
  .setting-actions { gap: 3px; }
  .setting-actions .edit-habit { width: 30px; height: 30px; }
  .save-mode { order: 4; }
  .mobile-install-button { order: 5; }
  #todayButton { order: 6; }
  .weekly-minimal-image { min-height: 205px; }
  .weekly-writing-panel { min-height: 330px; padding: 22px; }
  .weekly-writing-panel textarea { min-height: 210px; padding: 18px 2px; }
  .mood-reason-dialog { width: calc(100vw - 20px); border-radius: 24px; }
  .mood-reason-dialog form > header, .mood-reason-dialog form > footer { padding-inline: 18px; }
  .mood-reason-body { padding: 20px 18px 22px; }
  .mood-reason-body textarea { min-height: 170px; }
  .reflection-actions { align-items: flex-end; flex-direction: column-reverse; }
  .monthly-reflection-panel { padding: 21px; }
  .monthly-reflection-panel textarea { min-height: 300px; }
  .review-week-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-week-columns { grid-template-columns: 1fr; gap: 18px; }
  .review-week-columns section + section { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .compact-week-detail .review-week-output { min-height: 180px; }
  .settings-intro.quiet-intro { align-items: center; }
  .setting-row { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 13px 14px; }
}

/* On mobile, move the existing data button into the top controls instead of duplicating it. */
@media (max-width: 760px) {
  .save-mode { order: 4; flex: 1 1 auto; width: auto; min-height: 36px; }
  .mobile-install-button,
  #todayButton { order: 5; flex: 1 1 calc(50% - 5px); width: auto; min-height: 44px; }
  .top-actions > #exportButton { order: 4; display: grid; flex: 0 0 42px; width: 42px; height: 42px; border-color: color-mix(in srgb, var(--sage) 24%, var(--line)); color: var(--sage-dark); background: var(--card); }
  .top-actions > #exportButton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
}

html[data-theme="dark"] .top-actions > #exportButton {
  border-color: var(--edge-soft);
  background: var(--surface-2);
}
html[data-theme="dark"] .top-actions > #exportButton { color: var(--sage); }

/* Period target dashboard: one selected metric, one trend, three answers. */
.review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.period-dashboard-heading { align-items: center; margin-bottom: 16px; }
.period-add-button { min-height: 32px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--accent); font-size: 10px; font-weight: 700; transition: transform 140ms var(--ease-enter), background-color 160ms ease, border-color 160ms ease; }
.period-add-button:active { transform: scale(.97); }
.period-dashboard-controls { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.period-target-select { min-width: 0; flex: 1; display: grid; gap: 5px; }
.period-target-select > span { color: var(--muted); font: 500 8px var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.period-target-select select { width: 100%; min-height: 36px; padding: 7px 30px 7px 10px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: color-mix(in srgb, var(--card) 70%, transparent); font-size: 11px; font-weight: 650; }
.period-target-select select:focus { border-color: color-mix(in srgb, var(--accent) 54%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.chart-mode-switch { flex: 0 0 auto; display: inline-flex; padding: 3px; border-radius: 11px; background: var(--paper-deep); }
.chart-mode-switch button { min-height: 30px; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
.chart-mode-switch button.active { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(29,29,31,.08), inset 0 1px 0 rgba(255,255,255,.8); }
.period-dashboard { min-height: 204px; }
.period-kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 17px; }
.period-kpi-row > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--dashboard-color) 5%, transparent); }
.period-kpi-row span { display: block; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.period-kpi-row strong { display: block; margin-top: 6px; font: 600 19px var(--font-body); }
.period-kpi-row small { color: var(--muted); font-size: 9px; }
.period-trend-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.period-trend-heading > span { color: var(--muted); font-size: 9px; }
.period-trend-heading strong { display: inline-flex; align-items: center; gap: 5px; max-width: 64%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.period-trend-heading svg { width: 13px; height: 13px; color: var(--dashboard-color); }
.period-trend-chart svg { width: 100%; height: 118px; overflow: visible; }
.period-trend-chart line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.period-area { fill: color-mix(in srgb, var(--dashboard-color) 10%, transparent); }
.period-line { fill: none; stroke: var(--dashboard-color); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 460; animation: dashboardLineIn 650ms var(--ease-enter) both; }
.period-point { fill: var(--card); stroke: var(--dashboard-color); stroke-width: 2.2; transform-box: fill-box; transform-origin: center; animation: dashboardPointIn 300ms 350ms var(--ease-enter) both; }
.period-point.met { fill: var(--dashboard-color); }
.period-chart-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: -7px; color: var(--muted); font: 7px var(--font-body); }
.period-dashboard-empty { min-height: 204px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; }
.period-dashboard-empty > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--paper-deep); color: var(--muted); }
.period-dashboard-empty svg { width: 17px; height: 17px; }
.period-dashboard-empty strong { font-size: 12px; }
.period-dashboard-empty p { max-width: 260px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
@keyframes dashboardLineIn { from { stroke-dashoffset: 460; opacity: .25; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes dashboardPointIn { from { opacity: 0; transform: scale(.25); } to { opacity: 1; transform: scale(1); } }

/* Keep the identity complete, then balance both actions across the full footer. */
.profile { display: grid; grid-template-columns: 1fr; gap: 11px; align-items: center; }
.profile > div.profile-identity { grid-column: 1; grid-row: 1; }
.profile-identity { min-width: 0; display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: center; gap: 10px; }
.profile-copy { min-width: 0; }
.profile-copy strong,
.profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile > div.profile-actions { grid-column: 1; grid-row: 2; }
.profile-actions { display: flex; gap: 8px; }
.profile-actions .icon-button { flex: 1 1 0; width: 100%; height: 34px; }

@media (min-width: 761px) {
  body.sidebar-collapsed .profile > .profile-identity { display: block; }
  body.sidebar-collapsed .profile-copy,
  body.sidebar-collapsed .profile-actions { display: none; }
}

html[data-theme="dark"] .period-target-select select,
html[data-theme="dark"] .period-add-button { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .chart-mode-switch { background: #171a1f; }
html[data-theme="dark"] .chart-mode-switch button.active { background: #30343b; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 12px rgba(0,0,0,.22); }
html[data-theme="dark"] .period-kpi-row > div { border-color: var(--edge-soft); background: color-mix(in srgb, var(--dashboard-color) 8%, var(--surface-2)); }
html[data-theme="dark"] .period-point { fill: var(--surface-2); }
html[data-theme="dark"] .period-point.met { fill: var(--dashboard-color); }

@media (hover: hover) and (pointer: fine) {
  .period-add-button:hover { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
  .chart-mode-switch button:hover { color: var(--ink); }
}

@media (max-width: 760px) {
  .profile { display: none; }
  .review-grid { grid-template-columns: 1fr; }
  .period-dashboard-controls { align-items: stretch; flex-direction: column; }
  .chart-mode-switch { align-self: flex-start; }
  .period-kpi-row > div { padding: 9px; }
  .period-kpi-row strong { font-size: 17px; }
}

/* One daily planner, one journal, both driven by the same selected date. */
.day-roll-control { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 8px; margin: 16px 0 14px; }
.day-roll-arrow { width: 32px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); }
.day-roll { min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.day-roll-item { min-width: 0; height: 46px; display: grid; place-content: center; gap: 2px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); text-align: center; transition: transform 140ms var(--ease-enter), background-color 160ms ease, border-color 160ms ease; }
.day-roll-item span { overflow: hidden; font: 7px var(--font-body); letter-spacing: .06em; text-overflow: ellipsis; text-transform: uppercase; }
.day-roll-item strong { font: 600 13px var(--font-body); }
.day-roll-item.today { border-color: var(--line); }
.day-roll-item.active { color: #fff; border-color: transparent; background: var(--ink); box-shadow: 0 7px 18px rgba(29,29,31,.16); }
.future-plan-status { margin: 9px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.weekly-goal.future-plan .weekly-goal-check { opacity: .34; cursor: default; }
.weekly-goal.future-plan .weekly-goal-text { cursor: default; }
.daily-journal-card { background: linear-gradient(145deg, rgba(125,174,255,.055), transparent 54%), var(--card); }
.daily-tool-card { min-height: 0; padding: 0; overflow: hidden; background: var(--card); }
.daily-tool-header { min-height: 58px; padding: 12px 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.daily-tool-tabs { min-width: 0; padding: 3px; display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--paper-deep) 62%, transparent); }
.daily-tool-tabs button { min-height: 36px; padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-enter); }
.daily-tool-tabs button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.daily-tool-tabs button.active { color: var(--ink); background: var(--card); box-shadow: 0 5px 16px rgba(29,29,31,.08), inset 0 1px 0 rgba(255,255,255,.72); }
.daily-tool-tabs button:active { transform: scale(.97); }
.focus-mini-status { max-width: 170px; min-height: 36px; padding: 7px 10px; display: inline-grid; grid-template-columns: 7px auto minmax(0, 1fr); align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--sage) 28%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--sage-light) 52%, var(--card)); color: var(--ink); }
.focus-mini-status[hidden] { display: none; }
.focus-mini-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 12%, transparent); }
.focus-mini-status.running .focus-mini-pulse { animation: focusMiniPulse 1.8s ease-in-out infinite; }
.focus-mini-status strong { font: 700 10px var(--font-body); font-variant-numeric: tabular-nums; }
.focus-mini-status small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
@keyframes focusMiniPulse { 50% { opacity: .48; transform: scale(.72); } }
.daily-tool-viewport { min-width: 0; overflow-x: auto; overflow-y: hidden; outline: none; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.daily-tool-viewport::-webkit-scrollbar { display: none; }
.daily-tool-viewport:focus-visible { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--sage) 24%, transparent); }
.daily-tool-track { min-width: 0; display: flex; align-items: stretch; }
.daily-tool-page { min-width: 100%; padding: 17px 25px 18px; display: flex; flex: 0 0 100%; flex-direction: column; scroll-snap-align: start; scroll-snap-stop: always; }
.daily-tool-card .daily-journal-card { min-height: 350px; }
.daily-tool-card .focus-overview-card { min-height: 350px; margin: 0; padding: 0; grid-template-columns: 1fr; align-content: center; gap: 18px; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.daily-tool-card .focus-overview-card::after { opacity: .72; right: -90px; top: -112px; }
.daily-tool-card .focus-inline-timer { min-height: 118px; padding: 14px; grid-template-columns: 64px minmax(0, 1fr) minmax(92px, auto); }
.daily-tool-card .focus-inline-ring { width: 64px; height: 64px; }
.daily-tool-card .focus-inline-ring i { width: 54px; height: 54px; }
.daily-tool-card .focus-inline-copy strong { font-size: 32px; }
.daily-tool-card .focus-inline-actions .primary-button,
.daily-tool-card .focus-inline-actions .secondary-button { min-width: 96px; }
.daily-tool-pagination { min-height: 29px; padding: 0 0 12px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.daily-tool-pagination button { width: 21px; height: 20px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; }
.daily-tool-pagination span { width: 5px; height: 5px; border-radius: 99px; background: var(--line); transition: width 180ms var(--ease-enter), background-color 180ms ease; }
.daily-tool-pagination button.active span { width: 16px; background: var(--sage); }
.daily-journal-card .daily-goals-heading > div:first-child { min-width: 0; }
.journal-heading-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.voice-reflection-button { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--card)); color: var(--accent); font-size: 10px; font-weight: 700; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255,255,255,.66); transition: transform 160ms var(--ease-enter), border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }
.voice-reflection-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.voice-reflection-button:disabled { opacity: .36; cursor: default; filter: grayscale(.5); }
.voice-reflection-button:not(:disabled):active { transform: scale(.97); }
.voice-reflection-button[hidden] { display: none; }
.daily-journal-card textarea { width: 100%; flex: 1; min-height: 190px; margin-top: 17px; padding: 2px; border: 0; resize: vertical; outline: none; background: transparent; font: 13px/1.85 var(--font-display); }
.daily-journal-card textarea:disabled { opacity: .42; cursor: not-allowed; }
.daily-journal-card.future-locked { background: color-mix(in srgb, var(--paper-deep) 45%, var(--card)); }
.journal-availability { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.calendar-day.future { color: color-mix(in srgb, var(--muted) 76%, transparent); }

/* Voice reflection: one quiet entry point, one focused recording surface. */
.voice-reflection-dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: hidden; border: 1px solid rgba(255,255,255,.74); border-radius: 30px; background: rgba(248,248,250,.97); box-shadow: 0 36px 120px rgba(24,28,32,.28), inset 0 1px 0 rgba(255,255,255,.9); backdrop-filter: blur(34px) saturate(150%); }
.voice-reflection-dialog::backdrop { background: rgba(12,15,18,.46); backdrop-filter: blur(8px); }
.voice-dialog-shell { max-height: calc(100dvh - 30px); overflow-y: auto; overscroll-behavior: contain; }
.voice-dialog-shell > header { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.voice-dialog-shell > header h2 { margin: 6px 0 0; font: 700 21px/1.22 var(--font-display); letter-spacing: -.03em; }
.voice-capture-panel { min-height: 430px; padding: 38px 28px 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle at 50% 29%, rgba(76,141,255,.11), transparent 17rem); }
.voice-orb { --voice-p: calc(var(--voice-progress) * 1turn); width: 132px; aspect-ratio: 1; position: relative; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: conic-gradient(color-mix(in srgb, var(--accent) 72%, #fff) var(--voice-p), rgba(29,29,31,.075) 0); box-shadow: 0 24px 65px rgba(0,113,227,.12); transition: transform 260ms var(--ease-enter), box-shadow 260ms ease; }
.voice-orb::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(255,255,255,.82); border-radius: inherit; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(238,243,250,.92)); box-shadow: inset 0 1px 0 #fff; }
.voice-orb svg { position: relative; z-index: 2; width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.voice-orb i { position: absolute; z-index: 2; left: 50%; bottom: 27px; width: 2px; height: 7px; border-radius: 99px; background: currentColor; opacity: 0; transform-origin: center bottom; }
.voice-orb i:nth-of-type(1) { transform: translateX(-16px); }
.voice-orb i:nth-of-type(2) { transform: translateX(-9px); }
.voice-orb i:nth-of-type(3) { transform: translateX(-1px); }
.voice-orb i:nth-of-type(4) { transform: translateX(7px); }
.voice-orb i:nth-of-type(5) { transform: translateX(14px); }
.voice-orb.active { box-shadow: 0 28px 78px rgba(0,113,227,.2), 0 0 0 12px rgba(0,113,227,.055); }
.voice-orb.active svg { transform: translateY(-7px); }
.voice-orb.active i { opacity: .72; animation: voiceLevel 760ms ease-in-out infinite alternate; }
.voice-orb.active i:nth-of-type(2), .voice-orb.active i:nth-of-type(5) { animation-delay: -420ms; }
.voice-orb.active i:nth-of-type(3) { animation-delay: -170ms; }
.voice-orb.active.metering i { animation: none; transition: height 80ms linear, opacity 160ms ease; }
.voice-orb.active.quiet { color: #c37618; box-shadow: 0 28px 78px rgba(195,118,24,.16), 0 0 0 12px rgba(195,118,24,.05); }
.voice-orb.processing { animation: voiceBreathe 1.4s ease-in-out infinite; }
@keyframes voiceLevel { from { height: 4px; } to { height: 17px; } }
@keyframes voiceBreathe { 50% { transform: scale(1.045); box-shadow: 0 30px 82px rgba(0,113,227,.23); } }
.voice-time { margin-top: 20px; font: 650 26px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.voice-capture-panel h3 { margin: 19px 0 7px; font: 700 18px/1.25 var(--font-display); letter-spacing: -.02em; }
.voice-capture-panel > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.voice-capture-actions { min-height: 46px; margin-top: 25px; display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.voice-error { margin-top: 14px !important; padding: 10px 13px; border: 1px solid color-mix(in srgb, #d34b4b 24%, var(--line)); border-radius: 12px; background: color-mix(in srgb, #d34b4b 6%, transparent); color: #a43232 !important; }
.voice-draft-panel { padding: 28px; }
.voice-draft-panel[hidden] { display: none; }
.voice-draft-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.voice-draft-heading h3 { margin: 6px 0 0; font: 700 19px/1.25 var(--font-display); letter-spacing: -.025em; }
.voice-draft-heading > small { color: var(--muted); font-size: 9px; text-align: right; }
.voice-draft-panel textarea { width: 100%; min-height: 250px; margin-top: 20px; padding: 19px; resize: vertical; border: 1px solid var(--line); border-radius: 18px; outline: 0; background: color-mix(in srgb, var(--card) 84%, transparent); font: 13px/1.85 var(--font-display); box-shadow: inset 0 1px 0 rgba(255,255,255,.74); }
.voice-draft-panel textarea:focus { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); box-shadow: 0 0 0 4px rgba(0,113,227,.07); }
.voice-transcript { margin-top: 13px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--paper-deep) 43%, transparent); }
.voice-transcript summary { color: var(--muted); font-size: 10px; cursor: pointer; }
.voice-transcript p { margin: 12px 0 2px; color: var(--muted); font-size: 11px; line-height: 1.75; white-space: pre-wrap; }
.voice-draft-actions { margin-top: 19px; display: flex; justify-content: flex-end; gap: 9px; }
[data-voice-phase="draft"] .voice-capture-panel { display: none; }

html[data-theme="dark"] .voice-reflection-button { border-color: rgba(121,184,255,.2); background: rgba(121,184,255,.08); color: #8ec5ff; box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }
html[data-theme="dark"] .voice-reflection-dialog { border-color: var(--edge-strong); background: rgba(39,42,48,.98); box-shadow: 0 38px 120px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.055); }
html[data-theme="dark"] .voice-capture-panel { background: radial-gradient(circle at 50% 29%, rgba(74,144,255,.14), transparent 17rem); }
html[data-theme="dark"] .voice-orb { background: conic-gradient(#79b8ff var(--voice-p), rgba(255,255,255,.075) 0); color: #83bdff; box-shadow: 0 24px 70px rgba(26,104,214,.17); }
html[data-theme="dark"] .voice-orb::before { border-color: rgba(255,255,255,.08); background: linear-gradient(145deg, #323740, #272b31); box-shadow: inset 0 1px 0 rgba(255,255,255,.075); }
html[data-theme="dark"] .voice-draft-panel textarea,
html[data-theme="dark"] .voice-transcript { border-color: var(--edge-soft); background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }

/* Compact drawer rows: meaning and target expand only when requested. */
.drawer-future-notice { margin: 0 0 18px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--amber) 7%, transparent); color: var(--muted); font-size: 10px; line-height: 1.55; }
.drawer-habits details.drawer-habit { display: block; padding: 0; overflow: hidden; }
.drawer-habit summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; cursor: pointer; list-style: none; }
.drawer-habit summary::-webkit-details-marker { display: none; }
.drawer-habit summary > span:first-child { min-width: 0; display: flex; align-items: center; gap: 11px; }
.drawer-habit summary strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-habit summary .habit-check { color: var(--muted); transition: transform 180ms var(--ease-enter); }
.drawer-habit[open] summary .habit-check { transform: rotate(180deg); }
.drawer-habit.done summary .habit-check { color: var(--habit-color); transform: none; }
.drawer-habit-details { padding: 0 13px 13px 58px; border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent); }
.drawer-habit-details p { margin: 11px 0 5px; color: var(--muted); font-size: 10px; }
.drawer-habit-details .drawer-habit-note { margin: 7px 0 11px; padding-left: 9px; border-left: 2px solid color-mix(in srgb, var(--habit-color) 48%, var(--line)); color: var(--ink); line-height: 1.55; }
.drawer-habit-details .period-note { display: block; margin-bottom: 9px; }
.drawer-habit-toggle { min-height: 31px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font-size: 9px; font-weight: 700; }
.drawer-habit-toggle:disabled { opacity: .35; cursor: not-allowed; }

/* Customizable comparison dashboard, normalized to adherence percentage. */
.analytics-dashboard-heading { align-items: center; margin-bottom: 15px; }
.analytics-dashboard-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 15px; }
.analytics-control-label { display: block; margin-bottom: 7px; color: var(--muted); font: 500 8px var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.analytics-metric-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.analytics-metric-chip { min-width: 0; max-width: 150px; min-height: 30px; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 8px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 140ms var(--ease-enter); }
.analytics-metric-chip i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--metric-color); opacity: .42; }
.analytics-metric-chip.active { color: var(--ink); border-color: color-mix(in srgb, var(--metric-color) 45%, var(--line)); background: color-mix(in srgb, var(--metric-color) 8%, transparent); }
.analytics-metric-chip.active i { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--metric-color) 12%, transparent); }
.comparison-dashboard { min-height: 206px; }
.analytics-series-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.analytics-series-summary > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--series-color) 5%, transparent); }
.analytics-series-summary span { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-series-summary span i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--series-color); }
.analytics-series-summary strong { display: block; margin-top: 5px; font: 600 18px var(--font-body); }
.analytics-series-summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 7px; }
.analytics-chart svg { width: 100%; height: 128px; overflow: visible; }
.analytics-chart svg line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.analytics-chart svg text { fill: var(--muted); font: 6px var(--font-body); }
.analytics-line { fill: none; stroke: var(--series-color); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 460; animation: dashboardLineIn 650ms var(--ease-enter) both; }
.analytics-point { fill: var(--card); stroke: var(--series-color); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: dashboardPointIn 300ms 300ms var(--ease-enter) both; }
.analytics-bar { fill: var(--series-color); opacity: .82; transform-box: fill-box; transform-origin: bottom; animation: analyticsBarIn 430ms var(--ease-enter) both; }
@keyframes analyticsBarIn { from { transform: scaleY(.04); opacity: .25; } }

.review-week-select { min-width: min(260px, 42vw); display: grid; gap: 5px; }
.review-week-select span { color: var(--muted); font: 500 8px var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.review-week-select select { width: 100%; min-height: 36px; padding: 7px 30px 7px 10px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: color-mix(in srgb, var(--card) 70%, transparent); font-size: 10px; font-weight: 650; }
.focus-review-controls { min-width: min(300px, 45vw); display: grid; grid-template-columns: auto minmax(150px, 1fr); align-items: end; gap: 9px; }
.focus-review-scope { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--paper-deep); }
.focus-review-scope button { min-height: 34px; padding: 7px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.focus-review-scope button.active { background: var(--card); color: var(--ink); box-shadow: 0 4px 12px rgba(20,25,22,.08); }
.focus-review-controls .review-week-select { min-width: 0; }
.focus-review-controls .review-week-select[hidden] { display: none; }

.focus-review-panel { margin-top: 16px; overflow: hidden; }
.focus-review-content { min-height: 230px; display: grid; grid-template-columns: minmax(180px, .48fr) minmax(360px, 1.52fr); align-items: end; gap: 28px; padding-top: 20px; }
.focus-review-summary { align-self: stretch; padding: 20px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(145deg, color-mix(in srgb, var(--sage-light) 54%, transparent), transparent); }
.focus-review-summary > span { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.focus-review-summary > strong { display: flex; align-items: baseline; gap: 7px; margin: 18px 0 10px; }
.focus-review-summary > strong b { font: 700 clamp(42px, 5vw, 62px)/.9 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.focus-review-summary > strong small { color: var(--muted); font-size: 10px; font-weight: 600; }
.focus-review-summary p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.focus-review-breakdown { margin-top: 15px; display: grid; gap: 7px; }
.focus-review-breakdown span { min-width: 0; display: flex; justify-content: space-between; gap: 10px; }
.focus-review-breakdown b { overflow: hidden; font-size: 8px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.focus-review-breakdown small { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.focus-review-chart { height: 210px; padding: 10px 8px 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: clamp(7px, 1.4vw, 15px); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, color-mix(in srgb, var(--line) 72%, transparent) 52px); }
.focus-review-day { height: 100%; min-width: 0; display: grid; grid-template-rows: 18px minmax(0, 1fr) 24px; align-items: end; gap: 4px; text-align: center; }
.focus-review-day b { color: var(--muted); font-size: 8px; font-weight: 650; }
.focus-review-day i { width: min(28px, 76%); min-height: 4px; justify-self: center; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #8eab98, #667a6d); box-shadow: inset 0 1px 0 rgba(255,255,255,.24); transform-origin: bottom; animation: focusReviewBarIn 420ms var(--ease-enter) both; }
.focus-review-day small { color: var(--muted); font-size: 8px; }
.focus-review-chart.month-view { height: auto; min-height: 240px; padding: 8px; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(34px, 1fr); align-items: stretch; gap: 6px; border: 0; background: transparent; }
.focus-heatmap-spacer { min-width: 0; }
.focus-heatmap-day { position: relative; min-width: 0; min-height: 38px; padding: 6px; overflow: hidden; display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.focus-heatmap-day::after { content: ""; position: absolute; inset: 0; background: var(--sage); opacity: var(--focus-level); }
.focus-heatmap-day b, .focus-heatmap-day small { position: relative; z-index: 1; }
.focus-heatmap-day b { font-size: 8px; }
.focus-heatmap-day small { color: var(--ink); font-size: 7px; font-weight: 700; }
.focus-review-footer { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; text-align: right; }
@keyframes focusReviewBarIn { from { opacity: .3; transform: scaleY(.04); } }

html[data-theme="dark"] .daily-journal-card { background: linear-gradient(145deg, rgba(125,183,255,.07), transparent 52%), var(--surface-1); }
html[data-theme="dark"] .daily-tool-card { border-color: var(--edge-soft); background: var(--surface-1); }
html[data-theme="dark"] .daily-tool-tabs { border-color: var(--edge-soft); background: var(--surface-3); }
html[data-theme="dark"] .daily-tool-tabs button.active { color: #fff; background: var(--surface-2); box-shadow: 0 5px 18px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06); }
html[data-theme="dark"] .focus-mini-status { border-color: rgba(155,194,171,.2); background: rgba(155,194,171,.08); }
html[data-theme="dark"] .daily-tool-card .daily-journal-card { background: linear-gradient(145deg, rgba(125,183,255,.07), transparent 52%), transparent; }
html[data-theme="dark"] .day-roll-item.active { background: #79b8ff; color: #101318; box-shadow: 0 8px 20px rgba(47,121,216,.24); }
html[data-theme="dark"] .drawer-habit-toggle,
html[data-theme="dark"] .review-week-select select { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .analytics-metric-chip { border-color: var(--edge-soft); }
html[data-theme="dark"] .analytics-metric-chip.active { color: #fff; background: color-mix(in srgb, var(--metric-color) 11%, var(--surface-2)); }
html[data-theme="dark"] .analytics-series-summary > div { border-color: var(--edge-soft); background: color-mix(in srgb, var(--series-color) 7%, var(--surface-2)); }
html[data-theme="dark"] .analytics-point { fill: var(--surface-2); }
html[data-theme="dark"] .focus-review-summary { border-color: var(--edge-soft); background: linear-gradient(145deg, rgba(155,194,171,.09), transparent); }
html[data-theme="dark"] .focus-today-breakdown span { border-color: var(--edge-soft); background: rgba(255,255,255,.055); }
html[data-theme="dark"] .focus-review-scope { background: var(--surface-3); }
html[data-theme="dark"] .focus-review-scope button.active { background: var(--surface-2); }
html[data-theme="dark"] .focus-heatmap-day { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .focus-review-chart { border-color: var(--edge-soft); background: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, rgba(255,255,255,.055) 52px); }
html[data-theme="dark"] .focus-review-day i { background: linear-gradient(180deg, #a5cbb3, #668874); }
html[data-theme="dark"] .pointer-aura { background: radial-gradient(250px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(125,183,255,.07), transparent 66%); }

@media (hover: hover) and (pointer: fine) {
  .day-roll-item:hover { border-color: var(--line); background: color-mix(in srgb, var(--accent) 5%, transparent); }
  .day-roll-item.active:hover { background: var(--ink); }
  .analytics-metric-chip:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--metric-color) 34%, var(--line)); }
}

@media (max-width: 760px) {
  .day-roll-control { grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 5px; }
  .day-roll { gap: 3px; }
  .day-roll-item { padding: 0; }
  .daily-journal-card textarea { min-height: 220px; }
  .daily-journal-card .daily-goals-heading { width: 100%; align-items: stretch; flex-direction: column; gap: 12px; }
  .journal-heading-actions { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 9px; }
  .voice-reflection-button { min-height: 33px; padding: 7px 10px; }
  .voice-reflection-dialog { width: calc(100vw - 14px); max-height: calc(100dvh - 14px); border-radius: 26px; }
  .voice-dialog-shell { max-height: calc(100dvh - 16px); }
  .voice-dialog-shell > header { padding: 18px; }
  .voice-dialog-shell > header h2 { font-size: 17px; }
  .voice-capture-panel { min-height: 410px; padding: 34px 18px 26px; }
  .voice-orb { width: 118px; }
  .voice-draft-panel { padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .voice-draft-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .voice-draft-heading > small { text-align: left; }
  .voice-draft-panel textarea { min-height: 280px; padding: 16px; }
  .voice-draft-actions { flex-direction: column-reverse; }
  .voice-draft-actions button { width: 100%; }
  .analytics-dashboard-controls { grid-template-columns: 1fr; }
  .analytics-dashboard-controls .chart-mode-switch { justify-self: start; }
  .analytics-metric-chip { max-width: 128px; }
  .review-week-select { min-width: 0; width: 100%; }
  .focus-review-panel > .panel-heading { align-items: stretch; flex-direction: column; gap: 14px; }
  .focus-review-controls { width: 100%; min-width: 0; grid-template-columns: auto minmax(0, 1fr); }
  .focus-review-content { min-height: 0; grid-template-columns: 1fr; gap: 16px; }
  .focus-review-summary { min-height: 155px; padding: 18px; }
  .focus-review-chart { height: 180px; gap: 6px; }
}

/* CloudBase keeps the domestic self-hosting path quiet, private, and optional. */
.cloud-account-button { color: rgba(255,255,255,.68); }
.cloud-account-button.connected { color: #b9d9c4; background: rgba(132,181,151,.13); border-color: rgba(166,210,181,.22); }
.cloudbase-auth-body { padding: 24px 26px 20px; display: grid; gap: 18px; }
.cloudbase-auth-body > p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 13px; }
.cloudbase-auth-body label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.cloudbase-auth-body input { width: 100%; }
.cloudbase-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cloudbase-code-row .secondary-button { height: 43px; white-space: nowrap; }
.cloudbase-auth-status { min-height: 21px; color: var(--sage-dark) !important; font-weight: 650; }
.cloudbase-auth-status.error { color: var(--coral) !important; }
.cloudbase-auth-note { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.42); }
html[data-theme="dark"] .cloudbase-auth-note { background: rgba(255,255,255,.035); border-color: var(--edge); }

@media (max-width: 560px) {
  .cloudbase-code-row { grid-template-columns: 1fr; }
  .cloudbase-code-row .secondary-button { width: 100%; }
  .cloudbase-auth-dialog form > footer { flex-wrap: wrap; }
}

/* Mobile utility tray: controls stay available without occupying the reading area. */
@media (max-width: 760px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; margin-bottom: 20px; }
  .topbar-copy { min-width: 0; }
  .topbar h1 { max-width: 100%; margin-right: 0; font-size: clamp(25px, 7.6vw, 33px); line-height: 1.18; overflow-wrap: normal; text-wrap: balance; word-break: normal; }
  .mobile-toolbar-toggle { min-width: 42px; min-height: 42px; padding: 7px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--card) 78%, transparent); color: var(--muted); box-shadow: 0 8px 24px rgba(29,29,31,.055), inset 0 1px 0 rgba(255,255,255,.75); backdrop-filter: blur(18px) saturate(150%); }
  .mobile-toolbar-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-toolbar-toggle span { display: none; }
  .mobile-toolbar-toggle[aria-expanded="true"] { color: var(--ink); background: var(--card); }
  .top-actions { grid-column: 1 / -1; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 19px; background: color-mix(in srgb, var(--card) 82%, transparent); box-shadow: 0 14px 34px rgba(29,29,31,.07); backdrop-filter: blur(24px) saturate(150%); transform-origin: top right; }
  .top-actions.mobile-collapsed { display: none; }
  .top-actions.mobile-open { display: flex; animation: mobileToolsIn 210ms cubic-bezier(.22,1,.36,1) both; }
  .hero-copy h2 { max-width: 100%; font-size: clamp(21px, 6.6vw, 29px); line-height: 1.42; overflow-wrap: normal; text-wrap: balance; word-break: normal; white-space: pre-line; }
  .form-grid { grid-template-columns: 1fr; padding: 20px 18px 8px; }
  .form-grid label.full,
  .habit-live-preview { grid-column: 1; }
  .icon-picker-popover,
  .color-picker-popover { width: min(330px, calc(100vw - 72px)); }
  #habitDialog form > header,
  #habitDialog form > footer { padding-inline: 18px; }
  .habit-live-preview { grid-template-columns: 40px minmax(0, 1fr) 22px; }
}

@keyframes mobileToolsIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  html[data-theme="dark"] .mobile-toolbar-toggle,
  html[data-theme="dark"] .top-actions { border-color: var(--edge-soft); background: color-mix(in srgb, var(--surface-2) 88%, transparent); box-shadow: 0 14px 34px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.05); }
}

/*
 * Mobile hero layout contract (tested at 320–430px):
 * the progress ring stays in normal document flow and aligns to the lower-right,
 * so longer translations grow the card instead of colliding with its content.
 * Keep this block after earlier responsive overrides.
 */
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-card,
  .mood-card { min-width: 0; }
  .mood-reason-summary { min-width: 0; max-width: 100%; }
  .hero-card {
    min-height: 300px;
    padding: 24px 22px 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: space-between;
    align-items: stretch;
    gap: 14px;
  }
  .hero-copy { width: 100%; }
  .hero-copy h2 { margin-block: 22px 13px; }
  .hero-copy #heroProgressText { display: none; }
  .progress-orbit {
    width: 90px;
    max-width: none;
    min-height: 0;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;
    position: relative;
    inset: auto;
    justify-self: end;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-sizing: border-box;
    box-shadow: none;
    backdrop-filter: none;
  }
  .progress-orbit-ring {
    width: auto;
    aspect-ratio: auto;
    position: absolute;
    inset: 0;
    grid-column: 1;
    grid-row: 1;
    border-radius: 50%;
  }
  .progress-orbit-ring::after { inset: 6px; }
  .progress-orbit div {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    text-align: center;
  }
  .progress-orbit strong { justify-content: center; gap: 4px; }
  .progress-orbit strong b { font-size: 27px; }
  .progress-orbit strong small { font-size: 12px; }
  .progress-orbit-label { margin-top: 4px; font-size: 8px; letter-spacing: .03em; }
}

@media (max-width: 350px) {
  .hero-card { padding-inline: 18px; }
  .progress-orbit { width: 82px; }
  .progress-orbit strong b { font-size: 24px; }
}

/* Quiet, platform-neutral scrollbars for long settings and dialogs. */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 34%, transparent) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { min-height: 34px; border: 3px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--muted) 34%, transparent); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 52%, transparent); background-clip: padding-box; }
html[data-theme="dark"] * { scrollbar-color: rgba(226,231,238,.24) transparent; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: rgba(226,231,238,.24); background-clip: padding-box; }

/* Habit ordering: a dedicated grip prevents drag, edit and page scroll from competing. */
.habit-drag-handle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.habit-drag-handle:active { cursor: grabbing; }
.habit-drag-handle > span { width: 12px; display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; }
.habit-drag-handle i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.habit-drag-handle:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, transparent); outline: 3px solid color-mix(in srgb, var(--accent) 15%, transparent); }
.setting-row.habit-dragging { z-index: 5; opacity: .78; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 18px 42px rgba(20, 28, 24, .14); transform: scale(.985); }
body.habit-is-dragging { cursor: grabbing; user-select: none; }
html[data-theme="dark"] .habit-drag-handle { color: #aeb4bd; }
html[data-theme="dark"] .setting-row.habit-dragging { box-shadow: 0 20px 46px rgba(0,0,0,.36); }

/* Reminder belongs to Habit Settings, not to the global toolbar. */
.habit-reminder-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
}
.habit-reminder-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--sage) 12%, var(--paper)); color: var(--sage-dark); }
.habit-reminder-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.habit-reminder-copy { min-width: 0; display: grid; gap: 3px; }
.habit-reminder-copy small { color: var(--sage-dark); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.habit-reminder-copy strong { font-size: 13px; }
.habit-reminder-copy > span { color: var(--muted); font-size: 10px; }
.habit-reminder-arrow { color: var(--muted); transition: transform 160ms var(--ease-enter); }
.habit-reminder-card.ready .habit-reminder-icon { background: color-mix(in srgb, #57a977 18%, var(--card)); color: #43825d; }
.habit-reminder-card:active .habit-reminder-arrow { transform: translateX(3px); }
html[data-theme="dark"] .habit-reminder-card { border-color: var(--edge-soft); background: var(--surface-1); }
html[data-theme="dark"] .habit-reminder-icon { background: rgba(155,194,171,.1); color: #9bc2ab; }

/* Day Plan: one calm, read-only schedule surface. */
@media (min-width: 1101px) {
  .daily-planning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.day-plan-heading-actions { display: flex; align-items: center; gap: 7px; }
.calendar-sync-trigger { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, #6f95c8 7%, var(--card)); color: #567cae; font-size: 9px; font-weight: 750; white-space: nowrap; }
.calendar-sync-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.calendar-sync-trigger.connected { background: color-mix(in srgb, var(--sage) 10%, var(--card)); color: var(--sage-dark); }
.day-plan-expand { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--ink); font-size: 9px; font-weight: 700; white-space: nowrap; }
.day-plan-expand svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.day-plan-expand:active { transform: scale(.97); }
.day-plan-columns { min-width: 0; flex: 1; display: block; margin-top: 14px; }
.day-plan-columns > section { min-width: 0; display: flex; flex-direction: column; }
.day-plan-columns > section[hidden] { display: none; }
.day-schedule-column { padding: 0; border: 0; }
.day-plan-section-heading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.day-plan-section-heading > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.day-plan-section-heading h4 { margin: 0; font: 650 11px var(--font-body); }
.day-plan-section-heading > span, .day-plan-section-heading > strong { color: var(--muted); font: 650 8px var(--font-body); white-space: nowrap; }
.day-plan-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 3px; background: #6f95c8; box-shadow: 0 0 0 4px rgba(111,149,200,.11); }
.goal-check-glyph { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--sage-dark); font-size: 9px; font-weight: 800; }
.day-schedule-list, .routine-event-list { display: grid; gap: 2px; }
.day-schedule-event { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 8px; border-left: 2px solid var(--event-color, transparent); border-radius: 11px; color: var(--ink); transition: background-color 160ms ease, transform 150ms var(--ease-enter); }
.day-schedule-event time { color: #567cae; font: 700 9px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.day-schedule-event > div { min-width: 0; }
.day-schedule-event strong { display: block; overflow: hidden; font: 650 10px/1.35 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.day-schedule-event small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.day-schedule-event.all-day { background: color-mix(in srgb, #6f95c8 8%, transparent); }
.day-schedule-event.routine { color: color-mix(in srgb, var(--ink) 70%, var(--muted)); }
.day-schedule-event.routine time { color: var(--muted); }
.routine-label { padding: 4px 6px; border-radius: 99px; background: var(--paper-deep); color: var(--muted); font-size: 7px; font-weight: 700; }
.day-schedule-empty { margin: 0; padding: 18px 8px; color: var(--muted); font: 10px/1.6 var(--font-display); }
.routine-disclosure { min-height: 42px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; padding: 8px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; font-size: 9px; }
.routine-disclosure b { font-size: 12px; font-weight: 500; }
.routine-event-list { padding-top: 3px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.routine-event-list[hidden] { display: none; }

/* Goal horizon is progressive disclosure inside the existing weekly card. */
.goal-horizon-switch { align-self: flex-start; display: inline-flex; gap: 3px; margin-bottom: 22px; padding: 3px; border-radius: 12px; background: var(--paper-deep); }
.goal-horizon-switch button { min-height: 36px; padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; }
.goal-horizon-switch button.active { background: var(--card); color: var(--ink); box-shadow: 0 5px 16px rgba(25,31,28,.08); }
#weeklyGoalsPane, #longTermGoalsPane { min-height: 250px; flex: 1; display: flex; flex-direction: column; }
#weeklyGoalsPane[hidden], #longTermGoalsPane[hidden] { display: none; }
.long-term-heading p { max-width: 42ch; margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.long-term-goal-list { display: grid; gap: 6px; margin: 17px 0; }
.long-term-goal { min-width: 0; width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 16px; align-items: center; gap: 11px; padding: 12px 7px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.long-term-status { width: 8px; height: 8px; border-radius: 50%; background: #6f95c8; box-shadow: 0 0 0 4px rgba(111,149,200,.1); }
.long-term-goal.paused .long-term-status { background: var(--amber); box-shadow: 0 0 0 4px rgba(217,183,119,.11); }
.long-term-goal.completed .long-term-status { background: var(--sage); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 11%, transparent); }
.long-term-copy { min-width: 0; }
.long-term-copy strong, .long-term-copy small, .long-term-meta b, .long-term-meta small { display: block; }
.long-term-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.long-term-copy small { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.long-term-meta { text-align: right; }
.long-term-meta b { color: var(--sage-dark); font-size: 8px; }
.long-term-meta small { margin-top: 5px; color: var(--muted); font-size: 7px; white-space: nowrap; }
.long-term-chevron { color: var(--muted); font-size: 18px; }
.long-term-add-button { min-height: 46px; width: 100%; display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 9px 11px; border: 1px dashed color-mix(in srgb, var(--sage) 32%, var(--line)); border-radius: 12px; background: transparent; color: var(--sage-dark); text-align: left; }
.long-term-add-button span { font-size: 16px; }
.long-term-add-button b { font-size: 9px; }

/* Full-day sheet keeps the same visual language without becoming another page. */
.day-plan-dialog { width: min(780px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); }
.day-plan-dialog-shell { max-height: calc(100dvh - 28px); display: flex; flex-direction: column; }
.day-plan-dialog-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.day-plan-dialog-shell > header h2 { margin: 6px 0 0; font: 650 23px var(--font-display); }
.day-plan-dialog-body { min-height: 0; display: grid; grid-template-columns: 1fr; overflow: auto; }
.day-plan-dialog-body > section { min-width: 0; padding: 24px; }
.day-plan-dialog-body > section + section { border-left: 1px solid var(--line); }
.day-plan-dialog-section { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.day-plan-dialog-section > span:not(.goal-check-glyph) { width: 8px; height: 8px; border-radius: 3px; background: #6f95c8; box-shadow: 0 0 0 4px rgba(111,149,200,.11); }
.day-plan-dialog-section h3 { margin: 0; font: 650 13px var(--font-body); }
.day-plan-timeline { display: grid; gap: 4px; }
.day-plan-timeline .day-schedule-event { grid-template-columns: 54px minmax(0, 1fr) auto; padding: 11px 8px; }
.day-plan-timeline .day-schedule-event + .day-schedule-event { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.drawer-schedule-list { display: grid; gap: 3px; }
.drawer-schedule-list .day-schedule-event { padding-inline: 4px; }
.drawer-schedule-list .day-schedule-event + .day-schedule-event { border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent); }

/* Google Calendar remains a quiet, read-only layer inside Day Plan. */
.calendar-settings-dialog { width: min(650px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); }
.calendar-settings-shell { max-height: calc(100dvh - 28px); display: flex; flex-direction: column; }
.calendar-settings-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.calendar-settings-shell > header h2 { margin: 6px 0 0; font: 650 23px var(--font-display); }
.calendar-settings-body { min-height: 0; overflow: auto; padding: 22px 24px; }
.calendar-settings-shell > footer { display: flex; align-items: center; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.calendar-privacy-note { margin: 0 0 20px; color: var(--muted); font: 10px/1.6 var(--font-body); }
.calendar-disconnected-state { padding: 16px 0 9px; text-align: center; }
.calendar-connection-illustration { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 24px; background: color-mix(in srgb, #6f95c8 10%, var(--card)); color: #567cae; box-shadow: inset 0 1px 0 rgba(255,255,255,.72); }
.calendar-connection-illustration svg { width: 43px; height: 43px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.calendar-disconnected-state h3 { margin: 0; font: 650 18px/1.3 var(--font-display); }
.calendar-disconnected-state p { max-width: 48ch; margin: 9px auto 20px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.calendar-connected-summary { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--card) 82%, transparent); }
.calendar-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #57a977; box-shadow: 0 0 0 4px rgba(87,169,119,.12); }
.calendar-connected-summary strong, .calendar-connected-summary small { display: block; }
.calendar-connected-summary strong { font-size: 11px; }
.calendar-connected-summary small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.calendar-picker-fieldset { margin: 20px 0 0; padding: 0; border: 0; }
.calendar-picker-legend { margin: 0 0 10px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.calendar-accounts-list { display: grid; gap: 10px; }
.calendar-account-card { padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--card) 76%, transparent); }
.calendar-account-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.calendar-account-card > header strong, .calendar-account-card > header small { display: block; }
.calendar-account-card > header strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-account-card > header small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.calendar-account-disconnect { width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.calendar-add-account { width: 100%; min-height: 42px; margin-top: 11px; border: 1px dashed color-mix(in srgb, #6f95c8 48%, var(--line)); border-radius: 13px; background: color-mix(in srgb, #6f95c8 5%, transparent); color: #567cae; font: 700 9px var(--font-body); cursor: pointer; }
.calendar-picker-list { display: grid; gap: 5px; }
.calendar-picker-option { min-height: 48px; display: grid; grid-template-columns: 20px 10px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.calendar-picker-option:has(input:checked) { border-color: color-mix(in srgb, #6f95c8 23%, var(--line)); background: color-mix(in srgb, #6f95c8 6%, transparent); }
.calendar-picker-option input { width: 18px; height: 18px; accent-color: #6f95c8; }
.calendar-picker-option > i { width: 9px; height: 9px; border-radius: 3px; background: var(--calendar-color); }
.calendar-picker-option strong, .calendar-picker-option small { display: block; }
.calendar-picker-option strong { font-size: 10px; }
.calendar-picker-option small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.calendar-picker-empty { margin: 0; padding: 18px; color: var(--muted); text-align: center; font-size: 10px; }
.calendar-routine-setting { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 11px; margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--paper-deep); }
.calendar-routine-setting input { width: 18px; height: 18px; accent-color: var(--sage-dark); }
.calendar-routine-setting strong, .calendar-routine-setting small { display: block; }
.calendar-routine-setting strong { font-size: 10px; }
.calendar-routine-setting small { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.calendar-settings-status { min-height: 16px; margin: 12px 0 0; color: var(--sage-dark); font-size: 9px; }
.calendar-settings-status.error { color: #b55b55; }
.day-memory-status { position: absolute; left: 9px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; }
.day-memory-status i { min-width: 22px; height: 22px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid color-mix(in srgb, var(--sage) 20%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--sage-dark); font-style: normal; }
.day-memory-status svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.day-memory-status b { font: 700 7px var(--font-body); }
.day-reason-marker { width: 22px; color: var(--muted) !important; font: 700 15px/1 var(--font-display) !important; }
.day-calendar-status { position: absolute; right: 9px; bottom: 10px; min-width: 25px; height: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border-radius: 8px; color: var(--muted); background: color-mix(in srgb, var(--card) 72%, transparent); }
.day-calendar-status svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.day-calendar-status b { font: 700 7px var(--font-body); }
.habit-dots, .day-dots, .calendar-habit-dots { display: none !important; }

.long-term-dialog { width: min(610px, calc(100vw - 28px)); }
.long-term-dialog-body { padding: 24px 26px 8px; display: grid; gap: 17px; }
.long-term-dialog-body label { display: grid; gap: 7px; color: var(--muted); font-size: 9px; }
.long-term-dialog-body input, .long-term-dialog-body select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: color-mix(in srgb, var(--card) 78%, transparent); color: var(--ink); font: 11px var(--font-body); }
.long-term-dialog-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

html[data-theme="dark"] .day-plan-expand,
html[data-theme="dark"] .calendar-sync-trigger,
html[data-theme="dark"] .goal-horizon-switch button.active,
html[data-theme="dark"] .long-term-dialog-body input,
html[data-theme="dark"] .long-term-dialog-body select { border-color: var(--edge-soft); background: var(--surface-2); }
html[data-theme="dark"] .day-schedule-event.all-day { background: rgba(125,183,255,.08); }
html[data-theme="dark"] .day-plan-dot,
html[data-theme="dark"] .day-plan-dialog-section > span:not(.goal-check-glyph) { background: #7db7ff; box-shadow: 0 0 0 4px rgba(125,183,255,.1); }
html[data-theme="dark"] .day-schedule-event time { color: #9cc7ff; }
html[data-theme="dark"] .day-plan-dialog { background: var(--paper); border-color: var(--edge-soft); }
html[data-theme="dark"] .calendar-settings-dialog { background: var(--paper); border-color: var(--edge-soft); }
html[data-theme="dark"] .calendar-connected-summary { border-color: var(--edge-soft); background: var(--surface-1); }
html[data-theme="dark"] .calendar-connection-illustration { background: rgba(125,183,255,.09); color: #9cc7ff; box-shadow: none; }
html[data-theme="dark"] .calendar-routine-setting { background: var(--surface-1); }

@media (hover: hover) and (pointer: fine) {
  .day-plan-expand:hover, .calendar-sync-trigger:hover, .long-term-add-button:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
  .day-schedule-event:hover { background: color-mix(in srgb, #6f95c8 6%, transparent); transform: translateX(2px); }
  .long-term-goal:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
}

@media (max-width: 760px) {
  .daily-goals-card[data-plan="selected-day"] { min-height: 0; padding: 21px 18px; }
  .daily-goals-heading { gap: 12px; }
  .daily-goals-heading p { max-width: 32ch; line-height: 1.45; }
  .day-plan-heading-actions { gap: 5px; }
  .calendar-sync-trigger { width: 44px; flex: 0 0 44px; justify-content: center; padding: 0; }
  .calendar-sync-trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .day-plan-expand { width: 44px; flex: 0 0 44px; justify-content: center; padding: 0; }
  .day-plan-expand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .day-plan-columns { margin-top: 12px; }
  .day-schedule-event { min-height: 44px; grid-template-columns: 48px minmax(0, 1fr) auto; padding-inline: 4px; }
  .day-schedule-event strong { white-space: normal; }
  .goal-horizon-switch { width: 100%; }
  .goal-horizon-switch button { flex: 1; min-height: 42px; }
  .weekly-goals-card { padding: 22px 20px; }
  .long-term-goal { grid-template-columns: 10px minmax(0, 1fr) 16px; }
  .long-term-meta { display: none; }
  .long-term-copy strong, .long-term-copy small { white-space: normal; }
  .day-plan-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 24px; }
  .day-plan-dialog-shell { max-height: calc(100dvh - 16px); }
  .day-plan-dialog-shell > header { padding: 19px 18px; }
  .day-plan-dialog-shell > header h2 { font-size: 20px; }
  .day-plan-dialog-body { grid-template-columns: 1fr; }
  .day-plan-dialog-body > section { padding: 20px 18px; }
  .day-plan-dialog-body > section + section { border-left: 0; border-top: 1px solid var(--line); }
  .calendar-settings-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 24px; }
  .calendar-settings-shell { max-height: calc(100dvh - 16px); }
  .calendar-settings-shell > header, .calendar-settings-body { padding: 18px; }
  .calendar-settings-shell > footer { padding: 14px 18px 18px; flex-wrap: wrap; }
  .calendar-connected-summary { grid-template-columns: 11px minmax(0, 1fr); }
  .calendar-connected-summary .secondary-button { grid-column: 1 / -1; width: 100%; }
  .long-term-dialog-body { padding: 20px 18px 7px; }
  .long-term-dialog-row { grid-template-columns: 1fr; }
}

.focus-today-summary { margin-top: 7px !important; color: var(--sage-dark) !important; font-weight: 650; }
.review-canvas-trigger { min-height: 34px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--ink); font: 650 10px var(--font-body); white-space: nowrap; }

/* Local Review Canvas: evidence stays compact; the writing area gets the space. */
.review-canvas-dialog { width: min(1080px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: 0 34px 110px rgba(20,25,22,.24); }
.review-canvas-shell { max-height: calc(100vh - 28px); display: flex; flex-direction: column; }
.review-canvas-shell > header, .review-canvas-shell > footer { display: flex; align-items: center; gap: 12px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.review-canvas-shell > header { justify-content: space-between; }
.review-canvas-shell > header h2 { margin: 5px 0 0; font: 650 22px var(--font-display); }
.review-canvas-shell > footer { border-top: 1px solid var(--line); border-bottom: 0; }
.review-canvas-toolbar { display: flex; align-items: end; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.review-scope-switch { display: flex; padding: 3px; border-radius: 12px; background: var(--paper-deep); }
.review-scope-switch button { min-height: 34px; padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.review-scope-switch button.active { background: var(--card); color: var(--ink); box-shadow: 0 4px 14px rgba(20,25,22,.08); }
.review-canvas-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.review-canvas-toolbar select { min-height: 40px; padding: 8px 32px 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); }
.review-canvas-toolbar label[hidden] { display: none !important; }
.review-canvas-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.45fr); overflow: hidden; }
.review-evidence-panel, .review-draft-panel { min-height: 0; padding: 22px; overflow: auto; }
.review-evidence-panel { border-right: 1px solid var(--line); background: color-mix(in srgb, var(--sage) 4%, var(--paper)); }
.review-evidence-panel h3, .review-draft-panel h3 { margin: 6px 0 0; font: 650 16px var(--font-display); }
.review-evidence-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 20px 0; }
.review-evidence-stats div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.review-evidence-stats strong { display: block; font: 650 22px var(--font-display); }
.review-evidence-stats span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.review-evidence-notes { display: grid; gap: 8px; }
.review-evidence-notes p { margin: 0; padding: 11px 12px; border-radius: 11px; background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--muted); font: 10px/1.55 var(--font-body); }
.review-draft-panel { display: flex; flex-direction: column; }
.review-draft-heading { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
#reviewCanvasText { width: 100%; min-height: 430px; flex: 1; margin-top: 16px; padding: 18px; resize: none; border: 1px solid var(--line); border-radius: 16px; outline: none; background: var(--card); color: var(--ink); font: 13px/1.85 var(--font-display); }
#reviewCanvasText:focus { border-color: color-mix(in srgb, var(--accent) 46%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent); }
html[data-theme="dark"] .review-canvas-dialog { border-color: var(--edge-strong); background: var(--surface-1); box-shadow: 0 38px 120px rgba(0,0,0,.58); }
html[data-theme="dark"] .review-canvas-shell > header, html[data-theme="dark"] .review-canvas-shell > footer, html[data-theme="dark"] .review-canvas-toolbar, html[data-theme="dark"] .review-evidence-panel { border-color: var(--edge-soft); }
html[data-theme="dark"] .review-evidence-panel { background: rgba(89,124,103,.07); }
html[data-theme="dark"] .review-scope-switch { background: var(--surface-3); }
html[data-theme="dark"] .review-scope-switch button.active, html[data-theme="dark"] .review-canvas-toolbar select, html[data-theme="dark"] .review-evidence-stats div, html[data-theme="dark"] #reviewCanvasText { background: var(--surface-2); border-color: var(--edge-soft); }

@media (max-width: 760px) {
  .habit-drag-handle, .setting-actions .edit-habit { width: 32px; height: 32px; }
  .weekly-writing-heading { align-items: start; }
  .review-canvas-trigger { align-self: start; }
  .review-canvas-dialog { width: calc(100vw - 14px); max-height: calc(100dvh - 14px); border-radius: 23px; }
  .review-canvas-shell { max-height: calc(100dvh - 14px); }
  .review-canvas-toolbar { align-items: stretch; flex-wrap: wrap; padding: 12px 15px; }
  .review-scope-switch { flex: 1 1 100%; }
  .review-scope-switch button { flex: 1; }
  .review-canvas-toolbar label { flex: 1; }
  .review-canvas-grid { display: block; overflow: auto; }
  .review-evidence-panel { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .review-draft-panel { overflow: visible; }
  #reviewCanvasText { min-height: 390px; resize: vertical; }
  .review-canvas-shell > header, .review-canvas-shell > footer, .review-evidence-panel, .review-draft-panel { padding: 17px; }
}

/* Compact month view: preserve the calendar's geometry instead of stretching it vertically. */
@media (min-width: 761px) and (max-width: 1100px) {
  .calendar-card {
    width: min(100%, 730px);
    aspect-ratio: 1;
    margin-inline: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
  }
  .calendar-atmosphere {
    min-height: 0;
    height: clamp(72px, 10vw, 92px);
    flex: 0 0 auto;
    margin: -10px -10px 7px;
    padding: 17px 22px;
  }
  .calendar-atmosphere > span { font-size: clamp(40px, 6vw, 50px); }
  .calendar-atmosphere p strong { margin-bottom: 3px; font-size: 20px; }
  .weekdays { flex: 0 0 auto; }
  .weekdays span { padding: 7px 0 10px; font-size: 9px; }
  .calendar-grid { min-height: 0; flex: 1; grid-template-rows: repeat(6, minmax(0, 1fr)); }
  .calendar-day { min-height: 0; padding: 6px; }
}

@media (max-width: 760px) {
  .calendar-embedded { margin-top: 42px; padding-top: 34px; }
  .calendar-toolbar { flex-wrap: wrap; align-items: flex-start; }
  .calendar-controls { width: 100%; justify-content: space-between; }
  .calendar-view-switch button { padding-inline: 8px; }
  .calendar-card {
    width: min(100%, 430px);
    aspect-ratio: 1;
    margin-inline: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
  }
  .calendar-atmosphere {
    min-height: 0;
    height: clamp(58px, 18vw, 72px);
    flex: 0 0 auto;
    margin: -6px -6px 4px;
    padding: 12px 16px;
  }
  .calendar-atmosphere > span { font-size: clamp(32px, 10vw, 43px); }
  .calendar-atmosphere p { font-size: 7px; }
  .calendar-atmosphere p strong { margin-bottom: 2px; font-size: 16px; }
  .weekdays { flex: 0 0 auto; }
  .weekdays span { padding: 5px 0 7px; font-size: 8px; }
  .calendar-grid { min-height: 0; flex: 1; grid-template-rows: repeat(6, minmax(0, 1fr)); }
  .calendar-day { min-height: 0; padding: 3px; }
  .day-number { width: 21px; height: 21px; font-size: 9px; }
  .day-mood { width: 22px; height: 22px; top: 3px; right: 2px; border-radius: 7px; }
  .day-mood svg { width: 13px; height: 13px; }
  .day-memory-status { left: 2px; bottom: 2px; gap: 2px; }
  .day-memory-status i { min-width: 17px; width: 17px; height: 17px; border-radius: 6px; }
  .day-memory-status svg { width: 10px; height: 10px; }
  .day-photo-marker b { display: none; }
  .day-reason-marker { width: 17px !important; font-size: 12px !important; }
  .day-calendar-status { right: 2px; bottom: 2px; min-width: 19px; height: 17px; border-radius: 6px; }
  .day-calendar-status svg { width: 10px; height: 10px; }
  .day-calendar-status b { display: none; }
}

/* Daily reflection and the optional timer share one calm, swipeable surface. */
@media (max-width: 760px) {
  .daily-tool-header { min-height: 56px; padding: 10px 11px 0; }
  .daily-tool-tabs button { min-height: 35px; padding-inline: 9px; }
  .focus-mini-status { max-width: 112px; padding-inline: 8px; grid-template-columns: 7px auto; }
  .focus-mini-status small { display: none; }
  .daily-tool-page { padding: 15px 18px 16px; }
  .daily-tool-card .daily-journal-card { min-height: 390px; }
  .daily-tool-card .focus-overview-card { min-height: 390px; padding: 0; gap: 16px; }
  .daily-tool-card .focus-inline-timer { min-height: 0; padding: 15px; grid-template-columns: 60px minmax(0, 1fr); gap: 13px; }
  .daily-tool-card .focus-inline-ring { width: 60px; height: 60px; }
  .daily-tool-card .focus-inline-ring i { width: 50px; height: 50px; }
  .daily-tool-card .focus-inline-actions { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .daily-tool-card .focus-inline-actions .primary-button { min-width: 0; }
  .daily-tool-card .focus-inline-actions .secondary-button { min-width: 92px; }
  .daily-tool-card .focus-inline-actions .text-button { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .daily-tool-viewport { scroll-behavior: auto; }
  .focus-mini-status.running .focus-mini-pulse { animation: none; }
}
