:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --surface: #fffefa;
  --ink: #202821;
  --muted: #788078;
  --line: #e7e9e1;
  --leaf: #517a5d;
  --leaf-dark: #36573e;
  --leaf-pale: #e7efe4;
  --coral: #c7654a;
  --sun: #f0c967;
  --font-ui: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid #95b59a; outline-offset: 3px; }
.app-shell { min-height: 100vh; background: radial-gradient(ellipse at 87% 2%, rgba(234, 239, 218, .58), transparent 31%), var(--paper); }
.topbar { height: 76px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(32, 40, 33, .08); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--leaf); color: white; font-family: var(--font-display); font-size: 22px; font-style: italic; line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.sync-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d3a94a; }
.sync-status.is-connected .status-dot { background: #5b9669; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #5d675e; cursor: pointer; font-size: 23px; transition: background .18s ease, color .18s ease; }
.icon-button:hover { background: var(--leaf-pale); color: var(--leaf-dark); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.profile-button { padding: 9px 14px; border: 1px solid #dfe4da; border-radius: 4px; background: var(--surface); color: var(--leaf-dark); cursor: pointer; font-size: 12px; font-weight: 700; transition: border-color .2s, background .2s; }
.profile-button:hover { border-color: #9db59e; background: #f8fbf6; }
.main-layout { width: min(1120px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(40px, 7vw, 96px); padding: 58px 0 34px; }
.sidebar { min-width: 0; min-height: calc(100vh - 170px); display: flex; flex-direction: column; }
.sidebar-label, .eyebrow { margin: 0; color: #929991; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.sidebar-label { padding: 10px 12px 15px; }
.view-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: #687169; cursor: pointer; text-align: left; font-size: 13px; transition: background .16s ease, color .16s ease; }
.nav-item:hover { background: rgba(231, 239, 228, .7); color: var(--leaf-dark); }
.nav-item.is-active { background: var(--leaf-pale); color: var(--leaf-dark); font-weight: 700; }
.nav-icon { width: 18px; color: #819082; font-size: 16px; text-align: center; }
.nav-item.is-active .nav-icon { color: var(--leaf); }
.nav-count { margin-left: auto; color: #8e988f; font-size: 11px; }
.sidebar-bottom { margin-top: auto; padding-top: 40px; }
.reminder-card { display: grid; grid-template-columns: 28px minmax(0, 1fr) 34px; align-items: center; gap: 8px; padding: 12px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reminder-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #fff2d6; color: #a47d2c; font-size: 15px; }
.reminder-card strong, .reminder-card span:not(.reminder-icon) { display: block; }
.reminder-card strong { font-size: 11px; font-weight: 700; }
.reminder-card div span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.toggle-switch { width: 32px; height: 18px; position: relative; border: 0; border-radius: 20px; background: #c8cec7; cursor: pointer; transition: background .2s ease; }
.toggle-switch span { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: white; transition: transform .2s ease; }
.toggle-switch.is-on { background: var(--leaf); }
.toggle-switch.is-on span { transform: translateX(14px); }
.sidebar-note { min-height: 29px; margin: 9px 10px 0; color: #969d95; font-size: 10px; line-height: 1.5; }
.content-panel { max-width: 760px; min-width: 0; animation: appear .5s ease both; }
.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.eyebrow { margin-bottom: 12px; color: var(--leaf); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-family: var(--font-display); font-size: clamp(38px, 5vw, 52px); font-weight: 500; letter-spacing: 0; line-height: 1.06; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.date-picker-button { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: #656f66; cursor: pointer; font-size: 11px; white-space: nowrap; }
.date-picker-button:hover { border-color: #b7c8b7; color: var(--leaf-dark); }
.task-composer { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 7px 8px 7px 16px; border: 1px solid #dfe5dc; border-radius: 5px; background: var(--surface); box-shadow: 0 5px 18px rgba(49, 64, 47, .035); transition: border-color .2s, box-shadow .2s; }
.task-composer:focus-within { border-color: #a8c0a9; box-shadow: 0 5px 22px rgba(49, 94, 57, .09); }
.composer-plus { width: 23px; height: 23px; display: grid; flex: 0 0 23px; place-items: center; border: 1px solid #aebdae; border-radius: 50%; color: var(--leaf); font-size: 18px; font-weight: 300; line-height: 1; }
.task-composer input[type="text"] { width: 100%; min-width: 70px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.task-composer input::placeholder { color: #9ba39a; }
.composer-date { width: 35px; min-width: 35px; height: 34px; padding: 0; border: 0; background: transparent; color: transparent; cursor: pointer; }
.composer-date::-webkit-calendar-picker-indicator { width: 17px; height: 17px; opacity: .48; cursor: pointer; }
.add-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; flex: 0 0 auto; padding: 0 14px; border: 0; border-radius: 4px; background: var(--leaf); color: white; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .18s, transform .18s; }
.add-button:hover { transform: translateY(-1px); background: var(--leaf-dark); }
.list-toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.task-summary { display: flex; align-items: baseline; gap: 7px; color: #929990; font-size: 11px; }
.summary-number { color: var(--ink); font-family: var(--font-display); font-size: 19px; }
.text-button, .quiet-button { padding: 5px 0; border: 0; background: transparent; color: var(--coral); cursor: pointer; font-size: 11px; }
.text-button:hover, .quiet-button:hover { text-decoration: underline; }
.task-list { min-height: 180px; }
.task-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 28px; align-items: center; gap: 12px; min-height: 61px; border-bottom: 1px solid var(--line); animation: row-in .24s ease both; }
.task-check { width: 19px; height: 19px; display: grid; place-items: center; padding: 0; border: 1.5px solid #bdc8bc; border-radius: 50%; background: transparent; color: white; cursor: pointer; transition: border .18s, background .18s, transform .18s; }
.task-check:hover { transform: scale(1.08); border-color: var(--leaf); }
.task-check.is-done { border-color: var(--leaf); background: var(--leaf); }
.task-check svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.task-title { overflow-wrap: anywhere; color: #313a32; font-size: 13px; line-height: 1.45; }
.task-date { color: #9aa198; font-size: 10px; white-space: nowrap; }
.task-row.is-complete .task-title { color: #9ba19a; text-decoration: line-through; text-decoration-color: #bdc5bb; }
.task-row.is-complete .task-date { color: #b2b7b0; }
.delete-task { width: 28px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #a8afa7; cursor: pointer; font-size: 17px; opacity: 0; transition: opacity .16s, color .16s, background .16s; }
.task-row:hover .delete-task, .delete-task:focus-visible { opacity: 1; }
.delete-task:hover { background: #faeee9; color: var(--coral); }
.group-heading { display: flex; align-items: center; gap: 9px; margin: 25px 0 4px; color: #8c958c; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.group-heading:first-child { margin-top: 16px; }
.group-heading::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.empty-state { min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px 10px; text-align: center; animation: appear .45s ease both; }
.empty-state[hidden] { display: none; }
.empty-illustration { width: 62px; height: 62px; position: relative; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; background: #e9efe2; }
.sun-shape { width: 34px; height: 34px; position: absolute; top: 9px; right: 7px; border-radius: 50%; background: var(--sun); }
.empty-check { width: 27px; height: 27px; z-index: 1; display: grid; place-items: center; margin: 15px 0 0 -12px; border: 2px solid #fffefa; border-radius: 50%; background: var(--leaf); color: white; font-size: 14px; }
.empty-state h2 { margin-bottom: 7px; font-family: var(--font-display); font-size: 25px; font-weight: 500; }
.empty-state p { margin-bottom: 0; color: #929990; font-size: 12px; }
.content-footer { display: flex; justify-content: space-between; margin-top: 23px; color: #a0a69e; font-size: 10px; }
.settings-dialog { width: min(460px, calc(100% - 28px)); max-height: min(88vh, 760px); padding: 0; overflow: auto; border: 1px solid #e3e7df; border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 22px 70px rgba(26, 40, 28, .18); }
.settings-dialog::backdrop { background: rgba(28, 38, 29, .3); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 26px 19px; border-bottom: 1px solid var(--line); }
.dialog-header .eyebrow { margin-bottom: 8px; }
.dialog-header h2 { margin: 0; font-family: var(--font-display); font-size: 29px; font-weight: 500; }
.dialog-close { margin: -5px -7px 0 0; font-size: 27px; }
.dialog-content { padding: 22px 26px 26px; }
.setting-section + .setting-section { margin-top: 27px; padding-top: 23px; border-top: 1px solid var(--line); }
.setting-section h3 { margin-bottom: 6px; font-size: 13px; }
.setting-section p, .account-form > p:first-child { margin-bottom: 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.setting-section label, .account-form label { display: block; margin: 12px 0 6px; color: #667068; font-size: 10px; font-weight: 700; }
.setting-section input, .account-form input { width: 100%; min-height: 39px; padding: 0 10px; border: 1px solid #dfe5dc; border-radius: 4px; background: #fff; color: var(--ink); font-size: 12px; }
.setting-section input::placeholder { color: #a2aaa1; }
.secondary-button { min-height: 36px; padding: 0 12px; border: 1px solid #d7e1d4; border-radius: 4px; background: #f7faf4; color: var(--leaf-dark); cursor: pointer; font-size: 11px; font-weight: 700; }
.secondary-button:hover { border-color: #a6bda8; background: var(--leaf-pale); }
.button-row { display: flex; align-items: center; gap: 15px; margin-top: 14px; }
.fine-print { margin: 10px 0 0 !important; color: #9ba198 !important; font-size: 10px !important; }
.account-dialog { width: min(400px, calc(100% - 28px)); }
.account-form { display: grid; }
.account-form > p:first-child { margin-bottom: 7px; }
.auth-submit { width: 100%; margin-top: 18px; }
.form-message { min-height: 17px; margin: 9px 0 0; color: var(--coral); font-size: 11px; }
.account-form .quiet-button { justify-self: center; margin-top: 10px; color: var(--leaf); }
.sr-only { width: 1px; height: 1px; position: absolute; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
#hidden-date-input { position: fixed; left: -100vw; }

@keyframes appear { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 740px) {
  .topbar { height: 66px; padding: 0 18px; }
  .main-layout { width: min(100% - 36px, 620px); grid-template-columns: 1fr; gap: 24px; padding: 23px 0 26px; }
  .sidebar { min-height: 0; }
  .sidebar-label, .sidebar-bottom { display: none; }
  .view-nav { min-width: 0; max-width: 100%; display: flex; gap: 6px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
  .view-nav::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; min-height: 37px; flex: 0 0 auto; gap: 7px; padding: 0 11px; border: 1px solid transparent; font-size: 11px; }
  .nav-item.is-active { border-color: #dbe6d8; }
  .nav-icon { width: auto; font-size: 14px; }
  .nav-count { margin-left: 1px; }
  .content-heading { margin-bottom: 23px; }
  h1 { font-size: 40px; }
  .subtitle { font-size: 12px; }
  .task-composer { gap: 8px; padding-left: 11px; }
  .add-button { gap: 8px; padding: 0 11px; font-size: 10px; }
}
@media (max-width: 440px) {
  .topbar-actions { gap: 7px; }
  .sync-status { max-width: 83px; font-size: 10px; white-space: nowrap; }
  .profile-button { padding: 8px 9px; font-size: 10px; }
  .main-layout { width: calc(100% - 28px); }
  .content-heading { align-items: center; }
  h1 { font-size: 35px; }
  .date-picker-button { min-height: 33px; gap: 5px; padding: 0 8px; font-size: 10px; }
  .task-composer { flex-wrap: wrap; padding: 10px; }
  .task-composer input[type="text"] { flex: 1 1 calc(100% - 50px); }
  .composer-date { margin-left: 31px; }
  .add-button { min-height: 35px; margin-left: auto; }
  .task-row { grid-template-columns: 22px minmax(0, 1fr) auto 24px; gap: 8px; min-height: 57px; }
  .task-title { font-size: 12px; }
  .task-date { max-width: 72px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; }
  .delete-task { opacity: 1; }
  .dialog-header, .dialog-content { padding-right: 19px; padding-left: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}