:root {
  color-scheme: light;
  --paper: #f8faf9;
  --ink: #222e29;
  --muted: #63716a;
  --line: #dde4df;
  --green: #216a50;
  --green-light: #e8f2ec;
  --red: #a54335;
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: linear-gradient(180deg, #edf3ef 0, var(--paper) 260px); }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary, select { cursor: pointer; }
button, a, summary { touch-action: manipulation; }
button { color: inherit; border: 0; background: transparent; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; text-decoration: none; }
svg { width: 21px; height: 21px; flex-shrink: 0; stroke-width: 1.8; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8cbba5; outline-offset: 3px; }
.shell { max-width: 560px; margin: 0 auto; padding: 0 22px max(40px, env(safe-area-inset-bottom)); }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 600; min-width: 0; }
.brand > svg { color: var(--green); width: 25px; height: 25px; }
.icon-button { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; flex-shrink: 0; }
.icon-button:hover { background: var(--green-light); }
details { position: relative; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
nav { position: absolute; z-index: 5; top: 54px; right: 0; width: min(270px, calc(100vw - 44px)); padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 32px #22352a1a; }
nav a, nav button { display: flex; width: 100%; gap: 12px; align-items: center; padding: 13px 10px; text-align: left; min-height: 46px; font-size: 15px; border-radius: 3px; }
nav a:hover, nav button:hover { background: var(--green-light); }
nav .logout { color: var(--red); border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }
main { padding-top: 28px; }
h1 { font-size: 29px; font-weight: 600; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.page-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 6px 0 26px; }
.count { color: var(--muted); font-size: 13px; }
.auth-heading { margin: 36px 0 30px; }
.accent-line { display: block; width: 34px; height: 4px; background: #cf7969; margin-bottom: 20px; }
label { display: block; font-size: 14px; margin: 0 0 8px; }
input, select { min-width: 0; width: 100%; color: var(--ink); background: #fff; border: 1px solid #cbd5ce; border-radius: 5px; padding: 13px 12px; min-height: 48px; }
input::placeholder { color: #718078; }
#auth-form input { margin-bottom: 22px; }
.primary { background: var(--green); color: white; border-radius: 5px; min-height: 48px; }
.primary:hover { background: #19553f; }
.wide { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; }
.text-button { font-size: 14px; color: var(--green); padding: 17px 0; min-height: 48px; text-align: left; line-height: 1.6; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > input { flex: 1; }
.composer { border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 28px; }
.category-picker { display: flex; align-items: center; gap: 5px; padding-left: 3px; margin-top: 8px; color: var(--muted); }
.category-picker svg { width: 15px; height: 15px; }
.category-picker select { background: transparent; border: 0; width: auto; max-width: calc(100% - 24px); min-height: 44px; font-size: 14px; padding: 8px 25px 8px 6px; color: var(--muted); }
.group { margin-bottom: 26px; }
.group-heading { font-weight: 600; font-size: 13px; color: var(--green); margin: 0 0 8px; display: flex; justify-content: space-between; gap: 15px; overflow-wrap: anywhere; }
.group-heading span:last-child { font-weight: 400; color: var(--muted); flex-shrink: 0; }
.item { width: 100%; display: flex; gap: 13px; align-items: center; text-align: left; padding: 5px 1px; border-bottom: 1px solid var(--line); min-height: 34px; line-height: 1.45; }
.item:hover { background: #edf3ef; }
.item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.item-lifted { background: #fff; cursor: grabbing; box-shadow: 0 4px 15px #22352a24; }
.item-placeholder { background: var(--green-light); outline: 2px dashed #87ac99; outline-offset: -2px; box-shadow: none; }
.item-placeholder > * { visibility: hidden; }
.item-floating { background: #fff; opacity: .95 !important; border: 1px solid #87ac99; border-radius: 5px; box-shadow: 0 8px 24px #22352a30; }
.item-box { width: 22px; height: 22px; border: 1.5px solid #a5b4ab; border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.item-box svg { width: 17px; height: 17px; visibility: hidden; }
.item-text { overflow-wrap: anywhere; min-width: 0; }
.item.crossed .item-text { text-decoration: line-through; color: var(--muted); }
.item.crossed .item-box { background: var(--green-light); border-color: #87ac99; color: var(--green); }
.item.crossed .item-box svg { visibility: visible; }
.empty { padding: 42px 0; color: var(--muted); text-align: center; font-size: 15px; }
.empty svg { display: block; width: 34px; height: 34px; margin: 0 auto 15px; color: #8da296; }
.history-row { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 20px; justify-content: space-between; }
.history-row .item-text { text-decoration: line-through; color: var(--muted); line-height: 1.5; }
.history-row time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.category-create { margin-bottom: 25px; }
.category-edit { display: flex; align-items: center; gap: 5px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.category-edit input { flex: 1; background: transparent; }
.category-drag { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.category-edit .category-drag { width: 30px; }
.group-heading .category-drag { width: auto; height: auto; min-height: 30px; min-width: 0; flex-shrink: 1; justify-content: flex-start; gap: 6px; padding: 0; text-align: left; font-weight: inherit; overflow-wrap: anywhere; }
.group-heading .category-drag svg { width: 15px; height: 18px; }
.group-heading:has(.category-drag) { align-items: center; }
.category-lifted, .category-floating { background: var(--paper); box-shadow: 0 6px 20px #22352a26; }
.category-placeholder { outline: 2px dashed #87ac99; outline-offset: -2px; background: var(--green-light); }
.category-placeholder > * { opacity: .25; }
.category-floating { border-radius: 5px; }
.delete-button { color: var(--red); }
#error { background: #f9eae6; color: #8b3023; padding: 13px 15px; border-left: 3px solid #bc6354; border-radius: 3px; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; margin: 0 0 22px; }
#status { color: var(--muted); font-size: 14px; }
.sr-only { 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: 700px) { .shell { padding-top: 22px; } .topbar { height: 90px; } main { padding-top: 36px; } }
@media (max-width: 350px) { .shell { padding-left: 16px; padding-right: 16px; } .brand { font-size: 16px; gap: 8px; } .category-edit .icon-button { width: 44px; } }
@media (prefers-reduced-motion: no-preference) { main > section { animation: reveal .2s ease-out; } @keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } } }