/* Hallmark · shape: app screen · genre: editorial · theme: custom · redesign: full
 * idea: "every group is a passport; every place a visa stamp a friend pressed in, in their own ink" · vibe: "a well-travelled passport passed between friends"
 * paper: oklch(95.6% 0.016 84) visa-page stock · accent: oklch(40% 0.13 18) maroon cover cloth · display: Castoro · body: Golos Text · outlier: Shantell Sans (handwritten reviews and remarks only)
 * nav: running head (back, title) over a bottom tab bar with a raised Add · signature: the rating stamp, in the contributor's ink, pressed by holding · states: loading, empty, error, offline, full
 * axes: light/roman-serif/chromatic-red · posture: committed (cover screens only; restrained everywhere inside the app) · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V5 · weakest: P/R, the metaphor could turn into costume; kept the real nouns (group, category, place) and let only objects that carry data (the stamp, the booklet, the arrival card, the data page) take the passport form */
/* Hallmark · waive 65 · warm paper and a maroon accent were both pinned by the user's answers (warm paper and ink, maroon) · TrustWord is a passport whose cloth is maroon; the display is Castoro, a low-contrast old style, and the maroon sits at hue 18, not clay */
/* Hallmark · dropped ${TW.esc(n.link)}, friends.html · neither is gone: both links moved from inline scripts into assets/js/pages/notifications.js and add-friend.js, and friends.html is also the running-head back link */
/* Hallmark · reworded "TrustWord" to "Sign in" · the brand moved from the h1 into the cover wordmark, and the sheet's heading names the task */
/* Hallmark · dropped crumbs, controls, title, radius, confirm-user · breadcrumbs became the running head, the search form became a radio group named radius, the search title moved to s-title, and confirm-user now renders inside the delete-account sheet from profile.js */
/* Hallmark · answered F4 · the filled destroy button only appears inside a confirmation sheet, which is its own page */
/* Hallmark · finish-review: subagent · 8 findings · 5 resolved (dead bands, file input cell, duplicate member photos, control size and unread marker, stamped-by wrap), 3 kept by decision (desktop stays a phone column on a desk for a mobile-first PWA; booklet cloths vary like real passports; selections are the ink colour, not a new voice) · gap: Alerts and Friends carry no passport device yet */
/* Hallmark · answered F7 · every text field is one recipe on purpose: the arrival card's boxed cell */
@import url("./tokens.css");
@import url("./base.css");

/* ------------------------------------------------------------ Shell ---- */
html { scroll-padding-top: calc(var(--bar-h) + var(--space-md)); -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; background: var(--color-paper); overscroll-behavior-y: none; }
body.app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-lg)); }
.book { width: 100%; max-width: var(--column); margin-inline: auto; min-height: 100dvh; background: var(--color-paper); position: relative; }
.page { padding: var(--space-md) var(--gutter) var(--space-xl); display: grid; gap: var(--space-xl); }
.page > * { min-width: 0; }
.page > #msg:empty { display: none; }
.page > .section-head { margin-bottom: calc(var(--space-sm) - var(--space-xl)); }

@media (min-width: 48rem) {
  body { background: var(--color-desk); }
  body.app { padding-bottom: 0; }
  .book { margin-block: var(--space-lg) calc(var(--tabbar-h) + var(--space-xl)); min-height: calc(100dvh - var(--space-lg) - var(--tabbar-h) - var(--space-xl)); border-radius: var(--radius-book); box-shadow: var(--shadow-card); }
}

.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); border-radius: var(--radius-input); }
.skip:focus-visible { top: var(--space-md); outline-color: var(--color-paper); }

/* Running head */
.runhead { position: sticky; top: 0; z-index: var(--z-sticky-nav); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--space-xs); min-height: var(--bar-h); padding: 0 var(--space-xs); padding-top: env(safe-area-inset-top); background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-rule); }
@media (min-width: 48rem) { .runhead { border-radius: var(--radius-book) var(--radius-book) 0 0; } }
.runhead__title { font: 400 var(--text-lg)/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runhead__title small { display: block; font: 400 var(--text-xs)/1.3 var(--font-body); color: var(--color-muted); }
.runhead__end { display: flex; gap: var(--space-2xs); }
.wordmark { font: 400 var(--text-xl)/1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-accent); text-decoration: none; padding-left: var(--space-xs); }

/* Bottom tab bar */
.tabbar { position: fixed; z-index: var(--z-sticky-nav); left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: var(--column); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 var(--space-2xs) env(safe-area-inset-bottom); background: var(--color-paper-2); border-top: var(--rule-hair) solid var(--color-rule); }
@media (min-width: 48rem) { .tabbar { bottom: var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-book); padding-bottom: 0; height: var(--tabbar-h); } }
.tab { appearance: none; border: 0; background: transparent; font-family: var(--font-body); cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3xs); height: var(--tabbar-h); color: var(--color-muted); text-decoration: none; font-size: var(--text-sm); border-radius: var(--radius-card); transition: color var(--dur-short) var(--ease-out); }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--color-accent); font-weight: 600; }
.tab:hover { color: var(--color-ink); }
.tab:active svg { transform: translateY(1px); }
.tab:focus-visible { outline-offset: -4px; }
.tab__badge { position: absolute; top: var(--space-xs); left: calc(50% + var(--space-2xs)); min-width: 18px; height: 18px; padding: 0 var(--space-2xs); border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font: 600 var(--text-xs)/18px var(--font-body); text-align: center; font-variant-numeric: tabular-nums; }
.tab--add { color: var(--color-ink); }
.tab--add .tab__disc { display: grid; place-items: center; width: 60px; height: 60px; margin-top: calc(-1 * var(--space-lg)); border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); box-shadow: var(--shadow-card), 0 0 0 4px var(--color-paper-2); transition: transform var(--dur-micro) var(--ease-out); }
.tab--add .tab__disc svg { width: 28px; height: 28px; }
.tab--add:hover { color: var(--color-ink); }
.tab--add:active .tab__disc { transform: translateY(2px) scale(0.97); }

/* ------------------------------------------------------------ Type ---- */
.h-display { font: 400 var(--text-display)/1.08 var(--font-display); letter-spacing: var(--tracking-display); }
.h-section { font: 400 var(--text-xl)/1.15 var(--font-display); letter-spacing: var(--tracking-display); }
.h-title { font: 400 var(--text-lg)/1.2 var(--font-display); }
.meta { font-size: var(--text-sm); color: var(--color-muted); }
.meta strong { color: var(--color-ink-2); font-weight: 600; }
.lede { color: var(--color-ink-2); max-width: 45ch; }
.hand { font-family: var(--font-outlier); font-weight: 400; color: var(--color-ink-2); }
.num { font-variant-numeric: tabular-nums; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-sm); }

/* ------------------------------------------------------------ Controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 48px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-accent); border-radius: var(--radius-input); background: var(--color-accent); color: var(--color-accent-ink); font: 600 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; box-shadow: var(--shadow-card); transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:hover { background: var(--color-focus); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--block { width: 100%; }
.btn--quiet { background: var(--color-paper); color: var(--color-ink); border-color: var(--color-muted); }
.btn--quiet:hover { background: var(--color-paper-2); }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: transparent; box-shadow: none; min-height: 44px; padding: 0 var(--space-sm); }
.btn--ghost:hover { background: var(--color-paper-2); }
.btn--danger { background: var(--color-paper); color: var(--color-error); border-color: var(--color-error); }
.btn--danger:hover { background: var(--color-paper-2); }
.btn--destroy { background: var(--color-error); border-color: var(--color-error); color: var(--color-accent-ink); }
.btn--destroy:hover { background: var(--color-closed); }
.btn--small { min-height: 44px; padding: 0 var(--space-md); font-size: var(--text-sm); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-ink); cursor: pointer; text-decoration: none; transition: background-color var(--dur-short) var(--ease-out); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--color-paper-2); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.link { color: var(--color-accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.link:hover { text-decoration-thickness: 2px; }

/* Fields, set like an arrival card: boxed cells, label in the box */
.field { display: grid; gap: var(--space-2xs); }
.field > label, .legend { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.field .help { min-height: 1lh; font-size: var(--text-sm); color: var(--color-muted); }
.field .help.is-error { color: var(--color-error); }
.input, .field input:not([type=radio]):not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input);
  background: var(--color-paper); color: var(--color-ink); font-size: var(--text-md); outline: 2px solid transparent; outline-offset: -3px;
  transition: background-color var(--dur-short) var(--ease-out);
}
.field textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
.field input:hover, .field select:hover, .field textarea:hover, .input:hover { background: var(--color-paper-2); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .input:focus-visible { outline-color: var(--color-focus); }
.field [aria-invalid="true"] { border-color: var(--color-error); }
.field input:disabled, .field select:disabled { opacity: 0.55; cursor: not-allowed; }
.field input[type=file] { width: 100%; min-height: 48px; padding: var(--space-2xs); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; }
.field input[type=file]:hover { background: var(--color-paper-2); }
.field input[type=file]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -3px; }
.field input[type=file]::file-selector-button { margin-right: var(--space-sm); min-height: 40px; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); color: var(--color-ink); font: 600 var(--text-sm) var(--font-body); cursor: pointer; }
.row { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--split { justify-content: space-between; }
.input-row { display: flex; gap: var(--space-xs); }
.input-row > input { flex: 1; min-width: 0; }

/* A choice between a few: ticked boxes, like the card's yes/no */
.ticks { display: flex; flex-wrap: wrap; gap: var(--space-xs); border: 0; padding: 0; margin: 0; }
.ticks legend { margin-bottom: var(--space-xs); padding: 0; }
.ticks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ticks label { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.ticks label::before { content: ""; width: 18px; height: 18px; border: 2px solid var(--color-ink-2); border-radius: 3px; flex-shrink: 0; }
.ticks label:hover { background: var(--color-paper-2); }
.ticks input:checked + label { border-color: var(--color-ink); font-weight: 600; }
.ticks input:checked + label::before { background: var(--color-ink); box-shadow: inset 0 0 0 3px var(--color-paper); border-color: var(--color-ink); }
.ticks input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.ticks input:active + label { transform: translateY(1px); }

/* Segmented control (radius, list/pages) */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); overflow: hidden; background: var(--color-paper); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: flex; align-items: center; justify-content: center; gap: var(--space-2xs); min-height: 44px; padding: 0 var(--space-sm); font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); cursor: pointer; border-left: var(--rule-hair) solid var(--color-rule); white-space: nowrap; transition: background-color var(--dur-short) var(--ease-out); }
.seg label:first-of-type { border-left: 0; }
.seg label:hover { background: var(--color-paper-2); }
.seg input:checked + label { background: var(--color-ink); color: var(--color-paper); }
.seg input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: -3px; }

/* ------------------------------------------------------------ The stamp ---- */
.stamp { --ink: var(--color-stamp-1); --size: 76px; position: relative; flex-shrink: 0; display: grid; place-content: center; justify-items: center; width: var(--size); height: var(--size); border: 2px solid var(--ink); border-radius: var(--radius-pill); box-shadow: inset 0 0 0 3px var(--color-paper), inset 0 0 0 4px var(--ink); color: var(--ink); transform: rotate(var(--tilt, -6deg)); filter: url(#ink-rough); text-align: center; line-height: 1; }
.stamp__num { font: 400 calc(var(--size) * 0.42)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.stamp__of { font: 600 calc(var(--size) * 0.12)/1.2 var(--font-body); }
.stamp__who { max-width: calc(var(--size) * 0.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 calc(var(--size) * 0.1)/1.3 var(--font-body); }
.stamp--lg { --size: 136px; }
.stamp[data-ink="2"] { --ink: var(--color-stamp-2); }
.stamp[data-ink="3"] { --ink: var(--color-stamp-3); }
.stamp[data-ink="4"] { --ink: var(--color-stamp-4); }
.stamp.is-pressed { animation: stamp-down var(--dur-long) var(--ease-out); }
@keyframes stamp-down { 0% { transform: rotate(var(--tilt, -6deg)) scale(1.35); opacity: 0; } 45% { transform: rotate(var(--tilt, -6deg)) scale(0.96); opacity: 1; } 100% { transform: rotate(var(--tilt, -6deg)) scale(1); } }

/* Stamp pad: hold to stamp a rating, or tap a number */
.stamppad { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-md); align-items: center; padding: var(--space-md); border: var(--rule-hair) dashed var(--color-muted); border-radius: var(--radius-card); background: var(--color-paper-2); }
.stamppad__press { position: relative; display: grid; place-items: center; width: 136px; height: 136px; padding: 0; border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stamppad__press:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.stamppad__press:disabled { opacity: 0.55; cursor: not-allowed; }
.stamppad__press .stamp { pointer-events: none; }
.stamppad__press.is-empty .stamp { --ink: var(--color-muted); opacity: 0.55; }
.stamppad__press.is-holding .stamp { transform: rotate(var(--tilt, -6deg)) translateY(-4px) scale(1.04); transition: transform var(--dur-short) var(--ease-out); }
.stamppad__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.stamppad__ring circle { fill: none; stroke: var(--color-accent); stroke-width: 4; stroke-dasharray: 100; stroke-dashoffset: var(--fill, 100); }
.stamppad__how { font-size: var(--text-sm); color: var(--color-ink-2); }
.numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2xs); margin-top: var(--space-sm); border: 0; padding: 0; }
.numbers input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.numbers label { display: grid; place-items: center; min-height: 44px; border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.numbers label:hover { background: var(--color-paper-3); }
.numbers input:checked + label { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.numbers input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.numbers input:active + label { transform: translateY(1px); }
@media (max-width: 22rem) { .stamppad { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

/* ------------------------------------------------------------ Booklets (groups) ---- */
.shelf { display: grid; gap: var(--space-md); list-style: none; margin: 0; padding: 0; }
.booklet { --cloth: var(--color-cover-1); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-sm); min-height: 132px; padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-xl); border-radius: var(--radius-card) var(--radius-book) var(--radius-book) var(--radius-card); background: var(--cloth); color: var(--color-foil); text-decoration: none; box-shadow: var(--shadow-card), inset 14px 0 0 color-mix(in oklab, var(--cloth) 78%, var(--color-ink)); transition: transform var(--dur-short) var(--ease-out); }
.booklet[data-cloth="2"] { --cloth: var(--color-cover-2); }
.booklet[data-cloth="3"] { --cloth: var(--color-cover-3); }
.booklet[data-cloth="4"] { --cloth: var(--color-cover-4); }
.booklet:hover { transform: translateY(-2px); }
.booklet:active { transform: translateY(1px); }
.booklet:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.booklet__name { font: 400 var(--text-2xl)/1.1 var(--font-display); letter-spacing: var(--tracking-display); overflow-wrap: break-word; min-width: 0; }
.booklet__meta { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-foil); }
.booklet__owner { align-self: start; font-size: var(--text-xs); font-weight: 600; padding: var(--space-3xs) var(--space-xs); border: var(--rule-hair) solid var(--color-foil); border-radius: var(--radius-input); }

/* ------------------------------------------------------------ Data page (group header, profile) ---- */
.datapage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); padding-bottom: var(--space-lg); border-bottom: 2px solid var(--color-ink); }
.datapage dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2xs) var(--space-md); margin: 0; font-size: var(--text-sm); }
.datapage dt { color: var(--color-muted); }
.datapage dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.photos { display: flex; flex-wrap: wrap; gap: var(--space-xs); list-style: none; margin: 0; padding: 0; }
.idphoto { width: 48px; height: 60px; border-radius: 3px; object-fit: cover; background: var(--color-paper-3); color: var(--color-ink-2); display: inline-grid; place-items: center; font: 400 var(--text-xl)/1 var(--font-display); text-transform: uppercase; outline: 1px solid var(--color-rule); outline-offset: -1px; flex-shrink: 0; }
.idphoto--sm { width: 32px; height: 40px; font-size: var(--text-md); }
.idphoto--lg { width: 108px; height: 136px; font-size: var(--text-3xl); }

/* Contents: categories with leader dots */
.contents { list-style: none; margin: 0; padding: 0; counter-reset: chapter; }
.contents li { counter-increment: chapter; }
.contents a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-xs); min-height: 52px; padding: var(--space-sm) 0; color: var(--color-ink); text-decoration: none; border-bottom: var(--rule-hair) solid var(--color-rule); transition: background-color var(--dur-short) var(--ease-out); }
.contents a::before { content: counter(chapter); font: 400 var(--text-md)/1 var(--font-display); color: var(--color-muted); font-variant-numeric: tabular-nums; min-width: 1.5em; }
/* Category colours: a spine on the contents row and its number in the category's own colour. */
[data-color="1"] { --cat: var(--color-cat-1); } [data-color="2"] { --cat: var(--color-cat-2); }
[data-color="3"] { --cat: var(--color-cat-3); } [data-color="4"] { --cat: var(--color-cat-4); }
[data-color="5"] { --cat: var(--color-cat-5); } [data-color="6"] { --cat: var(--color-cat-6); }
[data-color="7"] { --cat: var(--color-cat-7); } [data-color="8"] { --cat: var(--color-cat-8); }
.contents a[data-color] { padding-left: var(--space-sm); box-shadow: inset 4px 0 0 var(--cat); }
.contents a[data-color]::before { color: var(--cat); font-weight: 400; }
.cat-stripe { height: 6px; border-radius: var(--radius-pill); background: var(--cat, var(--color-rule)); }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.swatches { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: 0; padding: 0; border: 0; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches label { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-pill); background: var(--cat); color: var(--color-accent-ink); cursor: pointer; box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 3px transparent; transition: transform var(--dur-micro) var(--ease-out); }
.swatches label:hover { transform: scale(1.06); }
.swatches label svg { width: 22px; height: 22px; opacity: 0; }
.swatches input:checked + label { box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-ink); }
.swatches input:checked + label svg { opacity: 1; }
.swatches input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 5px; }
.contents a:hover { background: var(--color-paper-2); }
.contents a:active { transform: translateY(1px); }
.contents a:focus-visible { outline-offset: -2px; }
.contents__name { font: 400 var(--text-lg)/1.25 var(--font-display); display: flex; align-items: baseline; gap: var(--space-xs); min-width: 0; }
.contents__name::after { content: ""; flex: 1; min-width: var(--space-md); border-bottom: 2px dotted var(--color-rule); transform: translateY(-4px); }
.contents__count { font-size: var(--text-sm); color: var(--color-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Plain list rows (members, friends) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: var(--space-sm); min-height: 60px; padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.rows > li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .name { font-weight: 600; overflow-wrap: anywhere; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-xs); border: var(--rule-hair) solid currentColor; border-radius: var(--radius-input); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.tag--accent { color: var(--color-accent); }
.tag--quiet { color: var(--color-muted); }

/* Meet-ups: a date block (the day stamped on maroon cloth), the place, and your answer. */
/* Location picker: link or coordinates, "I'm here", a map to tap or drag, and a far-away check. */
.lp { display: grid; gap: var(--space-sm); }
.lp-ways { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.lp-ways .btn svg { width: 18px; height: 18px; }
.lp-ways .btn[aria-busy="true"] { opacity: 0.6; }
.lp-note { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-card); background: var(--color-paper-2); font-size: var(--text-sm); line-height: 1.5; }
.lp-note strong { font-weight: 600; }
.lp-note--ok { box-shadow: inset 3px 0 0 var(--color-open); }
.lp-note--step { box-shadow: inset 3px 0 0 var(--color-accent); }
.lp-note--warn { box-shadow: inset 3px 0 0 var(--color-unknown); }
.lp-steps { margin: var(--space-xs) 0; padding-left: 1.3em; display: grid; gap: var(--space-2xs); }
.lp-map-wrap { display: grid; gap: var(--space-2xs); }
.lp-map { height: 260px; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-3); z-index: var(--z-base); }
.lp-pin svg { width: 28px; height: 40px; filter: drop-shadow(0 2px 2px oklch(25% 0.03 60 / 0.35)); }
.lp-pin path { fill: var(--color-accent); }
.lp-pin circle { fill: var(--color-paper); }
.nopin { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs); align-items: start; font-size: var(--text-sm); }
.nopin input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--color-accent); }
.nopin input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.credit { font-size: var(--text-xs); color: var(--color-muted); text-align: center; }
.link-added { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-card); background: var(--color-paper-2); font-size: var(--text-sm); box-shadow: inset 3px 0 0 var(--color-open); }
.link-added span { font-weight: 600; flex: 1; min-width: 8rem; }

/* "Also add it to": one row per other group, a tick and that group's category. */
.also-list { display: grid; gap: var(--space-sm); }
.also-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs) var(--space-sm); align-items: center; }
.also-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--color-accent); }
.also-row input[type=checkbox]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.also-row label { font-weight: 600; overflow-wrap: anywhere; }
.also-row select { grid-column: 2; }

.meets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.meet { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-md); align-items: center; padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); text-decoration: none; transition: background-color var(--dur-short) var(--ease-out); }
.meet:hover { background: var(--color-paper-2); }
.meet:active { transform: translateY(1px); }
.meet:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.meet__date { display: grid; justify-items: center; min-width: 3.25rem; padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-card); background: var(--color-accent); color: var(--color-accent-ink); font: 400 var(--text-xl)/1 var(--font-display); }
.meet__date small { font: 600 var(--text-xs)/1.5 var(--font-body); }
.meet__body { display: grid; gap: var(--space-3xs); min-width: 0; }
.meet__name { font: 400 var(--text-lg)/1.2 var(--font-display); overflow-wrap: break-word; }
.meet.is-cancelled .meet__name { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--color-muted); }
.meet.is-cancelled .meet__date { background: var(--color-muted); }

/* ------------------------------------------------------------ Visa entries (places) ---- */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.flip { display: grid; perspective: 1200px; }
.flip__inner { display: grid; transform-style: preserve-3d; transition: transform var(--dur-long) var(--ease-in-out); }
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip__inner { position: relative; }
.flip__face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; min-width: 0; }
/* Both faces share one grid cell, so a card is as tall as its taller face: no scrolling inside a card. */
.flip__face.flip__face--back { transform: rotateY(180deg); }
.visa { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-md); align-items: start; padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); touch-action: pan-y; }
.visa--back { grid-template-columns: minmax(0, 1fr) auto; background: var(--color-paper-2); }
.visa__name { font: 400 var(--text-lg)/1.2 var(--font-display); color: var(--color-ink); text-decoration: none; overflow-wrap: break-word; }
.visa__name:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
.visa__name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.visa__name:focus-visible { outline: none; }
.visa__name:focus-visible::after { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.visa__where { margin-top: var(--space-3xs); font-size: var(--text-sm); color: var(--color-muted); }
.visa__by { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); }
.visa__facts { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); margin: var(--space-xs) 0 0; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--color-ink-2); }
.visa__facts li { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.visa__facts svg { width: 16px; height: 16px; flex-shrink: 0; }
.visa__facts .is-no { color: var(--color-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.visa__side { position: relative; z-index: var(--z-raised); display: grid; gap: var(--space-2xs); justify-items: end; }
.visa__thumb { width: 60px; height: 60px; border-radius: 3px; object-fit: cover; border: 3px solid var(--color-paper); box-shadow: var(--shadow-card); transform: rotate(3deg); }
.visa__back-body { display: grid; gap: var(--space-xs); min-width: 0; font-size: var(--text-sm); }
.visa__back-body .hand { font-size: var(--text-md); overflow-wrap: break-word; }
.visa__back-actions { position: relative; z-index: var(--z-raised); display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-2xs); }

.status { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 600; }
.status svg { width: 16px; height: 16px; }
.status--open { color: var(--color-open); }
.status--closed { color: var(--color-closed); }
.status--unknown { color: var(--color-unknown); }

/* ------------------------------------------------------------ Place page ---- */
.visa-page { display: grid; gap: var(--space-lg); touch-action: pan-y; }
.visa-page__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-md); align-items: start; }
.pasted { position: relative; margin: 0; padding: var(--space-xs) var(--space-xs) var(--space-lg); background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule); box-shadow: var(--shadow-card); transform: rotate(-1.2deg); max-width: 100%; }
.pasted img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pasted figcaption { position: absolute; left: var(--space-xs); bottom: var(--space-2xs); font-size: var(--text-xs); color: var(--color-muted); }
.visa-page__stamp { margin-top: calc(-1 * var(--space-2xl)); margin-right: var(--space-xs); justify-self: end; position: relative; z-index: var(--z-raised); }
.visa-page__stamp--side { margin: 0; }
.visa-page__stamp--side .stamp { --size: 112px; }
.visa-page__stamp .stamp { background: color-mix(in oklab, var(--color-paper) 70%, transparent); }
.conditions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: var(--rule-hair) solid var(--color-rule); border-bottom: var(--rule-hair) solid var(--color-rule); }
.conditions > div { padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; }
.conditions > div + div { padding-left: var(--space-sm); border-left: var(--rule-hair) solid var(--color-rule); }
.conditions dt { font-size: var(--text-xs); color: var(--color-muted); }
.conditions dd { margin: var(--space-3xs) 0 0; font-weight: 600; }
.writing { padding: var(--space-md) var(--space-lg); border-radius: var(--radius-card); background: var(--color-paper-2) repeating-linear-gradient(transparent 0 calc(1.6em - 1px), var(--color-rule) calc(1.6em - 1px) 1.6em); background-position: 0 calc(var(--space-md) + 0.3em); font-family: var(--font-outlier); font-size: var(--text-lg); line-height: 1.6; color: var(--color-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.hours { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.hours th { width: 3.5rem; padding: var(--space-xs) 0; text-align: left; font-weight: 600; color: var(--color-ink-2); }
.hours td { padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.hours th { border-bottom: var(--rule-hair) solid var(--color-rule); }
.hours tr.is-today th, .hours tr.is-today td { color: var(--color-accent); font-weight: 600; }
.history { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-md); }
.history li { display: grid; justify-items: center; gap: var(--space-xs); font-size: var(--text-xs); color: var(--color-muted); text-align: center; }
.history .stamp { --size: 60px; opacity: 0.75; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { padding: var(--space-md) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.note:last-child { border-bottom: 0; }
.note__by { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-sm); }
.note__by .grow { flex: 1; min-width: 0; }
.note__body { margin-top: var(--space-xs); font-family: var(--font-outlier); font-size: var(--text-lg); line-height: 1.5; color: var(--color-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-xs); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.pager__folio { font-size: var(--text-sm); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.pager > :last-child { justify-self: end; }

/* ------------------------------------------------------------ Search ---- */
.searchbar { display: grid; gap: var(--space-sm); }
.searchbar .seg { width: 100%; }
.pull { display: grid; place-items: center; height: 0; overflow: visible; color: var(--color-muted); font-size: var(--text-sm); }
.pull__tab { display: flex; align-items: center; gap: var(--space-xs); transform: translateY(-36px); opacity: var(--pull-o, 1); }
.pull__tab svg { width: 18px; height: 18px; transform: rotate(var(--pull-r, 0deg)); }
.pull-target { transform: translateY(var(--pull, 0px)); }
.pull-target.is-settling, .pull__tab.is-settling { transition: transform var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out); }
.notice { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-card); background: var(--color-paper-2); font-size: var(--text-sm); }
.notice--warn { border: var(--rule-hair) solid var(--color-unknown); }
.notice--error { border: var(--rule-hair) solid var(--color-error); color: var(--color-ink); }
.notice strong { font-weight: 600; }

/* ------------------------------------------------------------ Empty, loading ---- */
.empty { display: grid; gap: var(--space-sm); justify-items: start; align-content: start; padding: var(--space-xl) 0; }
.empty h2 { font: 400 var(--text-xl)/1.2 var(--font-display); }
.empty p { color: var(--color-ink-2); max-width: 48ch; }
.skeleton { border-radius: var(--radius-card); background: var(--color-paper-2); }
.skeleton--entry { height: 112px; }
.skeleton--book { height: 132px; }
.js .skeleton { animation: breathe 1.4s var(--ease-in-out) infinite alternate; }
@keyframes breathe { from { opacity: 1; } to { opacity: 0.55; } }

/* ------------------------------------------------------------ Disclosure ---- */
details.more { border-top: var(--rule-hair) solid var(--color-rule); }
details.more > summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; cursor: pointer; font-weight: 600; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; font: 400 var(--text-xl)/1 var(--font-display); color: var(--color-muted); }
details.more[open] > summary::after { content: "\2212"; }
details.more > summary:focus-visible { outline-offset: -2px; }
details.more > summary:hover { color: var(--color-accent); }

/* ------------------------------------------------------------ Schedule editor ---- */
.sched { display: grid; gap: var(--space-2xs); }
.sched-day { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--space-xs); align-items: start; padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.sched-day:last-child { border-bottom: 0; }
.sched-day .day-name { padding-top: var(--space-sm); font-weight: 600; }
.sched-intervals { display: grid; gap: var(--space-xs); }
.sched-intervals select, .sched-interval input[type=time] { min-height: 44px; padding: 0 var(--space-xs); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); color: var(--color-ink); outline: 2px solid transparent; outline-offset: -3px; }
.sched-intervals select:focus-visible, .sched-interval input:focus-visible { outline-color: var(--color-focus); }
.sched-interval { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.sched-interval input[type=time] { width: 7.5rem; }
.day-toggles { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.day-toggles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-toggles span { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 var(--space-xs); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-paper); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.day-toggles input:checked + span { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.day-toggles input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.well { display: grid; gap: var(--space-sm); padding: var(--space-md); border-radius: var(--radius-card); background: var(--color-paper-2); }

/* Arrival card (add place) */
.card-form { display: grid; gap: var(--space-lg); counter-reset: part; }
.card-form__part { display: grid; gap: var(--space-md); padding-top: var(--space-md); border-top: 2px solid var(--color-ink); }
.card-form__part > h2 { display: flex; gap: var(--space-xs); align-items: baseline; font: 400 var(--text-lg)/1.2 var(--font-display); }
.card-form__part > h2::before { counter-increment: part; content: counter(part); min-width: 1.2em; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.located { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs); align-items: start; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-card); background: var(--color-paper-2); font-size: var(--text-sm); }
.located svg { width: 20px; height: 20px; color: var(--color-open); }
.located.is-error svg { color: var(--color-error); }
.located.is-approx svg { color: var(--color-unknown); }
.located__map { grid-column: 1 / -1; width: 100%; height: 180px; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-3); }

/* ------------------------------------------------------------ Auth: the cover ---- */
.cover { min-height: 100dvh; display: grid; grid-template-rows: minmax(36dvh, 1fr) auto; background: var(--color-cover-1); color: var(--color-foil); }
.cover__front { display: grid; align-content: center; justify-items: start; gap: var(--space-sm); width: 100%; max-width: var(--column); margin-inline: auto; padding: var(--space-2xl) var(--space-lg) var(--space-xl); }
.cover__mark { font: 400 clamp(3rem, 14vw, 4.5rem)/0.95 var(--font-display); letter-spacing: -0.02em; color: var(--color-foil); }
.cover__line { font-size: var(--text-lg); color: var(--color-foil); max-width: 24ch; }
.cover__sheet { width: 100%; max-width: var(--column); margin-inline: auto; padding: var(--space-lg) var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom)); background: var(--color-paper); color: var(--color-ink); border-radius: var(--radius-book) var(--radius-book) 0 0; display: grid; gap: var(--space-md); }
@media (min-width: 48rem) { .cover__sheet { border-radius: var(--radius-book); margin-bottom: var(--space-2xl); } }
.cover__sheet > div:empty { display: none; }
.invite-link { display: block; padding: var(--space-sm); border-radius: var(--radius-input); background: var(--color-paper-2); font-size: var(--text-sm); overflow-wrap: anywhere; user-select: all; }
.cover__sheet h1 { font: 400 var(--text-2xl)/1.1 var(--font-display); }
.or { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--color-rule); }

/* Install wall: on phones the app only runs installed; the cover sheet holds the steps. */
.install { display: grid; gap: var(--space-md); }
.install-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); counter-reset: step; }
.install-steps li { counter-increment: step; display: grid; grid-template-columns: 1.75em minmax(0, 1fr); gap: var(--space-xs); align-items: baseline; }
.install-steps li::before { content: counter(step); font: 400 var(--text-lg)/1 var(--font-display); color: var(--color-accent); font-variant-numeric: tabular-nums; }
.install-steps svg { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.25em; color: var(--color-accent); }
.install-steps strong { font-weight: 600; }
.link-button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.link-button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
#google-btn { display: flex; justify-content: center; min-height: 44px; }
.js .cover__sheet { animation: sheet-up var(--dur-long) var(--ease-out); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ Sheets, toasts ---- */
dialog.sheet { width: 100%; max-width: var(--column); max-height: min(88dvh, 44rem); margin: auto auto 0; padding: 0; border: 0; border-radius: var(--radius-book) var(--radius-book) 0 0; background: var(--color-paper); color: var(--color-ink); box-shadow: var(--shadow-card); overflow: auto; }
@media (min-width: 48rem) { dialog.sheet { margin: auto; border-radius: var(--radius-book); max-width: 30rem; } }
dialog.sheet::backdrop { background: var(--color-scrim); }
dialog.sheet[open] { animation: sheet-up var(--dur-long) var(--ease-out); }
.sheet__grip { width: 40px; height: 4px; margin: var(--space-xs) auto 0; border-radius: var(--radius-pill); background: var(--color-rule); }
.sheet__body { display: grid; gap: var(--space-md); padding: var(--space-md) var(--space-lg) var(--space-md); }
.sheet__body h2 { font: 400 var(--text-xl)/1.2 var(--font-display); }
.sheet__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-xs); padding: 0 var(--space-lg) calc(var(--space-lg) + env(safe-area-inset-bottom)); }
.sheet__error:empty { display: none; }
.picklist { list-style: none; margin: 0; padding: 0; }
.picklist button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 52px; padding: 0 var(--space-xs); border: 0; border-bottom: var(--rule-hair) solid var(--color-rule); background: transparent; color: var(--color-ink); font: 400 var(--text-lg)/1.2 var(--font-display); text-align: left; cursor: pointer; }
.picklist button:hover { background: var(--color-paper-2); }
.picklist button:active { transform: translateY(1px); }
.picklist button:disabled { opacity: 0.55; cursor: not-allowed; }
.picklist small { font: 400 var(--text-sm) var(--font-body); color: var(--color-muted); }
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-md)); transform: translateX(-50%); width: min(var(--column), 100%); padding: 0 var(--space-md); display: grid; gap: var(--space-xs); pointer-events: none; }
.toast { pointer-events: auto; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-card); background: var(--color-ink); color: var(--color-paper); font-size: var(--text-sm); box-shadow: var(--shadow-card); animation: sheet-up var(--dur-short) var(--ease-out); }
.toast--error { background: var(--color-error); color: var(--color-accent-ink); }
.offline { position: sticky; top: var(--bar-h); z-index: var(--z-sticky); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); font-size: var(--text-sm); }

/* QR */
.qr { display: inline-block; padding: var(--space-sm); background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); }
.qr svg { width: 168px; height: 168px; }
.qr svg path { fill: var(--color-ink); }
.qr svg rect { fill: var(--color-paper); }
#qr-reader { width: 100%; }

/* Alerts */
.post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-sm); padding: var(--space-md) 0; border-bottom: var(--rule-hair) solid var(--color-rule); color: var(--color-ink); text-decoration: none; }
.post:hover { background: var(--color-paper-2); }
.post:focus-visible { outline-offset: -2px; }
.post.is-unread .post__text { font-weight: 600; }
.post.is-unread .idphoto { outline: 2px solid var(--color-accent); }
.post__new { margin-left: var(--space-xs); }
.post__when { margin-top: var(--space-3xs); font-size: var(--text-sm); color: var(--color-muted); }

/* ------------------------------------------------------------ Page turns (cross-document view transitions) ---- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: turn-out var(--dur-short) var(--ease-in) both; }
::view-transition-new(root) { animation: turn-in var(--dur-long) var(--ease-out) both; }
html.turn-prev::view-transition-old(root) { animation-name: turn-out-prev; }
html.turn-prev::view-transition-new(root) { animation-name: turn-in-prev; }
@keyframes turn-out { to { opacity: 0; transform: translateX(-24px); } }
@keyframes turn-in { from { opacity: 0; transform: translateX(32px); } }
@keyframes turn-out-prev { to { opacity: 0; transform: translateX(24px); } }
@keyframes turn-in-prev { from { opacity: 0; transform: translateX(-32px); } }

@media (prefers-reduced-motion: reduce) {
  .flip__inner { transition: none; transform-style: flat; }
  .flip.is-flipped .flip__inner { transform: none; }
  .flip__face--back { transform: none; visibility: hidden; }
  .flip.is-flipped .flip__face--front { visibility: hidden; }
  .flip.is-flipped .flip__face--back { visibility: visible; }
  .stamp.is-pressed, .js .cover__sheet, dialog.sheet[open], .toast, .js .skeleton { animation: none; }
  .booklet, .booklet:hover { transform: none; }
  .stamppad__press.is-holding .stamp { transform: rotate(var(--tilt, -6deg)); }
  .pull-target { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
