:root {
  --canvas: #eee9df;
  --paper: #f8f5ef;
  --bright: #fffdf8;
  --ink: #252923;
  --muted: #74766e;
  --rule: #d9d3c8;
  --moss: #55634c;
  --deep: #30382e;
  --moss-soft: #dfe4d8;
  --clay: #a8664b;
  --clay-soft: #ecd9ce;
  --ochre: #b99049;
  --ochre-soft: #eee3c9;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Segoe UI Variable", "Avenir Next", "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, a, select, input, .file-button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, .file-button:focus-within { outline: 3px solid var(--ochre); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.eyebrow, .date-line, .step { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 700; color: var(--muted); }
.eyebrow.light { color: #d9d0bb; }
.muted { color: var(--muted); line-height: 1.65; }

.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.12; }
.brand-mark { width: 42px; height: 42px; border: 1px solid currentColor; display: grid; place-items: center; border-radius: 50%; font-family: "Segoe UI", sans-serif; font-size: 11px; letter-spacing: .12em; }

.setup-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .85fr) minmax(460px, 1.15fr); }
.setup-intro { padding: clamp(34px, 6vw, 78px); background: var(--deep); color: #f7f2e8; display: flex; flex-direction: column; justify-content: space-between; gap: 60px; }
.setup-intro h1 { max-width: 680px; margin: 16px 0 18px; font-size: clamp(44px, 6vw, 82px); line-height: .96; letter-spacing: -.045em; }
.setup-intro > div p:last-child { max-width: 580px; color: #d9d0bb; line-height: 1.7; }
.privacy-note { margin: 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); color: #d9d0bb; font-size: 12px; }
.setup-panel { align-self: center; width: min(620px, calc(100% - 48px)); margin: 40px auto; padding: clamp(28px, 5vw, 58px); background: var(--bright); box-shadow: 0 20px 60px rgba(54,49,41,.1); }
.setup-panel h2 { margin: 10px 0 8px; font-size: clamp(30px, 4vw, 46px); }
.form-stack { display: grid; gap: 18px; margin-top: 30px; }
.form-stack label, .quick-form label { display: grid; gap: 7px; color: var(--ink); font-size: 11px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
input, select { width: 100%; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: 12px 13px; border-radius: 0; }
input::placeholder { color: #999b94; }

.primary-button, .secondary-button, .danger-button, .sidebar-button, .text-button, .file-button { cursor: pointer; font-size: 11px; font-weight: 600; transition: 180ms ease; }
.primary-button { border: 0; background: var(--deep); color: #fff; padding: 13px 18px; }
.primary-button:hover { transform: translateY(-1px); background: var(--moss); }
.secondary-button, .file-button { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: 12px 16px; }
.secondary-button:hover, .file-button:hover { background: var(--moss-soft); }
.danger-button { border: 1px solid #caa99c; background: transparent; color: #8f4e38; padding: 12px 16px; }
.text-button { border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--ink); padding: 4px 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 34px 24px 26px; background: var(--deep); color: #f7f2e8; display: flex; flex-direction: column; justify-content: space-between; }
.primary-nav { display: grid; gap: 6px; margin-top: 68px; }
.nav-link { color: rgba(255,255,255,.62); text-decoration: none; padding: 12px 10px; display: flex; gap: 14px; align-items: center; border-left: 2px solid transparent; transition: 180ms ease; font-size: 13px; }
.nav-link span { font-size: 9px; letter-spacing: .12em; opacity: .6; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.06); border-left-color: #c9b98a; transform: translateX(2px); }
.sidebar-foot { display: grid; gap: 16px; }
.sidebar-foot p { display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.18); font-size: 11px; }
.sidebar-foot p span { color: rgba(255,255,255,.58); font-size: 10px; }
.sidebar-button { border: 1px solid rgba(255,255,255,.3); color: #fff; background: transparent; padding: 10px; text-align: left; }
.workspace { padding: 38px clamp(24px, 4vw, 58px) 70px; max-width: 1520px; width: 100%; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.topbar h1 { margin: 9px 0 4px; font-size: clamp(32px, 4vw, 46px); line-height: 1.05; letter-spacing: -.025em; }
.intro { margin: 0; color: var(--muted); font-size: 13px; }
.top-actions, .form-actions, .data-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.truth-banner { margin-bottom: 16px; padding: 13px 18px; background: var(--moss-soft); color: var(--moss); display: flex; gap: 9px; flex-wrap: wrap; font-size: 11px; line-height: 1.5; }
.truth-banner span { color: var(--ink); }

.priority-card { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 25px 28px; background: var(--bright); border-top: 3px solid var(--clay); box-shadow: 0 12px 34px rgba(54,49,41,.06); }
.priority-index { align-self: stretch; border-right: 1px solid var(--rule); display: flex; align-items: center; font-family: Georgia, serif; color: var(--clay); font-size: 22px; }
.priority-copy h2 { margin: 7px 0 5px; font-size: clamp(22px, 2.5vw, 30px); }
.priority-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.quick-form { margin-top: 16px; padding: 22px; background: var(--paper); border: 1px solid var(--rule); display: grid; grid-template-columns: 1.2fr 1fr 1fr; align-items: end; gap: 15px; }
.quick-form > div:first-child { grid-column: 1 / -1; }
.quick-form h2 { margin: 6px 0 0; }
.quick-form .form-actions { grid-column: 1 / -1; }

.section-block { padding-top: 34px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { font-size: 24px; margin: 5px 0 0; }
.section-heading.compact h2 { font-size: 21px; }
.section-count { color: var(--muted); font-size: 10px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { appearance: none; color: inherit; text-align: left; padding: 0; border: 1px solid var(--rule); background: var(--paper); cursor: pointer; transition: 200ms ease; overflow: hidden; }
.project-card:hover, .project-card.selected { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(54,49,41,.1); border-color: var(--moss); }
.project-art { height: 82px; padding: 14px; background: var(--moss-soft); position: relative; overflow: hidden; display: flex; justify-content: flex-end; }
.project-art::before, .project-art::after { content: ""; position: absolute; border: 1px solid rgba(37,41,35,.24); }
.project-art::before { width: 82px; height: 82px; border-radius: 50%; left: 18px; top: 20px; }
.project-art::after { width: 120px; height: 60px; transform: rotate(-16deg); right: 20px; bottom: -30px; }
.project-art span { z-index: 1; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.project-body { padding: 18px; }
.project-kicker, .project-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.project-body h3 { font-size: 20px; margin: 10px 0 14px; }
.project-body p { min-height: 38px; margin: 0 0 13px; font-size: 11px; line-height: 1.5; }
.project-footer { border-top: 1px solid var(--rule); padding-top: 12px; text-transform: none; letter-spacing: 0; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; padding-top: 32px; }
.panel, .data-panel { background: var(--paper); border: 1px solid var(--rule); padding: 22px; }
.task-panel select { width: auto; max-width: 220px; padding: 8px 30px 8px 10px; font-size: 10px; }
.task-list { display: grid; }
.task-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 58px; border-top: 1px solid var(--rule); cursor: pointer; }
.task-row input { position: absolute; opacity: 0; }
.custom-check { width: 15px; height: 15px; border: 1px solid var(--moss); display: grid; place-items: center; }
.task-row input:checked + .custom-check { background: var(--moss); }
.task-row input:checked + .custom-check::after { content: "✓"; color: #fff; font-size: 10px; }
.task-copy { display: grid; gap: 2px; }
.task-copy strong { font-size: 11px; }
.task-copy small, .task-row time { color: var(--muted); font-size: 9px; }
.task-row.done .task-copy { text-decoration: line-through; opacity: .55; }
.empty-state { margin: 16px 0 2px; color: var(--muted); font-size: 12px; }
.explainer-panel h2 { margin: 8px 0 12px; font-size: 22px; line-height: 1.2; }
.explainer-panel > p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.summary-list { margin: 24px 0 0; display: grid; }
.summary-list div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--rule); }
.summary-list dt { color: var(--muted); font-size: 10px; }
.summary-list dd { margin: 0; font-family: Georgia, serif; font-size: 17px; }
.data-panel { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.data-panel h2 { margin: 6px 0; font-size: 22px; }
.data-panel p { max-width: 720px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.file-button { display: inline-block; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 980px) {
  .setup-shell { grid-template-columns: 1fr; }
  .setup-intro { min-height: 58vh; }
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 26px 14px; align-items: center; }
  .brand > span:last-child, .nav-link, .sidebar-foot { display: none; }
  .project-grid { grid-template-columns: 1fr 1fr; }
  .quick-form { grid-template-columns: 1fr 1fr; }
  .data-panel { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .setup-intro { padding: 30px 22px; min-height: 520px; }
  .setup-panel { width: calc(100% - 28px); margin: 14px auto; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 18px; display: block; }
  .brand-mark { width: 36px; height: 36px; }
  .workspace { padding: 26px 18px 50px; }
  .topbar { display: grid; }
  .top-actions { justify-content: flex-start; }
  .priority-card { grid-template-columns: 36px 1fr; padding: 21px 18px; }
  .priority-card > button { grid-column: 2; justify-self: start; }
  .project-grid, .lower-grid, .quick-form { grid-template-columns: 1fr; }
  .quick-form .form-actions { grid-column: 1; }
}

@media (max-width: 460px) {
  .setup-intro h1 { font-size: 42px; }
  .priority-card { grid-template-columns: 1fr; }
  .priority-index { border-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
  .priority-card > button { grid-column: 1; }
  .section-heading { display: grid; align-items: start; }
  .task-panel select { width: 100%; max-width: none; }
  .task-row { grid-template-columns: 18px minmax(0, 1fr); padding: 8px 0; }
  .task-row time { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
