:root {
  color-scheme: light;
  --paper: #f6f7f5;
  --ink: #25362f;
  --muted: #788079;
  --green: #37735d;
  --line: #e7ebe5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
button, a, input { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--green); }
.shell { max-width: 640px; margin: 0 auto; padding: max(36px, env(safe-area-inset-top)) 24px max(60px, env(safe-area-inset-bottom)); }
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 78px; min-height: 44px; }
body.is-signed-in .masthead { margin-bottom: 10px; align-items: flex-start; }
body.is-signed-in .shell { max-width: 632px; padding-left: 16px; padding-right: 16px; padding-bottom: calc(var(--composer-height, 108px) + var(--keyboard-bottom, 0px) + 12px); }
.brand-stack { min-width: 0; padding-right: 12px; }
.brand-subtitle { margin: 3px 0 0 38px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--green); text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: -.5px; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.text-button { border: 0; padding: 12px 0 12px 16px; color: var(--muted); background: transparent; font-size: 13px; min-height: 44px; }
.text-button:hover { color: var(--ink); }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--ink); }
.icon-button svg { width: 21px; height: 21px; }
.settings-dialog { width: min(320px, calc(100vw - 40px)); padding: 22px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 12px 48px #25362f26; }
.settings-dialog::backdrop { background: #25362f55; }
.settings-dialog h2 { margin: 0 0 18px; font-size: 15px; font-weight: 600; }
.settings-action, .settings-cancel { width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 14px; }
.settings-action { color: #a6543f; }
.settings-cancel { margin-top: 10px; color: var(--muted); }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 650; letter-spacing: 1.8px; margin-bottom: 15px; }
h1 { margin: 0; font-size: clamp(34px, 8vw, 42px); font-weight: 650; letter-spacing: -1.6px; line-height: 1.16; }
.subtitle { margin: 13px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.composer-bar { position: fixed; z-index: 10; left: 0; right: 0; bottom: var(--keyboard-bottom, 0px); padding: 4px 16px max(8px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%); }
.composer-bar .add-form { max-width: 600px; margin: 0 auto; box-shadow: 0 6px 24px #25362f14; }
body.is-keyboard-open .composer-bar { padding-bottom: 8px; }
body.is-signed-in .notice { bottom: calc(var(--keyboard-bottom, 0px) + var(--composer-height, 108px) + 12px); }
.add-form { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid #dce3db; border-radius: 14px; padding: 6px; box-shadow: 0 3px 8px #25362f03; }
.add-form:focus-within { border-color: #8cae9d; box-shadow: 0 0 0 3px #37735d0a; }
.add-form input { min-width: 0; flex: 1; padding: 12px 10px; border: none; color: var(--ink); background: transparent; font-size: 16px; outline: none; }
input::placeholder { color: #8c948d; opacity: 1; }
.add-form button { display: grid; place-items: center; width: 44px; height: 44px; border: none; border-radius: 9px; background: var(--green); color: white; flex-shrink: 0; }
.add-form button:hover { background: #2b604b; }
.add-form button:disabled { opacity: .5; }
.add-form svg { width: 22px; height: 22px; }
.list-heading { display: flex; justify-content: space-between; align-items: center; margin: 12px 2px 8px; }
#priority-section[hidden] + .list-heading { margin-top: 0; }
h2 { margin: 0; font-size: 13px; font-weight: 600; }
.list-heading h2 { display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 21px; padding: 2px 6px; border-radius: 6px; color: #7b857d; background: #e9ede7; font-size: 11px; font-weight: 500; line-height: 16px; }
.sync-status { color: #8a938b; font-size: 11px; }
.sync-status[data-state="error"] { color: #a85e3e; }
.priority-section .list-heading { margin-top: 0; }
.priority-section h2 { color: var(--green); }
.priority-section .list-panel { overflow: hidden; }
.task-text { touch-action: pan-y; transition: transform .15s; }
.task-row.is-swiping { background: #f0f5f0; }
.task-row.is-swiping .task-text { transition: none; }
.list-panel { border: 1px solid var(--line); border-radius: 15px; background: #fff; overflow: clip; }
#active-panel { border: 0; background: transparent; overflow: visible; }
#active-list > .task-row { border-inline: 1px solid var(--line); }
#active-list > .run-first { border-top: 1px solid var(--line); border-top-left-radius: 15px; border-top-right-radius: 15px; }
#active-list > .run-last { border-bottom: 1px solid var(--line); border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; }
#active-list > .run-first::before { display: none; }
.sublist { margin: 8px 0; background: white; border: 1px solid var(--line); border-radius: 15px; transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.sublist:first-child { margin-top: 0; }
.sublist:last-child { margin-bottom: 0; }
.sublist-header { display: flex; align-items: center; min-height: 44px; }
.category-toggle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; width: 100%; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 600; text-align: left; }
.category-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.category-toggle .chevron { width: 12px; height: 12px; flex-shrink: 0; }
.category-toggle .count { flex-shrink: 0; }
.category-toggle[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.category-rename { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.category-rename svg { width: 14px; height: 14px; }
.category-rename:hover { color: var(--green); }
.sublist-tasks { min-height: 20px; }
.sublist-tasks .task-row { background: transparent; }
.category-editor { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 10px; }
.category-editor input { width: 100%; min-width: 0; border: none; border-bottom: 1px solid #b6cbbb; padding: 8px 0; font-size: 16px; color: var(--green); background: transparent; }
.category-editor button { min-height: 44px; padding: 8px; background: transparent; border: none; color: var(--green); font-size: 12px; }
.category-drop-target { border-color: #7da68b; box-shadow: 0 0 0 3px #37735d12; }
#empty-list { border: 1px solid var(--line); border-radius: 15px; background: white; }
.task-list { margin: 0; padding: 0; list-style: none; }
.task-row { display: flex; align-items: center; min-height: 48px; background: white; position: relative; padding: 2px 4px; transition: opacity .28s ease, transform .28s ease; }
.task-row + .task-row::before { content: ""; position: absolute; top: 0; left: 51px; right: 12px; border-top: 1px solid #f0f2ee; }
.check-label { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; height: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.task-checkbox { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid #cdd6cd; border-radius: 7px; background: white; cursor: pointer; display: grid; place-content: center; transition: background .15s, border-color .15s; }
.task-checkbox::after { content: ""; width: 9px; height: 5px; border: solid white; border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); margin-top: -2px; }
.task-checkbox:checked { background: var(--green); border-color: var(--green); }
.task-checkbox:checked::after { transform: rotate(-45deg) scale(1); }
.task-text { padding: 12px 8px 12px 3px; flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; font-size: 16px; }
.drag-handle { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; background: transparent; border: 0; color: #c2cbc2; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--green); }
.drag-handle svg { width: 18px; height: 22px; }
.task-row.completing { opacity: 0; transform: translateY(5px); }
.task-row.completing .task-text { text-decoration: line-through; color: var(--muted); }
.task-row.drag-placeholder { background: #f0f5f0; }
.task-row.drag-placeholder > * { opacity: 0; }
.task-row.drag-ghost { position: fixed; z-index: 20; pointer-events: none; border: 1px solid #bfcfc1; border-radius: 12px; box-shadow: 0 10px 30px #25362f20; opacity: .97; transition: none; }
.drag-caption { position: absolute; top: -27px; left: 10px; background: #37735d; color: white; border-radius: 5px; padding: 4px 7px; font-size: 11px; line-height: 16px; max-width: calc(100% - 20px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-row.creating-category { border-color: var(--green); }
.drop-marker { position: fixed; height: 3px; background: var(--green); border-radius: 3px; z-index: 19; pointer-events: none; }
.drop-marker::before { content: ""; position: absolute; left: -3px; top: -2px; width: 7px; height: 7px; border: 2px solid var(--green); border-radius: 50%; background: var(--paper); }
.drop-marker.new-category-marker { height: 8px; background: #37735d40; }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.drag-hint { margin: 8px 0 0; color: #8a938b; font-size: 11px; text-align: center; line-height: 1.4; }
.completed-section { margin-top: 20px; padding-top: 8px; border-top: 1px solid #e1e6df; }
.completed-toggle { display: flex; align-items: center; gap: 9px; padding: 8px 0; min-height: 44px; border: 0; background: transparent; color: #768177; font-size: 13px; font-weight: 500; }
.chevron { width: 13px; height: 13px; transition: transform .2s; }
.completed-toggle[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.completed-list { margin-top: 2px; }
.completed-list .task-row { background: transparent; padding-left: 0; min-height: 48px; }
.completed-list .task-text { color: #8a938b; text-decoration: line-through; }
.completed-list .task-checkbox { background: #8ea997; border-color: #8ea997; }
.completed-list .task-row + .task-row::before { border: none; }
.empty-state { text-align: center; padding: 24px 16px 28px; }
.empty-check { display: grid; place-items: center; margin: 0 auto 16px; width: 38px; height: 38px; border-radius: 50%; background: #eff5ed; color: #648367; font-size: 18px; }
.empty-state p { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.empty-state > span:last-child, .empty-completed { color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-completed { padding: 8px 22px; }
.login-card { margin-top: 34px; padding: 25px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.login-card label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 10px; }
.login-card input + label { margin-top: 18px; }
.login-card input:not(.visually-hidden) { display: block; width: 100%; border: 1px solid #dce3db; border-radius: 9px; padding: 14px; background: #fcfdfb; font-size: 16px; color: var(--ink); }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 16px; margin-top: 16px; color: white; background: var(--green); border: none; border-radius: 9px; font-size: 14px; font-weight: 500; min-height: 48px; }
.primary-button:disabled { opacity: .6; }
.form-error { font-size: 13px; color: #a6543f; line-height: 1.5; margin: 12px 0 0; }
.form-error:empty { display: none; }
.quiet-note { color: #8a938b; font-size: 12px; text-align: center; margin: 22px 0; }
.loading { padding: 40px 0; color: var(--muted); font-size: 14px; }
.notice { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 24px; right: 24px; z-index: 30; width: max-content; max-width: min(560px, calc(100vw - 48px)); margin: auto; padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 15px; background: #253c30; border-radius: 12px; color: white; box-shadow: 0 4px 20px #0002; font-size: 13px; line-height: 1.5; }
.notice button { border: 0; background: transparent; color: white; font-size: 22px; min-width: 44px; min-height: 44px; }
.undo-button { position: fixed; z-index: 25; right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--keyboard-bottom, 0px) + var(--composer-height, 108px) + 10px); display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 15px; border: 1px solid #c7d9cd; border-radius: 22px; background: #fff; color: var(--green); box-shadow: 0 4px 18px #25362f18; font-size: 13px; font-weight: 600; animation: undo-appear .18s ease-out; }
.undo-button svg { width: 18px; height: 18px; }
.undo-button:hover { background: #eff5ed; }
.undo-button:disabled { opacity: .5; }
@keyframes undo-appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 768px) { .shell { padding-top: 54px; } }
@media (max-width: 440px) { .shell { padding-left: 20px; padding-right: 20px; } .masthead { margin-bottom: 56px; } .login-card { padding: 22px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
