/* Today, direction C "Poster": bold colour per column, Today as the hero, 2px ink outlines. */

@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-400.woff2?v=SrUess1zBdF3) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-500.woff2?v=Gb8ZhJVlF8Nc) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dm-sans-700.woff2?v=NcXvoOXapS7l) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage-700.woff2?v=TDc848HMpByG) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage-800.woff2?v=PhtfClbumVt8) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --ink: #111111;
  --muted: #4a4a4a;
  --muted-2: #3d3d3d;
  --line: #d9d9d4;
  --chip: #f1f1ee;
  --paper: #ffffff;
  --danger: #b42318;
  --high: #ff5a4d;
  --med: #ffb020;
  --low: #d9d9d4;
  --ok: #3ddc84;
  --done: #1f9d55;
  --done-edge: #11683a;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.35; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
a { color: var(--ink); }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.spacer { flex: 1; }

/* ---------- Buttons ---------- */
.round-btn { width: 44px; height: 44px; flex: none; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); display: grid; place-items: center; padding: 0; }
.round-btn.small { width: 36px; height: 36px; }
.pill-btn { height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 22px; background: var(--paper); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pill-btn.dark { background: var(--ink); color: #fff; }
.pill-btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.link-btn { border: 0; background: none; padding: 6px 4px; font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; min-height: 36px; }
.link-btn.danger { color: var(--danger); }
.icon-btn { width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); display: grid; place-items: center; padding: 0; flex: none; }
.btn.primary { height: 48px; border: 0; border-radius: 24px; background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; padding: 0 24px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; flex: none; }

/* ---------- Badges and chips ---------- */
.badge { flex: none; padding: 2px 8px; border-radius: 10px; border: 2px solid var(--ink); color: var(--ink); font-size: 12px; font-weight: 700; margin-left: 8px; line-height: 1.3; }
.chip { display: inline-block; padding: 0 8px; border-radius: 9px; border: 2px solid var(--ink); font-size: 12px; font-weight: 700; line-height: 1.45; white-space: nowrap; }

/* ---------- Sync status ---------- */
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sync.pill { height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 22px; font-size: 14px; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--ok); }
.sync[data-state="pending"] .sync-dot, .sync[data-state="syncing"] .sync-dot { background: var(--med); }
.sync[data-state="offline"] .sync-dot { background: var(--paper); }
.sync[data-state="signedout"] .sync-dot { background: var(--high); }

/* ---------- Cards ---------- */
.card-list { display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.card-list:empty { min-height: 60px; border: 2px dashed var(--ink); border-radius: 16px; display: flex; flex-direction: row; align-items: center; padding: 0 16px; }
.card-list:empty::before { content: attr(data-empty); font-size: 14px; font-weight: 700; }
.done-list:empty { display: none; }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 4px 12px 4px 2px; display: flex; align-items: center; min-height: 60px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card.compact { min-height: 52px; border-radius: 14px; }
.card.is-done { background: rgba(255, 255, 255, 0.55); min-height: 52px; }
.tick { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; flex: none; }
/* Not done: a pale grey tick in the circle. Done: a green circle with a white tick. */
.tick-ring { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; background: var(--paper); color: #c4c4be; transition: background 0.15s, color 0.15s; }
.tick:hover .tick-ring { color: #8e8e88; }
.is-done .tick-ring, .tick-ring.on { background: var(--done); border-color: var(--done-edge); color: #fff; }
.tick-ring.small { width: 18px; height: 18px; }
.card-body { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.compact .card-title { font-size: 15px; }
.is-done .card-title { color: var(--muted-2); text-decoration: line-through; }
.card-meta { font-size: 13px; color: var(--muted); }
.card-meta.with-badge { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-meta.with-badge .badge { margin-left: 0; padding: 0 7px; }
.card-notes { font-size: 14px; line-height: 1.4; color: var(--muted-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.done-time { font-size: 13px; font-weight: 500; color: var(--muted-2); margin-left: 8px; white-space: nowrap; }
/* Swipe to delete */
.card { touch-action: pan-y; transition: transform 0.18s ease-out; }
.card.swiped { transform: translateX(var(--swipe, 0)); }
.swipe-delete { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); width: 76px; height: calc(100% + 4px); min-height: 52px; border: 2px solid var(--ink); border-radius: 16px; background: var(--danger); color: #fff; display: grid; place-items: center; padding: 0; }

/* Select mode */
.select-ring { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ink); background: var(--paper); display: grid; place-items: center; color: #fff; }
.is-selected .select-ring { background: var(--ink); }
.card.is-selected { box-shadow: 0 0 0 3px var(--ink); }
.select-toggle { margin-left: 4px; }
.hero-head .select-toggle { height: 32px; padding: 0 12px; font-size: 13px; }
.select-bar { position: fixed; left: 12px; right: 12px; margin: 0 auto; max-width: 560px; bottom: calc(18px + var(--safe-bottom)); z-index: 60; background: var(--paper); border: 2px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); padding: 8px 8px 8px 16px; display: flex; align-items: center; gap: 6px; }
.select-count { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-bar .pill-btn { padding: 0 12px; }
.pill-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
body:has(.select-bar) .bottom-bar { display: none; }
body:has(.select-bar) .toast { bottom: calc(96px + var(--safe-bottom)); }

/* A card just added: a quick pop, a yellow glow and a tick that fade out. */
.card { position: relative; }
.card.just-added { animation: added-pop 1.6s ease-out; }
@keyframes added-pop {
  0% { transform: scale(0.94); box-shadow: 0 0 0 0 rgba(17, 17, 17, 0); background: #fff6c2; }
  15% { transform: scale(1.02); box-shadow: 0 0 0 6px var(--ink); background: #fff6c2; }
  35% { transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0); background: var(--paper); }
}
.added-tick { position: absolute; top: -10px; right: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); border: 2px solid var(--ink); color: var(--ink); display: grid; place-items: center; animation: added-tick 1.6s ease-out forwards; pointer-events: none; z-index: 2; }
@keyframes added-tick { 0% { transform: scale(0); } 20% { transform: scale(1.2); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .card.just-added, .added-tick { animation-duration: 0.01s; } }
.drag-ghost { opacity: 0.35; }
.drag-flying, .sortable-fallback { transform: rotate(-3deg); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28); opacity: 1 !important; }
body.is-dragging { cursor: grabbing; }
body.is-dragging .tab-drop { min-height: 44px; }

/* ---------- Columns ---------- */
.column { border: 2px solid var(--ink); border-radius: 24px; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hero-head { display: flex; align-items: baseline; gap: 10px; padding: 0 6px 2px; flex-wrap: wrap; }
.hero-head h1 { font-size: 32px; font-weight: 800; line-height: 1.1; }
.hero-date { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--muted-2); }
.hero-head .sync, .hero-count { margin-left: auto; }
.hero-count { font-size: 15px; font-weight: 700; }
.column-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 4px; gap: 8px; }
.column-head h2 { font-size: 24px; font-weight: 800; }
.column-head h2 .link-btn { font: inherit; text-decoration: none; padding: 0; min-height: 0; }
.column-head span { font-size: 14px; font-weight: 700; white-space: nowrap; }
.done-strip { display: flex; flex-direction: column; gap: 8px; }
.done-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 0; font-size: 13px; font-weight: 700; }
.done-head .link-btn { font-size: 13px; padding: 0; }
.add-inline { border: 0; background: none; font-weight: 700; font-size: 14px; text-align: left; padding: 8px 8px 2px; min-height: 40px; }

/* ---------- Phone board ---------- */
.m-board { padding: calc(16px + var(--safe-top)) 16px calc(120px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }
.m-board .hero { border-radius: 24px; }
.tabs { margin-top: 14px; display: flex; flex-direction: column; }
.tab { border: 2px solid var(--ink); border-radius: 24px 24px 0 0; margin-top: -16px; position: relative; }
.tab:first-child { margin-top: 0; }
.tab:last-child { border-radius: 24px; padding-bottom: 4px; }
.tab.drawer:last-child { min-height: 140px; }
.tab-head { width: 100%; height: 72px; border: 0; background: none; padding: 0 18px 14px; display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 12px; }
.tab:last-child .tab-head { padding-bottom: 0; height: 60px; }
.tab-name { font-family: var(--display); font-size: 22px; font-weight: 800; white-space: nowrap; }
.tab-summary { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; text-align: right; }
.tab-drop { position: absolute; inset: 0; z-index: 1; pointer-events: none; display: flex; }
body.is-dragging .tab-drop { pointer-events: auto; }
.tab.drop-hover { box-shadow: inset 0 0 0 4px var(--ink); }
.tab.open { padding-bottom: 28px; }
.tab.open:last-child { padding-bottom: 8px; }
.tab-body { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: calc(22px + var(--safe-bottom)); display: flex; justify-content: center; align-items: center; gap: 14px; z-index: 20; pointer-events: none; }
.bottom-bar > * { pointer-events: auto; }
.bottom-bar .round-btn { width: 52px; height: 52px; }
.bottom-bar { gap: 10px; }
.big-btn { height: 64px; padding: 0 22px 0 18px; border: 0; border-radius: 32px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }

/* ---------- Desktop board ---------- */
.d-board { padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1800px; margin: 0 auto; }
.d-header { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.brand { font-family: var(--display); font-weight: 800; font-size: 20px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.d-columns { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.d-columns > .column { flex: 1 1 220px; border-radius: 28px; padding: 18px 14px; }
.d-columns > .hero { flex: 2 1 420px; padding: 20px 18px 18px; gap: 10px; }
.d-columns > .hero .hero-head h1 { font-size: 40px; }
.d-columns > .hero .hero-date { font-size: 24px; }
.d-columns > .hero .card { border-radius: 18px; padding: 8px 16px 8px 4px; }
.d-columns > .hero .card-title { font-size: 18px; }
.list-column { border-style: dashed !important; }
.shelf { border: 2px solid var(--ink); border-radius: 28px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.shelf-row { display: flex; flex-wrap: wrap; gap: 12px; }
.shelf-list { flex-direction: row; flex-wrap: wrap; gap: 12px; flex: 1 1 auto; }
.shelf-list:empty { display: none; }
.shelf-list .card { flex: 1 1 220px; background: var(--chip); border: 0; border-radius: 16px; }
.capture { flex: 1 1 220px; min-height: 64px; border: 2px dashed var(--ink); border-radius: 16px; background: none; font-size: 15px; font-weight: 700; }

/* ---------- Sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(17, 17, 17, 0.4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; max-height: 100%; overflow: auto; border-top: 2px solid var(--ink); border-radius: 24px 24px 0 0; }
@media (min-width: 900px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border: 2px solid var(--ink); border-radius: 24px; max-height: calc(100vh - 48px); box-shadow: 0 8px 0 var(--ink); }
}
.editor { height: 100%; display: flex; flex-direction: column; border-radius: 0; border-top: 0; }
@media (min-width: 900px) { .editor { height: auto; border-radius: 24px; border-top: 2px solid var(--ink); } }
.editor-top { border-bottom: 2px solid var(--ink); padding: calc(14px + var(--safe-top)) 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.editor-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.edit-title { width: 100%; border: 0; background: none; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; padding: 0; resize: none; outline: none; }
.transcript { margin: 0; font-size: 13px; color: var(--muted-2); }
.editor-body { padding: 18px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 18px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend, .field > label { font-size: 13px; font-weight: 700; margin-bottom: 8px; padding: 0; display: block; }
.move-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.move-btn { height: 44px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); font-size: 13px; font-weight: 700; padding: 0 6px; }
.move-btn[aria-pressed="true"], .label-toggle[aria-pressed="true"], .filter[aria-pressed="true"] { box-shadow: 0 3px 0 var(--ink); }
.label-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.label-toggle { height: 44px; padding: 0 14px 0 10px; border: 2px solid var(--ink); border-radius: 22px; background: var(--paper); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.label-toggle[aria-pressed="true"] { background: var(--ink); color: #fff; }
.label-toggle.dashed { border-style: dashed; padding: 0 14px; }
.new-label input { height: 44px; border: 2px solid var(--ink); border-radius: 22px; padding: 0 14px; width: 160px; font-weight: 700; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; }
.segmented button { height: 44px; border: 0; border-right: 2px solid var(--ink); background: var(--paper); font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 5px; }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { font-weight: 700; }
.segmented button[aria-pressed="true"] .dot { display: none; }
.segmented .dot { width: 10px; height: 10px; }
.due-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.picker { position: relative; flex: 1 1 120px; min-width: 0; display: flex; }
.due-row input { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; min-height: 44px; border: 2px solid var(--ink); border-radius: 14px; padding: 0 10px; font-size: 16px; font-weight: 700; color: var(--ink); background: var(--paper); min-width: 0; display: flex; align-items: center; }
.due-row input::-webkit-date-and-time-value { text-align: left; }
/* An empty picker shows its hint (iOS draws nothing in an empty date or time box). */
.picker.empty::after { content: attr(data-hint); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; font-weight: 700; color: var(--muted); pointer-events: none; }
.picker.empty input { color: transparent; }
.picker.empty input:focus { color: var(--ink); }
.picker.empty:focus-within::after { content: none; }
.notes-box { border: 2px solid var(--ink); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.notes-box textarea { border: 0; padding: 0; resize: vertical; font-size: 16px; line-height: 1.45; outline: none; min-height: 72px; background: none; }
.links { display: flex; flex-direction: column; gap: 6px; }
.link-chip { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--chip); text-decoration: none; font-size: 14px; font-weight: 700; overflow: hidden; }
.link-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.link-chip small { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumb { position: relative; }
.photo-open { width: 84px; height: 84px; border: 2px solid var(--ink); border-radius: 12px; padding: 0; overflow: hidden; background: #e4e4e0; display: block; }
.photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb:nth-child(odd) .photo-open { transform: rotate(-2deg); }
.photo-thumb:nth-child(even) .photo-open { transform: rotate(2deg); }
.photo-remove { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); display: grid; place-items: center; padding: 0; }
.editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.viewer { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9); z-index: 70; display: grid; place-items: center; }
.viewer-img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.viewer-close { position: absolute; top: calc(12px + var(--safe-top)); right: 12px; z-index: 1; }

/* Talk or type */
.capture { padding: 16px 16px calc(16px + var(--safe-bottom)); background: #fff; display: flex; flex-direction: column; gap: 10px; }
.capture-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--high); border: 2px solid var(--ink); animation: rec 1.2s ease-in-out infinite; }
@keyframes rec { 50% { transform: scale(0.7); opacity: 0.6; } }
.capture textarea { width: 100%; min-height: 96px; border: 2px solid var(--ink); border-radius: 16px; padding: 12px 14px; font-size: 18px; line-height: 1.4; resize: vertical; background: var(--paper); }
.capture-actions { display: flex; align-items: center; gap: 8px; }
.pill-btn.big { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 26px; }
.capture-error { margin: 0; color: var(--danger); font-weight: 700; font-size: 14px; }

/* Quick add */
.quick-add { padding: 16px 16px calc(16px + var(--safe-bottom)); border-top: 2px solid var(--ink); }
.qa-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qa-head label { font-weight: 700; font-size: 14px; }
.qa-row, .list-add, .add-row { display: flex; gap: 8px; }
.qa-row input, .list-add input, .add-row input, .settings select { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--ink); border-radius: 16px; padding: 0 14px; font-size: 17px; background: var(--paper); }
.qa-row .pill-btn, .list-add .pill-btn { height: 52px; border-radius: 16px; }
.qa-added { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.qa-added li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- Screens ---------- */
.screen { padding: calc(14px + var(--safe-top)) 16px calc(40px + var(--safe-bottom)); max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.screen-head { display: flex; align-items: center; gap: 12px; margin: calc(-14px - var(--safe-top)) -16px 4px; padding: calc(14px + var(--safe-top)) 16px 14px; border-bottom: 2px solid var(--ink); }
.screen-head.plain { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.screen-head h1 { font-size: 32px; font-weight: 800; line-height: 1.1; }
.count-chip { margin-left: auto; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 14px; background: #ffd23f; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sub-head { font-size: 20px; font-weight: 800; margin-top: 12px; }
.list-items.ideas .card-meta { white-space: normal; }
.empty { color: var(--muted); font-weight: 500; }

/* Logbook */
.search { position: relative; }
.search input { width: 100%; height: 46px; border: 2px solid var(--ink); border-radius: 23px; padding: 0 16px 0 44px; font-size: 15px; background: var(--paper); }
.search svg { position: absolute; left: 16px; top: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 22px; background: var(--paper); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.filter[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.log-day { display: flex; flex-direction: column; }
.log-day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px; border-bottom: 2px solid var(--ink); }
.log-day-head h2 { font-size: 20px; font-weight: 800; }
.log-day-head h2 span { font-weight: 700; color: var(--muted); }
.log-day-head > span { font-size: 13px; font-weight: 700; }
.log-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--done); color: #fff; display: grid; place-items: center; flex: none; }
.log-icon.archived { border-radius: 6px; border: 2px solid var(--ink); background: var(--low); color: var(--ink); }
.log-title { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 8px 0; font-size: 16px; font-weight: 500; display: flex; flex-direction: column; }
.log-title small { font-size: 12px; font-weight: 700; color: var(--muted); }
.archived .log-title span { color: var(--muted-2); }
.log-time { font-size: 13px; color: var(--muted); }
.load-more { display: flex; justify-content: center; padding: 12px; }

/* Settings */
.settings-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.settings-row { border: 2px solid var(--ink); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.row-main { display: flex; align-items: center; gap: 8px; }
.row-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.name-input { flex: 1; min-width: 0; height: 40px; border: 2px solid var(--ink); border-radius: 10px; padding: 0 10px; font-size: 15px; font-weight: 700; }
.row-note { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 50%; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; font-weight: 500; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.add-row { margin-top: 10px; }
.add-row input { height: 44px; font-size: 15px; }
.settings-block { display: flex; flex-direction: column; gap: 8px; }
.settings select { flex: none; height: 48px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.hint.small { font-size: 12px; }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(104px + var(--safe-bottom)); z-index: 80; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; max-width: calc(100vw - 32px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
.toast button { height: 36px; border: 2px solid #fff; border-radius: 18px; background: none; color: #fff; font-weight: 700; padding: 0 14px; flex: none; }
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* Password page and overlay */
.login-page { display: grid; place-items: center; min-height: 100vh; background: #ffd23f; padding: 16px; }
.login-overlay { align-items: center; padding: 16px; }
.login-card { background: var(--paper); border: 2px solid var(--ink); border-radius: 24px; padding: 24px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 0 var(--ink); }
.login-card h1 { font-size: 40px; font-weight: 800; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card label { font-weight: 700; font-size: 14px; }
.login-card input { height: 48px; border: 2px solid var(--ink); border-radius: 14px; padding: 0 14px; font-size: 17px; }
.login-card p { margin: 0; font-size: 14px; }
.login-error { color: var(--danger); font-weight: 700; }
@media (max-width: 380px) {
  .bottom-bar { gap: 6px; }
  .bottom-bar .round-btn { width: 46px; height: 46px; }
  .big-btn { padding: 0 16px 0 12px; font-size: 16px; }
}
