/* Forever Shoebox. Designed first for grandparents: big text, big buttons, plain words, nothing hidden. */
:root {
  --paper: #f7f1e7;
  --card: #fffdf8;
  --ink: #241a12;
  --muted: #5e4d3f;          /* still 7:1 on paper */
  --line: #dccfbc;
  --brand: #8a5a35;
  --brand-ink: #ffffff;
  --brand-dark: #3b2a1e;
  --accent: #3f6b3a;
  --danger: #a3271a;
  --warn: #8a5a00;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(59, 42, 30, .08), 0 6px 20px rgba(59, 42, 30, .07);
  --tabs-h: 76px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17120e; --card: #231b15; --ink: #f6eee2; --muted: #cbb9a6; --line: #3d3127;
    --brand: #d9a874; --brand-ink: #1a120c; --brand-dark: #0f0b08; --accent: #a7cf9c;
    --danger: #ff9c8a; --warn: #f0c35a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 19px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-underline-offset: 3px; }
h1, h2 { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.75rem, 5vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-bottom: .5rem; }
small, .sub, .fine { color: var(--muted); }
.fine { font-size: .9rem; }
.lede { font-size: 1.15rem; color: var(--muted); margin: .3rem 0 0; }
.warn { color: var(--warn); font-weight: 600; }
img { max-width: 100%; }

/* ---------- buttons & forms ---------- */
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); padding: .6rem 1.2rem; display: inline-flex; align-items: center;
  justify-content: center; gap: .5rem; text-decoration: none; min-height: 52px; text-align: center;
}
button:hover, .button:hover { border-color: var(--brand); }
button:active, .button:active { transform: translateY(1px); }
.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.primary:hover { filter: brightness(1.07); }
.big { min-height: 60px; font-size: 1.1rem; padding: .7rem 1.4rem; }
.wide { width: 100%; }
.ghost { background: transparent; }
.link { border: 0; background: none; padding: .25rem 0; min-height: 0; text-decoration: underline; color: inherit; font-weight: 500; }
.danger { color: var(--danger); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: .7rem .85rem; width: 100%; min-height: 56px;
}
textarea { line-height: 1.5; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, label:focus-within {
  outline: 4px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px;
}
label { display: grid; gap: .35rem; font-weight: 700; }
label small { font-weight: 400; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
label.check input { width: 26px; height: 26px; min-height: 0; }
.stack { display: grid; gap: 1.1rem; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin: 0 0 1.25rem; }
.error { background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); padding: .85rem 1rem; border-radius: 12px; font-weight: 600; }
.notice { background: color-mix(in srgb, var(--accent) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; }
.notice pre { white-space: pre-wrap; background: var(--card); padding: .75rem; border-radius: 8px; font-size: .95rem; }
.chip { display: inline-block; font-size: .9rem; font-weight: 600; padding: .15rem .7rem; border-radius: 999px; background: color-mix(in srgb, var(--brand) 18%, transparent); text-decoration: none; margin: 0 .3rem .3rem 0; vertical-align: middle; font-family: system-ui, sans-serif; }
.chip.ok { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.spinner { display: inline-block; width: 1.1em; height: 1.1em; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -3px; margin-right: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.25rem;
  padding: .55rem max(1rem, env(safe-area-inset-right)) .55rem max(1rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; }
.brand span { display: grid; line-height: 1.15; min-width: 0; }
.brand b { font-family: ui-serif, Georgia, serif; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.top-nav { display: flex; gap: .25rem; }
.top-nav a { text-decoration: none; padding: .6rem 1rem; border-radius: 12px; color: var(--muted); font-weight: 700; }
.top-nav a:hover { color: var(--ink); }
.top-nav a[aria-current] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.top-add { margin-left: auto; }

/* ---------- bottom tabs (phones & tablets) ---------- */
.tabs { display: none; }
@media (max-width: 860px) {
  body { font-size: 18px; }
  .top-nav, .top-add { display: none; }
  .bar { justify-content: center; }
  .tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  }
  .tabs a, .tabs label { display: grid; place-items: center; align-content: center; gap: .15rem; text-decoration: none; font-size: .85rem; font-weight: 700; color: var(--muted); cursor: pointer; }
  .tabs svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabs a[aria-current] { color: var(--brand); }
  .tabs a[aria-current] svg { stroke-width: 2.6; }
  .tab-add .plus { width: 54px; height: 54px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 12px rgba(0,0,0,.25); border: 4px solid var(--card); }
  .tab-add .plus svg { stroke-width: 3; }
  .tab-add { color: var(--ink) !important; }
  main { padding-bottom: calc(var(--tabs-h) + 2rem + env(safe-area-inset-bottom)) !important; }
  .uploads { bottom: calc(var(--tabs-h) + 1rem + env(safe-area-inset-bottom)) !important; }
}

main { padding: 0 max(1rem, env(safe-area-inset-left)) 6rem; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: .4rem 1rem; padding: 1.5rem 0 1rem; }
.page-head .sub { margin: 0; flex-basis: 100%; order: 2; }
.page-head .head-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.page-head .crumb { flex-basis: 100%; margin: 0; font-size: 1.05rem; }
.page-head .crumb a { color: var(--muted); font-weight: 600; }
.back-row { margin: 1rem 0 0; }
.back { min-height: 48px; padding: .4rem 1rem; }
.empty { text-align: center; padding: 2.5rem 1.25rem; }
.empty h2 { margin-top: .5rem; }
.empty .button { margin-top: .75rem; }

/* ---------- home feed ---------- */
.hello { padding: 1.5rem 0 1rem; }
.feed { display: grid; gap: 1.25rem; max-width: 760px; }
.post { margin: 0; padding: 1rem; }
.post-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.post-who { margin: 0; font-size: 1.15rem; }
.post-when { margin: 0; color: var(--muted); }
.post-when a { font-weight: 600; }
.post-grid { display: grid; gap: 6px; grid-template-columns: repeat(3, 1fr); }
.post-grid.n1 { grid-template-columns: 1fr; }
.post-grid.n1 .tile { aspect-ratio: 4 / 3; }
.post-grid.n2 { grid-template-columns: 1fr 1fr; }
.post-grid.nmany .tile:first-child { grid-column: span 2; grid-row: span 2; }
.see-all { width: 100%; margin-top: .8rem; }
.feed-end { color: var(--muted); max-width: 760px; text-align: center; margin: 2rem 0; }
.welcome { max-width: 760px; border: 2px solid var(--brand); }
.welcome .primary { width: 100%; }
.steps { padding-left: 1.4rem; margin: .5rem 0 1rem; }
.steps li { margin: .5rem 0; }
.avatar { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 1.2rem; }

/* ---------- photo grids ---------- */
.month { margin: 1.5rem 0 .6rem; font-size: 1.35rem; position: sticky; top: 64px; z-index: 5; background: var(--paper); padding: .4rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
@media (max-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } .month { top: 62px; } }
.big-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 860px) { .big-grid { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--line); border-radius: 8px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tile:hover img { transform: scale(1.03); }
.tile .badge { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: .8rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; }
.tile .badge.restored { left: 6px; right: auto; background: rgba(138,90,53,.92); }
.tile .approx { position: absolute; left: 6px; top: 6px; background: rgba(36,26,18,.75); color: #fff; font-size: .8rem; padding: 0 .45rem; border-radius: 6px; }
.selecting .tile::after { content: ""; position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; background: rgba(0,0,0,.3); }
.selecting .tile.picked::after { background: var(--brand); box-shadow: inset 0 0 0 4px #fff; }
.selecting .tile.picked img { transform: scale(.88); }
.more { height: 1px; }
.select-bar { position: sticky; top: 64px; z-index: 15; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius); padding: .6rem .8rem; box-shadow: var(--shadow); font-weight: 700; }
.select-bar select { width: auto; flex: 1 1 220px; }
.drop-hint { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 25%, transparent); border: 6px dashed var(--brand); font-size: 1.6rem; font-weight: 800; }

/* ---------- upload panel ---------- */
.uploads { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: min(420px, calc(100vw - 2rem)); background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.25); padding: 1.1rem 1.2rem; }
.up-title { margin: 0; font-size: 1.25rem; font-weight: 800; }
.up-progress { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; margin: .7rem 0 .4rem; }
#up-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.uploads p { margin: .2rem 0; }
.up-keep { color: var(--muted); font-size: .95rem; }
.uploads ul { margin: .4rem 0; padding-left: 1.2rem; color: var(--danger); font-size: .95rem; max-height: 9rem; overflow: auto; }
.uploads .primary, .uploads .big { width: 100%; margin-top: .6rem; }

/* ---------- photo viewer ---------- */
.viewer-page main { padding: 0; max-width: none; }
.viewer { position: relative; background: #0d0a08; display: grid; place-items: center; min-height: 240px; touch-action: pan-y; }
.v-media { margin: 0; width: 100%; display: grid; place-items: center; }
.v-media img, .v-media video { display: block; max-width: 100%; max-height: min(80svh, calc(100svh - 150px)); object-fit: contain; }
@media (min-width: 861px) { .viewer { min-height: 60svh; } }
.v-note { position: absolute; bottom: 1rem; color: #eee; background: rgba(0,0,0,.6); padding: .4rem .8rem; border-radius: 8px; }
.v-back { position: absolute; z-index: 2; top: 12px; left: 12px; color: #fff; text-decoration: none; background: rgba(0,0,0,.6); border-radius: 12px; padding: .5rem 1rem; font-weight: 700; font-size: 1.1rem; }
.v-nav { position: absolute; z-index: 2; top: 50%; translate: 0 -50%; color: #fff; text-decoration: none; background: rgba(0,0,0,.5); border-radius: 50%; width: 60px; height: 60px; display: grid; place-items: center; font-size: 2.4rem; line-height: 1; }
.v-prev { left: 12px; }
.v-next { right: 12px; }
.step-nav { display: flex; justify-content: space-between; gap: .75rem; max-width: 900px; margin: .9rem auto 0; padding: 0 max(1rem, env(safe-area-inset-left)); }
.step-nav .button { flex: 1; max-width: 260px; }
.details { max-width: 900px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-left)) 4rem; display: grid; gap: 1.1rem; }
.d-date { font-size: 1.6rem; }
.caption { font-size: 1.3rem; margin: .4rem 0; white-space: pre-wrap; }
.caption-edit { margin: .3rem 0; min-height: 48px; }
.caption-form { margin-top: .6rem; }
.restored-note { margin: .4rem 0 0; font-weight: 600; color: var(--brand); }
.chips { margin: .3rem 0 0; }
.d-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.big-select { width: auto; flex: 1 1 260px; min-height: 60px; font-weight: 600; }
.edit summary { cursor: pointer; font-weight: 700; padding: .7rem 0; color: var(--muted); }
.edit form { margin-top: .75rem; }
.edit .danger { margin-top: 1rem; }
.bring-back h2 { margin-bottom: .75rem; }
.fix-buttons { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: .6rem; }
.fix-buttons form { display: contents; }
.fix-buttons button, .fix-buttons .button { flex-direction: column; gap: .1rem; width: 100%; }
.fix-buttons small { font-weight: 400; font-size: .9rem; }
.working { font-size: 1.1rem; font-weight: 600; }


/* ---------- albums ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
@media (max-width: 860px) { .album-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; } }
.album-card { display: grid; gap: .25rem; text-decoration: none; }
.album-card b { font-size: 1.15rem; }
.album-card img, .album-empty { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.album-empty { display: grid; place-items: center; }
.album-desc { flex-basis: 100%; order: 1; margin: .3rem 0 0; max-width: 70ch; white-space: pre-wrap; font-size: 1.1rem; }
.sub-grid { margin: .25rem 0 2rem; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + .5rem); min-width: min(360px, calc(100vw - 2rem)); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 1rem; display: grid; gap: .8rem; }
.menu-pop.wide { min-width: min(420px, calc(100vw - 2rem)); }
.page-head .menu summary.button { min-height: 52px; }

/* ---------- me, people, settings ---------- */
.list-buttons { display: grid; gap: .7rem; margin-bottom: 1.25rem; max-width: 760px; }
.list-button { display: grid; gap: .1rem; text-decoration: none; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.list-button:hover { border-color: var(--brand); }
.list-button b { font-size: 1.15rem; }
.people { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .6rem; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.people li.off { opacity: .6; }
.people .who { flex: 1; min-width: 200px; }
.invite { border: 2px solid var(--brand); }
.invite-url { font-family: ui-monospace, Menlo, monospace; font-size: .95rem; background: var(--paper); padding: .6rem .8rem; border-radius: 10px; word-break: break-all; }
details summary { cursor: pointer; }

/* ---------- login, join & landing ---------- */
.auth main, .landing-main { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 2rem 1.6rem; box-shadow: var(--shadow); text-align: center; }
.auth-card form { text-align: left; margin-top: 1rem; }
.auth-card .tag { margin: .2rem 0 1rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.auth-card .primary { width: 100%; margin-top: .25rem; }
.landing-main { text-align: center; max-width: 640px; margin: 0 auto; align-content: center; }
.landing-main h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); }

/* invite picture */
.join-hero { display: block; width: 100%; margin: .2rem 0 1rem; border-radius: 14px; aspect-ratio: 1200 / 630; object-fit: cover; box-shadow: var(--shadow); }
.share-preview { display: block; width: 100%; max-width: 480px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; margin: .4rem 0; box-shadow: var(--shadow); }

/* letters: read like a letter, not like the edge of the paper */
.letter-page { background: #fbf6ea; color: #2b2118; border-radius: 16px; box-shadow: var(--shadow); border: 1px solid #e8dcc4;
  padding: clamp(1.25rem, 5vw, 2.75rem); max-width: 46rem; font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 3.6vw, 1.4rem); line-height: 1.85; }
.letter-page p { margin: 0 0 1.1em; max-width: 62ch; }
.letter-label { font-family: system-ui, sans-serif; font-size: .95rem !important; font-weight: 700; letter-spacing: .04em; color: #8a5a35; text-transform: uppercase; }
.letter-date { text-align: right; font-style: italic; color: #5e4d3f; }
.letter-greeting { font-weight: 700; font-size: 1.08em; }
.letter-para { text-indent: 1.5em; }
.letter-closing { margin-top: 1.5em !important; margin-left: auto !important; width: fit-content; font-style: italic; }
.letter-pagebreak { text-align: center; border-top: 1px dashed #d8c7a8; margin: 1.6em 0 1.2em !important; height: 0; }
.letter-pagebreak span { position: relative; top: -.85em; background: #fbf6ea; padding: 0 .8em; font-family: system-ui, sans-serif; font-size: .8rem; color: #8b7a66; text-transform: uppercase; letter-spacing: .08em; }
.letter-page .unsure { font-family: system-ui, sans-serif; font-size: .6em; font-weight: 800; color: #a06a2c; margin-left: .1em; }
.letter-page .unreadable { font-family: system-ui, sans-serif; font-size: .7em; background: #eadfca; color: #6b5a47; padding: .05em .5em; border-radius: 999px; text-indent: 0; }
.letter-page .margin-note { display: block; font-size: .85em; font-style: italic; color: #6b5a47; border-left: 3px solid #d8c7a8; padding-left: .8em; margin-top: .6em; text-indent: 0; }
.letter-legend { font-family: system-ui, sans-serif; font-size: .9rem !important; color: #7a6656 !important; }
.letter-page details summary { font-family: system-ui, sans-serif; font-size: 1rem; color: #7a6656; }
.letter-page textarea { font-family: inherit; font-size: 1.05rem; background: #fffdf8; color: #2b2118; }
.letter-raw { white-space: pre-wrap; font-size: 1rem; line-height: 1.6; color: #5e4d3f; padding: .5rem 0; }

.rotate-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.rotate-row span { font-weight: 600; color: var(--muted); flex-basis: 100%; }
.rotate-row form { flex: 1 1 140px; }
.rotate-row button { width: 100%; }

/* ---------- search ---------- */
.search-box { max-width: 760px; margin: 0 0 1.25rem; }
.search-box input { font-size: 1.1rem; min-height: 60px; border-radius: 16px; }
.inline-search { flex-basis: 100%; order: 3; margin: .6rem 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- hearts, people, memories ---------- */
.heart-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: .6rem 0; }
.heart-btn.on { border-color: #d6455d; background: color-mix(in srgb, #d6455d 12%, var(--card)); }
.heart-icon { font-size: 1.3em; }
.heart-names { color: var(--muted); font-weight: 600; }
.people-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .4rem 0 .6rem; }
.people-label { font-weight: 700; margin-right: .2rem; }
.chip.person { display: inline-flex; align-items: center; gap: .2rem; font-size: 1rem; padding: .3rem .4rem .3rem .8rem; }
.chip.person a { text-decoration: none; }
.chip.person form { display: inline; }
.chip-x { min-height: 0; border: 0; background: none; padding: 0 .3rem; font-size: 1.2rem; line-height: 1; color: var(--muted); }
.tag-add summary.button { min-height: 44px; padding: .3rem .9rem; font-size: 1rem; }
.tag-add form { margin-top: .5rem; }
.tag-add input { width: auto; flex: 1 1 200px; }
.memories h2 { margin-bottom: .8rem; }
.memory-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 1rem; }
.memory-list li { display: flex; gap: .7rem; align-items: flex-start; }
.avatar.small { width: 40px; height: 40px; flex-basis: 40px; font-size: 1rem; }
.memory-body { flex: 1; min-width: 0; }
.memory-who { margin: 0; }
.memory-text { margin: .2rem 0; white-space: pre-wrap; font-size: 1.1rem; }
.memory-body audio { width: 100%; max-width: 420px; margin: .3rem 0; }
.voice-status { font-weight: 700; color: var(--danger); }
#voice-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- home extras ---------- */
.activity ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.activity a { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.activity img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: 0 0 56px; }
.activity, .on-this-day { max-width: 760px; }
.on-this-day .sub { margin: -.3rem 0 .7rem; }

/* ---------- before / after ---------- */
.compare-wrap { max-width: 900px; margin: 1rem auto 0; padding: 0 max(1rem, env(safe-area-inset-left)); }
.compare-title { font-weight: 700; margin: 0 0 .5rem; }
.compare { position: relative; overflow: hidden; border-radius: 14px; background: #000; line-height: 0; touch-action: pan-y; cursor: ew-resize; }
.compare img { display: block; width: 100%; height: auto; }
.compare-before { position: absolute; inset: 0; width: 50%; overflow: hidden; border-right: 3px solid #fff; }
.compare-before img { height: 100%; max-width: none; object-fit: cover; }
.compare-tag { position: absolute; top: 10px; background: rgba(0,0,0,.6); color: #fff; font: 700 .85rem/1 system-ui, sans-serif; padding: .4rem .6rem; border-radius: 8px; }
.compare-tag.left { left: 10px; } .compare-tag.right { right: 10px; }
.compare-range { width: 100%; min-height: 44px; padding: 0; border: 0; background: none; accent-color: var(--brand); }

/* ---------- health ---------- */
.health { max-width: 760px; border: 2px solid var(--accent); }
.health.warn-card { border-color: var(--warn); }
.health-list { margin: 0; padding-left: 1.2rem; }
.health-list li { margin: .3rem 0; }
.health-list .bad { color: var(--danger); font-weight: 700; }

/* ---------- printable letter ---------- */
.print-page { background: #eee8dc; }
.print-actions { display: flex; gap: .6rem; justify-content: center; padding: 1rem; }
.print-letter { margin: 0 auto 2rem; }
.print-caption { font-style: italic; color: #5e4d3f; }
.print-footer { font-family: system-ui, sans-serif; font-size: .8rem !important; color: #8b7a66; text-align: center; margin-top: 2em !important; }
.print-scan { max-width: 46rem; margin: 0 auto 3rem; text-align: center; }
.print-scan img { max-width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.print-scan figcaption { color: #6b5a47; margin-top: .4rem; }
@media print {
  .no-print, .bar, .tabs, .uploads { display: none !important; }
  body, .print-page { background: #fff !important; }
  .letter-page { box-shadow: none; border: 0; background: #fff !important; max-width: none; padding: 0; font-size: 13pt; }
  .print-scan { page-break-before: always; }
  .print-scan img { box-shadow: none; max-height: 9.5in; }
}

/* ---------- full screen & zoom ---------- */
#zoomable { cursor: zoom-in; }
.v-zoom { position: absolute; z-index: 2; right: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 12px; min-height: 48px; font-size: 1rem; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.lightbox img { position: absolute; left: 50%; top: 50%; max-width: 100vw; max-height: 100svh; transform-origin: center center; will-change: transform; -webkit-user-drag: none; }
.lb-close { position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); right: 12px; background: rgba(255,255,255,.92); color: #111; border: 0; font-size: 1.15rem; min-height: 56px; padding: .5rem 1.2rem; border-radius: 14px; }
.lb-hint { position: absolute; z-index: 2; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); text-align: center; color: #ddd; font-size: .95rem; margin: 0; transition: opacity .6s; pointer-events: none; }

/* ---------- notifications ---------- */
.notify { max-width: 760px; }
.push-prefs { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.push-nudge { display: grid; gap: .2rem; max-width: 760px; text-decoration: none; border: 2px dashed var(--brand); }

.play-btn { white-space: nowrap; }
