/*
 * photo-intel in Light-Lux's "Minutes book" look: warm paper page beside a sidebar that follows the
 * light or dark setting, deep olive-black ink, firm rules, Public Sans for reading and Fraunces for
 * headlines, one slight 4px corner everywhere, generous spacing. Carolina blue is the accent:
 * selection, the active tab, ticked boxes. Tokens are copied from Light-Lux's styles.css; keep them
 * in step with it.
 */
@font-face { font-family: "Public Sans Variable"; src: url(/static/fonts/public-sans-latin-wght.woff2) format("woff2-variations"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces Variable"; src: url(/static/fonts/fraunces-latin-opsz.woff2) format("woff2-variations"); font-weight: 100 900; font-display: swap; }

:root {
  --ground: #f3efe2;
  --sidebar: #ebe6d6;
  --page: #fffdf5;
  --raised: #ffffff;
  --ink: #14150e;
  --ink-2: #3d3e35;
  --muted: #5a5a51;
  --faint: #63635a;
  --rule: #dcd8cb;
  --hair: #e9e6db;
  --hover: #efebdf;

  --carolina: #7bafd4;
  --carolina-ink: #1f5d8c;
  --carolina-soft: #d9e8f5;
  --on-carolina: #0d2236;

  --tally: #d23f2a;
  --tally-soft: #fbe9e6;
  --tally-ink: #a92f1e;
  --ok-ink: #2d6b4a;
  --ok-soft: #e4f1e9;
  --danger: #b4382a;
  --amber-ink: #8a5306;

  --shadow-sm: 0 1px 2px rgba(20, 21, 14, 0.07);
  --shadow: 0 1px 2px rgba(20, 21, 14, 0.08), 0 18px 44px -10px rgba(20, 21, 14, 0.24);
  --btn-shadow: 0 1px 2px rgba(27, 28, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.68, -0.18, 0.32, 1.22);
  --fast: 160ms;
  --med: 320ms;
  --r: 4px;

  --font: "Public Sans Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces Variable", Georgia, "Times New Roman", serif;
  --t-xs: 12px;
  --t-sm: 13px;
  --t-md: 15px;
  --t-lg: 20px;
  --t-xl: 28px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0c0d08;
    --sidebar: #0f100a;
    --page: #191a13;
    --raised: #212219;
    --ink: #faf7ec;
    --ink-2: #d2d0c5;
    --muted: #b5b3a8;
    --faint: #9a988e;
    --rule: #3a3a31;
    --hair: #2b2c24;
    --hover: #27281f;

    --carolina: #7bafd4;
    --carolina-ink: #a8cdea;
    --carolina-soft: #1f3a52;
    --on-carolina: #0b1b2b;

    --tally: #ee6550;
    --tally-soft: #3a1d18;
    --tally-ink: #f6a194;
    --ok-ink: #8fd0aa;
    --ok-soft: #16301f;
    --danger: #f0907f;
    --amber-ink: #e3a24a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -10px rgba(0, 0, 0, 0.6);
    --btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ground); color: var(--ink);
  font: 400 var(--t-sm)/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
button:disabled { cursor: default; opacity: 0.5; }
:focus-visible { outline: 2px solid var(--carolina-ink); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--carolina) 45%, transparent); color: inherit; }
a { color: var(--carolina-ink); text-decoration-color: color-mix(in srgb, var(--carolina-ink) 40%, transparent); text-underline-offset: 3px; }

/* Headlines: Fraunces at weight 400. */
.page-title, .doc-title, .section-head h2, .page-empty h2, .wordmark {
  font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 30; letter-spacing: -0.02em;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--t-xs); }
.num { font-variant-numeric: tabular-nums; }
.error { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Buttons: one word each, never wrapping ---- */
.primary, .secondary, .ghost, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  font-size: var(--t-sm); font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; text-decoration: none;
}
.primary { background: var(--ink); color: var(--page); box-shadow: var(--btn-shadow); }
.primary:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 86%, var(--carolina)); }
.primary:not(:disabled):active { background: color-mix(in srgb, var(--ink) 78%, var(--carolina)); }
.secondary { background: var(--raised); color: var(--ink); border-color: var(--rule); box-shadow: var(--shadow-sm); }
.secondary:not(:disabled):hover { background: var(--hover); }
.secondary.on { background: var(--carolina-soft); border-color: color-mix(in srgb, var(--carolina) 60%, var(--rule)); }
.ghost { background: none; color: var(--ink-2); }
.ghost:not(:disabled):hover { background: var(--hover); color: var(--ink); }
.danger { background: var(--danger); color: #fff; box-shadow: var(--btn-shadow); }
.danger:not(:disabled):hover { background: color-mix(in srgb, var(--danger) 86%, var(--ink)); }
.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--r); border: 1px solid transparent; background: none; color: var(--muted); flex: none; }
.icon-btn:not(:disabled):hover { background: var(--hover); color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--carolina-ink); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--carolina-ink) 40%, transparent); text-underline-offset: 3px; }

/* The one number badge. */
.count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r); background: var(--carolina-soft); color: var(--carolina-ink); font-size: var(--t-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.count.zero { background: none; color: var(--faint); font-weight: 500; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--r); border: 1px solid var(--rule); color: var(--muted); font-size: var(--t-xs); font-weight: 600; flex: none; white-space: nowrap; }
.tag.ok { border-color: transparent; background: var(--ok-soft); color: var(--ok-ink); }
.tag.bad { border-color: transparent; background: var(--tally-soft); color: var(--tally-ink); }
.tag.blue { border-color: transparent; background: var(--carolina-soft); color: var(--carolina-ink); }

/* ---- Segmented control: the active tab is a Carolina fill with navy text ---- */
.segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border: 1px solid var(--rule); border-radius: var(--r); background: color-mix(in srgb, var(--raised) 70%, transparent); box-shadow: inset 0 1px 2px rgba(27, 28, 20, 0.04); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 13px; border-radius: var(--r); color: var(--muted); font-size: var(--t-sm); font-weight: 500; white-space: nowrap; text-decoration: none; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.segmented a:not(.active):hover { color: var(--ink); }
.segmented a.active { background: var(--carolina); color: var(--on-carolina); font-weight: 600; box-shadow: 0 1px 2px rgba(13, 34, 54, 0.2); }
.segmented a.active .count:not(.zero) { background: var(--page); color: var(--carolina-ink); }
.segmented a.active .count.zero { color: var(--on-carolina); }

/* ---- Checkbox: square, ruled, Carolina when ticked ---- */
.check {
  appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid color-mix(in srgb, var(--muted) 70%, var(--rule)); border-radius: var(--r); background: var(--raised);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.check::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--on-carolina); border-top: 0; border-right: 0; transform: rotate(-45deg); clip-path: inset(0 100% 0 0); margin-top: -2px; transition: clip-path 260ms var(--ease); }
.check:checked { background: var(--carolina); border-color: color-mix(in srgb, var(--carolina) 70%, var(--on-carolina)); }
.check:checked::after { clip-path: inset(0); }

/* ---- Shell: the sidebar and the page ---- */
.shell { --side-w: 264px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100%; overflow: hidden; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.sidebar-top { padding: 24px 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; padding: 0 4px; font-size: 19px; font-variation-settings: "opsz" 24; color: var(--ink); text-decoration: none; }
.wordmark .mark { width: 22px; height: 22px; border-radius: var(--r); background: var(--carolina); color: var(--on-carolina); display: grid; place-items: center; }
/* The pages as a list: an icon, the word, and the count at the row's end (Light-Lux's .nav). */
.nav { padding: 2px 12px 14px; display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--rule); }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px;
  border-radius: var(--r); color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; text-decoration: none;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav a svg { color: var(--muted); flex: none; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--carolina-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--carolina) 70%, transparent); }
.nav a.active svg { color: var(--carolina-ink); }
.nav a .count { margin-left: auto; }
.nav a.active .count:not(.zero) { background: var(--page); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--carolina) 70%, transparent); }
.nav-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-note { padding: 18px 20px; color: var(--muted); font-size: var(--t-xs); display: flex; flex-direction: column; gap: 6px; }
.side-note b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--rule); padding: 10px 12px; }
.sidebar-foot .nav { padding: 0; border: 0; }

.main { background: var(--page); min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 44px; border-bottom: 1px solid var(--rule); }
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.page-title { margin: 0; font-size: 26px; line-height: 1.1; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.crumbs { color: var(--faint); min-width: 0; display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--ink); }
.crumbs strong { color: var(--ink); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.page-scroll { flex: 1; overflow-y: auto; padding: 40px 44px 80px; }
.page-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 48px; animation: grow-down var(--med) var(--spring); transform-origin: top center; }
@keyframes grow-down { from { clip-path: inset(0 0 100% 0); transform: translateY(-6px); } to { clip-path: inset(0 0 -40px 0); } }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 21px; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
.section-head h2 .count, .section-head h2 .tag { font-family: var(--font); font-variation-settings: normal; letter-spacing: 0; }
.section-head p { margin: 0; font-size: var(--t-sm); color: var(--muted); }
.figures { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; color: var(--muted); font-size: var(--t-sm); }
.figures b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Registers: ruled tables instead of cards ---- */
.register { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.register-head, .register-row { display: grid; grid-template-columns: var(--cols); gap: 0 20px; align-items: center; padding: 0 14px; }
.register-head { height: 40px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--rule); }
.register-row { min-height: 62px; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); transition: background-color var(--fast) var(--ease); }
.register-row:hover { background: var(--hover); }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-title { font-size: var(--t-md); font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
a.row-title:hover { color: var(--carolina-ink); }
.row-sub { font-size: var(--t-sm); color: var(--muted); }
.row-sub.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done .row-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.cell-date { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile { width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--rule); object-fit: cover; object-position: top; background: var(--hover); display: grid; place-items: center; color: var(--faint); }
.todos { --cols: 24px 40px minmax(0, 1fr) 96px; }
.notes-reg { --cols: minmax(0, 1fr) 96px; }
.errors-reg { --cols: minmax(0, 1fr) minmax(0, 2fr); }
.fields-reg { --cols: 180px minmax(0, 1fr); }
.fields-reg .register-row { min-height: 46px; padding-top: 11px; padding-bottom: 11px; }
.fields-reg .key { color: var(--muted); font-size: var(--t-sm); font-weight: 600; }
.note-text { grid-column: 1 / -1; margin: 6px 0 0; white-space: pre-wrap; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.6; }

/* A wide table (Reference) scrolls inside its rules. */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
table.register-table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
.register-table th { height: 40px; padding: 0 14px; text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.register-table td { padding: 16px 14px; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--ink-2); }
.register-table tr:hover td { background: var(--hover); }
.register-table td.title a { font-weight: 600; color: var(--ink); text-decoration: none; font-size: var(--t-md); }
.register-table td.title a:hover { color: var(--carolina-ink); }

/* ---- Review: the selection bar and the shots ---- */
.select-bar {
  position: sticky; top: -40px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: -12px -14px 0; padding: 12px 14px; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.select-bar .picked { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-sm); color: var(--muted); }
.select-bar .picked b { color: var(--ink); font-variant-numeric: tabular-nums; }
.select-bar .spacer { flex: 1; }
.select-bar .move { display: inline-flex; align-items: center; gap: 6px; }
.select-bar .move-label { font-size: var(--t-xs); font-weight: 600; color: var(--muted); margin-right: 2px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 20px; margin-top: 24px; }
.shot {
  --ec: var(--rule); --edge: 1px;
  position: relative; display: flex; flex-direction: column; background: var(--raised); border-radius: var(--r);
  box-shadow: 0 0 0 var(--edge) var(--ec), var(--shadow-sm); overflow: hidden;
  transition: box-shadow var(--med) var(--ease);
}
/* State is told by the edge: picked turns it Carolina and widens it to 2px. */
.shot:has(.check:checked) { --ec: var(--carolina); --edge: 2px; }
.shot-pic { display: block; height: 200px; overflow: hidden; background: var(--hover); border-bottom: 1px solid var(--hair); text-decoration: none; }
.shot-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.nothumb { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); font-size: var(--t-xs); }
.shot-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.shot-head { display: flex; align-items: flex-start; gap: 10px; }
.shot-head .check { margin-top: 2px; }
.shot-title { font-size: var(--t-md); font-weight: 600; line-height: 1.3; cursor: pointer; }
.shot-sum { font-size: var(--t-sm); color: var(--ink-2); }
.shot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.shot-why { font-size: var(--t-xs); color: var(--faint); }
.shot-act { font-size: var(--t-sm); color: var(--carolina-ink); font-weight: 500; }

/* ---- An item: the minutes book's page ---- */
.doc { max-width: 740px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.doc-head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--ink); }
.doc-title { margin: 0; font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: var(--t-sm); }
.doc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.doc-meta svg { color: var(--faint); }
.decide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.decide .label { font-size: var(--t-xs); font-weight: 600; color: var(--muted); margin-right: 4px; }
.doc p { margin: 0; }
.lead { font-size: var(--t-md); line-height: 1.6; color: var(--ink); }
.doc-pic { display: block; max-width: 100%; border-radius: var(--r); box-shadow: 0 0 0 1px var(--rule), var(--shadow-sm); }
.doc h3 { margin: 26px 0 0; font-family: var(--serif); font-weight: 400; font-size: var(--t-lg); letter-spacing: -0.02em; }
/* Plain text read from the image: ruled above and below, never a box. */
.text-block { margin: 0; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); white-space: pre-wrap; font: inherit; font-size: var(--t-sm); line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.log { max-height: 60vh; overflow: auto; font-variant-numeric: tabular-nums; }

.page-none { color: var(--muted); padding: 28px 14px; margin: 0; font-size: var(--t-sm); border-bottom: 1px solid var(--hair); }
.page-empty { max-width: 480px; margin: 10vh auto 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.page-empty svg.spot { color: var(--ink-2); }
.page-empty svg.spot .lit { color: var(--carolina); }
.page-empty svg.spot path, .page-empty svg.spot rect, .page-empty svg.spot circle { stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 900ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.page-empty h2 { margin: 0; font-size: 34px; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.page-empty p { margin: 4px 0 12px; color: var(--ink-2); font-size: 17px; line-height: 1.5; }

/* ---- The black toast: what just happened, on the page's axis ---- */
.toast {
  position: fixed; left: calc(50% + var(--side-w, 264px) / 2); translate: -50% 0; bottom: 28px; width: max-content; max-width: min(520px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px; font-size: var(--t-sm);
  background: var(--ink); color: var(--page); padding: 14px 18px; border-radius: var(--r); box-shadow: var(--shadow); z-index: 10;
  animation: slide-up 380ms var(--spring) backwards;
}
.toast svg { flex: none; }
.toast svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 420ms var(--ease) 260ms forwards; }
.toast.leaving { animation: slide-down var(--med) var(--ease) forwards; }
@keyframes slide-up { from { transform: translateY(24px); clip-path: inset(100% 0 0 0 round var(--r)); } to { clip-path: inset(0 0 0 0 round var(--r)); } }
@keyframes slide-down { to { transform: translateY(24px); clip-path: inset(100% 0 0 0 round var(--r)); } }

/* ---- Sidebar extras ---- */
.nav + .nav { padding-top: 14px; }
.sign-out { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 4px 0 12px; border-top: 1px solid var(--hair); }
.sign-out .me { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-xs); color: var(--muted); }

/* ---- Search, as in Light-Lux's top bar ---- */
.search { display: flex; align-items: center; gap: 8px; height: 34px; width: 300px; max-width: 100%; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); color: var(--muted); transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.search:focus-within { border-color: var(--carolina-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--carolina) 30%, transparent); }
.search input { border: 0; outline: none; background: none; flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--ink); }
.search input::placeholder { color: var(--faint); }

form.inline { display: inline-flex; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.foot-note { margin: 16px 0 0; }
.note-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pager { display: flex; justify-content: center; gap: 10px; padding-top: 24px; }
.figures form.inline { margin-left: 4px; }
.figures { align-items: center; }
.accounts-reg { --cols: minmax(0, 1fr) 220px 110px 200px; }

/* ---- Mail ---- */
.mail-reg { --cols: 200px minmax(0, 1fr) 96px; }
.mail-reg .register-row { color: inherit; text-decoration: none; min-height: 58px; padding-top: 10px; padding-bottom: 10px; }
.mail-reg .row-title { font-size: var(--t-sm); font-weight: 500; }
.mail-reg .unread .row-title, .mail-reg .unread .mail-from { font-weight: 700; color: var(--ink); }
.mail-from { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--t-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--carolina); }
.row-title.clip { white-space: nowrap; }

/* ---- Timeline: a day per section, its rows ruled ---- */
.timeline { gap: 40px; }
.tl-hint { margin: 0; }
.tl-day { display: flex; flex-direction: column; }
.tl-date { margin: 0 0 12px; display: flex; align-items: baseline; gap: 12px; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 30; font-size: 21px; letter-spacing: -0.02em; }
.tl-date span { font-family: var(--font); font-size: var(--t-sm); letter-spacing: 0; color: var(--muted); }
.tl-rows { border-top: 1px solid var(--ink); }
.tl-row { display: grid; grid-template-columns: 76px 40px minmax(0, 1fr); gap: 0 16px; align-items: center; min-height: 56px; padding: 9px 14px; border-bottom: 1px solid var(--hair); color: inherit; text-decoration: none; transition: background-color var(--fast) var(--ease); }
.tl-row:hover { background: var(--hover); }
.tl-time { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-kind { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r); color: var(--muted); border: 1px solid var(--hair); }
.tl-row.event .tl-kind { color: var(--carolina-ink); background: var(--carolina-soft); border-color: transparent; }
.tl-row .row-title { font-size: var(--t-sm); }
.tl-row.mail .row-title { font-weight: 500; }
.tl-row.mail.unread .row-title { font-weight: 700; }
.tl-none { margin: 0; padding: 16px 14px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--hair); color: var(--faint); font-size: var(--t-sm); }
/* A busy day's older mail stays folded until asked for; it then grows in where it belongs. */
.tl-row.extra { display: none; }
.tl-rows:has(.tl-unfold:checked) .tl-row.extra { display: grid; animation: grow-down var(--med) var(--spring) backwards; }
.tl-more { display: block; padding: 14px; cursor: pointer; border-bottom: 1px solid var(--hair); }
.tl-unfold:checked + .tl-more { display: none; }
.tl-unfold:focus-visible + .tl-more { outline: 2px solid var(--carolina-ink); outline-offset: -2px; }

/* ---- Sign in: one sheet on the ground ---- */
.signin-body { display: grid; place-items: center; min-height: 100%; padding: 24px 16px; }
.sheet { width: min(420px, 100%); background: var(--page); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 36px 36px 30px; display: flex; flex-direction: column; gap: 14px; animation: slide-up 480ms var(--spring) backwards; }
.sheet .wordmark { padding: 0; margin-bottom: 10px; }
.sheet-title { margin: 0; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 30; font-size: var(--t-xl); letter-spacing: -0.02em; line-height: 1.1; }
.sheet-intro { margin: 0 0 8px; color: var(--ink-2); font-size: var(--t-md); line-height: 1.5; }
.sheet-fine { margin: 6px 0 0; color: var(--muted); font-size: var(--t-xs); }
.sheet .error { margin: 0; font-size: var(--t-sm); }
.wide { width: 100%; }
.google-btn { gap: 10px; }

/* ---- Search and Ask ---- */
.finder { display: flex; flex-direction: column; gap: 18px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.find-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 10px; align-items: center; }
.find-box { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); color: var(--muted); box-shadow: var(--shadow-sm); transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.find-box:focus-within { border-color: var(--carolina-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--carolina) 30%, transparent); }
.find-box input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: var(--t-md); color: var(--ink); }
.find-box input::placeholder { color: var(--faint); }
.find-form .primary, .find-form .secondary { height: 48px; }
.find-filters { grid-column: 1 / -1; }
.find-filters summary { display: inline-block; list-style: none; cursor: pointer; font-size: var(--t-sm); }
.find-filters summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; padding-top: 14px; animation: grow-down var(--med) var(--spring); }
.filter-grid label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field { height: 38px; border: 1px solid var(--rule); background: var(--raised); border-radius: var(--r); padding: 0 11px; outline: none; color: var(--ink); font-size: var(--t-sm); min-width: 0; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.field:focus { border-color: var(--carolina-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--carolina) 30%, transparent); }
.label { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.ask-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ask-box { display: flex; flex-direction: column; gap: 6px; }
.answer { display: flex; flex-direction: column; gap: 14px; }
.answer .section-head { margin-bottom: 0; }
.answer-text { margin: 0; font-size: var(--t-md); line-height: 1.65; color: var(--ink); max-width: 760px; white-space: pre-line; }
.cite { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; margin: 0 1px; border-radius: var(--r); background: var(--carolina-soft); color: var(--carolina-ink); font-size: var(--t-xs); font-weight: 700; text-decoration: none; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.cite:hover { background: var(--carolina); color: var(--on-carolina); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 18px 16px; }
.tiles.near { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ptile { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: inherit; text-decoration: none; }
.ptile-pic { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--hover); box-shadow: 0 0 0 1px var(--hair); transition: box-shadow var(--fast) var(--ease); }
.ptile:hover .ptile-pic { box-shadow: 0 0 0 2px var(--carolina); }
.ptile-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ptile-pic .nothumb { color: var(--faint); }
.ptile-n { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--r); background: var(--carolina); color: var(--on-carolina); font-size: var(--t-xs); font-weight: 700; }
.ptile-flag { position: absolute; bottom: 6px; left: 6px; padding: 1px 6px; border-radius: var(--r); background: rgba(12, 13, 8, 0.66); color: #fff; font-style: normal; font-size: 11px; font-weight: 600; }
.ptile-when { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ptile-what { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asks-reg { --cols: minmax(0, 1fr) 80px; }
.asks-reg .register-row { min-height: 50px; color: inherit; text-decoration: none; }
.asks-reg .row-title { font-size: var(--t-sm); font-weight: 500; }
.find-start { display: flex; flex-direction: column; gap: 16px; }
.photo-pic { max-height: 70vh; width: auto; align-self: flex-start; }

/* ---- People and places ---- */
.ent-reg { --cols: 40px minmax(0, 1fr) 72px 64px 92px 120px; }
.ent-reg .register-row { color: inherit; text-decoration: none; }
.ent-reg .num, .mini-reg .num { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--t-sm); color: var(--ink-2); }
.tile.round, .ent-cover.round { border-radius: 50%; }
.ent-head { display: flex; align-items: center; gap: 22px; }
.ent-cover { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r); box-shadow: 0 0 0 1px var(--rule); flex: none; }
.ent-name { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ent-figs { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.ent-figs div { padding: 14px 16px; border-left: 1px solid var(--hair); display: flex; flex-direction: column-reverse; gap: 2px; }
.ent-figs div:first-child { border-left: 0; padding-left: 0; }
.ent-figs dd { margin: 0; font-family: var(--serif); font-variation-settings: "opsz" 30; font-size: 26px; font-variant-numeric: tabular-nums; }
.ent-figs dd.late { color: var(--tally-ink); }
.ent-figs dt { color: var(--muted); font-size: var(--t-xs); }
.gone-line { margin: -28px 0 0; color: var(--tally-ink); font-size: var(--t-sm); }
.years { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.year-bar { flex: 1 0 44px; max-width: 80px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; padding-bottom: 6px; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.year-bar b { font-weight: 600; color: var(--ink-2); }
.year-fill { width: 100%; height: calc(var(--h) * 0.7); min-height: 2px; background: var(--carolina); border-radius: 2px 2px 0 0; animation: grow-up 600ms var(--spring) backwards; transform-origin: bottom; }
@keyframes grow-up { from { transform: scaleY(0); } }
.ent-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; }
.mini-reg { --cols: minmax(0, 1fr) 64px; }
.mini-reg .register-row { min-height: 46px; padding-top: 10px; padding-bottom: 10px; color: inherit; text-decoration: none; }
.mini-reg .row-title { font-size: var(--t-sm); font-weight: 500; }
.fix-rows { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.fix-row { display: flex; align-items: flex-end; gap: 12px; padding: 16px 14px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.fix-row label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; max-width: 420px; }
.fix-row > .muted { flex: 1; align-self: center; }
.fix-row.aliases { align-items: center; }
.alias { display: inline-flex; align-items: center; gap: 4px; padding-left: 10px; border-left: 1px solid var(--hair); font-size: var(--t-sm); }

/* ---- Ideas ---- */
.ideas-reg { --cols: 64px minmax(0, 1fr) auto; }
.ideas-reg.compact { --cols: minmax(0, 1fr) auto; }
.ideas-reg .register-row { align-items: start; padding-top: 16px; padding-bottom: 16px; }
.ideas-reg .row-main { gap: 4px; }
.ideas-reg .row-title { font-size: var(--t-md); white-space: normal; }
.ideas-reg .row-actions form { display: inline-flex; gap: 4px; }
.tile.big { width: 64px; height: 64px; }
.idea-goal { align-self: flex-start; font-size: var(--t-xs); font-weight: 600; padding: 1px 7px; border-radius: var(--r); }
.idea-goal.g-save { background: var(--ok-soft); color: var(--ok-ink); }
.idea-goal.g-earn { background: var(--carolina-soft); color: var(--carolina-ink); }
.idea-goal.g-enjoy { background: color-mix(in srgb, var(--amber-ink) 14%, transparent); color: var(--amber-ink); }
.idea-goal.g-share { background: color-mix(in srgb, var(--a-people) 14%, transparent); color: var(--a-people); }
.idea-goal.g-todo { background: var(--hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.idea-goal.g-useful { background: var(--hover); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }
.code-value { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.ok-line { color: var(--ok-ink); }
.ok-line svg { vertical-align: -2px; }
.code.done .row-title, .idea.done .row-title { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.ideas-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.ideas-head h3 { margin: 0; }

/* ---- Inbox: one card per photo, one action leading ---- */
.inbox .section-head.sub { margin: 36px 0 16px; }
.inbox .section-head.sub h2 { font-size: var(--t-lg); }
.cards { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.card { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 0 20px; align-items: start; padding: 20px 14px; border-bottom: 1px solid var(--hair); transition: background-color var(--fast) var(--ease); }
.card:hover { background: color-mix(in srgb, var(--hover) 55%, transparent); }
.card-pic { position: relative; display: block; width: 96px; height: 96px; border-radius: var(--r); overflow: hidden; background: var(--hover); box-shadow: 0 0 0 1px var(--hair); }
.card-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-pic .nothumb { color: var(--faint); }
.card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-title { margin: 0; font-size: var(--t-md); font-weight: 600; line-height: 1.35; }
.card-why { margin: 0; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.ctx { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-xs); color: var(--muted); }
.ctx > span { display: inline-flex; align-items: center; gap: 5px; }
.ctx svg { color: var(--faint); flex: none; }
.ctx .tie { color: var(--carolina-ink); }
.ctx .tie svg { color: var(--carolina-ink); }
.happening { font-size: var(--t-xs); color: var(--faint); font-style: italic; }
.card-more { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 4px; }
.card-more .label { margin-right: 2px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--raised); color: var(--ink-2); font-size: var(--t-xs); text-decoration: none; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background-color var(--fast) var(--ease); }
a.chip:hover { background: var(--hover); color: var(--ink); }
.card-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 120px; }
.card-marks { display: flex; justify-content: flex-end; gap: 2px; }
.card.done .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.idea-goal.g-package, .idea-goal.g-event, .idea-goal.g-flight { background: var(--carolina-soft); color: var(--carolina-ink); }
.idea-goal.g-delivered { background: var(--ok-soft); color: var(--ok-ink); }
.idea-goal.g-draft { background: color-mix(in srgb, var(--amber-ink) 14%, transparent); color: var(--amber-ink); }
.idea-goal.g-promo, .idea-goal.g-confirmation, .idea-goal.g-phone, .idea-goal.g-url { background: var(--hover); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }
.q-reg { --cols: 64px minmax(0, 1fr); }
.q-row { align-items: start; padding-top: 16px; padding-bottom: 16px; }
.q-row .row-title { white-space: normal; font-size: var(--t-md); }
.q-row .row-main { gap: 6px; }
.q-opts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.q-opts .secondary { height: 32px; padding: 0 12px; }
.q-other { height: 32px; width: 180px; }
.pile-reg { --cols: minmax(0, 1fr) auto; }
.pile-reg .register-row { align-items: start; padding-top: 18px; padding-bottom: 18px; }
.pile-reg .row-main { gap: 6px; }
.pile-reg .row-title { display: flex; align-items: center; gap: 8px; }
.pile-strip { display: flex; gap: 6px; padding-top: 4px; }

/* ---- Use It: the obvious next steps, on a photo's and an item's page ---- */
.use-it { display: flex; flex-direction: column; gap: 12px; padding: 18px 0 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.use-head { display: flex; align-items: center; gap: 10px; }
.use-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 30; font-size: var(--t-lg); letter-spacing: -0.02em; }
.use-subject { display: flex; gap: 8px; align-items: center; }
.find-box.small { height: 40px; flex: 1; box-shadow: none; }
.find-box.small input { font-size: var(--t-sm); }
.use-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.use-it .muted.small { margin: 0; }
.doc-head + .use-it { border-top: 0; padding-top: 0; }
.ingredients { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.ingredients .use-head { justify-content: space-between; }
.ingredients ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
.ingredients li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--hair); font-size: var(--t-sm); }
.ingredients li a { color: var(--ink-2); text-decoration: none; }
.ingredients li a:hover { color: var(--carolina-ink); text-decoration: underline; }
@media (max-width: 760px) { .ingredients ul { columns: 1; } }

/* Working: a button busy with what it started keeps its colour and says so. */
button.is-busy { cursor: progress; }

/* ---- Phones: the sidebar is a drawer ---- */
.scrim { display: none; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(304px, 86vw);
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--med) var(--ease), visibility 0s linear var(--med);
  }
  body.drawer .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow); transition: transform var(--med) var(--ease); }
  body.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(12, 13, 8, 0.32); }
  .sidebar-top { padding-top: max(16px, env(safe-area-inset-top)); }
  .menu-btn { display: inline-grid; margin-left: -8px; }
  .nav a { min-height: 40px; }
  .topbar { height: auto; min-height: 60px; padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .topbar-title { flex: 1; align-items: center; }
  .page-title { font-size: 22px; }
  .doc-title { font-size: 30px; }
  .page-empty h2 { font-size: 28px; }
  .page-scroll { padding: 22px 16px 48px; }
  .page-inner { gap: 32px; }
  .register-head, .register-row { gap: 0 12px; padding-left: 6px; padding-right: 6px; }
  .todos { --cols: 24px 40px minmax(0, 1fr); }
  .todos .cell-date { display: none; }
  .fields-reg { --cols: minmax(0, 1fr); }
  .errors-reg { --cols: minmax(0, 1fr); }
  .errors-reg .register-head { display: none; }
  .accounts-reg { --cols: minmax(0, 1fr); }
  .accounts-reg .register-head { display: none; }
  .accounts-reg .row-actions { justify-content: flex-start; }
  .mail-reg { --cols: minmax(0, 1fr) 64px; }
  .mail-reg .register-head { display: none; }
  .mail-reg .mail-from { grid-column: 1 / -1; }
  .mail-reg .row-main { grid-column: 1; }
  .search { width: 100%; }
  .topbar-actions:has(.search) { flex: 1 1 100%; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ent-reg { --cols: 40px minmax(0, 1fr) 56px; }
  .card { grid-template-columns: 64px minmax(0, 1fr); gap: 0 12px; padding: 16px 6px; }
  .card-pic { width: 64px; height: 64px; }
  .card-actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; padding-top: 10px; }
  .q-reg { --cols: 48px minmax(0, 1fr); }
  .ideas-reg, .ideas-reg.compact { --cols: 48px minmax(0, 1fr); }
  .ideas-reg.compact { --cols: minmax(0, 1fr); }
  .ideas-reg .row-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
  .ideas-reg:not(.compact) .row-actions { grid-column: 2; }
  .tile.big { width: 48px; height: 48px; }
  .ent-reg .register-head > :nth-child(n+4), .ent-reg .register-row > :nth-child(n+4) { display: none; }
  .ent-figs { grid-template-columns: repeat(2, 1fr); }
  .ent-figs div:nth-child(3) { border-left: 0; padding-left: 0; }
  .ent-two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ent-cover { width: 64px; height: 64px; }
  .find-form .primary { height: 44px; }
  .find-box { height: 44px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 12px; }
  .tl-row { grid-template-columns: 56px 40px minmax(0, 1fr); gap: 0 10px; padding-left: 6px; padding-right: 6px; }
  .shots { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .select-bar { top: -22px; margin: -6px -16px 0; padding: 10px 16px; }
  .select-bar .move-label { display: none; }
  .toast { left: 50%; }
  .field, input[type="text"] { font-size: 16px !important; }
}

/* ---- Your Year: one colour per activity, in light and dark ---- */
:root {
  --a-work: #1f5d8c; --a-travel: #b07c22; --a-people: #b5506b; --a-food: #7a6bb0;
  --a-outdoors: #2a7f70; --a-events: #8a7520; --a-everyday: #c9c3b2;
  --p-0: #b5506b; --p-1: #1f5d8c; --p-2: #2a7f70; --p-3: #b07c22;
}
@media (prefers-color-scheme: dark) {
  :root {
    --a-work: #6fa6d6; --a-travel: #d9a54a; --a-people: #db7f98; --a-food: #a99ad8;
    --a-outdoors: #5fb8a6; --a-events: #c9b04f; --a-everyday: #4a4a3f;
    --p-0: #db7f98; --p-1: #6fa6d6; --p-2: #5fb8a6; --p-3: #d9a54a;
  }
}
.a-work { --c: var(--a-work); } .a-travel { --c: var(--a-travel); } .a-people { --c: var(--a-people); }
.a-food { --c: var(--a-food); } .a-outdoors { --c: var(--a-outdoors); } .a-events { --c: var(--a-events); }
.a-everyday { --c: var(--a-everyday); }

.year { max-width: 1180px; gap: 52px; }
.yr-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-bottom: 16px; }
.yr-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 30; letter-spacing: -0.02em; font-size: 21px; }
.yr-head p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.yr-cap { margin: 10px 0 0; color: var(--muted); font-size: var(--t-xs); line-height: 1.5; }

.yr-now { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 44px; align-items: end; }
.yr-lead { margin: 0; font-family: var(--serif); font-variation-settings: "opsz" 40; font-size: 31px; line-height: 1.22; letter-spacing: -0.02em; text-wrap: pretty; }
.yr-lead em { font-style: normal; color: var(--carolina-ink); }
.yr-sub { margin: 12px 0 0; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }
.yr-figs { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.yr-figs div { padding: 12px 14px; border-left: 1px solid var(--hair); display: flex; flex-direction: column-reverse; }
.yr-figs div:first-child { border-left: 0; padding-left: 0; }
.yr-figs dd { margin: 0; font-family: var(--serif); font-size: 27px; font-variant-numeric: tabular-nums; }
.yr-figs dt { color: var(--muted); font-size: var(--t-xs); }

/* At a Glance: lanes across the span */
.lanes { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
.lane-months { position: relative; height: 20px; }
.lane-months span { position: absolute; top: 0; font-size: 11px; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--rule); height: 100%; white-space: nowrap; }
.lane-label { padding: 10px 10px 10px 0; border-top: 1px solid var(--hair); font-size: var(--t-xs); color: var(--muted); line-height: 1.35; }
.lane-label b { display: block; color: var(--ink); font-size: var(--t-sm); font-weight: 600; }
.lane { position: relative; border-top: 1px solid var(--hair); min-height: 50px; }
.lane-base { position: absolute; left: 0; right: 0; top: 14px; height: 22px; background: color-mix(in srgb, var(--a-everyday) 45%, transparent); border-radius: 2px; font-size: 11px; font-weight: 600; color: var(--ink-2); padding: 3px 8px; }
.lane-bar { position: absolute; top: 14px; height: 22px; background: var(--c); border-radius: 2px; text-decoration: none; min-width: 4px; }
.lane-bar span { position: absolute; left: 0; top: 3px; padding: 0 6px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; background: var(--c); border-radius: 2px; line-height: 16px; }
.lane-bar:hover, .lane-tag:hover { box-shadow: 0 0 0 2px var(--ink); z-index: 2; }
.doing { display: flex; align-items: stretch; padding: 10px 0; gap: 0; }
.doing a, .doing i { flex: 1 1 0; min-width: 0; }
.doing a { background: var(--c); }
.doing a:hover { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; }
.moments { min-height: 72px; }
.lane-tag { position: absolute; height: 22px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 22px; color: #fff; background: var(--c); border-radius: 2px; text-decoration: none; white-space: nowrap; }
.lane-none { position: absolute; left: 0; top: 16px; font-size: var(--t-xs); color: var(--faint); }
.people .lane-name { position: absolute; left: 0; font-size: 11px; color: var(--muted); background: var(--page); padding-right: 6px; z-index: 1; }
.people .dot { position: absolute; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; }
.dot.pc0 { background: var(--p-0); } .dot.pc1 { background: var(--p-1); } .dot.pc2 { background: var(--p-2); } .dot.pc3 { background: var(--p-3); }
.yr-legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-xs); color: var(--muted); }
.yr-legend i, .chip i, .row-title .kind { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; }

.yr-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; }
.week-grid { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.week-grid i { height: 22px; border-radius: 2px; background: var(--hair); }
.week-grid i[class] { background: var(--c); }
.wk-day { line-height: 22px; }
.wk-hour { text-align: left; }

.mix { display: flex; flex-direction: column; gap: 8px; }
.mix-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; font-size: var(--t-xs); color: var(--muted); }
.mix-bar { display: flex; height: 22px; border-radius: 2px; overflow: hidden; background: var(--hair); }
.mix-bar i { background: var(--c); }
.mix-bar em { font-style: normal; padding: 3px 8px; }

.yr-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); margin-top: 16px; }
.yr-table.places { margin-top: 0; }
.yr-table th { text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--muted); padding: 0 8px 8px; border-bottom: 1px solid var(--rule); }
.yr-table td { padding: 0 8px; height: 44px; border-bottom: 1px solid var(--hair); }
.yr-table th:first-child, .yr-table td:first-child { padding-left: 0; }
.yr-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.yr-table td a { color: inherit; text-decoration: none; }
.yr-table td a:hover { color: var(--carolina-ink); text-decoration: underline; }
.yr-table td.late, .yr-table td.late a { color: var(--tally-ink); }
.chip { display: inline-flex; align-items: center; color: var(--ink); }
.spark polyline { fill: none; stroke: var(--carolina-ink); stroke-width: 1.5; stroke-linejoin: round; }

.yr-map { height: 340px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--hover); z-index: 0; color: var(--muted); display: grid; place-items: center; font-size: var(--t-sm); }
.yr-map.leaflet-container { display: block; font: inherit; font-size: var(--t-xs); }
.small-seg a { height: 24px; padding: 0 10px; font-size: var(--t-xs); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { border-radius: var(--r); background: var(--raised); color: var(--ink); }
.leaflet-popup-content { font: var(--t-sm)/1.5 var(--font); }

.changes-reg { --cols: minmax(0, 1fr) 150px 90px 80px; }
.chg-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chg-value.good { color: var(--ok-ink); } .chg-value.bad { color: var(--tally-ink); }
.stories-reg { --cols: 110px minmax(0, 1fr) 110px; }
.stories-reg form { justify-self: end; }
.story-note { margin: 8px 0 0; font-size: var(--t-sm); line-height: 1.6; color: var(--ink-2); max-width: 70ch; }

@media (max-width: 1000px) {
  .yr-now, .yr-two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 760px) {
  .yr-lead { font-size: 24px; }
  .yr-figs { grid-template-columns: repeat(2, 1fr); }
  .yr-figs div:nth-child(3) { border-left: 0; padding-left: 0; }
  .lanes { grid-template-columns: 72px minmax(0, 1fr); }
  .lane-label { font-size: 0; } .lane-label b { font-size: var(--t-xs); }
  .yr-range { display: none; }
  .changes-reg { --cols: minmax(0, 1fr) 70px; }
  .changes-reg .register-row > :nth-child(2), .changes-reg .register-row > :nth-child(4) { display: none; }
  .stories-reg { --cols: minmax(0, 1fr) 96px; }
  .stories-reg .cell-date { display: none; }
  .yr-table.places th:nth-child(2), .yr-table.places td:nth-child(2), .yr-table.places th:nth-child(5), .yr-table.places td:nth-child(5) { display: none; }
}
/* OpenStreetMap's tiles, quieted to sit on the paper; inverted to a night map in dark. */
.yr-tiles { filter: saturate(0.35) sepia(0.12) contrast(0.95); }
@media (prefers-color-scheme: dark) { .yr-tiles { filter: invert(1) hue-rotate(180deg) saturate(0.3) brightness(0.85) contrast(0.9); } }
.year .register { border-top: 0; }
.yr-reading { margin: 0 0 -24px; font-size: var(--t-sm); color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.yr-reading form.inline { display: inline; }
.dotpulse { width: 8px; height: 8px; border-radius: 50%; background: var(--carolina); animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.row-sub.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* ---- Insight: one photo read closely, its regions boxed over the picture ---- */
.ins-status { display: flex; flex-direction: column; gap: 4px; margin-bottom: -24px; font-size: var(--t-sm); color: var(--ink-2); }
.ins-status p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-tally { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.ins-tally div { display: flex; flex-direction: column-reverse; gap: 2px; }
.ins-tally dt { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.ins-tally dd { margin: 0; font-family: var(--serif); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ins-table { min-width: 780px; }
.ins-table td { vertical-align: middle; }
.ins-table td.title a { font-size: var(--t-sm); }
.ins-sure { font-weight: 600; color: var(--ok-ink); font-variant-numeric: tabular-nums; }
.ins-sure.low { color: var(--tally-ink); }

.ins-photo-page { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.ins-pic-col { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ins-pic-col .segmented { align-self: flex-start; }
.ins-frame { position: relative; margin: 0; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--rule), var(--shadow-sm); background: var(--hover); }
.ins-frame img { display: block; width: 100%; height: auto; }
.ins-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ins-box rect { fill: none; stroke: var(--carolina); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.ins-box circle { fill: var(--carolina); }
.ins-box text { fill: var(--on-carolina); font-family: var(--font); font-weight: 700; }
.ins-box.hot rect { stroke: var(--tally); stroke-width: 4px; }
.ins-box.hot circle { fill: var(--tally); }
.ins-box.hot text { fill: #fff; }
.ins-info-col { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.ins-info-col section { display: flex; flex-direction: column; gap: 10px; }
.ins-h { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--t-lg); letter-spacing: -0.02em; }
.ins-scene { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.5; font-variation-settings: "opsz" 24; }
.ins-conflict { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.ins-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--ink-2); padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.ins-reg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.ins-reg-head span { font-size: var(--t-xs); color: var(--muted); }
.ins-rows { display: flex; flex-direction: column; }
.ins-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 6px; border-bottom: 1px solid var(--hair); font-size: var(--t-sm); transition: background-color var(--fast) var(--ease); }
.ins-row.plain { grid-template-columns: minmax(0, 1fr) auto; }
.ins-row.ev { grid-template-columns: 64px minmax(0, 1fr) auto; }
.ins-row:hover, .ins-row.hot { background: var(--hover); }
.ins-row b { font-weight: 600; color: var(--ink); }
.ins-row .row-sub { display: block; margin-top: 2px; }
.ins-row q { color: var(--ink); font-style: italic; }
.ins-row:target { background: var(--carolina-soft); }
.ins-num { width: 22px; height: 22px; border-radius: 50%; background: var(--carolina); color: var(--on-carolina); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.ins-row.hot .ins-num { background: var(--tally); color: #fff; }
.ins-px { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-key, .ins-cite { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); background: var(--hover); border: 1px solid var(--hair); border-radius: var(--r); padding: 1px 6px; justify-self: start; white-space: nowrap; text-decoration: none; }
.ins-cites { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ins-cite:hover { color: var(--carolina-ink); border-color: var(--carolina); }
.ins-row details { margin-top: 4px; }
.ins-row summary { cursor: pointer; font-size: var(--t-xs); color: var(--carolina-ink); font-weight: 500; }
.ins-mail { margin: 6px 0 0; font-size: var(--t-xs); line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; }
.ins-q { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: var(--t-sm); }
.ins-q-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.small-btn { height: 30px; padding: 0 12px; font-size: var(--t-xs); }
.ins-other { height: 30px; width: 150px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--raised); font-size: var(--t-xs); }
.ins-other:focus { outline: none; border-color: var(--carolina-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--carolina) 30%, transparent); }
.ins-set { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r); color: inherit; text-decoration: none; font-size: var(--t-sm); transition: background-color var(--fast) var(--ease); }
.ins-set:hover { background: var(--hover); }
.ins-set b { font-weight: 600; }
.ins-set .row-sub { display: block; margin-top: 2px; }
.ins-set > svg { transform: rotate(180deg); color: var(--muted); }
.set-sheet .ptile-n { font-size: 11px; }
.set-sheet .ptile:target .ptile-pic { box-shadow: 0 0 0 3px var(--carolina); }
.set-sheet .ptile.repeat .ptile-pic img { opacity: 0.55; }
.ins-row.rec { grid-template-columns: 132px minmax(0, 1fr); }
.ins-row.rec .ins-key { white-space: normal; }
.rec-val { white-space: pre-line; color: var(--ink); }
@media (max-width: 1000px) {
  .ins-photo-page { grid-template-columns: minmax(0, 1fr); }
  .ins-pic-col { position: static; }
}
@media (max-width: 760px) {
  .ins-step, .ins-px { display: none; }
  .ins-row { grid-template-columns: 26px minmax(0, 1fr); }
}

/* Find, filter and sort on the list pages (_controls.html) */
.list-ctl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 20px; }
.list-ctl .ctl-find { width: 260px; height: 38px; }
.list-ctl .ctl { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.list-ctl .ctl select { height: 38px; min-width: 132px; font-weight: 400; }
.list-ctl .ctl-clear { align-self: flex-end; }
@media (max-width: 760px) {
  .list-ctl .ctl-find { width: 100%; }
  .list-ctl .ctl { flex: 1 1 40%; }
  .list-ctl .ctl select { width: 100%; }
}

/* Settings' Setup checklist */
.setup-reg { --cols: 28px minmax(0, 1fr) minmax(120px, 260px); }
.setup-reg .register-row { align-items: start; padding-top: 14px; padding-bottom: 14px; }
.setup-mark { width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--rule-strong, var(--rule)); display: inline-flex; align-items: center; justify-content: center; color: var(--on-carolina, #fff); }
.setup-reg .ok .setup-mark { background: var(--carolina-ink); border-color: var(--carolina-ink); color: #fff; }
.setup-fix { color: var(--ink); }
.setup-state { text-align: right; }
@media (max-width: 760px) { .setup-reg { --cols: 28px minmax(0, 1fr); } .setup-state { grid-column: 2; text-align: left; } }

/* The photo page: the picture leads, the technical details fold away */
.photo-doc .photo-pic { max-height: 520px; width: auto; max-width: 100%; margin: 0 0 28px; }
.more-details { margin-top: 40px; }
.more-details summary { cursor: pointer; list-style: none; font-size: var(--t-sm); margin-bottom: 14px; display: inline-block; }
.more-details summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) {
  .find-form { grid-template-columns: 1fr 1fr; }
  .find-form .find-box { grid-column: 1 / -1; }
}

/* A grouped Inbox card shows its photos as a mosaic */
.card-pic.mosaic { display: grid; gap: 2px; background: var(--hair); }
.card-pic.mosaic.n2 { grid-template-columns: 1fr 1fr; }
.card-pic.mosaic.n3, .card-pic.mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.card-pic.mosaic.n3 img:first-child { grid-row: span 2; }
.card-pic.mosaic img { min-height: 0; }
.card-pic .ptile-flag { position: absolute; left: 4px; bottom: 4px; }

/* Sell: one listing, posted anywhere */
.sell-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 28px; }
.sell-photos a { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--hover); box-shadow: 0 0 0 1px var(--hair); }
.sell-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sell-photos .small-flag { position: absolute; left: 4px; bottom: 4px; }
.sell-form { display: grid; gap: 14px; margin-bottom: 18px; }
.sell-form .row2 { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 14px; }
.sell-form label { display: flex; flex-direction: column; gap: 5px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.sell-form .field, .sell-form textarea { font-weight: 400; }
.sell-form textarea { min-height: 150px; padding: 10px 11px; line-height: 1.5; resize: vertical; height: auto; }
.sell-post { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 10px; }
.sell-listed { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: var(--t-sm); }
.sell-listed label { display: inline-flex; gap: 6px; align-items: center; }
.sell-check li { margin: 4px 0; }
@media (max-width: 760px) { .sell-form .row2 { grid-template-columns: 1fr 1fr; } .sell-form .row2 label:last-child { grid-column: 1 / -1; } }
