.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.section-heading h1 { margin: 10px 0 8px; font-size: clamp(34px, 5vw, 54px); line-height: 1; font-weight: 760; letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.capture-bar, .quick-note, .editor-form { display: grid; gap: 12px; }
.capture-bar { grid-template-columns: 1fr auto auto; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.capture-bar input, .quick-note input, .quick-note textarea, .editor-form input, .editor-form textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; color: var(--ink); background: rgba(255,255,255,.8);
}
.item-list { display: grid; gap: 10px; margin-top: 22px; }
.list-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.item-copy h2 { margin: 0; font-size: 16px; font-weight: 700; }
.item-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.list-item.is-done .item-copy { opacity: .52; text-decoration: line-through; }
.check-button, .icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.is-done .check-button { color: white; background: var(--sage); border-color: var(--sage); }
.icon-button:hover { color: white; background: var(--accent); }
.empty-state, .notice { padding: 42px 24px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }
.empty-state span { display: inline-grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: #efe4d7; color: var(--accent); font-size: 21px; }
.empty-state h2 { margin: 14px 0 6px; color: var(--ink); font-size: 21px; line-height: 1.2; font-weight: 730; }
.empty-state p { margin: 0; }
.notice { margin: 16px 0; padding: 16px; background: rgba(255,255,255,.54); }
.notice-error { color: #9d2f21; border-color: rgba(157,47,33,.3); }
.notes-layout { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.55fr); gap: 18px; align-items: start; }
.notes-sidebar, .note-editor { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.quick-note { padding: 16px; border-bottom: 1px solid var(--line); }
.quick-note textarea, .editor-body { resize: vertical; line-height: 1.6; }
.note-links { display: grid; max-height: 520px; overflow-y: auto; }
.note-link { display: grid; gap: 5px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.note-link span { color: var(--muted); font-size: 12px; }
.note-link:hover, .note-link.is-active { background: rgba(94,121,107,.10); }
.note-editor { padding: 18px; }
.editor-title { border: 0 !important; padding: 8px 4px !important; background: transparent !important; font-size: 29px !important; line-height: 1.15 !important; font-weight: 740 !important; letter-spacing: -.025em; }
.editor-body { min-height: 390px; }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.danger-zone { margin-top: 12px; text-align: right; }

/* V2.0 Todo */
.todo-heading { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:22px; }
.todo-heading h1 { margin:7px 0 3px; font-size:clamp(34px,5vw,52px); line-height:1; letter-spacing:-.045em; }
.todo-heading p { margin:0; color:var(--muted); }
.todo-overview { min-width:96px; display:grid; justify-items:end; }
.todo-overview strong { font-size:28px; line-height:1; }
.todo-overview span { margin-top:5px; color:var(--muted); font-size:12px; }
.todo-tabs { display:flex; gap:5px; padding:4px; margin-bottom:16px; width:max-content; max-width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.46); }
.todo-tabs a { padding:8px 16px; border-radius:9px; color:var(--muted); font-size:14px; font-weight:680; text-decoration:none; white-space:nowrap; }
.todo-tabs a:hover { color:var(--ink); }
.todo-tabs a.is-active { color:var(--ink); background:var(--surface-solid); box-shadow:0 2px 10px rgba(23,32,29,.08); }
.todo-rollover { display:flex; flex-wrap:wrap; gap:7px 16px; align-items:center; margin:0 0 14px; padding:12px 14px; border:1px solid rgba(94,121,107,.24); border-radius:13px; background:rgba(94,121,107,.09); font-size:13px; }
.todo-rollover span { color:var(--muted); }
.todo-capture { display:grid; grid-template-columns:minmax(260px,1fr) auto auto auto auto; gap:9px; padding:11px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:0 10px 32px rgba(43,48,39,.07); }
.todo-capture input, .todo-capture select, .todo-edit-form input, .todo-edit-form select, .todo-edit-form textarea, .todo-plan-form select {
    min-width:0; width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 11px; color:var(--ink); background:rgba(255,255,255,.78);
}
.todo-title-input { font-weight:650; }
.todo-capture-more { grid-column:1/-1; padding:0 4px; }
.todo-capture-more summary { width:max-content; color:var(--muted); cursor:pointer; font-size:12px; }
.todo-form-grid, .todo-edit-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin-top:12px; }
.todo-form-grid label, .todo-edit-form label { display:grid; gap:5px; color:var(--muted); font-size:12px; font-weight:650; }
.todo-form-grid textarea, .todo-edit-form textarea { resize:vertical; }
.todo-span-2 { grid-column:1/-1; }
.todo-areas { display:grid; gap:14px; margin-top:18px; }
.todo-area, .idea-collection, .history-week { border:1px solid var(--line); border-radius:17px; background:rgba(255,255,255,.54); overflow:hidden; }
.todo-area > header, .idea-collection > header, .history-week > header { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:48px; padding:10px 14px; border-bottom:1px solid var(--line); }
.todo-area > header > div { display:flex; align-items:center; gap:9px; }
.todo-area h2, .idea-collection h2, .history-week h2 { margin:0; font-size:14px; font-weight:760; }
.todo-area > header > span, .idea-collection > header > span, .history-week > header > span { color:var(--muted); font-size:12px; }
.todo-area-dot { width:8px; height:8px; flex:0 0 auto; border-radius:50%; background:#8b9691; }
.area-study { background:#55799c; }
.area-explore { background:#9a6fb0; }
.area-work { background:#d26a48; }
.area-life { background:#5f8c70; }
.todo-area-empty { margin:0; padding:13px 15px; color:var(--muted); font-size:13px; }
.todo-item { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:11px; align-items:center; min-height:59px; padding:11px 13px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.42); }
.todo-item:last-child { border-bottom:0; }
.todo-item:hover { background:rgba(255,255,255,.72); }
.todo-item.is-done .todo-item-copy { opacity:.52; }
.todo-item.is-done .todo-item-title strong { text-decoration:line-through; }
.todo-check-form, .todo-action-form, .todo-plan-form { margin:0; }
.todo-item-copy { min-width:0; }
.todo-item-title { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.todo-item-title strong { min-width:0; overflow-wrap:anywhere; font-size:14px; }
.todo-meta { display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:5px; color:var(--muted); font-size:11px; }
.commitment, .urgency, .outcome { padding:2px 6px; border-radius:999px; font-size:10px; font-weight:720; }
.commitment-must { color:#a53b29; background:rgba(212,82,53,.10); }
.commitment-planned { color:#4f6c5e; background:rgba(94,121,107,.11); }
.commitment-optional { color:var(--muted); background:rgba(101,113,108,.09); }
.urgency-overdue, .urgency-today { color:#a12f22; background:rgba(190,55,38,.11); }
.urgency-soon { color:#8b5e13; background:rgba(211,151,50,.13); }
.mini-button { border:1px solid var(--line); border-radius:9px; padding:7px 9px; color:var(--ink); background:rgba(255,255,255,.72); cursor:pointer; font-size:12px; font-weight:680; white-space:nowrap; }
.mini-button:hover { border-color:rgba(212,82,53,.42); }
.todo-plan-form { display:flex; gap:6px; align-items:center; }
.todo-plan-form select { width:auto; padding:7px 8px; font-size:12px; }
.todo-item-more { align-self:center; }
.todo-item-more > summary { list-style:none; width:30px; height:30px; display:grid; place-items:center; border-radius:8px; color:var(--muted); cursor:pointer; user-select:none; }
.todo-item-more > summary::-webkit-details-marker { display:none; }
.todo-item-more[open] > summary { background:rgba(23,32,29,.07); }
.todo-item-more[open] { position:static; }
.todo-edit-form { position:absolute; z-index:5; top:calc(100% - 6px); right:12px; width:min(560px,calc(100% - 24px)); padding:15px; border:1px solid var(--line); border-radius:14px; background:var(--surface-solid); box-shadow:var(--shadow); }
.todo-edit-actions { display:flex; justify-content:flex-end; }
.todo-agenda, .todo-ideas, .todo-history { display:grid; gap:12px; margin-top:18px; }
.agenda-day { display:grid; grid-template-columns:110px minmax(0,1fr); border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.52); overflow:hidden; }
.agenda-day > header { display:grid; align-content:start; gap:3px; padding:14px; border-right:1px solid var(--line); }
.agenda-day > header strong { font-size:13px; }
.agenda-day > header span { color:var(--muted); font-size:11px; }
.agenda-day.is-today { border-color:rgba(212,82,53,.38); }
.agenda-day.is-today > header { color:var(--accent); background:rgba(212,82,53,.06); }
.idea-collection .todo-item { grid-template-columns:auto minmax(0,1fr) auto auto; }
.history-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:11px; align-items:center; padding:12px 14px; border-bottom:1px solid var(--line); }
.history-row:last-child { border-bottom:0; }
.history-row div { display:grid; gap:3px; }
.history-row strong { font-size:13px; }
.history-row small, .history-row > span:not(.todo-area-dot) { color:var(--muted); font-size:11px; }
.outcome-completed { color:#477057 !important; background:rgba(94,121,107,.11); }
.outcome-carried { color:#815c1f !important; background:rgba(211,151,50,.12); }
.outcome-returned { color:#735486 !important; background:rgba(154,111,176,.12); }
.outcome-missed, .outcome-cancelled { color:#8d4235 !important; background:rgba(212,82,53,.10); }

@media (max-width: 860px) {
    .todo-capture { grid-template-columns:1fr 1fr; }
    .todo-title-input { grid-column:1/-1; }
    .todo-capture .button-primary { grid-column:1/-1; }
}
@media (max-width: 760px) {
    .capture-bar, .notes-layout { grid-template-columns:1fr; }
    .notes-sidebar { box-shadow:none; }
    .editor-actions { align-items:stretch; flex-direction:column; }
    .todo-heading { align-items:center; }
    .todo-heading h1 { font-size:38px; }
    .todo-capture { grid-template-columns:1fr; }
    .todo-title-input, .todo-capture .button-primary { grid-column:auto; }
    .todo-form-grid, .todo-edit-form { grid-template-columns:1fr; }
    .todo-span-2 { grid-column:auto; }
    .todo-item { grid-template-columns:auto minmax(0,1fr) auto; }
    .todo-plan-form { grid-column:2; justify-content:flex-start; }
    .todo-action-form { grid-column:2; }
    .todo-item-more { grid-column:3; grid-row:1; }
    .todo-edit-form { left:12px; right:12px; width:auto; }
    .agenda-day { grid-template-columns:74px minmax(0,1fr); }
    .history-row { grid-template-columns:auto minmax(0,1fr) auto; }
    .history-row .outcome { grid-column:2; width:max-content; }
}


/* Progressive navigation: full reload remains the no-JavaScript fallback. */
html::before {
    content: "";
    position: fixed;
    z-index: 100;
    top: 0;
    right: 100%;
    bottom: auto;
    left: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: inset .18s ease, opacity .12s ease;
}
html.is-navigating::before {
    right: 22%;
    opacity: 1;
}
html.is-navigating main {
    cursor: progress;
}
html.is-navigating main button,
html.is-navigating main input,
html.is-navigating main select,
html.is-navigating main textarea {
    pointer-events: none;
}
