:root {
  color-scheme: light;
  --paper: #f6f6f0;
  --surface: #fdfdfa;
  --ink: #26332d;
  --muted: #57655d;
  --line: #dce3d8;
  --forest: #305746;
  --soft: #edf1e9;
  --accent: #dce9df;
  --error: #9a302a;
  --radius: 18px;
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--paper); color: var(--ink); margin: 0; min-width: 280px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid #567747; outline-offset: 3px; }
a { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; }
.plain { background: none; border: 0; padding: 0; }
.top { border-bottom: 1px solid var(--line); }
.top-inner, .page, .dock-inner { max-width: 1060px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 36px); }
.top-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 1.32rem; letter-spacing: -.045em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 11px; background: var(--accent); color: var(--forest); }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 1.7; }
.brand-dot { color: #4d703c; }
.icon-button { display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; }
.icon-button:hover, .secondary:hover { background: var(--soft); }
.page { padding-top: 20px; padding-bottom: calc(105px + env(safe-area-inset-bottom)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 17px; min-height: 66px; }
.eyebrow { font-size: .83rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
h1 { font-size: clamp(1.82rem, 6.8vw, 3.13rem); letter-spacing: -.055em; font-weight: 620; }
.page-head h1::first-letter { text-transform: uppercase; }
.date-actions { display: flex; gap: 5px; align-items: center; }
.date-actions .icon-button { border-radius: 13px; }
.date-input { position: relative; overflow: hidden; }
.date-input input { cursor: pointer; position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; }
.date-input input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }
.date-input:focus-within { outline: 3px solid #567747; outline-offset: 3px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; margin-bottom: 17px; padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.week button { display: grid; place-content: center; gap: 1px; min-height: 46px; padding: 4px 1px; background: transparent; border: 1px solid transparent; border-radius: 11px; }
.week .weekday { color: var(--muted); font-size: .8rem; }
.week .date-number { font-weight: 600; font-variant-numeric: tabular-nums; }
.week button.today { border-color: #a3b397; }
.week button:hover { background: var(--soft); }
.week button[aria-current="date"] { background: var(--accent); color: var(--forest); border-color: var(--accent); }
.week button[aria-current="date"] .weekday { color: var(--forest); }
.dashboard { display: grid; gap: 17px; }
.progress-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: clamp(12px, 3.6vw, 21px) clamp(16px, 4vw, 23px);
  border: 1px solid #dae5d9;
  border-radius: var(--radius);
  background: #edf3e9;
  color: var(--forest);
}
.progress-card h2 { font-size: .86rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.progress-count { font-size: clamp(1.55rem, 5vw, 2.15rem); line-height: 1; letter-spacing: -.045em; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-caption { margin-top: 5px; font-size: .83rem; color: var(--muted); }
.ring { width: clamp(66px, 22vw, 90px); aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; stroke-width: 7; }
.ring-track { stroke: #ceddcf; }
.ring-fill { stroke: #4c765c; }
.ring-label { font-size: 1.13rem; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

.task-area { display: grid; gap: 20px; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; margin-bottom: 8px; }
.section-title { display: flex; align-items: center; gap: 7px; font-size: 1.04rem; letter-spacing: -.02em; font-weight: 610; }
.section-title svg { color: #4d7051; width: 20px; height: 20px; }
.section-count, .meta, .hint { color: var(--muted); }
.section-count { font-size: .85rem; white-space: nowrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; padding: 3px 4px 3px 5px; min-height: 53px; }
.row + .row { border-top: 1px solid #e7ebe4; }
.row.is-priority { background: #f3f6ef; box-shadow: inset 3px 0 #4d7051; }
.check { min-width: 0; min-height: 46px; border: 0; background: none; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; text-align: left; padding: 0; border-radius: 12px; }
.row button:focus-visible { outline-offset: -3px; }
.check-box { justify-self: center; border: 1.5px solid #75897a; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: transparent; }
.check svg { width: 15px; height: 15px; stroke-width: 2.4; }
.row.is-done .check-box { background: var(--forest); border-color: var(--forest); color: #fff; }
.row.is-done .row-title { text-decoration: line-through; color: var(--muted); }
.row.is-skipped .row-title { color: var(--muted); }
.row.is-skipped .check-box { border-style: dashed; opacity: .75; }
.row-body { min-width: 0; overflow-wrap: anywhere; padding: 5px 3px 5px 2px; }
.row-title { display: block; font-weight: 430; font-size: .96rem; line-height: 1.38; }
.row-meta { display: block; margin-top: 3px; font-size: .76rem; }
.priority-text { color: var(--forest); font-weight: 560; }
.row .icon-button { border: 0; background: none; color: var(--muted); }
.row .icon-button:hover, .check:hover { background: var(--soft); }
.row .icon-button svg { width: 19px; }
.inline-form { display: flex; gap: 7px; margin-top: 10px; }
.inline-form input { min-width: 0; width: 100%; }
.primary, .secondary, .text-button, .danger-button {
  min-height: 44px; border-radius: 12px; font-weight: 560; padding: 8px 13px; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; text-decoration: none; line-height: 1.2;
}
.primary { color: #fff; background: var(--forest); border: 1px solid var(--forest); }
.primary:hover { background: #28523b; }
.secondary { background: var(--surface); color: var(--forest); border: 1px solid var(--line); }
.text-button { background: transparent; border: 0; color: var(--forest); padding-inline: 5px; }
.text-button:hover { text-decoration: underline; }
.danger-button { border: 1px solid #ead5cf; color: var(--error); background: #fff5f1; }
.empty, .notice { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 15px; }
.notice { margin-bottom: 13px; }
.notice button { display: inline; min-height: 44px; }
.mini-chart { display: none; align-self: start; }
.overdue summary { cursor: pointer; padding: 14px; font-weight: 700; }
.overdue .row:first-of-type { border-top: 1px solid var(--line); }
.overdue .edit-actions { padding-inline: 14px; }
.move-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }

.dock { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
.dock-inner { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) 57px; align-items: center; gap: 4px; padding-block: 6px; }
.nav-button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 50px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: .88rem; line-height: 1.15; }
.nav-button svg { width: 21px; height: 21px; }
.nav-button[aria-current="page"] { color: var(--forest); background: var(--soft); font-weight: 620; }
.nav-add { display: grid; place-items: center; width: 49px; height: 49px; border: 1px solid #ccdece; border-radius: 15px; color: var(--forest); background: var(--accent); justify-self: end; }
.nav-add:hover { background: #d3e4d5; }

.goal-list { display: grid; gap: 13px; }
.goal-card { padding: 15px; }
.goal-top { display: flex; align-items: start; gap: 7px; justify-content: space-between; }
.goal-top h2 { font-size: 1.22rem; line-height: 1.23; letter-spacing: -.025em; font-weight: 610; overflow-wrap: anywhere; }
.goal-top .icon-button { margin-top: -5px; border-color: transparent; }
.goal-note { margin-top: 7px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.bar-label { display: flex; gap: 10px; justify-content: space-between; margin: 11px 0 5px; font-size: .87rem; }
.bar-label strong { color: var(--forest); font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 9px; display: block; appearance: none; background: var(--soft); border: 0; border-radius: 100px; overflow: hidden; accent-color: #62834c; }
progress::-webkit-progress-bar { background: var(--soft); }
progress::-webkit-progress-value { background: #62834c; border-radius: 100px; }
progress::-moz-progress-bar { background: #62834c; border-radius: 100px; }
.goal-steps { margin-top: 10px; }
.goal-steps .row { padding-inline: 0; }
.goal-steps .row + .row { border-color: #eeeFE5; }
.goal-add { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin-bottom: 13px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; overflow-wrap: anywhere; }
.stat strong { display: block; letter-spacing: -.06em; font-size: clamp(1.24rem, 5vw, 1.9rem); line-height: 1.15; }
.stat span { color: var(--muted); font-size: .8rem; }
.chart-panel { padding: clamp(11px, 3vw, 20px); }
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(37px,1fr); gap: 4px; overflow-x: auto; padding: 5px 3px 9px; }
.chart.small { grid-auto-columns: minmax(25px,1fr); overflow: visible; }
.chart button { display: grid; grid-template-rows: 20px 100px 22px; justify-items: center; gap: 4px; width: 100%; border: 1px solid transparent; border-radius: 10px; padding: 4px 1px 0; background: transparent; }
.chart.small button { grid-template-rows: 18px 66px 20px; }
.chart button:hover, .chart button[aria-pressed="true"] { background: #edf1e5; border-color: #e2e8db; }
.chart-perc, .chart-day { color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.chart small { color: var(--muted); }
.chart .bar-track { height: 100%; width: 64%; max-width: 24px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 7px; background: var(--soft); overflow: hidden; }
.bar-track progress { height: 100%; border-radius: 0; writing-mode: vertical-lr; direction: rtl; }
.chart .no-plan .bar-track { background: repeating-linear-gradient(145deg,var(--soft),var(--soft) 3px,#f4f4eb 3px,#f4f4eb 6px); }
.chart .no-plan progress { visibility: hidden; }
.chart-detail { font-size: .87rem; color: var(--muted); margin-top: 7px; }
.periods { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.periods button { min-height: 38px; border-radius: 10px; padding: 5px 10px; background: transparent; border: 0; white-space: nowrap; }
.periods button[aria-pressed="true"] { background: var(--forest); color: #fff; }

.auth-wrap { display: grid; min-height: 100svh; place-items: center; padding: 20px; }
.auth-card { width: min(100%,420px); padding: clamp(19px,6vw,34px); border: 1px solid var(--line); border-radius: 25px; background: var(--surface); }
.auth-card h1 { font-size: clamp(1.9rem,7vw,2.7rem); margin: 26px 0 18px; }
.auth-card .primary { width: 100%; }
.startup { min-height: 100svh; display: grid; justify-content: center; justify-items: center; align-content: center; gap: 12px; color: var(--muted); padding: 20px; text-align: center; }
.startup .brand-mark { width: 43px; height: 43px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 14px; }
.dialog-head h2 { font-size: 1.45rem; letter-spacing: -.055em; overflow-wrap: anywhere; }
dialog { border: 1px solid var(--line); color: var(--ink); background: var(--surface); width: min(100% - 20px, 490px); max-height: calc(100dvh - 24px); padding: clamp(14px,4vw,23px); border-radius: 23px; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #14251e87; }
.dialog-actions, .edit-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dialog-actions { margin-top: 12px; }
.dialog-actions .primary { flex: 1; }
.edit-actions { margin: 13px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.field { min-width: 0; margin-bottom: 10px; }
label { display: block; font-size: .9rem; margin-bottom: 4px; font-weight: 650; }
input:not([type=checkbox]), select, textarea { display: block; min-height: 44px; width: 100%; border-radius: 12px; border: 1px solid #cbd2c4; color: var(--ink); background: #fff; padding: 7px 9px; }
.date-input input { padding: 0; }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; padding-right: 27px; background-image: linear-gradient(45deg, transparent 50%, #41584a 50%),linear-gradient(135deg,#41584a 50%,transparent 50%); background-size: 5px 5px; background-position: calc(100% - 15px) 55%,calc(100% - 10px) 55%; background-repeat: no-repeat; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; }
.toggle input { accent-color: var(--forest); width: 19px; height: 19px; }
.field-hint { color: var(--muted); font-size: .8rem; margin: -3px 0 10px; }
.repeating-list { margin-top: 10px; }
.repeating-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; width: 100%; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; overflow-wrap: anywhere; }
.repeating-list button:hover { background: var(--soft); }
.repeating-list small { display: block; color: var(--muted); }
.repeating-list svg { width: 17px; height: 17px; color: var(--muted); }
.form-error { color: var(--error); font-size: .9rem; padding-top: 6px; }
.form-error:empty { display: none; }
.auth-card button { margin-top: 12px; }
.toast { position: fixed; z-index: 5; bottom: calc(75px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 30px); width: max-content; padding: 10px 14px; border-radius: 13px; background: var(--forest); color: #fff; box-shadow: 0 5px 22px #16292030; }

@media (min-width: 730px) {
  .top-inner { height: 70px; }
  .page { padding-top: 30px; }
  .page-head { margin-bottom: 20px; }
  .dashboard.has-sidebar { grid-template-columns: minmax(0, 1fr) minmax(270px, .62fr); grid-template-rows: auto 1fr; align-items: start; column-gap: 22px; }
  .progress-card { grid-column: 2; grid-row: 1; }
  .task-area { grid-column: 1; grid-row: 1 / span 2; }
  .mini-chart { display: block; grid-column: 2; grid-row: 1; }
  .progress-card ~ .mini-chart { grid-row: 2; }
  .week { max-width: 504px; }
  .week button { min-height: 58px; }
  .dock-inner { max-width: 490px; }
  .goal-list { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
  .stat { padding: 14px; }
}
@media (max-width: 360px) {
  .page-head { gap: 5px; }
  .date-actions { gap: 3px; }
  .date-actions .icon-button { width: 42px; flex-basis: 42px; }
  .page, .top-inner, .dock-inner { padding-inline: 12px; }
  .chart { grid-auto-columns: minmax(32px,1fr); gap: 2px; }
}
@media (min-width: 400px) and (max-width: 729px) {
  .date-actions { gap: 7px; }
}
@media (max-width: 729px) {
  dialog { margin: auto auto max(6px, env(safe-area-inset-bottom)); width: min(100% - 12px,490px); }
}
