:root {
  color-scheme: light;
  --paper: #f6f3eb;
  --card: #fffefa;
  --ink: #222820;
  --sub: #5c645a;
  --line: #e1ded2;
  --green: #23392e;
  --green-dark: #172a21;
  --sage: #e8eee5;
  --gold: #ecc77f;
  --danger: #963a29;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #8f6429;
  outline-offset: 3px;
}
h1, h2, p { margin: 0; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; line-height: 1.08; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.1rem, 5vw, 3.65rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -.035em; }
p { line-height: 1.55; }
img { max-width: 100%; }
.icon { flex: none; vertical-align: middle; }
.frame { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; gap: 12px; align-items: center; font-family: Georgia, serif; font-size: 1.15rem; white-space: nowrap; }
.brand img { border-radius: 10px; }
.brand small { display: block; font: 700 .63rem/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .2em; color: var(--sub); }
.nav { display: flex; gap: 3px; }
.nav a { padding: 11px 12px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; color: var(--sub); font-size: .87rem; font-weight: 650; }
.nav a:hover, .nav a[aria-current] { color: var(--green-dark); background: var(--sage); }
.account { position: relative; z-index: 3; }
.account summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: .87rem; font-weight: 650; }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; background: var(--sage); border: 1px solid #d8e2d6; color: var(--green); border-radius: 50%; width: 36px; height: 36px; }
.account-menu { position: absolute; right: 0; top: 50px; border: 1px solid var(--line); padding: 6px; border-radius: 12px; box-shadow: 0 8px 30px #272c1920; background: var(--card); white-space: nowrap; }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 7px; }
.account-menu a:hover, .account-menu button:hover { background: var(--sage); }
.main { padding-top: 30px; padding-bottom: 60px; }
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(24px, 5vw, 48px); background: var(--green); color: var(--paper); border-radius: 24px; }
.hero-copy { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { margin: 9px 0; }
.hero p:not(.eyebrow) { color: #e0e7dc; }
.hero .button { margin-top: 24px; }
.hero-mark { position: absolute; z-index: -1; right: 2%; bottom: -28%; color: #ffffff0b; font: 500 clamp(9rem, 27vw, 24rem)/1 Georgia, serif; letter-spacing: -.10em; pointer-events: none; user-select: none; }
.eyebrow { font-size: .69rem; line-height: 1.5; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: #596e5d; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-block: 16px 25px; }
.stat { display: flex; flex-direction: column; gap: 5px; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: .88rem; font-weight: 620; color: var(--sub); }
.stat:hover { border-color: #9aac99; }
.stat-value { font: 500 2.2rem/1 Georgia, serif; color: var(--green); }
.attention { color: var(--danger); font-weight: 700; }
.dashboard-grid, .calendar-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.panel { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.section-head, .page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-head { padding: 19px 20px; }
.section-head .eyebrow, .page-head .eyebrow { margin-bottom: 4px; }
.page-head { margin-bottom: 19px; }
.button, .icon-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; padding: 9px 14px; font-size: .9rem; font-weight: 700; line-height: 1.15; text-align: center; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-dark); }
.gold { background: var(--gold); color: #272213; }
.gold:hover { background: #f4d79b; }
.secondary, .icon-button { border-color: var(--line); background: var(--card); }
.secondary:hover, .icon-button:hover { background: var(--sage); }
.danger { background: var(--danger); color: white; }
.danger-link { color: var(--danger); min-height: 44px; display: inline-flex; align-items: center; padding-inline: 8px; font-weight: 650; }
.text-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--green); font-size: .88rem; font-weight: 700; }
.text-link:hover, .danger-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link .icon { width: 16px; }
.rows { list-style: none; padding: 0; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 10px 17px; min-width: 0; }
.row:first-child { border-top: 1px solid var(--line); }
.row-link { display: flex; flex: 1; min-width: 0; min-height: 44px; justify-content: center; flex-direction: column; padding-block: 2px; }
a.row-link:hover .row-title, .event-row:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.row-title { font-weight: 680; overflow-wrap: anywhere; }
.row-meta { font-size: .81rem; color: var(--sub); margin-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.done-title { text-decoration: line-through; color: var(--sub); }
.status-form { flex: none; }
.toggle { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--green); font-weight: 750; }
.toggle span { opacity: 0; }
.toggle:hover span, .toggle:focus-visible span { opacity: 1; }
.toggle.doing { border-color: #c0a46f; background: #fbf1d9; }
.toggle.done { background: var(--sage); border-color: #cedacd; }
.pill { flex: none; font-size: .71rem; font-weight: 700; border-radius: 20px; padding: 4px 8px; background: var(--sage); color: var(--green); }
.priority-1 { color: #832f22; background: #f7e6df; }
.priority-3 { color: #535b54; background: #efefe9; }
.empty { text-align: center; display: grid; place-items: center; gap: 7px; padding: 24px 14px 30px; color: var(--sub); font-size: .88rem; line-height: 1.4; }
.empty strong { color: var(--ink); }
.empty-icon { background: var(--sage); color: var(--green); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: 3px; }
.date-badge { flex: none; display: grid; place-content: center; place-items: center; width: 45px; height: 48px; border-radius: 9px; background: var(--sage); color: var(--green); }
.date-badge strong { font: 500 1.3rem/1 Georgia, serif; }
.date-badge small { font-size: .64rem; text-transform: uppercase; font-weight: 700; margin-top: 3px; }
.event-row > .icon { width: 16px; color: var(--sub); }
.filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: end; padding: 12px; margin-bottom: 15px; }
.filters label, .field { display: grid; gap: 6px; min-width: 0; font-size: .88rem; font-weight: 650; }
input:not([type=hidden]), select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #cfcfc1; border-radius: 9px; padding: 9px 10px; background: #fff; font-size: 1rem; font-weight: 400; }
input[type=date], input[type=time] { appearance: none; -webkit-appearance: none; text-align: start; }
textarea { resize: vertical; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 15px; }
.list-card { display: grid; align-content: start; gap: 10px; padding: 19px; }
.list-card .empty-icon { margin-bottom: 5px; }
.list-card p { overflow-wrap: anywhere; }
.list-count { font-size: .84rem; font-weight: 700; color: var(--green); }
.list-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; }
.calendar-panel { padding-bottom: 12px; }
.month-nav { display: flex; gap: 5px; align-items: center; }
.month-nav .text-link { padding-inline: 5px; }
.icon-button { width: 44px; padding: 0; }
.month { width: calc(100% - 18px); margin-inline: 9px; table-layout: fixed; border-spacing: 2px; }
.month th { color: var(--sub); font-size: .8rem; padding-bottom: 5px; }
.month td { padding: 0; }
.day { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; }
a.day:hover { background: var(--sage); }
.day.outside { color: #777d74; font-weight: 400; }
.day.today { border-color: #859b85; }
.day.selected, a.day.selected:hover { background: var(--green); color: #fff; }
.event-dot { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: #936527; }
.day.selected .event-dot { background: var(--gold); }
.narrow { width: 100%; max-width: 620px; margin-inline: auto; }
.back { margin-bottom: 5px; }
.form { display: grid; gap: 15px; }
.form-panel { padding: clamp(16px, 4vw, 28px); }
.form-panel > p { overflow-wrap: anywhere; }
.help { font-weight: 400; color: var(--sub); line-height: 1.5; }
.help ul { margin: 3px 0 0; padding-inline-start: 17px; }
.errorlist, .form-error { color: var(--danger); margin: 0; padding: 0; list-style: none; font-size: .88rem; line-height: 1.45; }
.messages { list-style: none; padding: 0; margin: 0 0 13px; }
.messages li, .connection { padding: 10px 13px; background: var(--sage); border-radius: 9px; font-size: .88rem; }
.messages .error, .connection { background: #f7e6df; color: var(--danger); }
.connection { margin-bottom: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.muted { color: var(--sub); }
.login-body { display: grid; place-items: center; min-height: 100svh; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.login-card { width: min(100%, 780px); display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 12px 45px #272c1910; }
.login-brand { display: grid; place-items: center; background: #030303; }
.login-brand img { display: block; width: 100%; height: auto; }
.login-content { display: grid; gap: 10px; padding: clamp(19px, 4vw, 34px); }
.login-content h1 { font-size: clamp(2rem, 5vw, 3rem); }
.login-content .form { margin-top: 9px; }
.login-content button { justify-content: space-between; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { top: 7px; left: 7px; width: auto; height: auto; clip-path: none; padding: 10px; background: white; z-index: 10; }
@media (max-width: 760px) {
  .frame { padding-inline: 15px; }
  .topbar-inner { min-height: 64px; }
  .main { padding-top: 19px; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .nav { position: fixed; inset: auto 0 0; z-index: 2; padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border-top: 1px solid var(--line); }
  .nav a { min-height: 50px; flex-direction: column; gap: 3px; padding: 4px 1px; font-size: .7rem; }
  .nav .icon { width: 20px; height: 20px; }
  .dashboard-grid, .calendar-layout { grid-template-columns: 1fr; }
  .account-name { display: none; }
}
@media (max-width: 520px) {
  .hero { padding: 22px 18px; border-radius: 18px; }
  .hero .button { margin-top: 17px; }
  .stats { gap: 6px; margin-block: 11px 16px; }
  .stat { padding: 10px 8px; font-size: .72rem; line-height: 1.3; }
  .stat-value { font-size: 1.75rem; }
  .section-head { padding: 12px; }
  .row { padding: 8px; gap: 7px; }
  .page-head { align-items: end; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .login-card { grid-template-columns: 1fr; max-width: 410px; }
  .login-brand img { width: min(100%, 280px); }
  .day { min-height: 42px; }
}
@media (max-width: 350px) {
  .button { padding-inline: 8px; }
  .page-head .button { font-size: .78rem; }
  .nav a { font-size: .65rem; }
}
.overdue-filter { color: var(--danger); font-size: .88rem; }
