:root {
  --paper: #FBFAF7; --linen: #F1ECE2; --tan: #DCCFB8; --stone: #A39E94; --graphite: #3A3936; --ink: #1F1E1C; --white: #FFFFFF;
  --danger-text: #A62B1F; --warn-text: #6B5200; --ok-text: #1D6B3B; --veil: rgba(251,250,247,.82);
  --muted: #6B665C;
  --red: #E0412F; --orange: #F28A1E; --yellow: #F5C518; --green: #2FA35B; --blue: #2E7FE0; --indigo: #4B3FB8; --violet: #9B4DCA;
  --red-t: #FCE9E6; --orange-t: #FEF3DF; --yellow-t: #FDF6D6; --green-t: #E6F4EA; --blue-t: #EAF2FC; --indigo-t: #ECEAF8; --violet-t: #F3EAF9;
  --head: 'Fraunces', Georgia, serif; --ui: 'Inter', system-ui, -apple-system, sans-serif; --write: 'Literata', Georgia, serif;
  --r: 8px; --card: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--ui); overflow-x: hidden; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--white); border: 1px solid var(--tan); border-radius: var(--r); padding: 8px 14px; min-height: 40px; }
button:hover { background: var(--linen); }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary:hover { background: var(--graphite); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--linen); }
button.small { padding: 4px 10px; min-height: 32px; font-size: 14px; }
button.danger { color: var(--danger-text); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
input[type=text], input[type=url], input[type=search], input[type=date], input[type=time], input[type=datetime-local], textarea, select {
  width: 100%; max-width: 100%; padding: 9px 11px; border: 1px solid var(--tan); border-radius: var(--r); background: var(--white); min-height: 42px;
}
textarea { min-height: 120px; resize: vertical; font-family: var(--write); }
label { display: block; font-size: 14px; font-weight: 500; margin: 12px 0 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px clamp(14px, 3vw, 32px); background: var(--paper); border-bottom: 1px solid var(--tan); }
.brand img { height: 40px; display: block; }
.topnav { display: flex; gap: 4px; }
.topnav a { text-decoration: none; padding: 8px 12px; border-radius: var(--r); color: var(--graphite); }
.topnav a:hover { background: var(--linen); }
.topnav a[aria-current=page] { background: var(--linen); color: var(--ink); font-weight: 500; }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.status { font-size: 13px; min-height: 32px; padding: 4px 10px; border-radius: 99px; background: var(--white); color: var(--muted); border-color: var(--tan); }
.status.saving { color: var(--graphite); }
.status.offline { background: var(--yellow-t); color: var(--warn-text); border-color: var(--yellow); }
.status.error { background: var(--red-t); color: var(--danger-text); border-color: var(--red); }

main { max-width: 1180px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 32px) 120px; outline: none; }
h1, h2, h3 { font-family: var(--head); font-weight: 500; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(34px, 5vw, 48px); letter-spacing: -0.02em; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.trim { display: block; margin: 6px 0 18px; color: var(--ink); overflow: visible; }
.trim .spindle { fill: currentColor; }
.trim.flourish .spindle { animation: spark 1.6s ease-out both; }
@keyframes spark { 0% { fill: var(--ink); } 20% { fill: var(--c); } 70% { fill: var(--c); } 100% { fill: var(--ink); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel { background: var(--white); border: 1px solid var(--tan); border-radius: var(--card); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.count { font-size: 14px; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-top: 20px; align-items: start; }
.stack { display: grid; gap: 8px; }

/* Activity wave */
.wave-wrap { min-width: 0; }
.wave { display: flex; align-items: flex-end; gap: 3px; height: 64px; width: min(340px, 100%); }
.wave .col { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; min-height: 4px; }
.wave .col.empty { background: var(--linen); border-radius: 2px; max-height: 4px; }
.wave .col span { display: block; height: 7px; border-radius: 2px; }
.wave-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Checklists */
.task { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--linen); min-width: 0; }
.task:first-of-type { border-top: 0; }
.task input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ink); flex: none; margin: 0; }
.task .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task.done .txt { text-decoration: line-through; color: var(--stone); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--linen); color: var(--graphite); white-space: nowrap; }
.chip.overdue { background: var(--red-t); color: var(--danger-text); }
.chip.cat { color: var(--white); }
.addrow { display: flex; gap: 8px; margin-top: 10px; }
.addrow input { flex: 1; min-width: 0; }
.addrow button { flex: none; }
.due-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }

/* Running note */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.tabs a, .tabs button { text-decoration: none; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--tan); background: var(--white); font-size: 15px; min-height: 36px; display: inline-flex; align-items: center; }
.tabs a[aria-current=page] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.note-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.note { font-family: var(--write); font-size: 17px; line-height: 1.6; }
.blk { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; border-radius: 6px; position: relative; }
.blk.flash { background: var(--yellow-t); transition: background 1.5s; }
.blk .sel { display: none; width: 20px; height: 20px; margin-top: 6px; flex: none; accent-color: var(--ink); }
.select-mode .blk .sel { display: block; }
.blk .bt { flex: 1; min-width: 0; outline: none; padding: 3px 4px; border-radius: 4px; overflow-wrap: anywhere; white-space: pre-wrap; min-height: 1.6em; }
.blk .bt:focus { background: var(--linen); }
.blk .bt:empty::before { content: attr(data-ph); color: var(--stone); }
.blk.heading .bt { font-family: var(--head); font-size: 23px; font-weight: 500; margin-top: 10px; }
.blk.list .bt { padding-left: 22px; position: relative; }
.blk.list .bt::after { content: '•'; position: absolute; left: 8px; top: 3px; }
.blk.link .bt { color: var(--blue); }
.blk .bmenu { opacity: 0; min-height: 30px; padding: 0 8px; background: transparent; border-color: transparent; color: var(--muted); font-family: var(--ui); }
.blk:hover .bmenu, .blk:focus-within .bmenu { opacity: 1; }
.blk .linked { font-family: var(--ui); font-size: 12px; margin-top: 6px; white-space: nowrap; }
.blk .linked a { text-decoration: none; }
.blk .open { font-family: var(--ui); font-size: 13px; margin-top: 5px; white-space: nowrap; }
.media img, .media video { max-width: 100%; max-height: 360px; border-radius: var(--r); display: block; }
.media { flex: 1; min-width: 0; }
.select-bar { position: sticky; bottom: 76px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--card); margin-top: 12px; }
.select-bar button { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* Projects */
.plist a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; border: 1px solid var(--tan); border-radius: var(--card); background: var(--white); }
.plist a:hover { background: var(--linen); }
.plist .dot { width: 12px; height: 34px; border-radius: 3px; background: var(--linen); flex: none; }
.plist .pt { flex: 1; min-width: 0; }
.plist .pt strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.plist .pt small { color: var(--muted); }
.band { height: 56px; border-radius: var(--card) var(--card) 0 0; background: var(--linen); display: flex; align-items: flex-end; padding: 8px 14px; color: var(--white); font-size: 13px; }
.band.none { color: var(--muted); }
.phead { background: var(--white); border: 1px solid var(--tan); border-top: 0; border-radius: 0 0 var(--card) var(--card); padding: 14px 18px 4px; }
.ptitle { font-family: var(--head); font-size: clamp(28px, 4.5vw, 40px); font-weight: 500; border: 0; padding: 0; background: transparent; width: 100%; min-height: 0; }
.ptitle:focus { outline: none; background: var(--linen); border-radius: 6px; }
.pmeta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 0; }
.pmeta select, .pmeta input { width: auto; min-height: 36px; padding: 5px 9px; font-size: 14px; }
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tan); margin: 22px 0 16px; overflow-x: auto; }
.ptabs a { padding: 10px 14px; text-decoration: none; color: var(--graphite); border-bottom: 3px solid transparent; white-space: nowrap; }
.ptabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.item { border-top: 1px solid var(--linen); padding: 12px 0; display: flex; gap: 12px; align-items: flex-start; }
.item:first-child { border-top: 0; }
.item .ib { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item .body { white-space: pre-wrap; font-family: var(--write); }
.item img, .item video { max-width: 100%; max-height: 320px; border-radius: var(--r); display: block; margin-top: 6px; }
.source { border-left: 4px solid var(--tan); padding: 4px 0 4px 14px; margin: 10px 0; border-radius: 0; }
.source .snap { font-family: var(--write); white-space: pre-wrap; }
.source small { color: var(--muted); }
.empty { color: var(--muted); }
.section-add { margin-top: 14px; }

/* Dialog and toasts */
dialog { border: 1px solid var(--tan); border-radius: var(--card); padding: 22px; width: min(520px, 94vw); background: var(--paper); color: var(--ink); max-height: 90vh; }
dialog::backdrop { background: rgba(31, 30, 28, 0.45); }
dialog h2 { margin-bottom: 4px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dlg-error { color: var(--danger-text); font-size: 14px; margin: 10px 0 0; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 50; display: grid; gap: 8px; width: min(460px, 92vw); }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r); display: flex; gap: 12px; align-items: center; }
.toast button { background: transparent; color: var(--paper); border-color: var(--stone); min-height: 30px; padding: 2px 10px; }
.toast span { flex: 1; }
.results a { display: block; padding: 10px 12px; text-decoration: none; border-top: 1px solid var(--linen); }
.results a:hover { background: var(--linen); }
.results small { color: var(--muted); display: block; }

.bottomnav, .fab { display: none; }

@media (max-width: 760px) {
  .topnav, .add-idea-top { display: none; }
  .brand img { height: 32px; }
  main { padding-top: 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--tan); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; text-align: center; text-decoration: none; padding: 8px 0 10px; font-size: 12px; color: var(--muted); }
  .bottomnav a .ico { display: block; font-size: 19px; line-height: 1.2; }
  .bottomnav a[aria-current=page] { color: var(--ink); font-weight: 500; }
  .fab { display: block; position: fixed; right: 14px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 31; border-radius: 99px; padding: 12px 18px; min-height: 48px; }
  body.typing .bottomnav, body.typing .fab { display: none; }
  .blk .bmenu { opacity: 1; }
  .toasts { bottom: calc(130px + env(safe-area-inset-bottom)); }
  .select-bar { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .wave { width: 100%; }
}

/* Slice 1b: documents, sheets, settings */
.pickup { background: var(--linen); border-radius: var(--r); padding: 8px 12px; margin: 0 0 14px; }
.gear { text-decoration: none; font-size: 20px; color: var(--graphite); padding: 4px 6px; border-radius: var(--r); }
.gear:hover { background: var(--linen); }
a.button { display: inline-block; text-decoration: none; border-radius: var(--r); padding: 9px 16px; border: 1px solid var(--tan); background: var(--white); }
a.button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.item.open { background: var(--linen); border-radius: var(--r); padding-left: 10px; padding-right: 10px; }
.doclink { text-decoration: none; }
.doclink:hover strong { text-decoration: underline; }
.editor-area { margin-top: 18px; border-top: 1px solid var(--tan); padding-top: 18px; }
.ed-name { font-family: var(--head); font-size: 24px; border: 0; padding: 2px 4px; background: transparent; min-height: 0; }
.ed-name:focus { outline: none; background: var(--linen); }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; position: sticky; top: 64px; z-index: 4; background: var(--white); padding: 6px 0; }
.toolbar button { min-height: 36px; padding: 4px 10px; font-size: 14px; }
.toolbar select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; }
.doc-ed, .doc-view { font-family: var(--write); font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
.doc-ed { min-height: 320px; border: 1px solid var(--tan); border-radius: var(--r); padding: 14px 18px; background: var(--paper); outline: none; }
.doc-ed:focus { border-color: var(--graphite); }
.doc-ed h2, .doc-view h2 { font-size: 24px; margin: 18px 0 8px; }
.doc-ed h3, .doc-view h3 { font-size: 19px; margin: 14px 0 6px; }
.doc-ed p, .doc-view p { margin: 0 0 10px; }
.doc-ed a, .doc-view a { color: var(--blue); }
.doc-view { border-left: 4px solid var(--tan); padding-left: 14px; margin-top: 8px; }
.ed-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-wrap { overflow-x: auto; border: 1px solid var(--tan); border-radius: var(--r); margin-top: 10px; -webkit-overflow-scrolling: touch; }
.sheet { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.sheet th, .sheet td { border-bottom: 1px solid var(--linen); border-right: 1px solid var(--linen); padding: 0; text-align: left; vertical-align: top; }
.sheet.view th, .sheet.view td { padding: 7px 10px; }
.sheet th { background: var(--linen); }
.sheet input, .sheet textarea { border: 0; border-radius: 0; min-height: 36px; min-width: 160px; width: 100%; padding: 8px 10px; background: transparent; font: 14px/1.4 var(--ui); }
.sheet textarea { display: block; resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet th input { font-weight: 500; }
.sheet .colnums th { background: var(--paper); font-weight: 400; font-size: 12px; color: var(--muted); padding: 4px 8px 0; text-align: center; }
.sheet .colnums .cn .ctl { justify-content: center; }
.sheet input:focus, .sheet textarea:focus { outline: 2px solid var(--blue); outline-offset: -2px; background: var(--white); }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td.rh, .sheet th.rh { width: 1%; white-space: nowrap; color: var(--muted); font-size: 12px; padding: 6px 8px; background: var(--paper); }
.sheet .ctl { display: flex; gap: 2px; padding: 0 4px 4px; visibility: hidden; }
.sheet th:hover .ctl, .sheet th:focus-within .ctl, .sheet tr:hover .rh .ctl, .sheet tr:focus-within .rh .ctl { visibility: visible; }
.sheet-wrap:focus-within .colnums .ctl, .sheet .colnums:hover .ctl { visibility: visible; }
.sheet .ctl button { min-height: 26px; padding: 0 6px; font-size: 12px; }
.sheet .ctl button:disabled { opacity: 0.35; cursor: default; }
.cat-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.cat-row .swatch { width: 28px; height: 28px; border-radius: 6px; flex: none; }
.cat-row input { max-width: 320px; }
@media (max-width: 760px) {
  .toolbar { top: 52px; }
  .sheet input, .sheet textarea { min-width: 130px; }
  .sheet .ctl { visibility: visible; }
}

/* Category colors and bullets */
.inline-label { display: inline; margin: 0; font-size: 13px; color: var(--muted); font-weight: 400; }
.swatch-pick { position: relative; width: 36px; height: 36px; border-radius: 8px; flex: none; margin: 0; cursor: pointer; border: 1px solid var(--tan); overflow: hidden; }
.swatch-pick input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-row { display: flex; gap: 12px; align-items: center; }
.color-row input[type=color] { width: 56px; height: 44px; padding: 2px; border: 1px solid var(--tan); border-radius: var(--r); background: var(--white); cursor: pointer; }
.bullet-box .bb-tools { display: flex; gap: 6px; margin-bottom: 6px; }
.bullet-box textarea { font-family: var(--write); }

/* Planner */
.pl-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pl-bar .button.small { padding: 5px 12px; min-height: 36px; font-size: 15px; display: inline-flex; align-items: center; }
.pl-label { font-family: var(--head); font-weight: 500; font-size: 20px; margin-left: 6px; }
.pl-views { margin-left: auto; display: inline-flex; gap: 4px; }
.pl-views .on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pl-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.pl-strip a { text-align: center; text-decoration: none; padding: 6px 0; border-radius: var(--r); border: 1px solid var(--tan); background: var(--white); }
.pl-strip a small { display: block; font-size: 11px; color: var(--muted); }
.pl-strip a.today b { color: var(--blue); }
.pl-strip a.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pl-strip a.on small, .pl-strip a.on.today b { color: var(--paper); }
.pl-scroll { max-height: 68vh; overflow-y: auto; border: 1px solid var(--tan); border-radius: var(--card); background: var(--white); }
.pl-grid { display: flex; min-width: 0; }
.pl-hours { position: relative; width: 52px; flex: none; }
.pl-hour { position: absolute; left: 0; right: 0; height: 0; }
.pl-hour span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pl-cols { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); min-width: 0; }
.pl-col { border-left: 1px solid var(--linen); min-width: 0; }
.pl-dayhead { position: sticky; top: 0; z-index: 3; height: 42px; display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--white); border-bottom: 1px solid var(--tan); font-size: 14px; }
.pl-dayhead small { color: var(--muted); }
.pl-col.today .pl-dayhead b { background: var(--ink); color: var(--paper); border-radius: 99px; padding: 1px 8px; }
.pl-slots { position: relative; cursor: copy; background-image: repeating-linear-gradient(to bottom, var(--linen) 0 1px, transparent 1px 48px); }
.pl-block { position: absolute; z-index: 2; border: 0; border-radius: 0 6px 6px 0; padding: 3px 6px; text-align: left; overflow: hidden; display: flex; flex-direction: column; gap: 0; font-size: 12px; line-height: 1.3; min-height: 0; cursor: pointer; }
.pl-block:hover { filter: brightness(0.97); }
.pl-block .t { font-size: 11px; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-block .n { font-weight: 500; overflow: hidden; }
.pl-block .rep { position: absolute; right: 5px; top: 2px; font-size: 11px; }
.pl-block.now { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 4; }
.pl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
main:focus, main:focus-visible { outline: none; }
.pl-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.pl-sumbar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14px; }
.pl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.scope { border: 1px solid var(--tan); border-radius: var(--r); margin: 14px 0 0; padding: 8px 12px; }
.scope label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; }
.now-strip { display: grid; gap: 8px; margin: 6px 0 4px; }
.now-strip:empty { display: none; }
.now-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 16px; border-radius: var(--card); text-decoration: none; }
.now-card b { font-family: var(--head); font-weight: 500; font-size: 20px; }
.now-card .go { margin-left: auto; font-size: 14px; }
.next-card { text-decoration: none; font-size: 14px; padding: 2px 4px; }
@media (max-width: 760px) {
  .pl-scroll { max-height: calc(100vh - 290px); }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > div:first-child { grid-column: 1 / -1; }
  .bottomnav a { font-size: 11px; }
}

/* Sheet controls float over the grid so rows stay compact */
.sheet td.rh, .sheet th.cn { position: relative; }
.sheet td.rh { padding: 9px 8px; vertical-align: top; }
.sheet .colnums th { padding: 3px 8px; height: 22px; }
.sheet td.rh .ctl { position: absolute; left: 100%; top: 4px; z-index: 6; padding: 3px; background: var(--white); border: 1px solid var(--tan); border-radius: 6px; box-shadow: 0 2px 6px rgba(31,30,28,.12); }
.sheet th.cn .ctl { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); z-index: 6; padding: 3px; background: var(--white); border: 1px solid var(--tan); border-radius: 6px; box-shadow: 0 2px 6px rgba(31,30,28,.12); }
.sheet-wrap { overflow-y: visible; }
.sheet-wrap:focus-within .colnums .ctl { visibility: hidden; }
.sheet .colnums th.cn:hover .ctl, .sheet .colnums th.cn:focus-within .ctl { visibility: visible; }
@media (max-width: 760px) {
  .sheet .ctl { visibility: hidden; }
  .sheet tr:focus-within td.rh .ctl, .sheet th.cn:focus-within .ctl, .sheet th.cn:active .ctl { visibility: visible; }
}

/* Edit in place */
.editable { cursor: text; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.editable:hover { background: var(--linen); }
.body.editable { min-height: 1.6em; }
.task .txt.editable { margin: 0; padding: 2px 4px; }
.task-edit { flex: 1; min-width: 0; min-height: 36px !important; padding: 4px 8px !important; }
.note-editing { flex: 1; min-width: 0; }

/* Planner: all-day row, tasks, month */
.pl-frame { border: 1px solid var(--tan); border-radius: var(--card); background: var(--white); overflow: hidden; }
.pl-frame .pl-scroll { border: 0; border-radius: 0; }
.pl-top { display: flex; border-bottom: 1px solid var(--tan); }
.pl-alllabel { width: 52px; flex: none; font-size: 11px; color: var(--muted); padding: 6px 4px; text-align: right; align-self: flex-end; }
.pl-heads { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); min-width: 0; }
.pl-dayhead { position: static; height: auto; display: block; padding: 4px 3px; border-left: 1px solid var(--linen); background: var(--white); border-bottom: 0; }
.pl-dayhead > a { display: flex; justify-content: center; gap: 4px; text-decoration: none; font-size: 14px; padding: 2px 0 4px; }
.pl-dayhead.today > a b { background: var(--ink); color: var(--paper); border-radius: 99px; padding: 0 8px; }
.pl-allcell { display: grid; gap: 3px; min-height: 0; }
.pl-top.noall .pl-allcell { display: none; }
.pl-col { border-left: 1px solid var(--linen); }
.pl-col .pl-dayhead { display: none; }
.pl-task { display: flex; align-items: center; gap: 5px; border-left: 4px solid; border-radius: 0 5px 5px 0; padding: 2px 6px 2px 4px; font-size: 12px; line-height: 1.3; min-width: 0; }
.pl-task input { width: 14px; height: 14px; margin: 0; flex: none; accent-color: var(--ink); }
.pl-task a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pl-task.done a { text-decoration: line-through; color: var(--stone); }
.pl-task .t { color: var(--muted); }
.pl-tmark { position: absolute; left: 2px; right: 2px; z-index: 5; transform: translateY(-1px); }
.pl-allblock { display: block; width: 100%; text-align: left; font-size: 12px; padding: 2px 6px; min-height: 0; border: 0; border-radius: 0 5px 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-month { border: 1px solid var(--tan); border-radius: var(--card); background: var(--white); overflow: hidden; }
.pl-mhead { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--tan); }
.pl-mhead span { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }
.pl-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); }
.pl-mcell { border-right: 1px solid var(--linen); border-bottom: 1px solid var(--linen); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: copy; }
.pl-mcell:nth-child(7n) { border-right: 0; }
.pl-mcell.out { background: var(--paper); }
.pl-mcell.out .num { color: var(--stone); }
.pl-mcell .num { align-self: flex-start; text-decoration: none; font-size: 13px; padding: 0 6px; border-radius: 99px; }
.pl-mcell .num:hover { background: var(--linen); }
.pl-mcell.today .num { background: var(--ink); color: var(--paper); }
.pl-mitem { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 0; border: 0; padding: 1px 2px; background: transparent; font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-mitem i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pl-mitem .t { color: var(--muted); }
.pl-mcell .more { font-size: 12px; color: var(--muted); text-decoration: none; padding: 0 4px; }
.pl-month.compact .pl-mgrid { grid-auto-rows: 56px; }
.pl-month.compact .pl-mcell { align-items: center; cursor: pointer; }
.pl-month.compact .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.pl-month.compact .dots i { width: 7px; height: 7px; border-radius: 50%; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-top: 10px; }
label.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.addrow .due-in { flex: 0 0 auto; width: 150px; min-width: 0; }
@media (max-width: 760px) {
  .addrow { flex-wrap: wrap; }
  .addrow input[name=text] { flex: 1 1 100%; }
  .addrow .due-in { flex: 1 1 auto; width: auto; }
}

/* Project entries: title, formatted notes, movers */
.item-title { margin-bottom: 4px; }
.item-title strong { font-weight: 600; font-size: 17px; }
.note-text { white-space: normal; font-family: var(--write); line-height: 1.6; }
.note-text p { margin: 0 0 8px; }
.note-text p:last-child { margin-bottom: 0; }
.note-text ul { margin: 2px 0 10px; padding-left: 1.4em; }
.note-text ul:last-child { margin-bottom: 0; }
.note-text li { margin: 3px 0; padding-left: 0.2em; }
.note-text li::marker { color: var(--graphite); }
.item-tools { display: flex; gap: 2px; align-items: center; flex: none; }
.mover { display: inline-flex; gap: 2px; }
.mover button { min-height: 30px; padding: 0 8px; }
.mover button:disabled { opacity: 0.3; cursor: default; }
.note-title-in { font-weight: 600; margin-bottom: 8px; }
.task .tcat { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.task .catchip { font-size: 11px; }
@media (max-width: 760px) { .task .catchip { display: none; } }

/* Project icons: ink on a white tile, never directly on color */
.pbadge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--white); color: var(--ink); border: 1px solid var(--tan); vertical-align: middle; }
.pbadge .picon { width: 62%; height: 62%; fill: currentColor; }
.pbadge.empty { background: transparent; border-style: dashed; border-color: var(--linen); }
.pbadge.xs { width: 18px; height: 18px; border-radius: 5px; margin-right: 4px; border-color: rgba(31,30,28,.15); }
.pbadge.lg { width: 52px; height: 52px; border-radius: 12px; }
.pbadge.pick { cursor: pointer; padding: 0; min-height: 0; }
.pbadge.pick:hover { background: var(--linen); }
.pbadge .plus { font-size: 11px; color: var(--muted); line-height: 1.1; text-align: center; }
.ptitle-row { display: flex; align-items: center; gap: 12px; }
.ptitle-row .ptitle { flex: 1; min-width: 0; }
.now-card b { display: inline-flex; align-items: center; gap: 8px; }
.pl-block .n { display: flex; align-items: center; }
.pl-allblock, .pl-mitem { display: flex; align-items: center; }
.ip-body { max-height: 52vh; overflow-y: auto; margin-top: 10px; }
.ip-group { font-family: var(--ui); font-size: 13px; color: var(--muted); font-weight: 500; margin: 12px 0 6px; }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.ip-btn { display: flex; align-items: center; justify-content: center; height: 46px; padding: 0; background: var(--white); color: var(--ink); }
.ip-btn .picon { width: 24px; height: 24px; fill: currentColor; }
.ip-btn.on { border: 2px solid var(--ink); }

/* Up next: three-day mini calendar on Ideas */
.upnext { margin: 6px 0 4px; }
.upnext-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.upnext-head h2 { font-size: 22px; }
.small-link { font-size: 14px; color: var(--graphite); text-decoration: none; }
.small-link:hover { text-decoration: underline; }
.up-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.up-col { background: var(--white); border: 1px solid var(--tan); border-radius: var(--card); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-day { font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-day b { color: var(--ink); font-weight: 500; }
.up-day .away { color: var(--stone); }
.up-day:hover b { text-decoration: underline; }
.up-chip { display: block; text-decoration: none; border-left: 5px solid; border-radius: 0 6px 6px 0; padding: 4px 7px; min-width: 0; }
.up-chip .t { display: block; font-size: 11px; opacity: .9; }
.up-chip .n { display: flex; align-items: center; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-chip.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.up-col .pl-task { font-size: 12px; }
.up-empty { font-size: 13px; color: var(--stone); margin: 0; }
.now-strip { display: block; }
@media (max-width: 760px) {
  .up-cols { gap: 5px; }
  .up-col { padding: 6px 5px; }
  .up-chip { padding: 3px 5px; border-left-width: 4px; }
  .up-chip .n { font-size: 12px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .up-chip .n .pbadge { display: none; }
  .up-day .away { display: none; }
  .up-col .pl-task { align-items: flex-start; }
  .up-col .pl-task a { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .up-col .pl-task .pbadge { display: none; }
}
.overdue-label { font-size: 13px; color: var(--danger-text); font-weight: 500; align-self: center; }

.scope-box { border: 1px solid var(--tan); border-radius: var(--r); padding: 10px 12px; margin-top: 14px; background: var(--white); }
.scope-q { margin: 0 0 6px; font-size: 14px; font-weight: 500; }
.scope-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.scope-btns button { min-height: 36px; padding: 6px 12px; font-size: 14px; }

/* Inspiration grid */
.insp-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.insp-filters .on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.insp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; padding: 0; text-align: left; border: 1px solid var(--tan); border-radius: var(--card); overflow: hidden; background: var(--white); min-height: 0; }
.tile:hover { border-color: var(--graphite); background: var(--white); }
.tile-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--linen); overflow: hidden; }
.tile-media img, .tile-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tile-media .play { position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 15px; padding-left: 3px; }
.tile-note { display: block; padding: 12px 14px; height: 100%; overflow: hidden; font-family: var(--write); font-size: 14px; line-height: 1.5; background: var(--paper); -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.tile-note p { margin: 0 0 6px; } .tile-note ul { margin: 0; padding-left: 1.2em; }
.tile-link, .tile-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; padding: 10px; text-align: center; }
.tile-link b { font-size: 16px; overflow-wrap: anywhere; } .tile-file b { font-size: 22px; letter-spacing: .04em; }
.tile-link small, .tile-file small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.tile-cap { display: flex; align-items: center; gap: 6px; padding: 8px 10px; min-width: 0; }
.tile-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-cap .chip { font-size: 11px; }
dialog.wide { width: min(980px, 96vw); }
.viewer-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.viewer-head h2 { margin: 0; }
.viewer-count { margin-left: auto; font-size: 13px; }
.viewer-body { margin-top: 12px; max-height: 66vh; overflow: auto; }
.viewer-body img, .viewer-body video { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto; border-radius: var(--r); }
.viewer-body .note-text { font-size: 17px; }
.viewer-actions { justify-content: flex-start; }
.viewer-actions .spacer { flex: 1; }
.viewer-actions button:disabled { opacity: .4; cursor: default; }
@media (max-width: 760px) {
  .insp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .viewer-actions .spacer { display: none; }
  .viewer-actions button { flex: 1 1 40%; }
}

/* Jacob's ladder */
.ladder { fill: currentColor; color: var(--ink); overflow: visible; flex: none; }
.ladder.sm { width: 12px; height: 16px; }
.ladder.md { width: 22px; height: 30px; color: var(--paper); }
.ladder.lg { width: 44px; height: 58px; }
.jl-arc { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .2s ease-out; }
.jl-arc.climbing { animation: jl-climb 1.3s ease-in infinite; }
@keyframes jl-climb { 0% { transform: translateY(0) scaleX(.5); opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(-44px) scaleX(1.3); opacity: 0; } }
.jl-loader { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 0; color: var(--muted); font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.upmeter b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* It's alive! */
.alive-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; pointer-events: none; animation: alive-veil 2.4s ease-out forwards; }
@keyframes alive-veil { 0% { background: transparent; } 10% { background: var(--veil); } 80% { background: var(--veil); } 100% { background: transparent; } }
.alive-row { --h: clamp(56px, 11vw, 96px); display: flex; align-items: center; justify-content: center; gap: calc(var(--h) * .22); }
.alive-bolt { width: var(--h); height: var(--h); fill: var(--ink); flex: none; animation: alive-spark 2.4s ease-out forwards; }
.alive-bolt.r { transform: scaleX(-1); animation-name: alive-spark-r; }
.alive-word { font-family: var(--head); font-weight: 500; font-size: calc(var(--h) * 1.05); line-height: 1; color: var(--ink); white-space: nowrap; transform-origin: 50% 55%; animation: alive-grow 2.4s cubic-bezier(.33,.7,.35,1) forwards; }
@keyframes alive-grow { 0% { opacity: 0; transform: scale(.08); } 6% { opacity: 1; transform: scale(.14); } 48% { transform: scale(1); } 84% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
@keyframes alive-spark { 0% { opacity: 0; } 5% { opacity: 1; } 10% { opacity: .15; } 15% { opacity: 1; } 21% { opacity: .3; } 27% { opacity: 1; } 34% { opacity: .5; } 40% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes alive-spark-r { 0% { opacity: 0; transform: scaleX(-1); } 5% { opacity: 1; } 12% { opacity: .2; } 17% { opacity: 1; } 24% { opacity: .35; } 30% { opacity: 1; } 37% { opacity: .5; } 43% { opacity: 1; } 82% { opacity: 1; transform: scaleX(-1); } 100% { opacity: 0; transform: scaleX(-1); } }
@media (max-width: 760px) { .alive-row { --h: clamp(34px, 9vw, 52px); } }
@media (prefers-reduced-motion: reduce) {
  .jl-arc.climbing { animation: none; }
  .alive-word, .alive-bolt { animation: alive-still 1.6s linear forwards; }
  .alive-bolt.r { transform: scaleX(-1); }
  @keyframes alive-still { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
}

/* Stairwell banner on Ideas */
.stairwell { margin: -8px 0 10px; border-radius: var(--card); overflow: hidden; background: var(--paper); }
.stairwell svg { display: block; width: 100%; }
.stairwell .sw-wide { aspect-ratio: 1000 / 250; max-height: 240px; }
.stairwell .sw-narrow { display: none; aspect-ratio: 530 / 210; }
@media (max-width: 760px) { .stairwell .sw-wide { display: none; } .stairwell .sw-narrow { display: block; } .stairwell { margin-top: -4px; } }
.door-spark .ds-bolt { animation: ds-flicker 3.6s infinite; }
.door-spark .ds-arc { opacity: 0; animation: ds-arc 3.6s infinite; }
.door-spark .a2 { animation-delay: .35s; } .door-spark .a3 { animation-delay: .8s; }
@keyframes ds-flicker { 0%, 100% { opacity: 1; } 4% { opacity: .2; } 8% { opacity: 1; } 11% { opacity: .35; } 15% { opacity: 1; } 52% { opacity: 1; } 55% { opacity: .3; } 58% { opacity: 1; } }
@keyframes ds-arc { 0%, 100% { opacity: 0; } 3% { opacity: 1; } 7% { opacity: 0; } 10% { opacity: 1; } 14% { opacity: 0; } 53% { opacity: 0; } 55% { opacity: 1; } 58% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .door-spark .ds-bolt, .door-spark .ds-arc { animation: none; } }

/* Interviews */
.crumb { margin: 0 0 6px; font-size: 14px; } .crumb a { color: var(--graphite); text-decoration: none; }
.label-sm { display: block; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: none; margin: 0 0 6px; }
.iv-topic-text { font-family: var(--write); font-size: 18px; margin: 0; }
.iv-topic details { margin-top: 8px; font-size: 14px; } .iv-topic summary { cursor: pointer; color: var(--graphite); }
.iv-transcript { margin: 16px 0; display: grid; gap: 10px; }
.iv-turn { padding: 10px 14px; border-left: 3px solid var(--tan); border-radius: 0; transition: background 1.5s; }
.iv-turn.flash { background: var(--yellow-t); }
.iv-q { margin: 0 0 6px; font-weight: 500; display: flex; gap: 10px; }
.iv-q span { color: var(--muted); font-weight: 400; flex: none; min-width: 26px; }
.iv-q.big { font-family: var(--head); font-size: 22px; line-height: 1.3; }
.iv-a { padding-left: 36px; } .iv-skip { padding-left: 36px; margin: 0; color: var(--stone); font-style: italic; }
.iv-current textarea { min-height: 140px; font-size: 17px; }
.iv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.iv-actions .spacer { flex: 1; }
.iv-wait { margin-top: 8px; }
.iv-reviewbox .tk { border-top: 1px solid var(--linen); padding: 10px 0; }
.iv-reviewbox .tk textarea { min-height: 0; font-size: 15px; margin-top: 6px; }
.tk-pick { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; }
.tk-pick input { width: 18px; height: 18px; accent-color: var(--ink); }
.tk-src { font-size: 13px; color: var(--muted); margin: 4px 0 0; } .tk-src a { color: var(--graphite); }
.tk-dest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.tk-dest label { margin: 0; } .tk-dest select { width: auto; max-width: 100%; }
@media (max-width: 760px) { .iv-a, .iv-skip { padding-left: 0; } .iv-actions .spacer { display: none; } .iv-q.big { font-size: 19px; } }

/* Creative help panel */
.help { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 40; background: var(--paper); border-left: 1px solid var(--tan); box-shadow: -8px 0 24px rgba(31,30,28,.08); display: flex; flex-direction: column; }
.help[hidden] { display: none; }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--tan); }
.help-head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.help-bolt { width: 22px; height: 22px; fill: var(--ink); }
.help-body { padding: 14px 16px 40px; overflow-y: auto; flex: 1; }
.help-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; background: var(--white); border: 1px solid var(--tan); border-radius: 8px; padding: 4px 4px 4px 8px; }
.hchip b { font-weight: 500; white-space: nowrap; }
.hchip button { min-height: 24px; padding: 0 6px; border: 0; background: transparent; }
.help-addctx { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.help-addctx select { width: auto; min-height: 32px; padding: 3px 8px; font-size: 14px; }
.help-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 14px; }
.help-actions button { font-size: 14px; padding: 8px 10px; }
.res { background: var(--white); border: 1px solid var(--tan); border-radius: var(--card); padding: 10px 12px; margin-bottom: 10px; font-size: 15px; }
.res-head { font-weight: 500; margin: 0 0 6px; font-size: 14px; }
.res ul, .res ol { margin: 0 0 8px; padding-left: 1.3em; }
.res-item { border-top: 1px solid var(--linen); padding: 6px 0; } .res-item:first-of-type { border-top: 0; } .res-item p { margin: 0 0 4px; }
.res-btns { display: flex; flex-wrap: wrap; gap: 2px; } .res-btns button { font-size: 12px; min-height: 28px; padding: 2px 8px; }
.edit { border-top: 1px solid var(--linen); padding: 8px 0; }
.ed-old { margin: 0 0 4px; text-decoration: line-through; color: var(--muted); font-family: var(--write); }
.ed-new { margin: 0 0 4px; font-family: var(--write); background: var(--green-t); border-radius: 4px; padding: 2px 4px; }
.ed-why { font-size: 13px; margin: 0 0 6px; }
.help-prefs { margin-top: 10px; border-top: 1px solid var(--tan); padding-top: 10px; }
.help-prefs summary { cursor: pointer; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.pref { display: flex; gap: 6px; align-items: center; margin: 6px 0; } .pref input { min-height: 34px; padding: 4px 8px; font-size: 14px; }
.pref .chip { flex: none; font-size: 11px; }
.pref-add { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; } .pref-add input { flex: 1 1 160px; min-height: 34px; padding: 4px 8px; font-size: 14px; } .pref-add select { width: auto; min-height: 34px; padding: 3px 6px; font-size: 13px; }
.toolbar .help-btn { margin-left: auto; }
@media (min-width: 1100px) { body.help-open main { margin-right: 430px; } }
@media (max-width: 760px) { .help { width: 100vw; border-left: 0; } .toolbar .help-btn { margin-left: 0; } }

.iv-progress { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.iv-meta { border-top: 1px solid var(--linen); padding-top: 10px; }
.iv-brief { margin-top: 10px; font-size: 15px; } .iv-brief summary { cursor: pointer; color: var(--graphite); font-weight: 500; }
.iv-brief p { margin: 6px 0; } .iv-areas, .iv-sources { margin: 4px 0 8px; padding-left: 1.2em; } .iv-areas li, .iv-sources li { margin: 3px 0; }
.depth { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; margin-right: 6px; background: var(--linen); color: var(--graphite); }
.depth.deep { background: var(--green-t); color: var(--ok-text); } .depth.some { background: var(--yellow-t); color: var(--warn-text); } .depth.light { background: var(--red-t); color: var(--danger-text); }
.iv-coverage { margin-top: 12px; border: 1px solid var(--tan); border-radius: var(--r); padding: 10px 12px; background: var(--paper); }
.iv-coverage.ok { border-color: var(--green); }
.cov-head { font-weight: 500; margin: 0 0 6px; }
.iv-coverage ul { margin: 0 0 8px; padding-left: 1.2em; }

/* Project rows: due date sits under the title so narrow columns don't squish */
.plist .pt small { display: block; }
.plist .pdue { display: block; margin-top: 4px; }
.plist .dot { align-self: stretch; height: auto; min-height: 34px; }
.plist a { align-items: center; }

/* Drag and resize on the Planner */
.pl-block { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
.pl-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.pl-resize::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: currentColor; opacity: 0; }
.pl-block:hover .pl-resize::after { opacity: .45; }
.pl-block.dragging { z-index: 20; box-shadow: 0 6px 18px rgba(31,30,28,.25); cursor: grabbing; opacity: .95; }
body.pl-dragging, body.pl-dragging * { cursor: grabbing !important; }
@media (hover: hover) { .pl-block { cursor: grab; } }

/* Look back */
.lb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.lb-tile { background: var(--white); border: 1px solid var(--tan); border-radius: var(--card); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.lb-tile b { font-family: var(--head); font-weight: 500; font-size: 30px; line-height: 1.1; }
.lb-tile span { font-size: 13px; color: var(--muted); }
.lb-group { margin-top: 10px; } .lb-gh { font-weight: 500; margin: 10px 0 4px; display: flex; align-items: center; gap: 2px; }
#lb ul { margin: 0 0 6px; padding-left: 1.3em; } #lb li { margin: 3px 0; }
.lb-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
@media (max-width: 760px) { .lb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Dark mode: warm charcoal; category colors stay the same */
:root[data-theme=dark] {
  --paper: #1C1B19; --linen: #2A2824; --tan: #3E3A34; --stone: #8F8A80; --graphite: #CFC9BE; --ink: #F3EFE7; --white: #24221F; --muted: #A8A296;
  --red-t: #3A2320; --orange-t: #3A2B1A; --yellow-t: #39331A; --green-t: #1E3325; --blue-t: #1C2A3D; --indigo-t: #26233F; --violet-t: #2F2238;
  --danger-text: #F4A39A; --warn-text: #F2D27A; --ok-text: #8FD6A8; --veil: rgba(28,27,25,.86);
  color-scheme: dark;
}
:root[data-theme=dark] .brand img, :root[data-theme=dark] .stairwell svg { filter: invert(.9) hue-rotate(180deg); }
:root[data-theme=dark] .stairwell { background: transparent; }
:root[data-theme=dark] .pl-block.dragging { box-shadow: 0 6px 18px rgba(0,0,0,.5); }
:root[data-theme=dark] .help { box-shadow: -8px 0 24px rgba(0,0,0,.4); }

/* ---------- Brewing: project ideas not official yet ---------- */
.shelf-h { font-size: 20px; margin: 22px 0 8px; }
.brew-shelf { margin-top: 8px; padding: 16px 18px 18px; border: 1.5px dashed var(--tan); border-radius: var(--card); background: var(--linen); }
.brew-shelf .shelf-h { margin: 0; }
.brew-shelf .hint { margin: 4px 0 12px; }
.brew-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.brew-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed var(--muted); border-radius: var(--card); background: var(--white); text-decoration: none; color: var(--ink); min-height: 84px; }
.brew-card:hover { border-style: solid; }
.brew-top { display: flex; align-items: center; gap: 10px; }
.brew-top strong { font-weight: 500; overflow-wrap: anywhere; }
.brew-pitch { font-size: 14px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.band.brewing { background: repeating-linear-gradient(-45deg, var(--linen) 0 12px, var(--paper) 12px 24px); color: var(--ink); border: 1.5px dashed var(--tan); border-bottom: 0; }
.brew-panel textarea { width: 100%; margin-top: 6px; }
.brew-panel h3 { margin: 0; }
.brew-go { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.brew-go .hint { flex: 1; min-width: 220px; margin: 0; }

/* ---------- done time blocks: they stay on the calendar, faded with a check ---------- */
.pl-check { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .55; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; z-index: 2; }
.pl-check:hover { opacity: 1; }
.pl-check.on { opacity: 1; background: currentColor; }
.pl-check.on::after { content: ''; width: 5px; height: 9px; border: solid var(--white); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); mix-blend-mode: difference; }
.pl-block .pl-check { top: 3px; right: 3px; }
.pl-block .rep { right: 26px; }
.pl-block.done, .pl-allblock.done, .pl-mitem.done, .up-chip.done { opacity: .55; }
.pl-block.done .n, .pl-allblock.done, .pl-mitem.done, .up-chip.done .n { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.pl-allblock, .up-chip { position: relative; padding-right: 26px; }
.pl-allblock .pl-check, .up-chip .pl-check { top: 50%; transform: translateY(-50%); }
.pl-mitem .pl-check { display: none; }
.done-row { font-weight: 500; }

/* ---------- project pictures (square, instead of an icon) ---------- */
.pbadge { width: 40px; height: 40px; }
.pbadge.img { overflow: hidden; padding: 0; background: var(--linen); }
.pbadge.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pbadge.img.xs { width: 22px; height: 22px; }
.pbadge.lg { width: 60px; height: 60px; }
.pbadge.lg.img { width: 72px; height: 72px; border-radius: 14px; }
.brew-top .pbadge.img { width: 44px; height: 44px; }
.ip-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0 14px; border-bottom: 1px solid var(--linen); margin-bottom: 10px; }
.ip-photo .hint { flex-basis: 100%; margin: 0; }

/* ---------- Lab notebook ---------- */
.lab-h { margin: 18px 0 8px; }
.lab-iv { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; border: 1px solid var(--tan); border-radius: var(--card); background: var(--white); color: var(--ink); }
.lab-iv .pt { flex: 1; min-width: 0; }
.lab-iv .pt strong { display: block; font-weight: 500; }
.lab-iv .pt small { color: var(--muted); }
.lab-run { border: 1px solid var(--tan); border-radius: var(--card); background: var(--white); padding: 12px 14px; margin-bottom: 10px; }
.lab-head { margin: 0 0 6px; font-size: 14px; }
.lab-ask, .lab-ctx { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.lab-body { line-height: 1.5; overflow-wrap: anywhere; }
.lab-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.lab-btns select { max-width: 220px; }
.lab-kept { margin-top: 8px; }

/* ---------- interview roadmap, study guide, packet ---------- */
.iv-roadmap-preview { margin-top: 10px; padding: 10px 12px; background: var(--linen); border-radius: 10px; font-size: 14px; }
.iv-roadmap-preview ul { margin: 6px 0 0; padding-left: 18px; }
.iv-roadmap-preview li { color: var(--muted); margin: 3px 0; }
.iv-roadmap-preview li.on { color: var(--ink); }
.iv-roadmap ol { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 4px; }
.iv-roadmap li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--linen); }
.iv-roadmap li.later { color: var(--muted); }
.iv-roadmap .rm-t { flex: 1 1 200px; min-width: 0; }
.rm-dots { display: inline-flex; gap: 3px; }
.rm-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink); }
.rm-dots i.on { background: var(--ink); }
.rm-later { font-size: 13px; }
.depth.none { background: var(--linen); color: var(--muted); }
.iv-sec { margin: 0 0 2px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.iv-packet h3 { margin: 18px 0 6px; }
.iv-packet ul { margin: 0; padding-left: 20px; line-height: 1.5; }
.iv-packet li { margin: 4px 0; }
.pk-from { color: var(--muted); font-size: 13px; }
.pk-quotes li { font-style: italic; }

/* ---------- drag to reorder checklist items ---------- */
.task { position: relative; }
.drag-h { flex: none; width: 14px; align-self: stretch; min-height: 28px; cursor: grab; touch-action: none; border-radius: 4px; margin-left: -6px;
  background: radial-gradient(circle, var(--stone) 1.3px, transparent 1.6px) 0 50% / 7px 7px; background-repeat: repeat; opacity: .55; }
.drag-h:hover, .drag-h:focus-visible { opacity: 1; }
.task.dragging { background: var(--linen); box-shadow: 0 6px 18px rgba(0,0,0,.12); border-radius: 8px; z-index: 3; }
body.task-dragging, body.task-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.brew-pitch { white-space: pre-line; }
.brew-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Brewing: a big, roomy place to think ---------- */
.brew-panel #ppitch { min-height: max(340px, 52vh); font-size: 17px; line-height: 1.6; padding: 14px 16px; resize: vertical; }
.alive-btn { border-color: var(--ink); font-weight: 600; }

/* ---------- Checklist page: category bar and completed list ---------- */
.ck-mix, .ck-done { margin-top: 16px; }
.ck-drow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linen); color: var(--muted); }
.ck-drow:last-child { border-bottom: 0; }
.ck-dt { flex: 1; min-width: 0; text-decoration: line-through; text-decoration-color: var(--stone); overflow-wrap: anywhere; }
.ck-dm { flex: none; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; max-width: 45%; }
.ck-dm a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-drow input { opacity: .6; }
@media (max-width: 600px) { .ck-drow { flex-wrap: wrap; } .ck-dm { max-width: 100%; padding-left: 30px; } }

/* ---------- category picker with colors ---------- */
select.catsel-hidden { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip-path: inset(50%); }
.catpick { --cp: transparent; display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 6px 12px 6px 10px; border: 1.5px solid var(--tan); border-radius: 999px;
  background: var(--white); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; text-align: left; max-width: 100%; }
.catpick.has { border-color: var(--cp); background: color-mix(in srgb, var(--cp) 14%, var(--white)); }
.catpick:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.catpick[aria-expanded="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp, var(--tan)) 35%, transparent); }
.catpick .cp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cp-caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .6; margin-left: 2px; }
.cp-sw { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.12); }
.cp-sw.none { background: repeating-linear-gradient(-45deg, transparent 0 3px, var(--tan) 3px 4.5px); box-shadow: inset 0 0 0 1.5px var(--tan); }
.cp-sw.new { display: inline-flex; align-items: center; justify-content: center; background: var(--linen); color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1; }
label + .catsel-hidden + .catpick, label + .catpick { display: flex; width: 100%; }
.pmeta .catpick, .pmeta label + .catsel-hidden + .catpick { display: inline-flex; width: auto; min-width: 170px; }
.catmenu { position: fixed; z-index: 1000; max-height: 420px; overflow-y: auto; padding: 6px; background: var(--white); color: var(--ink); border: 1px solid var(--tan); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18); animation: cm-in .12s ease-out; }
@keyframes cm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cm-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; outline: none; }
.cm-opt:hover, .cm-opt:focus { background: var(--linen); }
.cm-opt[aria-selected="true"] { font-weight: 600; }
.cm-check { margin-left: auto; padding-left: 12px; }
.cm-new { border-top: 1px solid var(--linen); margin-top: 4px; padding-top: 11px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .catmenu { animation: none; } }

/* ---------- embedded videos (YouTube, Vimeo) ---------- */
.vid-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; }
.vid-frame.tall { aspect-ratio: 9 / 16; max-width: min(360px, 100%); max-height: 62vh; margin: 0 auto; }
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer-body .vid-frame:not(.tall) { max-width: min(100%, calc(62vh * 16 / 9)); margin: 0 auto; }
.vid-src { text-align: center; margin: 10px 0 0; font-size: 14px; }
.url-prev { margin-top: 10px; }
.url-prev:empty { display: none; }
.url-prev .hint { margin: 6px 0 0; }

/* category pill on brewing cards */
.brew-cat { align-self: flex-end; margin-top: auto; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--white)); color: var(--ink); }
.brew-cat i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* ---------- Projects: Brewing and In the works, equal weight ---------- */
.proj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-top: 8px; }
.proj-col { padding: 16px 18px 18px; border-radius: var(--card); min-width: 0; }
.works-col { border: 1.5px solid var(--tan); background: var(--white); }
.brew-shelf.proj-col { margin-top: 0; }
.proj-col .shelf-h { margin: 0; }
.proj-col .shelf-h .count { font-family: var(--sans, inherit); font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.proj-col > .hint { margin: 4px 0 12px; }
.proj-col .brew-grid { grid-template-columns: 1fr; }
.works-col .plist a { background: var(--paper); }
.proj-switch { display: none; }
@media (max-width: 860px) {
  .proj-cols { grid-template-columns: 1fr; }
  .proj-switch { display: flex; gap: 4px; padding: 4px; margin-top: 6px; background: var(--linen); border-radius: 999px; }
  .proj-switch button { flex: 1; border: 0; border-radius: 999px; background: transparent; min-height: 40px; font-weight: 500; }
  .proj-switch button[aria-selected="true"] { background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
  .proj-switch .count { color: var(--muted); font-weight: 400; margin-left: 4px; }
  .proj-cols[data-tab="works"] .brew-shelf, .proj-cols[data-tab="brewing"] .works-col { display: none; }
}

/* ---------- editable tabs and headings ---------- */
.edit-title { cursor: text; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.edit-title:hover, .edit-title:focus-visible { background: var(--linen); box-shadow: inset 0 -2px 0 var(--tan); }
.edit-title:hover::after { content: ' ✎'; font-size: .7em; color: var(--muted); }
.title-input { font: inherit; font-family: var(--serif, Georgia, serif); border: 1.5px solid var(--tan); border-radius: 8px; padding: 2px 8px; background: var(--white); color: var(--ink); min-width: 0; width: min(100%, 360px); }
.title-input.h2 { font-size: 22px; } .title-input.h3 { font-size: 19px; }
.tabs .tab-edit { margin-left: auto; font-size: 14px; }
.et-list { display: grid; gap: 8px; margin: 8px 0 4px; }
.et-row { display: flex; align-items: center; gap: 6px; }
.et-row input { flex: 1; min-width: 0; }
.et-keep { font-size: 13px; color: var(--muted); padding: 0 8px; min-width: 64px; text-align: center; }
.et-row .danger { min-width: 64px; }

/* ---------- reminders and sharing settings ---------- */
.ok-line { color: var(--ok-text); font-weight: 500; }
.remind-prefs { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linen); }
.steps { margin: 6px 0 12px; padding-left: 22px; line-height: 1.55; }
.steps li { margin: 6px 0; }
.steps code, .copyrow code { background: var(--linen); padding: 1px 6px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
.copyrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.share-secret { border: 1.5px solid var(--yellow, #e5b409); background: var(--yellow-t, #fbf3d6); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.share-secret p { margin: 0 0 4px; }
.share-steps { margin-top: 12px; }
.share-steps summary { cursor: pointer; font-weight: 500; }
.share-guide { margin-top: 10px; }
.share-guide h3 { margin: 18px 0 6px; font-size: 18px; }
.share-guide .copyrow code { font-size: 13px; padding: 6px 8px; display: block; width: 100%; }
.share-log { margin: 10px 0; font-size: 14px; }
.share-log ul { margin: 6px 0 0; padding-left: 18px; }
.share-log li { margin: 4px 0; overflow-wrap: anywhere; }
.share-log li.ok b { color: var(--ok-text); } .share-log li.bad b { color: var(--danger-text); }

/* ---------- Just shared tray ---------- */
.shared-tray { margin-top: 14px; border: 1.5px solid var(--yellow, #e5b409); }
.sh-all { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sh-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sh-item { border: 1px solid var(--tan); border-radius: var(--card); overflow: hidden; background: var(--white); display: flex; flex-direction: column; }
.sh-prev { background: var(--linen); min-height: 90px; max-height: 170px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sh-prev img { width: 100%; height: 170px; object-fit: cover; display: block; }
.sh-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; width: 100%; overflow-wrap: anywhere; }
.sh-link img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.sh-link small { color: var(--muted); font-size: 12px; }
.sh-text { padding: 10px 12px; font-size: 14px; line-height: 1.45; white-space: pre-line; width: 100%; }
.sh-file { padding: 14px; font-weight: 500; }
.sh-act { padding: 8px 10px 10px; display: grid; gap: 6px; }
.sh-act select { width: 100%; }
.sh-btns { display: flex; gap: 6px; justify-content: space-between; }

/* ---------- phone home page order: Up next, Quick checklist, Pick up a project, Running note, Just shared ---------- */
@media (max-width: 760px) {
  .home-flow { display: flex; flex-direction: column; }
  .home-flow .layout, .home-flow .layout > div { display: contents; }
  .home-flow > *, .home-flow .layout > div > *, .home-flow .layout > aside { margin-top: 14px; }
  .home-flow #now-strip { order: 1; margin-top: 0; }
  .home-flow .due-strip { order: 2; }
  .home-flow .home-check { order: 3; }
  .home-flow .home-projects { order: 4; }
  .home-flow #note-panel { order: 5; }
  .home-flow #shared-tray { order: 6; }
  .home-flow #shared-tray:empty, .home-flow #now-strip:empty { margin-top: 0; }
}

/* due date and category sit on their own line under the task text */
.task .tmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task .tmain .txt { flex: none; }
.task .tmeta { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
.task .tmeta .chip { font-size: 12px; }
@media (max-width: 760px) { .task .tmeta .catchip { display: inline-flex; } }

/* ---------- + Add: Todo, Note, or Brew ---------- */
.add-modes { display: flex; gap: 4px; padding: 4px; background: var(--linen); border-radius: 999px; margin: 4px 0 6px; }
.add-modes button { flex: 1; border: 0; border-radius: 999px; background: transparent; min-height: 40px; font-weight: 500; padding: 0 8px; }
.add-modes button[aria-selected="true"] { background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Completed: category pills, editable rows ---------- */
.dpills { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.dpill { --c: var(--stone); display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px 4px 9px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--white)); color: var(--ink); }
.dpill i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.dpill.all { --c: var(--tan); padding-left: 12px; }
.dpill.on { background: var(--c); color: var(--white); font-weight: 600; }
.dpill.all.on { background: var(--ink); border-color: var(--ink); }
.dpill.on i { background: var(--white); }
button.ck-dt { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px; min-height: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
button.ck-dt:hover { background: var(--linen); text-decoration-color: var(--muted); }
.dcat { width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 4px; flex: none; }

/* + Add dialog: even fields and a friendly file picker */
.add-body input[type=date], .add-body input[type=time] { min-height: 46px; font: inherit; color: var(--ink); -webkit-appearance: none; appearance: none; }
.add-body select:not(.catsel-hidden) { min-height: 46px; }
.filepick { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 10px 14px; min-height: 46px; border: 1.5px dashed var(--tan); border-radius: var(--r); background: var(--white); cursor: pointer; font-weight: 500; }
.filepick:hover { background: var(--linen); }
.filepick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filepick:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.filepick .fp-name { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.row2 > div, .row3 > div { min-width: 0; }
.row2 input, .row3 input { width: 100%; min-width: 0; box-sizing: border-box; }

/* Search lives as a small icon up top; "Saved" only shows when something is happening. */
.search-link { display: inline-flex; align-items: center; justify-content: center; line-height: 0; padding: 6px; }
.status.idle { display: none; }
