:root {
  color-scheme: light dark;
  --paper: #fff;
  --surface: #f4f7fa;
  --nav: #f5f8fa;
  --ink: #182c3a;
  --dim: #536574;
  --edge: #d9e4ec;
  --teal: #126c66;
  --pressed: #d9efec;
  --solid: #126c66;
  --solid-ink: #fff;
  --warn: #9c3f27;
  --work: #5269be;
  --life: #087971;
  --shadow: 0 4px 24px #203a4c0a;
  font: 15px/1.55 "DM Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--surface);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b2229;
    --surface: #151a21;
    --nav: #202831;
    --ink: #e9f0f5;
    --dim: #a5b6c3;
    --edge: #354450;
    --teal: #82ded0;
    --pressed: #203f40;
    --solid: #87dfd0;
    --solid-ink: #132b29;
    --warn: #ffab94;
    --work: #a9b8fa;
    --life: #75d8c8;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--edge); }
.topbar-inner { max-width: 1280px; min-height: 66px; margin: auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .top-actions { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 730; letter-spacing: .025em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--solid-ink); background: var(--solid); border-radius: 9px; font-size: 18px; font-weight: 800; }
.login-wrap { margin: 12vh auto 0; width: min(100% - 32px, 408px); }
.login-card { display: grid; gap: 16px; padding: 28px; background: var(--paper); border: 1px solid var(--edge); border-radius: 17px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 25px; margin-bottom: 1px; }
.login-card details .field { margin-top: 8px; }
.workspace { display: grid; grid-template-columns: 160px minmax(0, 1fr) 320px; grid-template-areas: "nav tasks capture"; align-items: start; gap: 18px; max-width: 1280px; padding: 24px; margin: 0 auto; }
.side-nav { grid-area: nav; position: sticky; top: 20px; display: grid; gap: 4px; min-width: 0; padding: 11px; border: 1px solid var(--edge); border-radius: 16px; background: var(--nav); }
.side-nav button { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; white-space: nowrap; text-align: left; font-size: 14px; width: 100%; }
.side-nav button[aria-pressed="true"] { background: var(--pressed); color: var(--teal); font-weight: 700; }
.side-nav button:hover:not([aria-pressed="true"]) { background: var(--paper); }
.nav-mark { width: 16px; line-height: 1; display: inline-grid; place-items: center; color: var(--teal); font-size: 16px; }
.side-nav small { margin-left: auto; color: var(--dim); font-size: 11px; }
.nav-section { display: grid; gap: 4px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--edge); }
.nav-section p { margin: 0 9px; font-size: 11px; color: var(--dim); }
.dot { flex: none; width: 8px; height: 8px; margin: 0 4px; background: var(--dim); border-radius: 50%; }
.dot.work { background: var(--work); }
.dot.life { background: var(--life); }
.tasks-panel, .capture { min-width: 0; background: var(--paper); border: 1px solid var(--edge); border-radius: 17px; box-shadow: var(--shadow); }
.tasks-panel { grid-area: tasks; min-height: 430px; padding: 25px; }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.view-heading p { color: var(--dim); font-size: 12px; margin-bottom: 4px; }
.view-heading h1 { line-height: 1.16; font-size: clamp(29px, 4vw, 36px); letter-spacing: -.02em; }
.primary, .outline, .quiet { min-height: 40px; padding: 6px 12px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; }
.primary { color: var(--solid-ink); background: var(--solid); font-weight: 700; }
.primary:hover:not(:disabled) { filter: brightness(1.12); }
.outline { color: var(--ink); border-color: var(--edge); background: var(--paper); }
.outline:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--pressed); color: var(--teal); }
.quiet { color: var(--dim); background: transparent; }
.search { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 0 11px; border: 1px solid var(--edge); border-radius: 9px; background: var(--surface); color: var(--dim); }
.search-icon { flex: none; width: 12px; height: 12px; border: 1.6px solid currentColor; border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; height: 1.6px; width: 6px; background: currentColor; transform: rotate(45deg); right: -5px; bottom: -2px; }
.search input { min-height: 43px; width: 100%; min-width: 0; border: 0; background: transparent; padding: 0 2px; }
.search input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--dim); opacity: 1; }
.task-group { margin-top: 23px; }
.task-group h2, .templates h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.task-group h2 small { font-size: 11px; font-weight: 500; color: var(--dim); }
.overdue h2 { color: var(--warn); }
.task { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 9px; min-height: 62px; padding: 10px 0; border-bottom: 1px solid var(--edge); }
.task-text { min-width: 0; padding-top: 4px; }
.task-title { display: block; overflow-wrap: anywhere; font-weight: 650; }
.task.complete .task-title { color: var(--dim); text-decoration: line-through; }
.task-meta, .task-note { display: block; overflow-wrap: anywhere; font-size: 12px; color: var(--dim); }
.task-meta { margin-top: 3px; }
.task-note { margin-top: 4px; white-space: pre-wrap; }
.task-check { display: grid; place-items: center; width: 30px; height: 36px; background: transparent; border: 0; border-radius: 8px; }
.task-check::before { content: ""; display: grid; place-items: center; border: 1.5px solid var(--dim); border-radius: 5px; width: 17px; height: 17px; }
.task-check[aria-pressed="true"]::before { content: "✓"; color: var(--solid-ink); background: var(--solid); border-color: var(--solid); font-size: 12px; font-weight: 700; line-height: 1; }
.task-check:hover { background: var(--pressed); }
.row-actions { display: flex; align-items: center; gap: 2px; }
.row-actions button { font-size: 12px; min-height: 36px; padding: 3px 7px; }
.row-actions .delete { color: var(--warn); }
.empty { color: var(--dim); margin: 22px 0 10px; padding: 8px 0; }
.more { margin-top: 14px; }
.templates { margin-top: 22px; }
.template-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 4px 7px; padding: 7px; margin-top: 8px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); }
.template-list button { min-height: 40px; padding: 5px 7px; border: 0; border-radius: 7px; background: transparent; text-align: left; font-size: 13px; overflow-wrap: anywhere; }
.template-list button:hover { background: var(--pressed); color: var(--teal); }
.template-list button span { color: var(--teal); margin-right: 5px; }
.capture { grid-area: capture; position: sticky; top: 20px; }
.capture-form { display: grid; gap: 12px; padding: 19px; }
.capture-form header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.capture-form h2 { font-size: 21px; font-weight: 735; }
.field { display: grid; min-width: 0; gap: 5px; color: var(--dim); font-size: 12px; }
.field :is(input, select, textarea) { width: 100%; min-width: 0; min-height: 43px; padding: 8px 9px; border: 1px solid var(--edge); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: 15px; }
.field textarea { resize: vertical; }
.date-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.date-choices button { min-height: 40px; padding: 3px 2px; border: 1px solid var(--edge); border-radius: 8px; background: var(--paper); white-space: nowrap; font-size: 12px; }
.date-choices button[aria-pressed="true"] { color: var(--teal); background: var(--pressed); border-color: transparent; font-weight: 700; }
details summary { color: var(--dim); cursor: pointer; font-size: 13px; min-height: 30px; padding: 4px 0; }
.capture details .field + .field { margin-top: 9px; }
.message { color: var(--teal); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message[data-error="true"] { color: var(--warn); }
.message:empty { display: none; }
#list-message:not(:empty) { margin-top: 13px; }
.dim { color: var(--dim); }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 125px minmax(0, 1fr) 286px; gap: 12px; padding: 15px; }
  .tasks-panel { padding: 17px; }
}
@media (max-width: 790px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "capture" "tasks"; }
  .side-nav { position: static; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 5px; gap: 4px; }
  .nav-section { display: contents; }
  .nav-section p { display: none; }
  .side-nav button { justify-content: center; }
  .side-nav small { display: none; }
  .capture { position: static; }
  .capture-form { padding: 14px 16px; gap: 9px; }
  .tasks-panel { min-height: 280px; }
  .topbar-inner { min-height: 58px; padding: 0 16px; }
}
@media (max-width: 465px) {
  .workspace { padding: 10px; gap: 10px; }
  .side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .side-nav button { min-height: 42px; }
  .row-actions { display: grid; }
  .task { grid-template-columns: 37px minmax(0, 1fr) auto; gap: 4px; }
  .task-check { width: 37px; }
  .view-heading h1 { font-size: 29px; }
}
@media (pointer: coarse) {
  button, .search input, details summary { min-height: 44px; }
  .field :is(input, select, textarea), .search input { font-size: 16px; }
  .row-actions button { min-height: 44px; }
  .task-check { min-height: 44px; }
}
