:root {
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --ink: #17211d;
  --muted: #68736d;
  --line: #d8d9d1;
  --forest: #1e4d3b;
  --coral: #d8664f;
  --yellow: #e6b84a;
  --radius: 6px;
  --sidebar: 190px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
a { color: inherit; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 10; background: var(--ink); color: white; padding: 10px; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template: 64px 1fr / var(--sidebar) 1fr; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--forest); color: white; border-radius: 4px; font-family: Georgia, serif; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; border-radius: var(--radius); cursor: pointer; font-size: 18px; }
.sidebar { display: flex; flex-direction: column; gap: 4px; padding: 24px 14px; border-right: 1px solid var(--line); }
.sidebar a { padding: 10px 12px; text-decoration: none; border-left: 3px solid transparent; color: var(--muted); font-weight: 650; }
.sidebar a:hover, .sidebar a.active { color: var(--ink); background: rgba(255,255,255,.65); border-left-color: var(--coral); }
.content { width: min(100%, 940px); padding: 54px clamp(24px, 5vw, 72px) 96px; }
.auth-content { grid-column: 1 / -1; margin: 0 auto; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.page-header.compact { margin-bottom: 18px; }
.page-header h1 { margin: 3px 0 0; font: 700 42px/1.05 Georgia, serif; }
.eyebrow { margin: 0; color: var(--coral); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.header-note, .muted { color: var(--muted); max-width: 330px; line-height: 1.5; }
.summary-strip { display: flex; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.summary-strip strong { display: block; color: var(--ink); font-size: 19px; }
.capture-form { display: grid; grid-template-columns: 1fr 46px; margin-bottom: 42px; background: var(--surface); border: 1px solid var(--line); box-shadow: 4px 4px 0 var(--ink); }
.capture-form input { min-width: 0; border: 0; background: transparent; padding: 17px 18px; outline: none; }
.capture-form:focus-within { border-color: var(--forest); }
.add-button { border: 0; border-left: 1px solid var(--line); background: var(--forest); color: white; font-size: 26px; cursor: pointer; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font: 700 23px Georgia, serif; }
.section-heading a { color: var(--forest); font-size: 14px; font-weight: 700; }
.section-block + .section-block { margin-top: 42px; }
.task-list { border-top: 1px solid var(--ink); }
.task-list.roomy { margin-top: 18px; }
.task-row { min-height: 72px; display: grid; grid-template-columns: 42px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.task-row:hover { background: rgba(255,255,255,.5); }
.complete-form { display: grid; place-items: center; }
.check-button { width: 21px; height: 21px; border: 1.5px solid var(--muted); border-radius: 50%; background: transparent; cursor: pointer; }
.check-button:hover, .check-button:focus { border-color: var(--forest); box-shadow: inset 0 0 0 5px var(--surface); background: var(--forest); }
.check-button.checked { border-color: var(--forest); box-shadow: inset 0 0 0 5px var(--surface); background: var(--forest); }
.task-copy { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 15px 8px 15px 0; text-decoration: none; }
.task-copy strong { font-size: 15px; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.task-meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--area-colour); }
.task-meta span + span { border-left: 1px solid var(--line); padding-left: 8px; }
.priority { font-weight: 750; }
.priority.p4 { color: #a9362d; }
.priority.p3 { color: #865a00; }
.needs-review { border-left: 3px solid var(--yellow); }
.empty-state { display: flex; flex-direction: column; gap: 6px; color: var(--muted); padding: 36px 8px; }
.empty-state strong { color: var(--ink); }
.setup-callout { display: flex; flex-direction: column; gap: 5px; padding: 18px; border: 1px solid var(--line); border-left: 4px solid var(--yellow); background: var(--surface); text-decoration: none; }
.setup-callout span { color: var(--muted); font-size: 13px; }
.week-metric { min-width: 120px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.week-metric strong, .week-metric span { display: block; }
.week-metric strong { font-size: 24px; }
.week-metric span { color: var(--muted); font-size: 12px; }
.week-outcome { display: grid; gap: 6px; margin-bottom: 28px; padding: 17px 19px; background: var(--forest); color: white; border-left: 5px solid var(--coral); }
.week-outcome span { color: rgba(255,255,255,.72); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.week-grid { border-top: 1px solid var(--ink); }
.day-row { display: grid; grid-template-columns: 62px 1fr; min-height: 82px; border-bottom: 1px solid var(--line); }
.day-date { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); color: var(--muted); }
.day-date span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.day-date strong { color: var(--ink); font: 700 25px Georgia, serif; }
.day-content { display: grid; align-content: center; padding: 10px 16px; }
.day-content a { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; text-decoration: none; }
.day-content a + a { border-top: 1px solid var(--line); }
.day-content a strong { font-size: 14px; overflow-wrap: anywhere; }
.day-content a span, .day-content p { color: var(--muted); font-size: 12px; }
.day-content p { margin: 0; }
.next-without-date { margin-top: 38px; }
.area-list { border-top: 1px solid var(--ink); }
.area-row { display: grid; grid-template-columns: 10px minmax(150px, 1fr) auto auto auto 20px; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--line); text-decoration: none; }
.area-row > span:not(.area-swatch) { color: var(--muted); font-size: 12px; }
.area-swatch { width: 8px; height: 28px; background: var(--area-colour); }
.area-row i { color: var(--muted); font-style: normal; font-size: 22px; }
.more-list { display: grid; border-top: 1px solid var(--ink); }
.more-list a { display: grid; grid-template-columns: 1fr auto 20px; align-items: center; gap: 14px; min-height: 78px; border-bottom: 1px solid var(--line); text-decoration: none; }
.more-list span { display: flex; flex-direction: column; gap: 5px; }
.more-list small, .coming-tools small { color: var(--muted); }
.more-list b { display: grid; place-items: center; min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.more-list i { color: var(--muted); font-style: normal; font-size: 22px; }
.coming-tools { margin-top: 46px; }
.coming-tools > div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.filter-row a { flex: none; padding: 8px 10px; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.filter-row a.selected { color: var(--ink); border-color: var(--coral); }
.status-filters { margin-top: 4px; border-top: 1px solid var(--line); }
.planning-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.plan-section { border-top: 3px solid var(--line); background: rgba(255,255,255,.5); padding: 18px; }
.plan-section.status-unplanned { border-color: var(--yellow); }
.plan-section.status-next { border-color: var(--coral); }
.plan-section.status-scheduled { border-color: var(--forest); }
.plan-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.plan-heading h2 { margin: 0; font: 700 21px Georgia, serif; }
.plan-heading span { display: grid; place-items: center; min-width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-weight: 800; }
.plan-list { display: grid; }
.plan-list a { display: flex; flex-direction: column; gap: 4px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.plan-list strong { font-size: 14px; overflow-wrap: anywhere; }
.plan-list span, .plan-list p { margin: 0; color: var(--muted); font-size: 12px; }
.plan-more { display: inline-block; margin-top: 14px; color: var(--forest); font-size: 13px; font-weight: 750; }
.edit-form, .login-panel { max-width: 620px; background: var(--surface); border: 1px solid var(--line); padding: clamp(22px, 5vw, 40px); }
.login-panel { margin: 8vh auto 0; max-width: 460px; }
.login-panel h1 { margin: 7px 0; font: 700 42px Georgia, serif; }
.stack-form, .edit-form { display: grid; gap: 18px; }
.stack-form { margin-top: 28px; }
.field { display: grid; gap: 7px; }
.field label, .stack-form label { font-size: 13px; font-weight: 750; }
.field input:not([type=checkbox]), .field select, .field textarea, .stack-form input { width: 100%; border: 1px solid var(--line); background: white; padding: 12px; border-radius: 3px; }
.checkbox-field { grid-template-columns: auto 1fr; align-items: center; }
.checkbox-field label { grid-column: 2; grid-row: 1; }
.checkbox-field input { grid-column: 1; grid-row: 1; width: 19px; height: 19px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--forest); border-radius: 3px; font-weight: 750; cursor: pointer; text-decoration: none; }
.primary-button { background: var(--forest); color: white; }
.secondary-button { background: transparent; color: var(--forest); }
.form-error { color: #a9362d; font-size: 13px; }
.messages { position: fixed; right: 20px; top: 76px; z-index: 5; }
.message { background: var(--ink); color: white; padding: 12px 16px; border-radius: 3px; box-shadow: 0 4px 20px rgba(0,0,0,.15); }

@media (max-width: 720px) {
  .app-shell { grid-template: 58px 1fr 62px / 1fr; }
  .topbar { grid-column: 1; padding: 0 16px; }
  .content { grid-row: 2; padding: 32px 18px 72px; }
  .auth-content { grid-row: 2 / 4; }
  .sidebar { z-index: 4; position: fixed; inset: auto 0 0; height: 62px; padding: 0 6px; border: 0; border-top: 1px solid var(--line); background: var(--surface); flex-direction: row; align-items: stretch; justify-content: space-around; }
  .sidebar a { flex: 1; display: grid; place-items: center; padding: 6px 4px; border-left: 0; border-top: 3px solid transparent; font-size: 12px; }
  .sidebar a:hover, .sidebar a.active { border-left-color: transparent; border-top-color: var(--coral); }
  .page-header { align-items: start; flex-direction: column; gap: 18px; }
  .page-header h1 { font-size: 34px; }
  .today-header { margin-bottom: 22px; }
  .summary-strip { width: 100%; justify-content: space-between; gap: 10px; }
  .capture-form { margin-bottom: 34px; box-shadow: 3px 3px 0 var(--ink); }
  .task-row { min-height: 76px; }
  .header-note { margin: 0; }
  .login-panel { margin-top: 3vh; }
  .planning-grid { grid-template-columns: 1fr; }
  .area-row { grid-template-columns: 10px 1fr auto 18px; gap: 9px; }
  .area-row > span:not(.area-swatch) { display: none; }
  .day-content a { flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: no-preference) {
  .task-row { transition: background-color 140ms ease; }
  button, a { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
}
