:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --canvas: #f1f3ed;
  --canvas-deep: #e8ece4;
  --paper: #ffffff;
  --paper-soft: rgba(255, 255, 255, .72);
  --ink: #18231e;
  --muted: #68736c;
  --quiet: #939b96;
  --line: rgba(25, 37, 31, .09);
  --line-strong: rgba(25, 37, 31, .16);
  --forest: #20392f;
  --forest-deep: #14251e;
  --lime: #c9f47a;
  --mint: #e5f0e7;
  --accent-ink: #345b47;
  --danger: #ba514c;
  --danger-soft: #fae7e4;
  --shadow-card: 0 12px 34px rgba(28, 41, 34, .065);
  --shadow-nav: 0 18px 46px rgba(26, 38, 32, .17);
  --shadow-sheet: 0 -24px 80px rgba(19, 29, 24, .22);
  background: var(--canvas);
  color: var(--ink);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101713;
  --canvas-deep: #0b110e;
  --paper: #1a241f;
  --paper-soft: rgba(27, 38, 32, .76);
  --ink: #f1f5f1;
  --muted: #a6b0a9;
  --quiet: #7c8981;
  --line: rgba(232, 241, 235, .09);
  --line-strong: rgba(232, 241, 235, .16);
  --forest: #d0f58e;
  --forest-deep: #111a16;
  --lime: #ccf67f;
  --mint: #24352c;
  --accent-ink: #b9ddc5;
  --danger: #ff9189;
  --danger-soft: #432724;
  --shadow-card: 0 15px 38px rgba(0, 0, 0, .18);
  --shadow-nav: 0 18px 50px rgba(0, 0, 0, .34);
  --shadow-sheet: 0 -24px 80px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #101713;
    --canvas-deep: #0b110e;
    --paper: #1a241f;
    --paper-soft: rgba(27, 38, 32, .76);
    --ink: #f1f5f1;
    --muted: #a6b0a9;
    --quiet: #7c8981;
    --line: rgba(232, 241, 235, .09);
    --line-strong: rgba(232, 241, 235, .16);
    --forest: #d0f58e;
    --forest-deep: #111a16;
    --lime: #ccf67f;
    --mint: #24352c;
    --accent-ink: #b9ddc5;
    --danger: #ff9189;
    --danger-soft: #432724;
    --shadow-card: 0 15px 38px rgba(0, 0, 0, .18);
    --shadow-nav: 0 18px 50px rgba(0, 0, 0, .34);
    --shadow-sheet: 0 -24px 80px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% -10%, rgba(132, 178, 143, .17), transparent 24rem),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-deep) 100%);
}

body { -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, [data-note-id], [data-check-note] { touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [role="button"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--lime) 60%, #52856a); outline-offset: 2px; }
.icon { width: 1.25em; height: 1.25em; flex: 0 0 auto; }
.app-shell { min-height: 100vh; min-height: 100dvh; overflow-x: clip; }

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--canvas);
}

.app-loading::before {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--forest-deep);
  color: var(--lime);
  content: "P";
  box-shadow: var(--shadow-card);
  font-weight: 780;
  letter-spacing: -.05em;
  animation: loading-pulse 1.15s ease-in-out infinite alternate;
}

@keyframes loading-pulse { to { transform: translateY(-4px); opacity: .74; } }

.screen {
  width: min(100%, 820px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 20px calc(126px + env(safe-area-inset-bottom));
}

#page-root { animation: page-in .32s cubic-bezier(.2, .75, .25, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

.page-header {
  min-height: 188px;
  padding: 14px 4px 25px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-header > div { min-width: 0; }
.eyebrow {
  margin: 0 0 11px;
  color: #63806e;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .105em;
  line-height: 1.35;
  text-transform: uppercase;
}

html[data-theme="dark"] .eyebrow { color: #a8cfb5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #a8cfb5; } }

.page-header h1 {
  max-width: 650px;
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(38px, 7vw, 55px);
  font-weight: 520;
  line-height: .97;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.page-lead {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.round-add {
  width: 51px;
  height: 51px;
  margin-top: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 18px;
  background: var(--forest-deep);
  color: var(--lime);
  box-shadow: 0 12px 28px rgba(18, 34, 27, .18);
  cursor: pointer;
}
.round-add .icon { width: 23px; height: 23px; stroke-width: 2.2; }
.round-add:active { transform: scale(.96); }

.focus-card {
  position: relative;
  min-height: 284px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 31px;
  background:
    radial-gradient(circle at 88% 12%, rgba(193, 241, 119, .16), transparent 13rem),
    linear-gradient(145deg, #263d33, #14241d 75%);
  color: #f7fbf7;
  box-shadow: 0 24px 54px rgba(23, 37, 30, .19);
  overflow: hidden;
}

.focus-card::after {
  position: absolute;
  right: -64px;
  bottom: -72px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(203, 246, 130, .14);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 25px rgba(203, 246, 130, .025), 0 0 0 54px rgba(203, 246, 130, .018);
}

.focus-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, .52);
  font-size: 10px;
  text-transform: capitalize;
}

.privacy-chip {
  min-height: 31px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(218, 255, 159, .12);
  border-radius: 999px;
  background: rgba(213, 255, 144, .09);
  color: #d9ff98;
  font-size: 9px;
  font-weight: 720;
}
.privacy-chip .icon { width: 14px; height: 14px; }

.focus-main {
  position: relative;
  z-index: 1;
  margin-top: 38px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 25px;
  align-items: center;
}

.score-ring {
  width: 112px;
  height: 112px;
  padding: 6px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(218, 255, 159, .32);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px rgba(218, 255, 159, .035);
}
.score-ring strong { color: var(--lime); font-size: 30px; line-height: 1; letter-spacing: -.055em; }
.score-ring span { margin-top: 6px; color: rgba(255,255,255,.5); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }

.focus-message { min-width: 0; }
.focus-message > span { color: rgba(255, 255, 255, .5); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.focus-message strong { max-width: 390px; margin-top: 9px; display: block; font-family: ui-serif, Georgia, serif; font-size: clamp(24px, 4vw, 34px); font-weight: 520; line-height: 1.05; letter-spacing: -.04em; }
.focus-message p { margin: 12px 0 0; color: rgba(255,255,255,.5); font-size: 11px; line-height: 1.45; }

.section-block { margin-top: 34px; }
.section-title {
  min-height: 31px;
  margin: 0 3px 13px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.section-title h2 { margin: 0; font-size: 20px; font-weight: 760; line-height: 1.15; letter-spacing: -.035em; }
.section-title > span { color: var(--quiet); font-size: 10px; }
.section-title button { padding: 5px 0 5px 8px; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: #52705e; cursor: pointer; font-size: 10px; font-weight: 720; }
.section-title button .icon { width: 14px; height: 14px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.quick-grid button {
  min-height: 122px;
  padding: 15px;
  display: grid;
  grid-template-areas: "icon chevron" "label label";
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
}
.quick-grid button > span { grid-area: icon; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--mint); color: var(--accent-ink); }
.quick-grid button > span .icon { width: 19px; height: 19px; }
.quick-grid button > .icon { grid-area: chevron; width: 15px; height: 15px; align-self: center; justify-self: end; color: var(--quiet); }
.quick-grid strong { grid-area: label; min-width: 0; align-self: end; overflow-wrap: anywhere; font-size: 12px; font-weight: 750; line-height: 1.2; letter-spacing: -.015em; }
.quick-grid button:active { transform: translateY(1px) scale(.98); }

.flow-list, .timeline, .task-groups { display: grid; gap: 10px; }
.flow-row {
  min-height: 78px;
  padding: 0 15px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.flow-open { min-width: 0; min-height: 76px; padding: 13px 0 13px 15px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 0; background: transparent; cursor: pointer; color: inherit; text-align: left; }
.flow-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 15px; background: #fff3cf; color: #8b6a28; }
.flow-icon.task { background: var(--mint); color: var(--accent-ink); }
.flow-icon .icon { width: 18px; height: 18px; }
.flow-open > span:nth-child(2) { min-width: 0; }
.flow-open > span:nth-child(2) strong, .flow-open > span:nth-child(2) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-open > span:nth-child(2) strong { font-size: 12px; font-weight: 740; }
.flow-open > span:nth-child(2) small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.flow-open > .icon { width: 16px; color: var(--quiet); }
.flow-row > button[data-check-note] { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 11px; background: transparent; color: var(--accent-ink); cursor: pointer; }
.flow-row > button[data-check-note] .icon { width: 15px; }

.recent-grid, .note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recent-grid .note-card:first-child:last-child { grid-column: 1 / -1; }

.note-card {
  --note-ink: #1c2822;
  --note-muted: rgba(28, 40, 34, .68);
  --note-quiet: rgba(28, 40, 34, .56);
  position: relative;
  min-height: 206px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 24px;
  outline: none;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  color: var(--note-ink);
  overflow: hidden;
}
.note-card::after { position: absolute; top: -52px; right: -44px; width: 118px; height: 118px; border: 1px solid rgba(25,37,31,.045); border-radius: 50%; content: ""; }
.note-card:active { transform: scale(.985); }
.note-card:focus-visible { box-shadow: 0 0 0 3px rgba(70, 111, 89, .2), var(--shadow-card); }
.tone-0 { background: var(--paper); }
.tone-1 { background: #e8f2ec; }
.tone-2 { background: #fff0c7; }
.tone-3 { background: #f7e0dc; }
.tone-4 { background: #e8e7f5; }
html[data-theme="dark"] .tone-1 { background: #24362d; }
html[data-theme="dark"] .tone-2 { background: #3a3221; }
html[data-theme="dark"] .tone-3 { background: #3a2826; }
html[data-theme="dark"] .tone-4 { background: #2d2d40; }
html[data-theme="dark"] .note-card { --note-ink: #f1f5f1; --note-muted: rgba(241, 245, 241, .78); --note-quiet: rgba(241, 245, 241, .64); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tone-1 { background: #24362d; }
  :root:not([data-theme="light"]) .tone-2 { background: #3a3221; }
  :root:not([data-theme="light"]) .tone-3 { background: #3a2826; }
  :root:not([data-theme="light"]) .tone-4 { background: #2d2d40; }
  :root:not([data-theme="light"]) .note-card { --note-ink: #f1f5f1; --note-muted: rgba(241, 245, 241, .78); --note-quiet: rgba(241, 245, 241, .64); }
}
.note-card-top { min-height: 26px; margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-card-actions { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 5px; }
.kind-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--note-quiet); font-size: 8px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.kind-badge .icon { width: 14px; height: 14px; }
.pin { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--note-ink) 9%, transparent); color: var(--note-ink); }
.pin .icon { width: 13px; height: 13px; }
.note-open { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--note-ink) 9%, transparent); color: var(--note-ink); cursor: pointer; }
.note-open .icon { width: 13px; height: 13px; }
.note-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 760; line-height: 1.17; letter-spacing: -.035em; overflow-wrap: anywhere; }
.note-body { margin: 0; display: -webkit-box; overflow: hidden; color: var(--note-muted); font-size: 11px; line-height: 1.52; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.mini-checklist { margin: 0 0 10px; display: grid; gap: 7px; }
.mini-check { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 7px; color: var(--note-muted); font-size: 10px; line-height: 1.4; cursor: pointer; }
.mini-check input { width: 16px; height: 16px; margin: -1px 0 0; appearance: none; border: 1.5px solid var(--note-quiet); border-radius: 5px; background: color-mix(in srgb, var(--note-ink) 8%, transparent); }
.mini-check input:checked { border-color: #355f49; background: #355f49; }
.mini-check input:checked::after { width: 6px; height: 3px; margin: 3px 0 0 3px; display: block; border: solid #fff; border-width: 0 0 1.5px 1.5px; content: ""; transform: rotate(-45deg); }
.mini-check.done span { opacity: .48; text-decoration: line-through; }
.note-meta { margin-top: auto; padding-top: 13px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--note-quiet); font-size: 8px; }
.badge { min-height: 24px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: rgba(255,255,255,.57); color: #675829; font-weight: 680; }
.badge .icon { width: 12px; height: 12px; }

.library-search {
  height: 56px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  color: var(--quiet);
}
.library-search .icon { width: 19px; height: 19px; }
.library-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.library-search input::placeholder { color: var(--quiet); }
.library-filters { margin: 13px 0 26px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.library-filters::-webkit-scrollbar { display: none; }
.library-filter { min-height: 39px; padding: 0 14px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 13px; background: var(--paper-soft); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 730; }
.library-filter.active { border-color: var(--forest-deep); background: var(--forest-deep); color: #d8ff96; }
.library-count { margin-bottom: 13px; }

.progress-card {
  min-height: 155px;
  padding: 23px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 42%);
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 27px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}
.progress-card strong { display: block; font-family: ui-serif, Georgia, serif; font-size: 40px; font-weight: 520; line-height: 1; letter-spacing: -.05em; }
.progress-card span { margin-top: 7px; display: block; color: var(--muted); font-size: 10px; }
.progress-card progress { width: 100%; height: 9px; appearance: none; border: 0; border-radius: 999px; background: var(--mint); overflow: hidden; }
.progress-card progress::-webkit-progress-bar { background: var(--mint); }
.progress-card progress::-webkit-progress-value { border-radius: 999px; background: #4d775f; }
.task-groups { margin-top: 18px; }
.task-group { border: 1px solid var(--line); border-radius: 23px; background: var(--paper); box-shadow: var(--shadow-card); overflow: hidden; }
.task-group-head { width: 100%; min-height: 71px; padding: 13px 15px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.task-group-head > span:first-child { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--mint); color: var(--accent-ink); }
.task-group-head > span:first-child .icon { width: 17px; }
.task-group-head strong, .task-group-head small { display: block; }
.task-group-head strong { overflow: hidden; font-size: 12px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.task-group-head small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.task-group-head > .icon { width: 15px; color: var(--quiet); }
.task-group > div { border-top: 1px solid var(--line); }
.task-row { min-height: 54px; padding: 11px 16px; display: grid; grid-template-columns: 21px minmax(0, 1fr); align-items: center; gap: 10px; border-top: 1px solid var(--line); cursor: pointer; font-size: 11px; line-height: 1.4; }
.task-row:first-child { border-top: 0; }
.task-row input { width: 20px; height: 20px; margin: 0; accent-color: #3d684f; }
.task-row.done span { color: var(--quiet); text-decoration: line-through; }

.week-strip { margin: 0 -2px 30px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-cell { min-height: 88px; padding: 11px 4px 8px; display: grid; grid-template-rows: auto 1fr 10px; justify-items: center; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-soft); color: var(--muted); }
.day-cell span { font-size: 8px; font-weight: 760; text-transform: uppercase; }
.day-cell strong { align-self: center; color: var(--ink); font-size: 18px; }
.day-cell i { width: 6px; height: 6px; border-radius: 50%; background: transparent; font-size: 0; }
.day-cell.has-event i { background: #5f8b6f; }
.day-cell.today { border-color: var(--forest-deep); background: var(--forest-deep); color: rgba(255,255,255,.64); }
.day-cell.today strong { color: var(--lime); }
.day-cell.today.has-event i { background: var(--lime); }
.timeline-row { min-height: 84px; padding: 12px 15px 12px 12px; display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow-card); cursor: pointer; }
.timeline-row time { width: 51px; height: 58px; display: grid; align-content: center; justify-items: center; border-radius: 16px; background: #fff0c7; color: #725d2c; }
.timeline-row time strong { font-size: 20px; line-height: 1; }
.timeline-row time span { margin-top: 4px; font-size: 8px; font-weight: 730; text-transform: uppercase; }
.timeline-row > div { min-width: 0; }
.timeline-row > div > span { color: #568067; font-size: 8px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.timeline-row > div strong, .timeline-row > div small { display: block; }
.timeline-row > div strong { margin-top: 5px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-row > div small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.timeline-row > .icon { width: 15px; color: var(--quiet); }

.settings-label { margin: 5px 5px 10px; color: var(--quiet); font-size: 9px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.settings-card { margin-bottom: 26px; border: 1px solid var(--line); border-radius: 25px; background: var(--paper); box-shadow: var(--shadow-card); overflow: hidden; }
.setting-stack { padding: 18px; border-bottom: 1px solid var(--line); }
.setting-copy strong, .setting-copy span { display: block; }
.setting-copy strong { font-size: 12px; font-weight: 760; }
.setting-copy span { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.segmented { margin-top: 14px; padding: 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-radius: 14px; background: var(--canvas); }
.segmented button { min-height: 36px; padding: 0 8px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 730; }
.segmented button.active { background: var(--paper); color: var(--ink); box-shadow: 0 5px 14px rgba(25,37,31,.09); }
.setting-row { width: 100%; min-height: 76px; padding: 13px 17px; display: flex; align-items: center; justify-content: space-between; gap: 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span { min-width: 0; display: flex; align-items: center; gap: 12px; }
.setting-row > span > .icon { width: 39px; height: 39px; padding: 10px; flex: 0 0 auto; border-radius: 13px; background: var(--mint); color: var(--accent-ink); }
.setting-row > span > span { min-width: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 11px; font-weight: 750; }
.setting-row small { margin-top: 4px; color: var(--muted); font-size: 8.5px; line-height: 1.42; }
.setting-row > .icon { width: 15px; color: var(--quiet); }
.setting-row em { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--accent-ink); font-size: 9px; font-style: normal; font-weight: 740; }
.setting-row:disabled { cursor: default; opacity: .82; }
.setting-row em .icon { width: 13px; height: 13px; }
.switch { width: 44px; height: 25px; padding: 3px; flex: 0 0 auto; border-radius: 999px; background: #d5dad6; }
.switch b { width: 19px; height: 19px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(20,30,25,.18); transition: transform .2s; }
.switch.on { background: #4b775e; }
.switch.on b { transform: translateX(19px); }
.action-card .setting-row:last-of-type { border-bottom: 0; }
.danger-row { color: var(--danger); }
.danger-row > span > .icon { background: var(--danger-soft); color: var(--danger); }
.settings-panel { padding: 18px; border-bottom: 1px solid var(--line); background: rgba(118, 148, 130, .055); }
.settings-panel > strong { font-size: 11px; }
.settings-panel > p { margin: 6px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.settings-panel textarea { width: 100%; min-height: 112px; padding: 12px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 14px; outline: none; background: var(--paper); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; line-height: 1.45; }
.settings-panel textarea:focus { border-color: #659178; box-shadow: 0 0 0 3px rgba(69, 117, 88, .09); }
.panel-button { min-height: 41px; margin-top: 10px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 13px; background: var(--forest-deep); color: #e1ffa8; cursor: pointer; font-size: 9px; font-weight: 750; }
.panel-button .icon { width: 15px; height: 15px; }
.info-panel p { margin: 0 0 9px; }
.info-panel small { color: var(--quiet); font-size: 8px; }

.empty {
  min-height: 244px;
  padding: 36px 23px;
  display: grid;
  place-items: center;
  align-content: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: 25px;
  background: var(--paper-soft);
  text-align: center;
}
.empty > span { width: 57px; height: 57px; display: grid; place-items: center; border-radius: 19px; background: var(--mint); color: var(--accent-ink); }
.empty > span .icon { width: 24px; height: 24px; }
.empty h3 { margin: 15px 0 7px; font-size: 15px; letter-spacing: -.025em; }
.empty p { max-width: 310px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 15;
  width: min(calc(100% - 24px), 790px);
  min-height: 76px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 25px;
  background: rgba(250, 252, 248, .9);
  box-shadow: var(--shadow-nav);
  transform: translateX(-50%);
  backdrop-filter: blur(20px) saturate(140%);
}
html[data-theme="dark"] .bottom-nav { border-color: rgba(255,255,255,.08); background: rgba(24,34,29,.91); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bottom-nav { border-color: rgba(255,255,255,.08); background: rgba(24,34,29,.91); } }
.nav-item { min-width: 0; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 18px; background: transparent; color: var(--quiet); cursor: pointer; }
.nav-item .icon { width: 20px; height: 20px; }
.nav-item span { max-width: 100%; overflow: hidden; font-size: 8px; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { background: var(--forest-deep); color: #d9ff98; box-shadow: 0 8px 18px rgba(19,34,27,.19); }
.nav-item.active .icon { stroke-width: 2.1; }

.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(12, 20, 16, .54); opacity: 0; pointer-events: none; transition: opacity .24s; backdrop-filter: blur(4px); }
.scrim.open { opacity: 1; pointer-events: auto; }
.editor {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 21;
  width: min(100%, 760px);
  max-height: min(94vh, 920px);
  max-height: min(94dvh, 920px);
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.62);
  border-bottom: 0;
  border-radius: 31px 31px 0 0;
  background: var(--canvas);
  box-shadow: var(--shadow-sheet);
  transform: translate(-50%, 105%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.editor.open { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: var(--line-strong); }
.editor-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-head > div:first-child { min-width: 0; display: grid; gap: 2px; }
.editor-head > div:first-child span { color: var(--quiet); font-size: 8px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.editor-head strong { font-size: 15px; letter-spacing: -.025em; }
.editor-actions { display: flex; gap: 4px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--muted); cursor: pointer; }
.icon-button .icon { width: 17px; height: 17px; }
.icon-button:active { transform: scale(.96); }
.icon-button.danger { color: var(--danger); }
.icon-button.danger.confirm { border-color: var(--danger); background: var(--danger-soft); }
.icon-button.close-button { border-color: var(--forest-deep); background: var(--forest-deep); color: #fff; }
.editor-title { width: 100%; margin-top: 15px; padding: 7px 2px; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: ui-serif, Georgia, serif; font-size: 31px; font-weight: 520; letter-spacing: -.045em; }
.editor-title::placeholder { color: var(--quiet); }
.editor-body { width: 100%; min-height: 112px; padding: 8px 2px 18px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.62; }
.editor-body::placeholder { color: var(--quiet); }
.editor-block { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); }
.block-label { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--quiet); font-size: 8px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.colors { display: flex; gap: 11px; }
.color-choice { width: 31px; height: 31px; border: 3px solid var(--paper); border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px var(--line-strong); }
.tone-swatch-0 { background: #ffffff; }
.tone-swatch-1 { background: #e8f2ec; }
.tone-swatch-2 { background: #fff0c7; }
.tone-swatch-3 { background: #f7e0dc; }
.tone-swatch-4 { background: #e8e7f5; }
.color-choice.selected { box-shadow: 0 0 0 2px #3b674f; }
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.soft-button { min-height: 41px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 720; }
.soft-button .icon { width: 15px; height: 15px; }
.soft-button.active { border-color: rgba(58,103,79,.24); background: var(--mint); color: var(--accent-ink); }
.checklist-editor { display: grid; gap: 8px; }
.check-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 32px; align-items: center; gap: 7px; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #3c684f; }
.check-row input[type="text"], .reminder-input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: var(--canvas); color: var(--ink); font-size: 10px; }
.check-row input[type="text"]:focus, .reminder-input:focus { border-color: #659178; box-shadow: 0 0 0 3px rgba(69,117,88,.08); }
.check-row button { width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--quiet); cursor: pointer; }
.add-check { margin-top: 10px; padding: 0; border: 0; background: transparent; color: var(--accent-ink); cursor: pointer; font-size: 9px; font-weight: 770; }
.privacy-hint { margin: 9px 0 0; color: var(--quiet); font-size: 8px; line-height: 1.5; }
.save-button { width: 100%; height: 54px; margin-top: 15px; border: 0; border-radius: 17px; background: var(--forest-deep); color: #efffd2; box-shadow: 0 12px 28px rgba(19,34,27,.17); cursor: pointer; font-size: 11px; font-weight: 770; }

.toast { position: fixed; left: 50%; bottom: calc(103px + env(safe-area-inset-bottom)); z-index: 30; max-width: calc(100vw - 40px); padding: 12px 17px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #18251f; color: #fff; box-shadow: 0 15px 40px rgba(20,29,25,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s; font-size: 10px; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

@media (max-width: 680px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .page-header { min-height: 171px; padding-left: 3px; padding-right: 3px; }
  .page-header h1 { font-size: clamp(36px, 10.3vw, 48px); }
  .focus-card { min-height: 277px; padding: 21px; border-radius: 28px; }
  .focus-main { margin-top: 34px; grid-template-columns: 100px minmax(0,1fr); gap: 20px; }
  .score-ring { width: 100px; height: 100px; }
  .score-ring strong { font-size: 27px; }
  .focus-message strong { font-size: clamp(22px, 6.4vw, 29px); }
  .recent-grid, .note-grid { grid-template-columns: 1fr; }
  .recent-grid .note-card:nth-child(n+3) { display: none; }
  .note-card { min-height: 184px; }
  .week-strip { gap: 4px; }
  .day-cell { min-height: 80px; border-radius: 15px; }
  .editor { padding-left: 15px; padding-right: 15px; }
}

@media (max-width: 390px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .page-header h1 { font-size: 37px; }
  .page-lead { font-size: 11px; }
  .focus-card { min-height: 263px; padding: 18px; }
  .focus-top > span:last-child { display: none; }
  .focus-main { grid-template-columns: 88px minmax(0,1fr); gap: 16px; }
  .score-ring { width: 88px; height: 88px; }
  .score-ring strong { font-size: 24px; }
  .score-ring span { font-size: 7px; }
  .quick-grid { gap: 7px; }
  .quick-grid button { min-height: 108px; padding: 12px 10px; border-radius: 20px; }
  .quick-grid button > span { width: 38px; height: 38px; }
  .quick-grid strong { font-size: 10px; }
  .bottom-nav { width: calc(100% - 16px); min-height: 72px; padding: 6px; }
  .nav-item { padding-left: 2px; padding-right: 2px; }
  .nav-item span { font-size: 7px; }
  .round-add { width: 47px; height: 47px; }
  .setting-row { padding-left: 14px; padding-right: 14px; }
  .setting-row small { max-width: 210px; }
}

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

/* Readable mobile scale: keep labels and controls comfortably legible at arm's length. */
.icon { width: 1.4em; height: 1.4em; }
.eyebrow { font-size: 12px; }
.page-lead { font-size: 15px; line-height: 1.55; }
.round-add { width: 56px; height: 56px; }
.round-add .icon { width: 27px; height: 27px; }
.focus-top { font-size: 12px; }
.privacy-chip { min-height: 35px; padding: 0 12px; font-size: 11px; }
.privacy-chip .icon { width: 17px; height: 17px; }
.score-ring span { font-size: 10px; }
.focus-message > span { font-size: 12px; }
.focus-message p { font-size: 13px; }
.section-title h2 { font-size: 22px; }
.section-title > span,
.section-title button { font-size: 12px; }
.section-title button .icon { width: 17px; height: 17px; }
.quick-grid button > span { width: 48px; height: 48px; }
.quick-grid button > span .icon { width: 23px; height: 23px; }
.quick-grid button > .icon { width: 18px; height: 18px; }
.quick-grid strong { font-size: 14px; }
.flow-icon { width: 48px; height: 48px; }
.flow-icon .icon { width: 22px; height: 22px; }
.flow-open { grid-template-columns: 51px minmax(0, 1fr) auto; }
.flow-open > span:nth-child(2) strong { font-size: 15px; }
.flow-open > span:nth-child(2) small { font-size: 12px; }
.flow-open > .icon { width: 19px; height: 19px; }
.flow-row > button[data-check-note] { width: 40px; height: 40px; }
.flow-row > button[data-check-note] .icon { width: 19px; height: 19px; }
.kind-badge { font-size: 10px; }
.kind-badge .icon { width: 17px; height: 17px; }
.pin,
.note-open { width: 34px; height: 34px; }
.pin .icon,
.note-open .icon { width: 16px; height: 16px; }
.note-card h3 { font-size: 20px; }
.note-body { font-size: 14px; }
.mini-check { grid-template-columns: 20px minmax(0, 1fr); font-size: 13px; }
.mini-check input { width: 19px; height: 19px; }
.note-meta { font-size: 11px; }
.badge { min-height: 28px; padding: 0 10px; }
.badge .icon { width: 15px; height: 15px; }
.library-search { height: 60px; }
.library-search .icon { width: 23px; height: 23px; }
.library-search input { font-size: 15px; }
.library-filter { min-height: 44px; padding: 0 16px; font-size: 13px; }
.progress-card span { font-size: 13px; }
.task-group-head { min-height: 78px; grid-template-columns: 48px minmax(0, 1fr) auto; }
.task-group-head > span:first-child { width: 46px; height: 46px; }
.task-group-head > span:first-child .icon { width: 22px; height: 22px; }
.task-group-head strong { font-size: 15px; }
.task-group-head small { font-size: 12px; }
.task-group-head > .icon { width: 19px; height: 19px; }
.task-row { min-height: 60px; font-size: 14px; }
.task-row input { width: 23px; height: 23px; }
.day-cell span { font-size: 10px; }
.day-cell strong { font-size: 21px; }
.timeline-row > div > span { font-size: 10px; }
.timeline-row > div strong { font-size: 15px; }
.timeline-row > div small { font-size: 12px; }
.timeline-row > .icon { width: 19px; height: 19px; }
.settings-label { font-size: 11px; }
.setting-copy strong { font-size: 15px; }
.setting-copy span { font-size: 12px; }
.segmented button { min-height: 42px; font-size: 13px; }
.setting-row { min-height: 88px; }
.setting-row > span > .icon { width: 46px; height: 46px; padding: 11px; }
.setting-row strong { font-size: 14px; }
.setting-row small { font-size: 11px; }
.setting-row > .icon { width: 19px; height: 19px; }
.setting-row em { font-size: 12px; }
.setting-row em .icon { width: 16px; height: 16px; }
.settings-panel > strong { font-size: 14px; }
.settings-panel > p { font-size: 12px; }
.settings-panel textarea { font-size: 11px; }
.panel-button { min-height: 46px; font-size: 12px; }
.panel-button .icon { width: 18px; height: 18px; }
.empty > span { width: 64px; height: 64px; }
.empty > span .icon { width: 29px; height: 29px; }
.empty h3 { font-size: 18px; }
.empty p { font-size: 13px; }
.bottom-nav { min-height: 84px; }
.nav-item .icon { width: 25px; height: 25px; }
.nav-item span { font-size: 11px; }
.editor-head > div:first-child span { font-size: 10px; }
.editor-head strong { font-size: 18px; }
.icon-button { width: 44px; height: 44px; }
.icon-button .icon { width: 20px; height: 20px; }
.editor-title { font-size: 34px; }
.editor-body { font-size: 15px; }
.block-label { font-size: 11px; }
.color-choice { width: 36px; height: 36px; }
.soft-button { min-height: 46px; font-size: 12px; }
.soft-button .icon { width: 18px; height: 18px; }
.check-row input[type="text"],
.reminder-input { height: 48px; font-size: 14px; }
.add-check { font-size: 12px; }
.privacy-hint { font-size: 11px; }
.save-button { height: 58px; font-size: 15px; }
.toast { font-size: 13px; }
