/* Wedding site styles. Every colour comes from theme variables, so each couple can choose their own palette. */

:root {
  /* Brand palette ("Deep") */
  --rose: #A6445D;
  --navy: #142F40;
  --teal: #62929E;
  --olive: #393A10;
  --cream: #E7DECD;

  /* The six theme colours. Wedding sites can override these. */
  --bg: #F4EFE6;
  --paper: #FFFFFF;
  --ink: #142F40;
  --accent: #62929E;
  --btn: #A6445D;
  --btn-ink: #FFFFFF;

  --danger: #B0413B;
  --ok: #393A10;
  --ok-soft: #E8E7D5;

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --script: 'Dancing Script', 'Segoe Script', 'Brush Script MT', cursive;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

/* Shades worked out from the theme colours (.themed lets a live preview use its own palette). */
:root, .themed {
  --ink-2: color-mix(in srgb, var(--ink) 80%, var(--bg));
  --muted: color-mix(in srgb, var(--ink) 56%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 15%, var(--bg));
  --tint: color-mix(in srgb, var(--ink) 5%, var(--bg));
  --tint-2: color-mix(in srgb, var(--ink) 10%, var(--bg));
  --accent-deep: color-mix(in srgb, var(--accent) 78%, var(--ink));
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--paper));
  --btn-deep: color-mix(in srgb, var(--btn) 84%, #000);
  --shadow-sm: 0 4px 14px -6px color-mix(in srgb, var(--ink) 25%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 4%, transparent);
  --shadow: 0 22px 40px -28px color-mix(in srgb, var(--ink) 45%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 3%, transparent);
}
/* Older browsers without color-mix(): fixed shades of the default palette. */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root, .themed {
    --ink-2: #415561; --muted: #7A8A92; --line: #D5D5D0; --tint: #EAE7E0; --tint-2: #E0DED8;
    --accent-deep: #507D8A; --accent-soft: #E7F0F1; --btn-deep: #8C3A4F;
    --shadow-sm: 0 4px 14px -6px rgba(20, 47, 64, 0.25); --shadow: 0 22px 40px -28px rgba(20, 47, 64, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: radial-gradient(900px 520px at 50% -8%, color-mix(in srgb, var(--paper) 55%, transparent), transparent 70%) no-repeat, var(--bg);
  background-color: var(--bg);
  font-family: var(--script);
  font-size: 19px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Hide names/dates until settings load (avoids flashing the default names). */
body:not(.ready) [data-bind], body:not(.ready) [data-couple] { visibility: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 62px; padding: 0 28px;
  border-radius: 999px;
  font-family: var(--script); font-size: 1.55rem; font-weight: 600; line-height: 1;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s, opacity 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn .icon { width: 27px; height: 27px; }
.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: 0 16px 28px -16px color-mix(in srgb, var(--btn) 85%, transparent); }
.btn-primary:hover { background: var(--btn-deep); }
.btn-light { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-light:hover { box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--ink) 30%, transparent); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 23px; height: 23px; }
.icon-btn.sage { color: var(--accent-deep); }

/* ---------- Welcome page ---------- */
.landing { max-width: 520px; margin: 0 auto; padding: 56px 24px 12px; text-align: center; }
.date-pill {
  display: inline-flex; align-items: center; gap: 14px; margin: 0;
  color: var(--accent); font-style: italic; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; font-size: 1rem;
}
.date-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.couple {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 8.6vw, 3.5rem); line-height: 1.12; margin: 0.45em 0 0;
}
.amp { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); padding: 0 0.04em; }

/* Photo frame: the shape (heart, circle, scroll…) is a clip-path set from JavaScript;
   the paper-coloured outline is made with drop shadows so it follows any shape. */
.frame-wrap { position: relative; width: min(64vw, 300px); margin: 44px auto 0; }
.frame-wrap::before {
  content: ''; position: absolute; inset: -22% -30%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 80%, transparent), transparent);
}
.frame {
  --edge: 7px;
  filter:
    drop-shadow(var(--edge) 0 0 var(--paper)) drop-shadow(calc(var(--edge) * -1) 0 0 var(--paper))
    drop-shadow(0 var(--edge) 0 var(--paper)) drop-shadow(0 calc(var(--edge) * -1) 0 var(--paper))
    drop-shadow(0 24px 22px color-mix(in srgb, var(--ink) 26%, transparent));
}
.frame-inner {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden;
  background: linear-gradient(180deg, var(--tint), var(--tint-2));
  clip-path: url(#wu-shape-heart); -webkit-clip-path: url(#wu-shape-heart);
}
.frame-inner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.monogram {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.frame-inner[data-shape='heart'] .monogram { padding-bottom: 14%; }
.frame-inner[data-shape='maple'] .monogram { padding-bottom: 8%; }
.monogram b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(2.2rem, 10vw, 3.3rem); color: var(--accent); line-height: 1; }
.monogram span { font-family: var(--serif); font-size: 0.78rem; letter-spacing: 0.25em; color: var(--muted); }
.monogram::before, .monogram::after { content: ''; width: 46px; height: 1px; background: var(--line); }

.divider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 38px 0 24px; }
.divider span { width: 70px; height: 1px; background: var(--line); }
.divider i { width: 11px; height: 11px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; }

.welcome { font-size: 1.32rem; color: var(--ink-2); margin: 0 auto; max-width: 27em; line-height: 1.55; }

.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; margin: 38px auto 34px; }
.stats > div { display: flex; flex-direction: column; align-items: center; padding: 0 26px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { font-size: 2.05rem; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.stats span { color: var(--muted); font-size: 1.08rem; }

.actions { display: grid; gap: 14px; }
.not-live { display: grid; gap: 22px; margin-top: 4px; }
.made { text-align: center; color: var(--muted); font-size: 1.08rem; padding: 34px 20px 40px; }
.made .icon { width: 15px; height: 15px; color: var(--muted); vertical-align: -2px; margin: 0 2px; }
.powered { display: block; margin-top: 12px; font-size: 1rem; color: var(--btn); }
.powered .icon { color: currentColor; width: 14px; height: 14px; }
.powered:hover { text-decoration: underline; }

/* Small "Admin" button for the couple, top-left of the welcome page. */
.admin-chip {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 14px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px 7px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); box-shadow: var(--shadow-sm);
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600; color: var(--ink-2);
}
.admin-chip:hover { background: var(--paper); color: var(--ink); }
.admin-chip .icon { width: 14px; height: 14px; }

/* ---------- Top bar (upload page) ---------- */
.topbar {
  max-width: 580px; margin: 0 auto; padding: 16px 16px 6px;
  display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px;
}
.topbar-title { text-align: center; min-width: 0; }
.topbar-title h1 {
  font-family: var(--serif); font-weight: 500; font-size: 1.42rem; line-height: 1.2; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title p { margin: 0; color: var(--ink-2); font-size: 1.05rem; }

/* ---------- Upload page ---------- */
.upload { max-width: 580px; margin: 0 auto; padding: 8px 14px 30px; }
.upload.has-items { padding-bottom: 120px; }

.viewfinder {
  position: relative; width: min(100%, 60vh); margin: 12px auto 0; aspect-ratio: 4 / 5;
  background: #0b0a0c; border-radius: 30px; overflow: hidden;
  box-shadow: 0 24px 40px -26px rgba(0, 0, 0, 0.7);
  isolation: isolate;
}
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.viewfinder.live video { opacity: 1; }
.viewfinder.mirror video { transform: scaleX(-1); }
.corners i { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, 0.88); pointer-events: none; z-index: 2; }
.corners i:nth-child(1) { top: 20px; left: 20px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.corners i:nth-child(2) { top: 20px; right: 20px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.corners i:nth-child(3) { bottom: 20px; left: 20px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.corners i:nth-child(4) { bottom: 20px; right: 20px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

.vf-start, .vf-msg {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #fff; text-align: center; padding: 40px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 60%);
}
.vf-start { font-size: 1.55rem; }
.vf-start .icon { width: 50px; height: 50px; stroke-width: 1.5; opacity: 0.75; }
.vf-start:hover .icon { opacity: 1; }
.vf-msg { font-size: 1.25rem; color: #ece8e4; }
.vf-msg .icon { width: 40px; height: 40px; stroke-width: 1.5; opacity: 0.7; }
.vf-msg small { font-family: var(--sans); font-size: 0.78rem; opacity: 0.7; max-width: 26em; line-height: 1.5; }
.vf-msg .mini-btn {
  margin-top: 6px; font-family: var(--sans); font-size: 0.85rem; padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); color: #fff;
}
.viewfinder.starting .vf-start { opacity: 0.4; pointer-events: none; }

.vf-flash { position: absolute; inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; }
.vf-flash.go { animation: flash 0.38s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

.vf-rec {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: var(--sans); font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.vf-last { position: absolute; left: 18px; bottom: 18px; z-index: 3; width: 60px; height: 60px; }
.vf-last .thumb { width: 100%; height: 100%; border-radius: 14px; border: 2px solid #fff; overflow: hidden; background: #333; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
.vf-last .thumb img { width: 100%; height: 100%; object-fit: cover; }
.vf-last .count {
  position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--accent); color: #fff; font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
}
.vf-last.pop { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.15); } }

.modes { display: flex; justify-content: center; gap: 46px; margin: 24px 0 16px; }
.modes button {
  position: relative; padding: 6px 2px;
  font-style: italic; font-weight: 500; font-size: 1.3rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); transition: color 0.2s;
}
.modes button.active { color: var(--accent); }
.modes button.active::after {
  content: ''; position: absolute; left: 50%; bottom: -3px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
}
.modes button:disabled { opacity: 0.4; cursor: not-allowed; }

.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 10px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-2); font-size: 1.08rem; }
.round-btn {
  width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); transition: transform 0.15s, opacity 0.2s;
}
.round-btn:active { transform: scale(0.93); }
.round-btn .icon { width: 30px; height: 30px; }
.round-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.shutter {
  width: 94px; height: 94px; padding: 6px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--ink) 40%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 4%, transparent);
  transition: transform 0.12s;
}
.shutter:active { transform: scale(0.93); }
.shutter .ring { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 7px solid var(--tint-2); }
.shutter .core { width: 100%; height: 100%; border-radius: 50%; background: var(--paper); transition: all 0.22s ease; }
.mode-video .shutter .core { width: 58%; height: 58%; background: #e0443e; }
.recording .shutter .core { width: 36%; height: 36%; border-radius: 8px; }
.shutter:disabled { opacity: 0.5; cursor: not-allowed; }

.card { background: var(--paper); border-radius: 28px; padding: 26px 24px; box-shadow: var(--shadow); }

.closed-card { text-align: center; margin-top: 16px; padding: 40px 26px; }
.closed-card h2 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin: 0 0 6px; }
.closed-card p { color: var(--ink-2); margin: 0 0 24px; font-size: 1.25rem; }

.tray { margin-top: 28px; }
.tray-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tray-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: 0; }
.tray-head span { color: var(--muted); font-size: 1.1rem; }
.tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 16px; }
.t-item { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--tint); }
.t-item.new { animation: tileIn 0.3s ease-out; }
.t-item > img, .t-item > video { width: 100%; height: 100%; object-fit: cover; }
.t-item .open { position: absolute; inset: 0; }
@keyframes tileIn { from { opacity: 0; transform: scale(0.9); } }
.t-remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20, 20, 25, 0.62); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.t-remove .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.t-badge {
  position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff;
  font-family: var(--sans); font-size: 0.72rem; pointer-events: none;
}
.t-badge .icon { width: 11px; height: 11px; }
.t-add {
  aspect-ratio: 1; border-radius: 16px; border: 1.5px dashed var(--line); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 1rem;
}
.t-add .icon { width: 24px; height: 24px; }
.t-add:hover { border-color: var(--accent); color: var(--accent); }

.share { margin-top: 28px; }
.share h2 { font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1.2; margin: 0; }
.lead { color: var(--ink-2); margin: 0.35em 0 0.6em; font-size: 1.22rem; }
.field-label, .field-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 24px 2px 9px; font-style: italic; font-size: 1.08rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
.field-label em { font-style: normal; color: var(--btn); margin-left: 4px; }
.field-row span { letter-spacing: 0; font-family: var(--sans); font-style: normal; font-size: 0.8rem; color: var(--muted); }
.input {
  width: 100%; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--paper);
  font-family: var(--script); font-size: 1.3rem; color: var(--ink); line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.invalid { border-color: #c9625b; box-shadow: 0 0 0 4px #f8e3e1; }
textarea.input { min-height: 118px; }
.field-error { display: flex; align-items: center; gap: 6px; margin: 8px 4px 0; color: var(--danger); font-size: 1.1rem; }
.field-error .icon { width: 17px; height: 17px; }
.shake { animation: shake 0.42s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.done-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 26px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.done-bar .btn { max-width: 548px; margin: 0 auto; }
.done-bar .btn .check { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: grid; place-items: center; }
.done-bar .btn .check .icon { width: 18px; height: 18px; stroke-width: 2.6; }
@keyframes rise { from { transform: translateY(100%); } }

/* Upload sheet */
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 24, 30, 0.45); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.25s;
}
.sheet-panel {
  width: 100%; max-width: 580px; max-height: 90vh; overflow: auto;
  background: var(--paper); border-radius: 30px 30px 0 0;
  padding: 30px 24px calc(28px + env(safe-area-inset-bottom));
  animation: sheetUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@media (min-width: 640px) {
  .sheet { align-items: center; padding: 20px; }
  .sheet-panel { border-radius: 30px; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1.2; margin: 0; }
.sheet-sub { color: var(--ink-2); margin: 4px 0 0; font-size: 1.2rem; }
.overall { margin-top: 18px; }
.bar { height: 7px; border-radius: 99px; background: var(--tint-2); overflow: hidden; }
.bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.15s linear; }
.up-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.up-item { display: grid; grid-template-columns: 54px 1fr 30px; gap: 14px; align-items: center; }
.up-thumb { width: 54px; height: 54px; border-radius: 13px; object-fit: cover; background: var(--tint); }
.up-meta { min-width: 0; }
.up-top { display: flex; justify-content: space-between; gap: 8px; font-family: var(--sans); font-size: 0.86rem; color: var(--ink); margin-bottom: 7px; }
.up-top span:last-child { color: var(--muted); white-space: nowrap; }
.up-item .bar { height: 5px; }
.up-state { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.up-state .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.up-item.done .up-state { background: var(--accent); color: var(--paper); animation: pop 0.3s; }
.up-item.error .up-state { background: #f8e3e1; color: var(--danger); }
.up-item.error .bar i { background: var(--danger); }
.up-item.waiting { opacity: 0.55; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet-actions { display: grid; gap: 12px; margin-top: 26px; }

.sheet-done { text-align: center; padding: 10px 0 0; }
.done-check { width: 96px; height: 96px; margin: 0 auto 18px; }
.done-check circle { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 280; stroke-dashoffset: 280; animation: draw 0.7s ease-out forwards; }
.done-check path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.4s 0.55s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sheet-done p { color: var(--ink-2); font-size: 1.25rem; margin: 8px 0 0; }

/* Photo viewer (always dark, so photos pop) */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto auto 1fr auto;
  background: rgba(12, 14, 16, 0.96); color: #fff; animation: fadeIn 0.2s;
}
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px; padding-top: calc(14px + env(safe-area-inset-top)); }
.lb-top .group { display: flex; gap: 10px; }
.lb-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: #fff; transition: background 0.2s; }
.lb-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lb-btn .icon { width: 21px; height: 21px; }
.lb-count { font-family: var(--sans); font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.lb-progress { height: 3px; margin: 0 16px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.lightbox.playing .lb-progress { opacity: 1; }
.lb-progress i { display: block; height: 100%; width: 0; background: #fff; }
.lb-stage { position: relative; min-height: 0; overflow: hidden; touch-action: pan-y; }
.lb-stage > img, .lb-stage > video {
  position: absolute; inset: 0; margin: auto; max-width: calc(100% - 20px); max-height: calc(100% - 12px);
  border-radius: 12px; animation: fadeIn 0.3s;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12); color: #fff;
}
.lb-nav .icon { width: 26px; height: 26px; }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
@media (hover: none) { .lb-nav { display: none; } }
.lb-caption { padding: 14px 24px calc(22px + env(safe-area-inset-bottom)); text-align: center; }
.lb-caption h3 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0; }
.lb-caption time { display: block; font-family: var(--sans); font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }
.lb-caption p { margin: 8px auto 0; max-width: 30em; font-size: 1.25rem; color: rgba(255, 255, 255, 0.92); }

/* ---------- Album ---------- */
.g-hero {
  position: relative; min-height: min(78vh, 640px); overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 90px 20px 0; text-align: center;
}
.g-hero-bg { position: absolute; inset: 0; background: linear-gradient(180deg, var(--tint-2) 0%, var(--bg) 100%); }
.g-hero-bg img { width: 100%; height: 76%; object-fit: cover; }
.g-hero-bg .ghost-mono {
  position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-style: italic; font-size: clamp(7rem, 34vw, 13rem);
  color: color-mix(in srgb, var(--accent) 14%, transparent); line-height: 1; white-space: nowrap;
}
.g-hero.has-cover .g-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.08) 30%, rgba(16, 20, 26, 0.42) 56%, color-mix(in srgb, var(--bg) 55%, transparent) 72%, var(--bg) 84%);
}
.g-hero:not(.has-cover) { min-height: 0; padding-top: 110px; }
.g-hero > p, .g-hero > h1, .g-hero > .stats { position: relative; }
.hero-back { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px; z-index: 2; }
.g-date { margin: 0; font-style: italic; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; font-size: 1.05rem; color: var(--accent); }
.g-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 10vw, 3.6rem); line-height: 1.12; margin: 0.3em 0 0; }
.g-hero.has-cover .g-date, .g-hero.has-cover h1 { color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.25); }
.g-hero.has-cover h1 .amp { color: #fff; }
.g-hero .stats { margin: 44px auto 28px; }

.gallery { max-width: 980px; margin: 0 auto; padding: 0 16px 20px; }
.gallery > .btn { max-width: 560px; margin: 0 auto; }
.g-tools { margin-top: 44px; padding: 14px; border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; }
.tabs { display: flex; gap: 2px; width: 100%; }
.tab { display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; font-size: 1.22rem; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.tab .icon { width: 19px; height: 19px; }
.tab .n { color: var(--muted); }
.tab.active { background: var(--accent); color: var(--paper); }
.tab.active .n { color: color-mix(in srgb, var(--paper) 82%, transparent); }
.pill-select { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 42px; border: 1.5px solid var(--line); border-radius: 999px; }
.pill-select.grow { flex: 1 1 100px; min-width: 0; }
.pill-select .icon { width: 20px; height: 20px; flex: none; }
.pill-select .chev { width: 16px; height: 16px; position: absolute; right: 12px; pointer-events: none; }
.pill-select select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--script); font-size: 1.2rem; color: var(--ink); padding: 0 22px 0 0; max-width: 170px;
}
.pill-select select option { color: #142F40; background: #fff; }
.pill-select.grow select { width: 100%; max-width: none; min-width: 0; text-overflow: ellipsis; }
.pill-select select:focus { outline: none; }
.pill-select:focus-within { border-color: var(--accent); }
.tool-btn { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.tool-btn .icon { width: 22px; height: 22px; }
.tool-btn:hover { background: var(--tint); }
.tool-btn.play { background: var(--accent); color: var(--paper); }
.tool-btn.play:hover { background: var(--accent-deep); }
.tool-btn.play .icon { width: 20px; height: 20px; margin-left: 2px; }

.g-label { margin: 36px 6px 0; font-style: italic; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-size: 1.05rem; }
.g-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 30px 6px 16px; }
.g-group-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; line-height: 1.2; margin: 0; }
.g-group-head span { color: var(--muted); font-size: 1.15rem; white-space: nowrap; }
.m-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; }
.dense .m-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 720px) {
  .m-grid { grid-template-columns: repeat(3, 1fr); gap: 22px 20px; }
  .dense .m-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
}
.m-card {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 22px; background: var(--tint-2);
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 16px 26px -18px color-mix(in srgb, var(--ink) 55%, transparent);
  transition: transform 0.25s, box-shadow 0.25s;
}
.m-card:hover { transform: rotate(0deg) scale(1.02); box-shadow: 0 22px 30px -18px color-mix(in srgb, var(--ink) 55%, transparent); }
.dense .m-card { border-radius: 14px; transform: none; }
.m-card img, .m-card video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s; }
.m-card .loaded { opacity: 1; }
.m-badges { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; pointer-events: none; }
.m-badge {
  display: flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5); color: #fff; font-family: var(--sans); font-size: 0.74rem;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.m-badge .icon { width: 12px; height: 12px; }
.dense .m-badge span { display: none; }

.empty { text-align: center; padding: 60px 20px 20px; }
.empty .icon-wrap { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--accent); box-shadow: var(--shadow-sm); }
.empty .icon-wrap .icon { width: 36px; height: 36px; stroke-width: 1.5; }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin: 0; }
.empty p { color: var(--ink-2); margin: 6px 0 24px; font-size: 1.22rem; }
.empty .btn { max-width: 320px; margin: 0 auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top)); z-index: 100; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 440px; padding: 11px 18px; border-radius: 14px; background: #142F40; color: #fff;
  font-family: var(--sans); font-size: 0.88rem; line-height: 1.4; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.error { background: var(--danger); }
.toast.success { background: #393A10; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
