/* Journey — editorial scrapbook. Neutral surfaces, charcoal text, configurable accent. */
:root {
  --accent: #2f6f62;
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #efebe4;
  --text: #24211e;
  --muted: #6c655d;
  --line: #e2dcd2;
  --danger: #a3332b;
  --warn-bg: #fbf1dc;
  --ok: #2e7d4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 6px 18px rgba(40, 30, 20, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #151413; --surface: #1d1c1a; --surface-2: #262421; --text: #ece7df; --muted: #a39b90; --line: #33302c; --warn-bg: #3a2f17; --shadow: 0 1px 2px rgba(0,0,0,.4); }
}
:root[data-theme="dark"] { --bg: #151413; --surface: #1d1c1a; --surface-2: #262421; --text: #ece7df; --muted: #a39b90; --line: #33302c; --warn-bg: #3a2f17; --shadow: 0 1px 2px rgba(0,0,0,.4); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
img, video { max-width: 100%; display: block; }
h1, h2, h3, .brand, .entry-title, .card-title { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }
.error { color: var(--danger); }
.warn { background: var(--warn-bg); padding: .6rem .8rem; border-radius: 10px; }
.boot { display: grid; place-items: center; min-height: 100vh; font: 600 2rem var(--serif); color: var(--muted); }

/* privacy cover: shown instantly on visibilitychange / pagehide */
.cover { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: none; place-items: center; }
.cover.on { display: grid; }
.cover-mark { font: 600 2rem var(--serif); color: var(--muted); }

/* layout */
.layout { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .25rem; padding: calc(.5rem + var(--safe-t)) 1rem .5rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-size: 1.4rem; text-decoration: none; color: var(--text); }
.main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem calc(var(--nav-h) + 2rem + var(--safe-b)); outline: none; }
.navbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; align-items: center; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface); border-top: 1px solid var(--line); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; min-height: 48px; justify-content: center; text-decoration: none; color: var(--muted); font-size: .72rem; }
.nav-item.active { color: var(--accent); }
.nav-item.add { color: #fff; background: var(--accent); border-radius: 50%; width: 56px; height: 56px; margin-top: -18px; box-shadow: var(--shadow); }
.nav-item.add span { position: absolute; left: -9999px; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: none; border-radius: 12px; cursor: pointer; color: var(--text); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { min-width: 32px; min-height: 32px; }
.icon-btn.lock.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (min-width: 900px) {
  .navbar { top: 0; bottom: 0; right: auto; width: 88px; height: auto; flex-direction: column; justify-content: flex-start; gap: .75rem; padding-top: 5rem; border-top: 0; border-right: 1px solid var(--line); }
  .nav-item.add { margin: .5rem 0; }
  .topbar { padding-left: 104px; }
  .main { padding-bottom: 3rem; padding-left: 104px; max-width: 864px; }
}

/* buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.ghost.danger { color: var(--danger); background: transparent; }
.btn.small { min-height: 36px; padding: .3rem .75rem; font-size: .875rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
textarea { resize: vertical; line-height: 1.5; }
.field { margin: .5rem 0; flex: 1; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.hint { font-size: .8rem; color: var(--muted); margin: .25rem 0 0; }
.check, .radio { display: flex; gap: .5rem; align-items: flex-start; min-height: 36px; padding: .25rem 0; cursor: pointer; }
.check input, .radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1rem; margin: .75rem 0; }
legend { font-weight: 600; padding: 0 .25rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card.warn { border-color: #d9b45a; }
.card.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); font-size: .8rem; color: var(--text); text-decoration: none; margin: 2px; }
.chip.label { background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--text)); }
.chip.person { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.chip.draft { background: var(--warn-bg); }
.chip.priv { background: #ece1f0; color: #5b3a6b; }
.chip.shared { background: #dcecf3; color: #255a72; }
.chip.toggle input { width: 14px; height: 14px; }
.chip.editable select { width: auto; min-height: 28px; padding: 0 .25rem; border: 0; background: transparent; font-size: .8rem; }
.chip .x { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 0 .2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.page-title { font-size: 1.8rem; margin: .5rem 0 1rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-title { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.empty { text-align: center; padding: 3rem 1rem; }
.empty.welcome h2 { font-size: 1.8rem; }
.loading { display: grid; place-items: center; padding: 3rem; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list > li.row { justify-content: space-between; }
.menu-list { list-style: none; padding: 0; }
.menu-item { display: block; width: 100%; text-align: left; padding: .9rem 1rem; min-height: 48px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); cursor: pointer; }
.menu-item.danger { color: var(--danger); }
.disclosure { margin-top: 2rem; }

/* toasts & dialogs */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 1rem + var(--safe-b)); z-index: 2000; display: grid; gap: .5rem; width: min(92vw, 420px); }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 12px; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); color: #fff; }
dialog.modal { width: min(94vw, 560px); max-height: 88vh; border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 16, 12, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-body { padding: 1rem; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.codes { font: 1.1rem/1.8 ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 1rem; border-radius: 10px; }
pre.code { background: var(--surface-2); padding: .75rem; border-radius: 10px; overflow: auto; font-size: .8rem; }

/* timeline */
.filters { display: flex; gap: .4rem; overflow-x: auto; padding: .25rem 0 .75rem; }
.filters select { width: auto; flex: 0 0 auto; min-height: 38px; font-size: .875rem; border-radius: 999px; }
.scrubber { position: fixed; right: max(.5rem, calc((100vw - 864px) / 2 - 80px)); top: 30%; display: none; flex-direction: column; gap: .15rem; z-index: 10; }
.scrubber a { font-size: .75rem; color: var(--muted); text-decoration: none; padding: .1rem .4rem; border-radius: 6px; }
.scrubber a:hover { color: var(--accent); background: var(--surface-2); }
@media (min-width: 1100px) { .scrubber { display: flex; } }
.year-head { position: sticky; top: calc(56px + var(--safe-t)); z-index: 5; font-size: 2.2rem; margin: 2rem 0 .5rem; padding: .25rem 0; background: var(--bg); }
.month-head { font: 600 .8rem var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 1.25rem 0 .5rem; }
.feed { display: grid; gap: 1.25rem; }
.card-link { display: block; color: inherit; text-decoration: none; }
article.card { padding: 0; overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 420px; }
article.card .card-body { padding: .9rem 1rem .5rem; }
article.card .card-chips { padding: 0 1rem .9rem; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: var(--muted); font-size: .85rem; }
.card-title { font-size: 1.35rem; margin: .25rem 0; }
.card-excerpt { margin: .25rem 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-quote { font: italic 1.15rem/1.5 var(--serif); margin: .5rem 0; padding-left: .75rem; border-left: 3px solid var(--accent); }
.hero { background: var(--surface-2); overflow: hidden; max-height: 70vh; }
.hero img, .hero video { width: 100%; height: 100%; object-fit: cover; }
.mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; aspect-ratio: 4/3; position: relative; background: var(--surface-2); }
.mosaic > :first-child { grid-row: span 2; }
.mosaic img, .mosaic .vid-wrap { width: 100%; height: 100%; object-fit: cover; }
.mosaic .more { position: absolute; right: .5rem; bottom: .5rem; background: rgba(0,0,0,.6); color: #fff; border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; }
.vid-wrap { position: relative; }
.vid-wrap .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.vid-wrap .play .ico { width: 48px; height: 48px; fill: rgba(0,0,0,.45); }
.media-pending { display: grid; place-items: center; min-height: 120px; background: var(--surface-2); color: var(--muted); font-size: .85rem; padding: 1rem; text-align: center; }
.otd-row { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.otd-row > * { scroll-snap-align: start; }
.load-more { margin: 1rem auto; display: flex; }
.t-travel { --theme: #2f7d6d; } .t-family { --theme: #b0662a; } .t-celebration { --theme: #c2417a; } .t-reflection { --theme: #5a5fa8; } .t-intimacy { --theme: #9b3d4f; } .t-health { --theme: #3d7f9b; }
article.card[class*="t-"] { border-top: 3px solid var(--theme); }
.t-reflection .card-title, .t-reflection .entry-title { font-style: italic; }

/* entry */
.entry-bar { display: flex; align-items: center; gap: .25rem; margin-bottom: .5rem; }
.entry-bar .page-title { margin: 0; }
.entry-head { margin: 1rem 0; }
.entry-title { font-size: 2.2rem; line-height: 1.15; margin: .4rem 0 .6rem; }
.narrative { font: 1.15rem/1.7 var(--serif); }
.narrative h2 { font-size: 1.5rem; margin: 1.5rem 0 .5rem; }
.narr { margin: 0 0 1rem; white-space: pre-wrap; }
.mention { color: var(--accent); text-decoration: none; border-bottom: 1px dotted; }
figure.quote { margin: 1.5rem 0; padding: .5rem 0 .5rem 1.25rem; border-left: 4px solid var(--accent); }
figure.quote blockquote { margin: 0; font: italic 1.35rem/1.5 var(--serif); }
figure.quote figcaption { margin-top: .4rem; color: var(--muted); font: .9rem var(--sans); }
dl.detail { display: flex; gap: .5rem; font: .95rem var(--sans); margin: .5rem 0; }
dl.detail dt { color: var(--muted); } dl.detail dd { margin: 0; font-weight: 600; }
.gallery { margin: 0 -1rem 1rem; }
.gallery.single .g-item img { width: 100%; max-height: 80vh; object-fit: contain; background: #000; }
.gallery.mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; aspect-ratio: auto; }
.gallery.mosaic .g-item img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 85%; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 1rem; }
.gallery.carousel .g-item { scroll-snap-align: center; }
.gallery.carousel img { aspect-ratio: 4/5; object-fit: cover; width: 100%; border-radius: 10px; }
.g-item { margin: 0; }
.g-item figcaption { font-size: .85rem; color: var(--muted); padding: .25rem 1rem; }
.g-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
@media (min-width: 900px) { .gallery { margin: 0 0 1rem; } }
.file-row, .audio-row { display: flex; gap: .75rem; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); margin: .5rem 0; background: var(--surface); }
.audio-row audio { width: 100%; }
.entry-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.loc { display: flex; align-items: center; gap: .3rem; color: var(--muted); }
.ai-panel { margin-top: 2rem; padding: 1rem; border-radius: var(--radius); background: var(--surface-2); }
.ai-panel.off { background: transparent; padding: 0; }
.artifact { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: .75rem; margin: .75rem 0; }
.artifact.accepted { border-style: solid; }
.cite { text-decoration: none; margin-left: .2rem; }
dialog.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; display: grid; grid-template-columns: 56px 1fr 56px; grid-template-rows: 1fr auto; align-items: center; }
dialog.lightbox:not([open]) { display: none; }
.lb-media { grid-column: 2; display: grid; place-items: center; height: 100%; }
.lb-media img, .lb-media video { max-height: 90vh; object-fit: contain; }
.lb-prev, .lb-next { height: 100%; border: 0; background: none; color: #fff; font-size: 2.5rem; cursor: pointer; }
.lb-close { position: absolute; top: calc(.5rem + var(--safe-t)); right: .5rem; color: #fff; }
.lb-cap { grid-column: 1 / -1; text-align: center; padding: .5rem; }

/* editor */
.editor-bar { position: sticky; top: calc(56px + var(--safe-t)); z-index: 6; display: flex; align-items: center; gap: .5rem; padding: .5rem 0; background: var(--bg); }
.save-state { font-size: .85rem; color: var(--muted); }
.save-state.ok { color: var(--ok); } .save-state.warn { color: #9a6b00; } .save-state.error { color: var(--danger); }
.title-input { font: 600 1.8rem var(--serif) !important; border: 0 !important; background: transparent !important; padding-left: 0 !important; }
.when-row .when { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.when select, .when input { width: auto; flex: 1 1 140px; }
.blocks { margin: 1rem 0; display: grid; gap: .75rem; }
.block-ed { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.block-ctl { display: flex; flex-direction: column; gap: .25rem; align-items: center; }
.block-ctl select { width: 104px; min-height: 32px; font-size: .75rem; padding: .2rem; }
textarea.story { font: 1.1rem/1.65 var(--serif); border: 0; border-left: 2px solid var(--line); border-radius: 0; background: transparent; padding-left: .75rem; min-height: 6rem; }
.heading-input { font: 600 1.3rem var(--serif) !important; }
.quote-ed { display: grid; gap: .4rem; border-left: 4px solid var(--accent); padding-left: .75rem; }
.add-blocks { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
details.ed-section { border-top: 1px solid var(--line); padding: .5rem 0; }
details.ed-section > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; list-style: none; }
details.ed-section > summary::after { content: "+"; margin-left: auto; color: var(--muted); }
details.ed-section[open] > summary::after { content: "–"; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.5rem; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; color: var(--muted); text-align: center; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.uploads { display: grid; gap: .4rem; margin: .5rem 0; }
.up-row { display: grid; grid-template-columns: 1fr 100px auto; gap: .5rem; align-items: center; font-size: .85rem; }
.up-row.error { color: var(--danger); }
.edit-media { display: grid; gap: .75rem; }
.edit-att { display: grid; grid-template-columns: 120px 1fr; gap: .75rem; align-items: start; }
.edit-att img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.att-ctl { display: flex; flex-wrap: wrap; gap: .3rem; }
.att-ctl input.small { min-height: 34px; flex: 1 1 140px; font-size: .85rem; }
.att-ctl select { width: auto; min-height: 34px; font-size: .8rem; }
.people-ed { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.people-ed input { flex: 1 1 160px; width: auto; }
.where { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

/* people */
.people-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-top: 1rem; }
.person-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; padding: 1rem .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; min-height: 160px; }
.pc-name { font: 600 1.05rem var(--serif); }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; }
.avatar.initials { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); font: 600 1.4rem var(--serif); }
.person-head { display: flex; gap: 1rem; align-items: center; }
.person-head h1 { margin: 0; font-size: 2rem; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 1rem 0; }
.tab { padding: .6rem .8rem; min-height: 44px; display: flex; align-items: center; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 120px; gap: .5rem; align-items: end; }
.field-row select { min-height: 36px; font-size: .8rem; margin-bottom: .5rem; }
dl.stats { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; }
dl.stats dd { margin: 0; font-weight: 600; text-align: right; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.cal-head select { width: auto; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.cal-month h3 { margin: .25rem 0; font-size: 1rem; }
.cal-month h3 a { color: inherit; text-decoration: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { font-size: .65rem; color: var(--muted); text-align: center; }
.cal-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; font-size: .75rem; color: var(--muted); position: relative; overflow: hidden; text-decoration: none; }
.cal-cell.has { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--text); font-weight: 600; }
.cal-month.big .cal-cell { font-size: .9rem; }
.cal-month.big .cal-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.cal-month.big .cal-cell .d { position: relative; background: rgba(0,0,0,.35); color: #fff; border-radius: 6px; padding: 0 .3rem; }

/* library, settings, admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; min-height: 110px; }
.tile .ico { color: var(--accent); }
.map { width: 100%; height: auto; border-radius: var(--radius); background: var(--surface-2); }
.map-bg { fill: var(--surface-2); }
.map circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.sugg { display: grid; gap: .5rem; margin-bottom: 1rem; }
.scopes { display: grid; gap: .1rem; }
.webhook { border-top: 1px solid var(--line); padding: .5rem 0; }
table.mini, table.users, table.audit { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.mini td, table.users td, table.users th, table.audit td, table.audit th { padding: .4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tr.persona { background: var(--warn-bg); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.test-steps { list-style: none; padding: 0; }
.test-steps li { padding: .3rem 0; }
.test-steps .mark { display: inline-block; width: 1.4rem; font-weight: 700; }
.test-steps li.ok .mark { color: var(--ok); }
.test-steps li.fail .mark { color: var(--danger); }
.integration h3 { margin-bottom: .25rem; }
.danger-zone { border-color: var(--danger); }
.persona-banner { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem 1rem; padding-top: calc(.6rem + var(--safe-t)); background: #7a1f2b; color: #fff; }
.persona-banner .btn { color: #fff; border-color: rgba(255,255,255,.5); background: transparent; }
.share-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .4rem; }
.thumb-check { position: relative; display: block; }
.thumb-check input { position: absolute; top: 4px; left: 4px; z-index: 1; }
.thumb-check img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.share-preview { margin-top: 1rem; }
.recipient-render { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--bg); }
.comment { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.search-form { display: grid; gap: .5rem; }
.search-input { font-size: 1.15rem !important; }

/* plain server-rendered pages (consent, signed out, docs) */
body.plain { display: block; }
.plain-card { max-width: 640px; margin: 3rem auto; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plain-card table.api { width: 100%; font-size: .85rem; border-collapse: collapse; }
.plain-card table.api td { border-bottom: 1px solid var(--line); padding: .25rem; }
code.m-get { color: #2e7d4f; } code.m-post { color: #255a72; } code.m-patch, code.m-put { color: #9a6b00; } code.m-delete { color: var(--danger); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 480px) { .entry-title { font-size: 1.8rem; } .where { grid-template-columns: 1fr; } .edit-att { grid-template-columns: 80px 1fr; } }
