:root {
  --paper: #f5eedf;
  --card: #fbf7ee;
  --ink: #3b2a1e;
  --ink-soft: #7a6652;
  --line: #e3d8c3;
  --sage: #6b8467;
  --sage-deep: #4f6a4c;
  --gold: #b8903f;
  --wine: #8b2e3a;
  --display: 'Young Serif', Georgia, 'Times New Roman', serif;
  --body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0; }
a { color: var(--sage-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

#app { min-height: 100dvh; max-width: 560px; margin: 0 auto; position: relative; }

/* ---------- Top bar and tabs ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 24px; letter-spacing: 0.2px; }
.top .who { border: 0; background: none; padding: 0; border-radius: 50%; }

main { padding: 18px 16px calc(var(--tab-h) + var(--safe-b) + 90px); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabs-inner { display: flex; width: 100%; max-width: 560px; }
.tab {
  flex: 1; height: var(--tab-h); border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  position: relative;
}
.tab svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--sage-deep); }
.tab[aria-current="page"]::after {
  content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}

/* ---------- Buttons and fields ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 12px 22px; min-height: 46px;
  background: var(--sage-deep); color: var(--paper); font-weight: 700;
}
.btn:active { background: var(--sage); }
.btn.quiet { background: transparent; color: var(--sage-deep); border: 1.5px solid var(--sage); }
.btn.danger { background: transparent; color: var(--wine); border: 1.5px solid var(--wine); }
.btn.small { min-height: 38px; padding: 7px 16px; font-size: 15px; }
.btn[disabled] { opacity: 0.55; }
.linkbtn { border: 0; background: none; padding: 6px 0; color: var(--ink-soft); font-size: 15px; font-weight: 600; }
.linkbtn.wine { color: var(--wine); }

label { display: block; font-weight: 700; font-size: 15px; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=tel], input[type=datetime-local], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card);
}
input:focus, textarea:focus, select:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px rgba(107, 132, 103, 0.25); }
textarea { resize: vertical; min-height: 96px; }
.hint { color: var(--ink-soft); font-size: 15px; margin: 4px 0 0; }
.error { color: var(--wine); font-weight: 600; margin: 12px 0 0; min-height: 1.2em; }

/* ---------- Avatars ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover;
  display: inline-grid; place-items: center;
  font-family: var(--display); font-size: 18px; color: var(--paper);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1.5px var(--line);
}
.avatar.big { width: 96px; height: 96px; font-size: 40px; }
.avatar.small { width: 30px; height: 30px; font-size: 13px; border-width: 1.5px; }

/* ---------- Sign in ---------- */
.gate { padding: 12vh 24px 40px; }
.gate .mark { width: 76px; height: 76px; border-radius: 20px; display: block; margin-bottom: 22px; }
.gate h1 { font-size: 36px; margin-bottom: 8px; }
.gate p { color: var(--ink-soft); margin: 0 0 8px; }
.gate .btn { width: 100%; margin-top: 22px; }

/* ---------- Feed: photos are mounted like prints in a family album ---------- */
.post { margin: 0 0 30px; }
.post-head { display: flex; align-items: center; gap: 11px; margin: 0 4px 10px; }
.post-head .names { flex: 1; min-width: 0; }
.post-head strong { display: block; font-weight: 700; line-height: 1.2; }
.post-head time { color: var(--ink-soft); font-size: 14px; }

.print {
  position: relative; background: var(--card);
  padding: 12px 12px 14px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px -8px rgba(59, 42, 30, 0.35);
  transform: rotate(-0.5deg);
}
.post:nth-child(even) .print { transform: rotate(0.5deg); }
.print .mount { position: relative; display: block; background: var(--line); }
.print .mount img { display: block; width: 100%; max-height: 78vh; object-fit: cover; }
.print .mount::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(135deg, var(--wine) 50%, transparent 50%) top left / 20px 20px no-repeat,
    linear-gradient(225deg, var(--wine) 50%, transparent 50%) top right / 20px 20px no-repeat,
    linear-gradient(45deg, var(--wine) 50%, transparent 50%) bottom left / 20px 20px no-repeat,
    linear-gradient(315deg, var(--wine) 50%, transparent 50%) bottom right / 20px 20px no-repeat;
}
.print .cap { margin: 12px 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.print.textonly { transform: none; padding: 16px 18px; }
.print.textonly .cap { margin: 0; }

.actions { display: flex; align-items: center; gap: 18px; margin: 12px 6px 0; }
.act { border: 0; background: none; padding: 6px 2px; display: inline-flex; gap: 7px; align-items: center; font-weight: 700; color: var(--ink-soft); }
.act svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.act.on { color: var(--wine); }
.act.on svg { fill: var(--wine); }
.act.del { margin-left: auto; font-weight: 600; font-size: 15px; }
.likedby { margin: 2px 6px 0; font-size: 15px; color: var(--ink-soft); }

.comments { margin: 10px 4px 0; }
.comment { display: flex; gap: 9px; margin: 9px 0; align-items: flex-start; }
.comment .bubble { flex: 1; min-width: 0; background: rgba(227, 216, 195, 0.45); padding: 8px 12px; border-radius: 4px 16px 16px 16px; }
.comment strong { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--ink-soft); }
.comment .txt { overflow-wrap: anywhere; white-space: pre-wrap; }
.comment .x { border: 0; background: none; color: var(--ink-soft); font-size: 13px; padding: 0 0 0 6px; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; border-radius: 999px; padding: 10px 16px; }

.empty { text-align: center; padding: 56px 24px; color: var(--ink-soft); }
.empty h2 { color: var(--ink); font-size: 22px; margin-bottom: 8px; }

.fab {
  position: fixed; z-index: 7;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  height: 56px; padding: 0 22px 0 18px; border-radius: 999px; border: 0;
  background: var(--gold); color: #2d2014; font-weight: 800;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 20px -6px rgba(59, 42, 30, 0.55);
}
.fab svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(59, 42, 30, 0.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--paper); border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(24px + var(--safe-b));
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font-size: 24px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.row .btn { flex: 1; }
.photo-pick { margin-top: 12px; }
.photo-pick img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-top: 10px; }

/* ---------- Events ---------- */
.day { margin: 26px 0 10px; font-size: 20px; }
.day:first-child { margin-top: 0; }
.event { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--sage); border-radius: 6px 16px 16px 6px; padding: 14px 16px; margin-bottom: 12px; }
.event h3 { font-family: var(--body); font-weight: 700; font-size: 18px; }
.event .when { color: var(--sage-deep); font-weight: 700; }
.event .meta { color: var(--ink-soft); font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.rsvp { display: flex; gap: 8px; margin-top: 12px; }
.rsvp button { flex: 1; min-height: 42px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; font-weight: 700; font-size: 15px; }
.rsvp button[aria-pressed="true"].going { background: var(--sage-deep); color: var(--paper); border-color: var(--sage-deep); }
.rsvp button[aria-pressed="true"].maybe { background: var(--gold); color: #2d2014; border-color: var(--gold); }
.rsvp button[aria-pressed="true"].no { background: var(--wine); color: var(--paper); border-color: var(--wine); }
.who-list { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); }
.who-list b { color: var(--ink); }

/* ---------- Chat ---------- */
.thread { display: flex; gap: 13px; align-items: center; width: 100%; text-align: left; padding: 12px 4px; border: 0; background: none; border-bottom: 1px solid var(--line); }
.thread .t { flex: 1; min-width: 0; }
.thread strong { display: block; }
.thread .last { color: var(--ink-soft); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 82px - env(safe-area-inset-top, 0px) - var(--tab-h) - var(--safe-b) - 78px); }
main.chat-on { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 78px); }
.chat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.chat-head h2 { font-size: 22px; }
.msgs { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding-bottom: 12px; }
.msg { max-width: 82%; padding: 9px 14px; border-radius: 18px 18px 18px 4px; background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .from { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.msg.mine { align-self: flex-end; background: var(--sage-deep); border-color: var(--sage-deep); color: var(--paper); border-radius: 18px 18px 4px 18px; }
.composer {
  position: fixed; left: 0; right: 0; z-index: 6; display: flex; justify-content: center;
  bottom: calc(var(--tab-h) + var(--safe-b)); background: var(--paper); border-top: 1px solid var(--line);
}
.composer form { display: flex; gap: 8px; width: 100%; max-width: 560px; padding: 10px 14px; }
.composer input { flex: 1; border-radius: 999px; padding: 11px 18px; }

/* ---------- Family ---------- */
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.person .avatar { width: 76px; height: 76px; font-size: 32px; }
.person strong { line-height: 1.2; }
.person small { color: var(--ink-soft); }
.profile { text-align: center; }
.profile .avatar { margin: 4px auto 10px; }
.profile h2 { font-size: 28px; }
.profile .bio { color: var(--ink-soft); margin: 8px 0 0; white-space: pre-wrap; }
.section-title { font-size: 20px; margin: 30px 0 4px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(var(--tab-h) + var(--safe-b) + 84px);
  background: var(--ink); color: var(--paper); padding: 11px 20px; border-radius: 999px; font-weight: 600; width: max-content; max-width: 90vw; text-align: center;
}

@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

.notice { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: 6px 16px 16px 6px; padding: 14px 16px; margin-bottom: 22px; }
.notice strong { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; }
.notice p { margin: 4px 0 0; color: var(--ink-soft); }

/* chores */
.chore-people { display: grid; gap: 10px; margin-top: 14px; }
.chore-person { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; font: inherit; color: var(--ink); }
.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.cp-name { font-weight: 700; font-size: 17px; }
.cp-count { font-size: 14px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar { display: block; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width .3s; }
.bar.wide { margin: 8px 0 4px; }
.chore-sheet { margin-top: 6px; }
.chore-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.chore-head h3 { font-size: 22px; margin: 0; }
.slot h4 { margin: 20px 0 8px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.chore { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; margin: 0 0 8px; padding: 10px 14px; text-align: left; font: inherit; font-size: 17px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.chore .box { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--sage); display: grid; place-items: center; background: var(--paper); }
.chore .box svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.chore.done .box { background: var(--sage-deep); border-color: var(--sage-deep); }
.chore.done .box svg { opacity: 1; }
.chore.done { background: transparent; color: var(--ink-soft); }
.chore.done .ct { text-decoration: line-through; text-decoration-color: var(--line); }
.chore small { display: block; font-size: 13px; text-decoration: none; color: var(--ink-soft); }

/* emergency */
.sos-card { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; font: inherit; color: var(--ink); padding: 14px 16px; margin: 0 0 18px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--wine); border-radius: 14px; }
.sos-card strong { font-family: 'Young Serif', serif; font-weight: 400; font-size: 19px; }
.sos-card span { color: var(--ink-soft); font-size: 15px; }
.sos-call { display: flex; flex-direction: column; gap: 2px; margin: 14px 0; padding: 18px; border-radius: 16px; background: var(--wine); color: #fff; text-decoration: none; }
.sos-call strong { font-family: 'Young Serif', serif; font-weight: 400; font-size: 30px; }
.sos-call span { font-size: 15px; opacity: .9; }
.address-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.address-card small { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.address-card strong { font-size: 22px; line-height: 1.25; }
.address-card span { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.dial { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; margin: 0 0 8px; padding: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.dial span { display: flex; flex-direction: column; }
.dial small { color: var(--ink-soft); font-size: 13px; }
.dial b { color: var(--sage-deep); font-size: 17px; white-space: nowrap; }
.step-card { margin: 0 0 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.step-card h3 { margin: 0 0 6px; font-size: 18px; }
.step-card p { margin: 4px 0; font-size: 16px; }
.facts { display: grid; gap: 8px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.fact span { font-size: 13px; color: var(--ink-soft); }
.fact em { color: var(--ink-soft); font-size: 15px; }

/* dashboard */
.dash-h { margin: 26px 0 10px; font-size: 19px; }
.behind { display: grid; gap: 8px; }
.bh { padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--wine); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.bh span { font-size: 14px; color: var(--ink-soft); }
.wk { display: grid; gap: 5px; }
.wk-row { display: grid; grid-template-columns: 72px repeat(7, 1fr); gap: 5px; align-items: center; }
.wk-head span { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.wk-head span.now { color: var(--wine); }
.wk-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.cell { display: grid; place-items: center; height: 34px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--line); color: var(--ink-soft); }
.cell.full { background: var(--sage-deep); color: #fff; font-size: 15px; }
.cell.part { background: #e8d9a8; color: #6b5316; }
.cell.zero { background: #ecc9c9; color: var(--wine); }
.cell.future, .cell.none { background: transparent; border: 1px dashed var(--line); }
.ptlist { display: grid; gap: 10px; }
.pt { display: grid; grid-template-columns: 72px 1fr 34px; align-items: center; gap: 8px; }
.pt-name { font-weight: 700; font-size: 15px; }
.pt-bar { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pt-bar > span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.pt-n { text-align: right; font-size: 17px; }
.pt-s { grid-column: 2 / 4; margin-top: -6px; color: var(--ink-soft); font-size: 13px; }
.extra { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.extra > span { flex: 1; min-width: 0; }
.extra small { color: var(--ink-soft); }
.extra b { color: var(--sage-deep); }
.extra .x { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--ink-soft); padding: 4px 8px; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pv { width: 64px; min-height: 40px; text-align: center; font: inherit; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.pv.saved { border-color: var(--sage-deep); background: #e3ecdf; }

/* groups */
.gbar { margin: 0 0 16px; }
.gtop { display: flex; align-items: center; gap: 10px; }
.gtop h2 { flex: 1; margin: 0; font-size: 22px; text-align: center; }
.seg { display: flex; gap: 6px; margin-top: 12px; padding: 4px; background: var(--line); border-radius: 12px; }
.seg-b { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.seg-b.on { background: var(--card); color: var(--sage-deep); box-shadow: 0 1px 3px rgba(59,42,30,.15); }
.group-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; }
.group-open { flex: 1; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.group-open strong { font-family: 'Young Serif', serif; font-weight: 400; font-size: 19px; }
.group-open small { color: var(--ink-soft); font-size: 14px; }
.mem-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mem-name { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.mem-post { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.mem-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--sage-deep); }
.tabs-inner .tab { font-size: 12px; }

/* albums */
.album-card { border-left-color: var(--gold); }
.album-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.album { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 10px; }
.album img, .album-empty { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: var(--line); display: block; margin-bottom: 6px; }
.album strong { font-family: 'Young Serif', serif; font-weight: 400; font-size: 16px; padding: 0 4px; }
.album small { color: var(--ink-soft); font-size: 13px; padding: 0 4px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.thumb { padding: 0; border: 0; background: var(--line); aspect-ratio: 1; border-radius: 4px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: #130d08; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.lightbox img { max-width: 100%; max-height: calc(100% - 130px); object-fit: contain; }
.lb-top, .lb-nav { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; }
.lb-top { top: env(safe-area-inset-top); }
.lb-nav { bottom: env(safe-area-inset-bottom); padding-bottom: 18px; }
.lb-who { color: #e9dfc9; font-size: 15px; flex: 1; }
.lb-btn { min-height: 44px; padding: 0 18px; border: 1.5px solid #8a7a62; border-radius: 99px; background: transparent; color: #f5eedf; font: inherit; font-weight: 700; }
.lb-btn[hidden] { display: none; }

/* tagging */
.tagpick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tagchip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 14px 4px 6px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; }
.tagchip[aria-pressed="true"] { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.with { color: var(--sage-deep); font-weight: 600; font-size: 15px; }

.group-link { border-left-color: var(--sage); }

.bar[hidden] { display: none; }
button.mount { width: 100%; padding: 0; border: 0; cursor: zoom-in; font: inherit; }
.lightbox img { touch-action: pinch-zoom; }
