@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --paper: #f4eee5;
  --paper-2: #ebe3d6;
  --card: #fffdf9;
  --ink: #2a2520;
  --ink-2: #6b6158;
  --ink-3: #9a8f84;
  --line: #ddd3c4;
  --accent: #7b4b8e;
  --accent-ink: #fff;
  --danger: #a33a2a;
  --u0: #b5532e;
  --u1: #3d6e70;
  --u2: #7a5a9b;
  --u3: #8a7a2a;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
  --shadow-lg: 0 10px 40px rgba(40, 25, 10, .22);
  --radius: 16px;

  --c-zand: #f3e6cf;
  --c-salie: #dfe7d4;
  --c-perzik: #f7d9c8;
  --c-lavendel: #e5ddf0;
  --c-hemel: #d6e5ee;
  --c-citroen: #f5eeb8;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1a17;
    --paper-2: #26221e;
    --card: #2b2723;
    --ink: #f1ebe3;
    --ink-2: #bdb2a6;
    --ink-3: #8c8277;
    --line: #3d3731;
    --accent: #c59ad8;
    --accent-ink: #1d1a17;
    --danger: #e07a68;
    --u0: #e0835c;
    --u1: #7fb5b6;
    --u2: #b89be0;
    --u3: #cdbb5c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    --c-zand: #3a3125;
    --c-salie: #2f3729;
    --c-perzik: #40302a;
    --c-lavendel: #342e3f;
    --c-hemel: #283640;
    --c-citroen: #3c3820;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 2rem; text-align: center; }

/* ---------- knoppen & velden ---------- */
.btn {
  border: 0; border-radius: 999px; padding: .7rem 1.25rem; font-weight: 600;
  min-height: 44px; transition: transform .1s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }

.icon-btn {
  border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { background: var(--paper-2); }

.field { display: block; margin: 0 0 1rem; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field input, .field textarea, .comment-form textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px;
  padding: .7rem .85rem; font-size: 16px; /* voorkomt inzoomen op iOS */
  transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus, .comment-form textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; line-height: 1.5; }
.form-error { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: .25rem 0 .75rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- aanmelden ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 24px; padding: 2rem 1.5rem 1.5rem;
  box-shadow: var(--shadow); text-align: center;
}
.login-mark { color: var(--accent); margin-bottom: .5rem; }
.login h1 { font-size: 2rem; }
.lead { color: var(--ink-2); margin: .25rem 0 1.5rem; }
.login fieldset { border: 0; padding: 0; margin: 0 0 1rem; text-align: left; }
.login legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: .5rem; }
.login .field { text-align: left; }
.name-pick { display: flex; gap: .5rem; flex-wrap: wrap; }
.name-btn {
  flex: 1 1 0; min-width: 130px; display: flex; align-items: center; gap: .6rem; justify-content: center;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: .9rem 1rem;
  font-weight: 600; font-size: 1.05rem; min-height: 58px; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.name-btn:hover { border-color: var(--uc); background: color-mix(in srgb, var(--uc) 10%, var(--card)); }
.name-btn:active { transform: scale(.97); }
.name-btn .avatar { width: 30px; height: 30px; font-size: .85rem; }

.credit { text-align: center; font-size: .75rem; color: var(--ink-3); padding: 1.5rem 1rem calc(1.5rem + var(--safe-b)); }
.credit a { text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.credit-app { padding-bottom: calc(6rem + var(--safe-b)); }

/* ---------- app ---------- */
.app { max-width: 1200px; margin: 0 auto; padding: 0 1rem calc(6rem + var(--safe-b)); }
.topbar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 0 .75rem;
}
.brand h1 { font-size: 1.75rem; line-height: 1.1; }
.greeting { margin: .15rem 0 0; color: var(--ink-2); font-size: .95rem; }

.avatar, .avatar-btn {
  --uc: var(--u0);
  display: inline-grid; place-items: center; border-radius: 50%; background: var(--uc); color: #fff;
  font-weight: 700; font-family: var(--sans); flex: none;
}
.avatar-btn { width: 42px; height: 42px; border: 0; font-size: 1.05rem; box-shadow: var(--shadow); }
.avatar { width: 22px; height: 22px; font-size: .7rem; }
@media (prefers-color-scheme: dark) { .avatar, .avatar-btn { color: #1d1a17; } }

.menu {
  position: absolute; right: 0; top: calc(100% - .25rem); z-index: 30; background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: .35rem; min-width: 230px;
}
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .7rem .9rem; border-radius: 10px; }
.menu button:hover { background: var(--paper-2); }

.controls { position: sticky; top: 0; z-index: 10; background: var(--paper); padding: .5rem 0 .6rem; display: grid; gap: .55rem; }
.search {
  display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0 1rem; color: var(--ink-3);
}
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; background: transparent; outline: none; flex: 1; padding: .65rem 0; font-size: 16px; color: var(--ink); min-width: 0; }

.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: transparent; border-radius: 999px;
  padding: .35rem .85rem; font-size: .88rem; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: .35rem; min-height: 36px;
}
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .count { font-weight: 500; opacity: .65; }
.chips-tags .chip { font-weight: 500; font-size: .82rem; padding: .25rem .7rem; min-height: 32px; }

.news {
  margin: .25rem 0 .75rem; background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-radius: 12px; padding: .6rem .9rem; font-size: .92rem;
}

/* ---------- bord ---------- */
.board { columns: 1; column-gap: 1rem; padding-top: .5rem; }
@media (min-width: 620px) { .board { columns: 2; } }
@media (min-width: 940px) { .board { columns: 3; } }
@media (min-width: 1180px) { .board { columns: 4; } }

.card {
  break-inside: avoid; display: block; width: 100%; margin: 0 0 1rem; text-align: left;
  background: var(--card); border: 0; border-radius: var(--radius); padding: 1rem 1rem .8rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--cc); }
.card { --cc: var(--c-zand); background: color-mix(in srgb, var(--cc) 45%, var(--card)); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card:active { transform: scale(.99); }
.card-top { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; font-size: .75rem; color: var(--ink-2); }
.card-top .spacer { flex: 1; }
.card h3 { font-size: 1.15rem; line-height: 1.25; margin-bottom: .3rem; overflow-wrap: anywhere; }
.card p { margin: 0 0 .6rem; color: var(--ink-2); font-size: .93rem; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: var(--ink-3); margin-top: .4rem; }
.card-foot .spacer { flex: 1; }
.card-foot .liked { color: var(--accent); }
.badge-new { background: var(--accent); color: var(--accent-ink); font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .1rem .5rem; letter-spacing: .02em; }
.pin { color: var(--accent); }

.status-pill {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-2);
}
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sc, var(--ink-3)); }
.s-idee { --sc: #d4a12a; }
.s-uitwerken { --sc: #3d8bb5; }
.s-gedaan { --sc: #4a9a5c; }
.s-geparkeerd { --sc: #9a8f84; }
.card.is-gedaan h3 { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.card.is-geparkeerd { opacity: .72; }

.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-size: .75rem; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-2); border-radius: 999px; padding: .1rem .55rem; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); }
.empty-title { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); margin: 0 0 .25rem; }

.fab {
  position: fixed; right: max(1.25rem, calc((100vw - 1200px) / 2 + 1rem)); bottom: calc(1.25rem + var(--safe-b)); z-index: 20;
  width: 62px; height: 62px; border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform .15s ease;
}
.fab:active { transform: scale(.94); }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(30, 20, 10, .42); animation: fade .2s ease; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--paper); border-radius: 24px 24px 0 0; padding: .5rem 1.25rem calc(1.25rem + var(--safe-b));
  box-shadow: var(--shadow-lg); animation: up .25s cubic-bezier(.2, .8, .3, 1); overscroll-behavior: contain;
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: .25rem auto .75rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; gap: 1rem; }
.sheet-head h2 { font-size: 1.4rem; }
.sheet-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 1.5rem; }
  .sheet { border-radius: 24px; padding-bottom: 1.5rem; }
  .sheet-grip { display: none; }
  .sheet-head { margin-top: .75rem; }
}
.sheet-center { align-items: center; padding: 1.25rem; }
.dialog { position: relative; background: var(--paper); border-radius: 20px; padding: 1.5rem; max-width: 380px; width: 100%; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.dialog p { margin: 0 0 1rem; font-size: 1.05rem; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg button {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: .45rem .9rem;
  font-size: .9rem; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: .4rem; min-height: 40px;
}
.seg button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.seg button[aria-checked="true"] { border-color: var(--ink); color: var(--ink); background: color-mix(in srgb, var(--sc) 18%, var(--card)); }
.seg-small button { padding: .3rem .7rem; font-size: .82rem; min-height: 36px; }

.swatches { display: flex; gap: .55rem; flex-wrap: wrap; }
.swatches button {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: var(--cc);
}
.swatches button[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper) inset; }

/* ---------- detail ---------- */
.d-title { font-size: 1.65rem; line-height: 1.2; overflow-wrap: anywhere; }
.d-meta { color: var(--ink-3); font-size: .85rem; margin: .4rem 0 1rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.d-body { white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 1rem; font-size: 1.02rem; }
.d-body:empty { display: none; }
.d-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.pill-btn {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: .45rem .9rem;
  font-size: .88rem; font-weight: 600; color: var(--ink-2); min-height: 40px;
}
.pill-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.pill-danger { color: var(--danger); }
.d-quickstatus { display: flex; flex-direction: column; gap: .4rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.d-quickstatus > span { font-size: .8rem; font-weight: 600; color: var(--ink-3); }

.comments { border-top: 1px solid var(--line); padding-top: 1rem; }
.comments h3 { font-size: 1.1rem; margin-bottom: .75rem; }
.comment-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.comment { display: flex; gap: .6rem; align-items: flex-start; }
.comment .avatar { width: 30px; height: 30px; font-size: .8rem; margin-top: .1rem; }
.bubble { background: var(--card); border-radius: 4px 16px 16px 16px; padding: .55rem .8rem; flex: 1; min-width: 0; box-shadow: var(--shadow); }
.bubble-head { display: flex; gap: .5rem; align-items: baseline; font-size: .78rem; color: var(--ink-3); margin-bottom: .15rem; }
.bubble-head strong { color: var(--ink); font-size: .85rem; }
.bubble-head .spacer { flex: 1; }
.bubble-head button { border: 0; background: none; color: var(--ink-3); font-size: .75rem; padding: 0 .1rem; text-decoration: underline; }
.bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.comment-empty { color: var(--ink-3); font-size: .92rem; }
.comment-form { display: flex; gap: .5rem; align-items: flex-end; }
.comment-form textarea { flex: 1; min-height: 46px; }

/* ---------- meldingen ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(6.25rem + var(--safe-b)); transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--paper); padding: .65rem 1.1rem; border-radius: 999px; font-size: .92rem;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 2rem); text-align: center; animation: pop .18s ease;
}
.offline { position: sticky; top: 0; z-index: 60; background: var(--danger); color: #fff; text-align: center; font-size: .85rem; padding: .4rem 1rem; }
#login-error:empty { display: none; }

/* ---------- tabs ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; background: var(--paper-2);
  border-radius: 999px; padding: .3rem; margin: .25rem 0 .2rem;
}
.tab {
  border: 0; background: transparent; border-radius: 999px; padding: .55rem .5rem; min-height: 44px;
  font-weight: 700; font-size: .95rem; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  position: relative; transition: background .15s ease, color .15s ease;
}
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tab .tab-ico { font-size: 1.05rem; line-height: 1; }
.tab .tab-dot {
  min-width: 18px; height: 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: .68rem; font-weight: 800; display: inline-grid; place-items: center; padding: 0 .3rem;
}
@media (max-width: 360px) { .tab .tab-ico { display: none; } }

/* ---------- dates ---------- */
.when { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--ink); margin: 0 0 .5rem;
  background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 999px; padding: .15rem .6rem; }
.when.past { color: var(--ink-3); }
.s-ooit { --sc: #d4a12a; }
.s-gepland { --sc: #3d8bb5; }
.s-bezig { --sc: #7b4b8e; }
.s-bingo { --sc: #4a9a5c; }
.card.is-gedaan.kind-date h3 { text-decoration: none; }
.field-row { display: flex; gap: .5rem; align-items: center; }
.field-row input { flex: 1; }
.link-btn { border: 0; background: none; color: var(--ink-2); text-decoration: underline; font-size: .88rem; padding: .3rem; }

/* ---------- bingo ---------- */
.card.kind-bingo { cursor: pointer; }
.dots { display: flex; flex-wrap: wrap; gap: .45rem; margin: .35rem 0 .55rem; }
.dot {
  width: 34px; height: 34px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--ink) 28%, transparent);
  background: color-mix(in srgb, var(--card) 80%, transparent); padding: 0; display: grid; place-items: center;
  color: #fff; font-size: .8rem; font-weight: 800; transition: transform .12s ease, background .15s ease;
}
.dot:hover { border-color: var(--ink-2); }
.dot:active { transform: scale(.88); }
.dot.on { border: 2px solid var(--uc); background: var(--uc); }
@media (prefers-color-scheme: dark) { .dot.on { color: #1d1a17; } }
.dot.on::after { content: "✓"; }
.dots-big { gap: .6rem; margin: .5rem 0 1rem; }
.dots-big .dot { width: 46px; height: 46px; font-size: 1.05rem; }
.progress { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.bar { flex: 1; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.card.is-bingo .bar > i, .bar.done > i { background: #4a9a5c; }
.bingo-badge { background: #4a9a5c; color: #fff; font-size: .7rem; font-weight: 800; border-radius: 999px; padding: .12rem .55rem; letter-spacing: .03em; }
.who-ticked { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin-bottom: .5rem; }
.who-ticked > span { display: inline-flex; align-items: center; gap: .35rem; }
.stepper { display: inline-flex; align-items: center; gap: .4rem; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); font-size: 1.3rem; font-weight: 700; color: var(--ink);
}
.stepper input { width: 80px; text-align: center; }
.hint { font-size: .82rem; color: var(--ink-3); margin: .35rem 0 0; }
.celebrate { animation: cheer .6s ease; }
@keyframes cheer { 0% { transform: scale(1); } 30% { transform: scale(1.04) rotate(-.6deg); } 60% { transform: scale(.99) rotate(.4deg); } 100% { transform: none; } }
.card .when { display: inline-flex; -webkit-line-clamp: unset; color: var(--ink); margin: 0 0 .5rem; }
.card .when.past { color: var(--ink-3); }
.dots-small { gap: .35rem; }
.dots-small .dot { width: 26px; height: 26px; font-size: .65rem; }

/* ---------- foto's ---------- */
.card-photo { position: relative; margin: -1rem -1rem .75rem; aspect-ratio: 16 / 9; max-height: 220px; width: calc(100% + 2rem); background: var(--paper-2); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:has(.card-photo)::before { z-index: 1; }
.photo-count { position: absolute; right: .5rem; bottom: .5rem; background: rgba(20, 15, 10, .62); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .15rem .55rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.photo-grid:empty { display: none; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--paper-2); border: 0; padding: 0; display: block; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20, 15, 10, .7); color: #fff; font-size: 1.1rem; line-height: 1; display: grid; place-items: center; }
.photo-add { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; position: relative; }
.photo-add:focus-within { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.d-photos { margin: 1rem 0 .25rem; }

.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(12, 9, 6, .94); display: flex; align-items: center; justify-content: center; padding: 3.5rem .5rem 4.5rem; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; animation: pop .18s ease; }
.viewer-close { position: absolute; top: calc(.6rem + env(safe-area-inset-top, 0px)); right: .6rem; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 2rem; line-height: 1; }
.viewer-prev { left: .5rem; }
.viewer-next { right: .5rem; }
.viewer-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem calc(.75rem + var(--safe-b)); color: rgba(255, 255, 255, .8); font-size: .85rem; }
.viewer-bar .pill-btn { background: transparent; border-color: rgba(255, 255, 255, .3); color: #ffb3a6; }
