/* =====================================================================
   Tagality — stylesheet  (TAG + reALITY: tag real places with stories)
   Identity: a cool cartographic palette (ink blue, mist paper, deep-rose
   tags) with topographic contour lines as the signature motif.
   Literata (serif) carries memories and headings; Figtree runs the UI.
   Tags have no category: the optional template sets one accent colour
   (accent-rose default, amber, violet, teal, ink).
   ===================================================================== */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/literata-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/literata-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/literata-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/literata-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --ink: #1d2a3e;
  --ink-2: #3b4b63;
  --muted: #5b6878;
  --paper: #f2f5f4;
  --paper-2: #e7eeec;
  --card: #ffffff;
  --line: #d3dcd9;
  --contour: #a9bdb6;
  --rose: #b23a62;
  --rose-dark: #8f2c4e;
  --rose-soft: #f6e6ec;
  --t-place: #2b7a71;
  --t-event: #bf7a14;
  --t-memorial: #5d5490;
  --ok: #2f7d4f;
  --warn: #a8670d;
  --danger: #b3261e;
  --accent: var(--rose);

  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(29, 42, 62, .06), 0 8px 24px -12px rgba(29, 42, 62, .18);
  --shadow-lift: 0 2px 4px rgba(29, 42, 62, .06), 0 18px 40px -18px rgba(29, 42, 62, .32);
  --gutter: clamp(16px, 4vw, 32px);
  --wrap: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Contour lines, as a tileable background */
  --contour-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='360' viewBox='0 0 560 360'%3E%3Cg fill='none' stroke='%23a9bdb6' stroke-width='1' opacity='.55'%3E%3Cpath d='M-10 250c70-40 120-20 180-60s80-110 160-118 130 52 240 20'/%3E%3Cpath d='M-10 280c80-38 135-18 195-58s95-104 170-108 120 58 215 30'/%3E%3Cpath d='M-10 310c90-34 150-14 212-52s110-96 180-96 110 64 188 40'/%3E%3Cpath d='M-10 340c100-30 165-10 228-46s124-86 190-84 100 70 162 50'/%3E%3Cpath d='M70 90c26-28 74-38 104-18s18 64-20 74-104-18-84-56z'/%3E%3Cpath d='M92 92c16-16 48-22 68-9s12 40-12 46-66-12-56-37z'/%3E%3Cpath d='M400 70c40-20 96-10 110 18s-26 58-72 52-80-46-38-70z'/%3E%3C/g%3E%3C/svg%3E");
  --contour-img-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='360' viewBox='0 0 560 360'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' opacity='.12'%3E%3Cpath d='M-10 250c70-40 120-20 180-60s80-110 160-118 130 52 240 20'/%3E%3Cpath d='M-10 280c80-38 135-18 195-58s95-104 170-108 120 58 215 30'/%3E%3Cpath d='M-10 310c90-34 150-14 212-52s110-96 180-96 110 64 188 40'/%3E%3Cpath d='M-10 340c100-30 165-10 228-46s124-86 190-84 100 70 162 50'/%3E%3Cpath d='M70 90c26-28 74-38 104-18s18 64-20 74-104-18-84-56z'/%3E%3Cpath d='M92 92c16-16 48-22 68-9s12 40-12 46-66-12-56-37z'/%3E%3Cpath d='M400 70c40-20 96-10 110 18s-26 58-72 52-80-46-38-70z'/%3E%3C/g%3E%3C/svg%3E");
}
.accent-rose, .theme-rose     { --accent: var(--rose); }
.accent-teal, .theme-teal     { --accent: var(--t-place); }
.accent-amber, .theme-amber   { --accent: var(--t-event); }
.accent-violet, .theme-violet { --accent: var(--t-memorial); }
.accent-ink, .theme-ink       { --accent: var(--ink); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-dark); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--rose); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--rose-soft); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.narrow { max-width: 760px; }
.narrow-wide { max-width: 920px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.icon-xs { width: 1em; height: 1em; vertical-align: -.14em; }

.display { font-size: clamp(2.4rem, 5.6vw, 4.3rem); line-height: 1.04; letter-spacing: -.025em; font-weight: 500; }
.display-2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.02em; }
.display-3 { font-family: var(--serif); font-size: 1.5rem; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 38em; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-tight { padding-top: 32px; padding-bottom: 64px; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: .9em; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head .section-title { margin: 0; }

.contour-bg { background-color: var(--paper-2); background-image: var(--contour-img); background-size: 560px 360px; }
.contour-dark { background-color: var(--ink); background-image: var(--contour-img-dark); color: #fff; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 .95rem/1 var(--sans); padding: .78em 1.2em; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .18s var(--ease), color .18s, border-color .18s, transform .12s;
  white-space: nowrap; min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-small { font-size: .85rem; padding: .55em .95em; min-height: 36px; }
.btn-large { font-size: 1.05rem; padding: .95em 1.5em; min-height: 52px; }
.btn-block { width: 100%; }
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: var(--rose-dark); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); color: #fff; }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: rgba(255,255,255,.6); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8e1d17; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #e7c3c0; }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: .35em; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--paper-2); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(242, 245, 244, .88); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(211, 220, 217, .7); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 600 1.2rem/1 var(--serif); letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav > a:not(.btn), .site-nav .link-btn { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav > a:not(.btn):hover, .site-nav .link-btn:hover { color: var(--ink); text-decoration: none; }
.site-nav > a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--rose); }
.nav-form { margin: 0; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); cursor: pointer; }
  .site-nav { position: fixed; inset: 64px 0 auto 0; background: var(--paper); flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lift); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s var(--ease); }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .site-nav > a:not(.btn), .site-nav .link-btn { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; width: 100%; }
  .site-nav > a[aria-current="page"] { box-shadow: none; color: var(--rose-dark); }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- Flash & notices ---------- */
.flash-stack { margin-top: 16px; display: grid; gap: 8px; }
.flash { position: relative; padding: 12px 48px 12px 16px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500; animation: flash-in .35s var(--ease); }
.flash-success { border-left: 4px solid var(--ok); }
.flash-error { border-left: 4px solid var(--danger); }
.flash-info { border-left: 4px solid var(--ink); }
.flash-close { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; cursor: pointer; color: var(--muted); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }
.notice { padding: 14px 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); margin: 16px 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice p { margin: 0; }
.notice-warn { background: #fdf5e7; border-color: #efd9ad; }
.notice-danger { background: #fbeceb; border-color: #efc5c1; color: #7d1a14; }
.notice-ok { background: #ecf6ef; border-color: #bfdcc9; }

/* ---------- Hero (home) ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero-copy .display { margin-bottom: .35em; max-width: 11em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 16px; }
.hero-note { font-size: .92rem; }
.hero-visual { position: relative; aspect-ratio: 52 / 44; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-lift); overflow: hidden; color: var(--contour); }
.hero-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-pin { position: absolute; }
.hp-1 { left: 30%; top: 40%; } .hp-2 { left: 62%; top: 24%; } .hp-3 { left: 74%; top: 70%; }
.pin-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(0,0,0,.25); flex: none; }
.hero-pin .pin-dot { width: 22px; height: 22px; }
.hero-pin .pin-dot::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ping 2.8s var(--ease) infinite; }
.hp-2 .pin-dot::after { animation-delay: .9s; } .hp-3 .pin-dot::after { animation-delay: 1.8s; }
@keyframes ping { 0% { opacity: .7; transform: scale(.5); } 70%, 100% { opacity: 0; transform: scale(1.6); } }
.note-card { position: absolute; margin: 0; background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-lift); max-width: 62%; border-top: 3px solid var(--accent); }
.note-card blockquote { margin: 0 0 6px; font: italic 400 .98rem/1.45 var(--serif); }
.note-card figcaption { font-size: .78rem; color: var(--muted); }
.nc-1 { left: 6%; top: 52%; }
.nc-2 { right: 5%; top: 7%; max-width: 50%; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { aspect-ratio: 4 / 3; }
}

/* ---------- How it works ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); counter-reset: none; }
.steps li { position: relative; padding-top: 18px; border-top: 2px solid var(--ink); }
.step-n { font: 500 2.6rem/1 var(--serif); color: var(--rose); display: block; margin-bottom: 14px; }
.steps h3 { font-size: 1.3rem; }
.steps p { color: var(--ink-2); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Use cases ---------- */
.uses { background: var(--card); }
.use-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.use { padding: 28px 26px 22px; border-radius: var(--r-lg); background: var(--paper); position: relative; overflow: hidden; }
.use::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.use-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--accent); margin-bottom: 18px; }
.use-icon .icon { width: 24px; height: 24px; }
.use h3 { font-size: 1.35rem; }
.use p { color: var(--ink-2); }
.use-list { margin: 0; padding: 0; list-style: none; font-size: .92rem; color: var(--muted); }
.use-list li { padding: 7px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .use-grid { grid-template-columns: 1fr; } }

/* ---------- Place cards (listings) ---------- */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.place-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s; }
.place-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.pc-media { aspect-ratio: 3 / 2; background: var(--paper-2); overflow: hidden; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; }
.pc-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--accent); }
.pc-placeholder .icon { width: 44px; height: 44px; opacity: .8; }
.pc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-body h3 { font-size: 1.18rem; margin: 2px 0 0; }
.pc-where { margin: 0; font-size: .88rem; }
.pc-count { margin: auto 0 0; font-size: .85rem; font-weight: 600; color: var(--accent); }
.type-chip { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 3px 9px 3px 7px; border-radius: 999px; width: fit-content; }
.type-chip-lg { font-size: .85rem; padding: 5px 12px 5px 10px; }
.grid-ad { grid-column: 1 / -1; }

/* ---------- Map teaser / FAQ / CTA ---------- */
.map-teaser-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.map-teaser p { color: rgba(255,255,255,.8); max-width: 34em; }
.map-teaser .section-title { color: #fff; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-weight: 600; }
.legend-list li { display: flex; align-items: center; gap: 14px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; padding: 20px 36px 20px 0; font: 500 1.15rem/1.35 var(--serif); list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 400 1.6rem/1 var(--sans); color: var(--rose); transition: transform .2s var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--ink-2); padding-bottom: 12px; max-width: 40em; }
.final-cta { background: var(--card); }
.final-cta .lede { margin: 0 auto 28px; }

/* ---------- Ads ---------- */
.ad-slot { margin: 28px auto; text-align: center; min-height: 90px; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .02em; }

/* ---------- Public page ---------- */
.owner-bar { background: var(--ink); color: #fff; font-size: .9rem; }
.owner-row { display: flex; align-items: center; gap: 10px; min-height: 48px; flex-wrap: wrap; }
.owner-row span { margin-right: auto; }
.owner-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.owner-bar .btn-ghost:hover { background: rgba(255,255,255,.08); border-color: #fff; color: #fff; }

.place-hero { position: relative; padding: clamp(48px, 9vw, 110px) 0 clamp(36px, 6vw, 64px); isolation: isolate; }
.place-hero.has-cover { color: #fff; min-height: min(62vh, 520px); display: flex; align-items: flex-end; }
.place-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.place-hero.has-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20,28,42,.05) 0%, rgba(20,28,42,.35) 45%, rgba(20,28,42,.82) 100%); }
.place-hero-inner { width: 100%; }
.place-title { font-size: clamp(2.1rem, 5.4vw, 3.8rem); line-height: 1.06; letter-spacing: -.02em; margin: 14px 0 8px; max-width: 18em; }
.place-subtitle { font: 400 1.2rem/1.4 var(--serif); opacity: .9; margin-bottom: 8px; }
.in-memory { font: italic 400 1.05rem/1 var(--serif); margin: 18px 0 -6px; opacity: .85; }
.life-dates { font: 400 1.15rem/1.4 var(--serif); margin: 0 0 6px; }
.hero-meta { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-weight: 500; }
.has-cover .type-chip { background: rgba(255,255,255,.92); }
.place-hero:not(.has-cover) { border-bottom: 1px solid var(--line); }
.place-hero:not(.has-cover) .place-title { color: var(--ink); }

.place-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 4vw, 56px); padding-top: 36px; padding-bottom: 80px; }
.place-aside { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 961px) { .place-aside { position: sticky; top: 84px; align-self: start; } }
@media (max-width: 960px) { .place-layout { grid-template-columns: 1fr; } }
.place-description { font: 400 1.12rem/1.7 var(--serif); color: var(--ink-2); max-width: 40em; margin-bottom: 28px; }

.posting-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 20px 22px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); margin-bottom: 40px; border-left: 4px solid var(--accent); }
.posting-panel.is-closed { border-left-color: var(--muted); background: transparent; box-shadow: none; border: 1px dashed var(--line); border-left: 4px solid var(--muted); }
.posting-title { font: 500 1.12rem/1.35 var(--serif); margin: 0 0 4px; }
.posting-panel p.small { margin: 0; }

.memories-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.memories-head h2 { font-size: 1.6rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.count-badge { font: 600 .85rem/1 var(--sans); background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 9px; }
.sort-select select { width: auto; min-height: 40px; padding: 6px 34px 6px 12px; font-size: .9rem; }

.memory-list { display: flex; flex-direction: column; gap: 18px; }
.memory { background: var(--card); border-radius: var(--r); padding: 20px 22px 12px; box-shadow: var(--shadow); position: relative; }
.memory.is-new { animation: arrive .7s var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); box-shadow: 0 0 0 4px var(--rose-soft); } }
.memory-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 1rem/1 var(--sans); background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); }
.avatar-anon { background: var(--paper-2); color: var(--muted); }
.memory-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.memory-author { font-weight: 600; }
.memory-dates { font-size: .82rem; color: var(--muted); display: flex; gap: 4px 14px; flex-wrap: wrap; }
.exp-date { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; }
.memory-body { font: 400 1.06rem/1.7 var(--serif); overflow-wrap: anywhere; }
.memory-body p { margin: 0 0 .8em; }
.memory-photos { display: grid; gap: 6px; margin: 4px 0 10px; border-radius: var(--r-sm); overflow: hidden; }
.memory-photos.count-1 { grid-template-columns: 1fr; }
.memory-photos.count-2 { grid-template-columns: 1fr 1fr; }
.memory-photos.count-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.memory-photos.count-3 .photo:first-child { grid-row: span 2; }
.memory-photos.count-4 { grid-template-columns: 1fr 1fr; }
.memory-photos .photo { display: block; background: var(--paper-2); aspect-ratio: 4 / 3; overflow: hidden; }
.memory-photos.count-1 .photo { aspect-ratio: auto; max-height: 520px; }
.memory-photos.count-3 .photo:first-child { aspect-ratio: auto; }
.memory-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.memory-photos .photo:hover img { transform: scale(1.03); }
.memory-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--paper-2); padding-top: 8px; margin-top: 4px; }
.report-btn { font-size: .8rem; }

/* Template-specific memory treatments, same structure */
.tpl-wedding .memory, .tpl-party .memory { border-top: 3px solid var(--accent); }
.tpl-wedding .memory-body, .tpl-party .memory-body { font-size: 1.1rem; }
.tpl-memorial .memory { box-shadow: none; border: 1px solid var(--line); background: #fbfbfd; }
.tpl-memorial .memory-body { color: #2a3346; }
.tpl-memorial .memory-author { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.tpl-memorial .avatar { background: #ecebf4; }
.tpl-monument .memory, .tpl-travel .memory, .tpl-school .memory, .tpl-bench .memory, .tpl-iwashere .memory { border-left: 3px solid var(--accent); }
.posting-panel.is-open { border-left-color: var(--accent); }

.empty-state { padding: 28px; border-radius: var(--r); border: 1px dashed var(--line); text-align: center; color: var(--muted); }
.empty-state.big { padding: clamp(36px, 6vw, 64px) 24px; }
.empty-state.big p { margin-bottom: 18px; }

.aside-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.mini-map { height: 220px; background: var(--paper-2); }
.map-caption { padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.qr-card { display: flex; gap: 14px; padding: 14px; align-items: center; }
.qr-preview { width: 104px; height: 104px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line); }
.qr-title { font: 500 1.1rem/1.2 var(--serif); margin: 0 0 4px; }
.qr-card p.small { margin: 0 0 10px; }
.qr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.aside-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- Dialogs (memory form, report, lightbox) ---------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(20, 28, 42, .55); backdrop-filter: blur(2px); }
.sheet { width: min(620px, 100%); max-height: min(92vh, 900px); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-lift); }
.sheet[open] { animation: sheet-in .28s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.sheet-small { width: min(480px, 100%); }
.sheet-inner { padding: 8px 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--card); padding: 14px 0 6px; z-index: 2; margin-right: -10px; }
.sheet-head h2 { font-size: 1.45rem; margin: 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--card); padding: 12px 0 4px; border-top: 1px solid var(--paper-2); }
@media (max-width: 640px) {
  .sheet { width: 100%; max-width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; }
  .sheet-small { height: auto; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .sheet[open] { animation: sheet-up .3s var(--ease); }
  .sheet-inner { padding: 4px 18px max(16px, env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
.lightbox { background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: var(--r-sm); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-close { position: fixed; top: 12px; right: 12px; background: rgba(255,255,255,.92); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 600; font-size: .93rem; }
legend { padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.hint { font-size: .84rem; color: var(--muted); margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px; min-height: 46px;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
#mf-body { font: 400 1.05rem/1.6 var(--serif); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%231d2a3e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 42, 62, .12); }
input:disabled { background: var(--paper); color: var(--muted); }
.check, .radio { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; line-height: 1.45; }
.check input, .radio input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--rose); }
.consent { font-size: .88rem; color: var(--ink-2); }
.form-error { color: var(--danger); background: #fbeceb; padding: 10px 14px; border-radius: var(--r-sm); margin: 0; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; border: 1.5px dashed var(--contour); border-radius: var(--r); background: var(--paper); cursor: pointer; text-align: center; font-weight: 600; color: var(--ink-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--ink); background: #fff; }
.dropzone .icon { width: 28px; height: 28px; color: var(--accent); }
input[type=file]:focus-visible + .dropzone, .dropzone:focus-within { outline: 3px solid var(--rose); }
.photo-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-previews figure { margin: 0; position: relative; width: 84px; height: 84px; border-radius: var(--r-sm); overflow: hidden; background: var(--paper-2); }
.photo-previews img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: grid; place-items: center; }
.cf-turnstile, .h-captcha, .g-recaptcha { min-height: 65px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.input-small { width: 170px !important; min-height: 36px !important; padding: 6px 10px !important; font-size: .85rem !important; }

/* ---------- Auth ---------- */
.auth { padding: clamp(32px, 7vw, 88px) var(--gutter); display: grid; place-items: start center; min-height: 70vh; }
.auth-card { width: min(440px, 100%); background: var(--card); padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); }
.auth-card h1 { font-size: 2rem; }
.auth-alt { text-align: center; margin: 22px 0 0; color: var(--muted); }

/* ---------- Explore ---------- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 0; border-bottom: 1px solid var(--line); }
.search-bar { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 16px; max-width: 520px; margin: 18px 0 22px; }
.search-bar:focus-within { border-color: var(--ink); }
.search-bar input { border: 0; box-shadow: none !important; min-height: 40px; padding: 6px 4px; background: transparent; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rose); }
.tabs-small a { padding: 8px 12px; font-size: .9rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 40px; }
.pagination a { font-weight: 600; }

/* ---------- World map ---------- */
.page-map .site-footer { display: none; }
.map-page { position: relative; height: calc(100vh - 64px); height: calc(100dvh - 64px); min-height: 420px; }
.world-map { position: absolute; inset: 0; background: var(--paper-2); }
.map-toolbar { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.map-toolbar > * { pointer-events: auto; }
.map-search { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 0 6px 0 14px; box-shadow: var(--shadow-lift); flex: 1 1 260px; max-width: 360px; }
.map-search input { border: 0; min-height: 44px; padding: 6px; box-shadow: none !important; background: transparent; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 0 14px 0 10px; min-height: 40px; box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .pin-dot { width: 12px; height: 12px; box-shadow: 0 0 0 2px #fff; }
.chip:has(input:not(:checked)) { opacity: .55; background: var(--paper); }
.chip:has(input:focus-visible) { outline: 3px solid var(--rose); }
.locate-btn { background: #fff; box-shadow: var(--shadow-lift); margin-left: auto; }
.map-status { position: absolute; z-index: 500; bottom: 22px; left: 50%; transform: translateX(-50%); margin: 0; background: var(--ink); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .85rem; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.map-status.is-visible { opacity: .92; }
.map-ad { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 640px) { .map-search { max-width: none; flex-basis: 100%; } .locate-btn { position: absolute; right: 0; top: 52px; } }

/* Leaflet markers & popups in house style */
.sp-marker { background: none; border: 0; }
.sp-marker span { display: block; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0,0,0,.3); margin: 2px 0 0 2px; }
.sp-marker span::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; left: 8px; top: 8px; }
.sp-marker.approx span { width: 18px; height: 18px; border-radius: 50%; transform: none; opacity: .85; }
.sp-marker.approx span::after { display: none; }
.sp-cluster { background: none; }
.sp-cluster div { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 .85rem/1 var(--sans); box-shadow: 0 0 0 5px rgba(29,42,62,.18), 0 4px 10px rgba(0,0,0,.25); }
.leaflet-popup-content-wrapper { border-radius: var(--r); padding: 0; overflow: hidden; box-shadow: var(--shadow-lift); }
.leaflet-popup-content { margin: 0; width: 260px !important; font-family: var(--sans); }
.leaflet-container a.leaflet-popup-close-button { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); top: 6px; right: 6px; }
.map-pop img { width: 100%; height: 130px; object-fit: cover; }
.map-pop .pop-body { padding: 12px 14px 14px; }
.map-pop h3 { font-size: 1.1rem; margin: 6px 0 4px; }
.map-pop p { margin: 0 0 8px; font-size: .88rem; color: var(--ink-2); }
.map-pop .pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; }
.map-pop .pop-foot a { font-weight: 700; }
.leaflet-container { font-family: var(--sans); }

/* ---------- Editor ---------- */
.editor { padding-top: 28px; padding-bottom: 80px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-weight: 500; margin-bottom: 18px; }
.editor-form { display: flex; flex-direction: column; gap: 20px; }
.panel { background: var(--card); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); border: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-form .panel { margin: 0; }
.panel-title { font: 500 1.3rem/1.2 var(--serif); margin: 0; padding: 0; }
.panel-title.spaced { margin-top: 12px; }
.panel-subtitle { font-size: 1.1rem; margin: 12px 0 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 680px) { .type-picker { grid-template-columns: 1fr; } }
.type-option { position: relative; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-option-body { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r); border: 1.5px solid var(--line); height: 100%; transition: border-color .15s, background .15s; }
.type-option-icon { color: var(--accent); }
.type-option-icon .icon { width: 28px; height: 28px; }
.type-option strong { font: 500 1.15rem/1.2 var(--serif); }
.type-option input:checked + .type-option-body { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); box-shadow: inset 0 0 0 1px var(--accent); }
.type-option input:focus-visible + .type-option-body { outline: 3px solid var(--rose); }
.editor-map { height: 320px; border-radius: var(--r); background: var(--paper-2); border: 1px solid var(--line); z-index: 0; }
.geo-results { list-style: none; margin: 4px 0 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); max-height: 240px; overflow: auto; }
.geo-results button { width: 100%; text-align: left; background: none; border: 0; padding: 10px; border-radius: 4px; cursor: pointer; font: inherit; font-size: .92rem; }
.geo-results button:hover, .geo-results button:focus { background: var(--paper); }
.mode-picker { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; }
.radio-card input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rose); flex: none; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; }
.radio-card:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.status-line { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.status-line.is-open { color: var(--ok); }
.status-line.is-closed { color: var(--muted); }

.editor-form:not(.mode-scheduled) [data-scheduled-fields] { display: none; }
.editor-form:not(.show-tz) [data-tz-field] { display: none; }
.guest-rules { display: flex; gap: .5em; align-items: flex-start; margin-top: .75rem; }
.guest-rules .icon { flex: none; margin-top: .2em; color: var(--accent, currentColor); }
.cover-current { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cover-current img { border-radius: var(--r-sm); }
.editor-actions { display: flex; justify-content: flex-end; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--paper) 30%); }

/* ---------- Dashboard ---------- */
.dash { padding-top: 28px; padding-bottom: 80px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-head h1 { margin: 8px 0 4px; }
.dash-head p { margin: 0; }
.dash-list { display: flex; flex-direction: column; gap: 12px; }
.dash-item { display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); border-left: 4px solid var(--accent); }
.dash-qr img { width: 72px; height: 72px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.dash-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dash-item-main h2 { font-size: 1.2rem; margin: 2px 0 0; }
.dash-item-main h2 a { color: var(--ink); text-decoration: none; }
.dash-item-main h2 a:hover { text-decoration: underline; }
.dash-stats { display: flex; gap: 4px 16px; flex-wrap: wrap; margin: 0; color: var(--muted); }
.dash-stats .ok { color: var(--ok); font-weight: 600; }
.dash-stats .closed { font-weight: 600; }
.dash-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .dash-item { flex-wrap: wrap; } .dash-item-actions { width: 100%; } .dash-item-actions .btn { flex: 1; } }
.badge { display: inline-block; font: 600 .74rem/1.4 var(--sans); background: var(--paper-2); color: var(--ink-2); border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
.badge-danger, .badge-suspended, .badge-removed { background: #fbe3e1; color: #8e1d17; }
.badge-warn, .badge-hidden { background: #fbefd8; color: #7a4a06; }
.badge-published, .badge-active { background: #e1f1e6; color: #1f5c38; }
.dash-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.dash-grid .panel { margin: 0; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.qr-panel { align-items: stretch; }
.qr-panel.is-new { box-shadow: 0 0 0 3px var(--rose), var(--shadow-lift); }
.qr-big { width: 100%; max-width: 260px; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-size: .88rem; min-height: 40px; }
.download-list { display: grid; gap: 8px; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-row > div { background: var(--paper); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; }
.stat-n { font: 500 1.6rem/1.1 var(--serif); }
.stat-l { font-size: .8rem; color: var(--muted); }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr 1fr; } }
.spark { margin: 0; }
.spark svg { width: 100%; height: 80px; display: block; }
.bar-qr { fill: var(--rose); } .bar-web { fill: #9fb0c4; } .axis { stroke: var(--line); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 6px; vertical-align: -1px; }
.key-qr { background: var(--rose); } .key-web { background: #9fb0c4; }
.mod-list { display: flex; flex-direction: column; gap: 12px; }
.mod-item { display: flex; gap: 16px; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.mod-item.is-hidden { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f7f8f8 10px, #f7f8f8 20px); }
.mod-main { flex: 1; min-width: 0; }
.mod-main > p { margin: 0 0 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mod-body { font: 400 .98rem/1.6 var(--serif); overflow-wrap: anywhere; }
.mod-body p { margin: 0 0 .5em; }
.mod-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 130px; }
.mod-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.mod-photo { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mod-photo img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); }
.mod-photo.is-hidden img { filter: grayscale(1) blur(2px); opacity: .6; }
.photo-hidden { width: 96px; height: 96px; display: grid; place-items: center; background: var(--paper-2); border-radius: var(--r-sm); color: var(--muted); }
@media (max-width: 640px) { .mod-item { flex-direction: column; } .mod-actions { flex-direction: row; flex-wrap: wrap; } }
.edit-memory summary { list-style: none; cursor: pointer; }
.edit-memory summary::-webkit-details-marker { display: none; }
.edit-memory[open] summary .mod-body { display: none; }
.danger-zone { border: 1px solid #efc5c1; box-shadow: none; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { max-width: 220px; }

/* ---------- Legal / errors ---------- */
.legal { padding-top: 40px; padding-bottom: 80px; }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.prose li { margin-bottom: .4em; }
.error-page { padding: clamp(64px, 12vw, 140px) 0; min-height: 60vh; }
.error-code { font: 500 4rem/1 var(--serif); color: var(--rose); margin-bottom: 8px; }
.error-page .lede { margin: 0 auto 28px; }
pre.debug { white-space: pre-wrap; font-size: .8rem; background: #fff; padding: 16px; border-radius: var(--r); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.78); padding: 56px 0 28px; margin-top: auto; font-size: .93rem; }
.site-footer a { color: rgba(255,255,255,.88); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 10px; }
.footer-brand { font: 600 1.3rem/1 var(--serif); color: #fff; }
.site-footer .muted { color: rgba(255,255,255,.6); }
.footer-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Admin ---------- */
.admin-body { background: #eef1f0; }
.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--ink); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.admin-side .brand { color: #fff; padding: 0 8px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { color: rgba(255,255,255,.78); text-decoration: none; padding: 10px 10px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 10px; font-weight: 500; }
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.nav-badge { margin-left: auto; background: var(--rose); color: #fff; font-size: .74rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px; font-size: .9rem; }
.admin-side-foot a, .admin-side-foot .link-btn { color: rgba(255,255,255,.7); }
.admin-main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.admin-main > .flash { margin-bottom: 14px; }
.admin-title { font-size: 1.9rem; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.panel .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; padding: 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--paper-2); vertical-align: top; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.admin-filter input, .admin-filter select { width: auto; min-width: 200px; min-height: 40px; }
.report-details { font-family: var(--serif); font-style: italic; margin: 4px 0 8px; }
.reported-content { border-left: 3px solid var(--line); padding-left: 12px; margin-top: 8px; }
.settings-form textarea.mono { font-size: .82rem; }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, #eef1f0 40%); display: flex; justify-content: flex-end; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav a { padding: 8px; font-size: .88rem; }
  .admin-side-foot { flex-direction: row; margin: 0; }
}

/* ---------- Installer ---------- */
.install { padding: 40px var(--gutter) 80px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist .ok { color: var(--ok); } .checklist .ko { color: var(--danger); font-weight: 600; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Fixes after visual review ---------- */
.note-card { color: var(--ink); }
/* Keep fieldset legends inside the panel instead of on its border */
fieldset.panel > legend.panel-title { float: left; width: 100%; margin-bottom: 16px; }
fieldset.panel > legend.panel-title ~ * { clear: both; }
fieldset.panel { display: block; }
fieldset.panel > * + * { margin-top: 16px; }
fieldset.panel > legend + * { margin-top: 0; }

/* =====================================================================
   v1.1 — Tagality: templates, rich text, media, print designs
   ===================================================================== */
.tag-chip, .tag-code { display: inline-flex; align-items: center; gap: .35em; font: 600 .82rem/1 var(--sans); letter-spacing: .01em; padding: 6px 11px 6px 9px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); width: fit-content; }
.tag-chip .icon { color: var(--accent); }
.tag-code { background: var(--paper-2); padding: 4px 9px; font-size: .78rem; font-variant-numeric: tabular-nums; }
.hero-tag { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%) rotate(-4deg); background: var(--rose); color: #fff; font: 600 .95rem/1 var(--sans); padding: 10px 16px 10px 14px; border-radius: 6px 999px 999px 6px; box-shadow: var(--shadow-lift); display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.hero-tag .icon { color: #fff; }
.legend-list .icon { color: #f3b6c9; width: 18px; height: 18px; }

/* Rich text (descriptions) */
.rich { font: 400 1.1rem/1.7 var(--serif); color: var(--ink-2); overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich h2 { font-size: 1.7rem; color: var(--ink); margin: 1.1em 0 .4em; }
.rich h3 { font-size: 1.3rem; color: var(--ink); margin: 1.2em 0 .35em; }
.rich h4 { font-size: 1.1rem; color: var(--ink); margin: 1em 0 .3em; }
.rich p { margin: 0 0 .9em; }
.rich ul, .rich ol { margin: 0 0 1em; padding-left: 1.3em; }
.rich li { margin-bottom: .3em; }
.rich blockquote { margin: 1em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink); }
.rich blockquote.tpl-center { border-left: 0; padding-left: 0; }
.rich hr { border: 0; height: 1px; background: var(--line); margin: 1.6em auto; width: 40%; }
.rich a { color: var(--rose-dark); }
.rich table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .95em; }
.rich th, .rich td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.rich .tpl-center { text-align: center; }
.rich .tpl-right { text-align: right; }
.rich .tpl-lead { font-size: 1.25em; color: var(--ink); line-height: 1.45; }
.rich .tpl-small { font-size: .85em; }
.rich .tpl-muted { color: var(--muted); font-style: italic; }
.rich .tpl-signature { font-style: italic; color: var(--ink); margin-top: 1.4em; }
.rich .tpl-box { background: color-mix(in srgb, var(--accent) 8%, #fff); border-radius: var(--r); padding: 12px 16px; font-family: var(--sans); font-size: .95rem; }
.place-description { max-width: 40em; margin-bottom: 28px; }
.tag-media { display: flex; flex-direction: column; gap: 12px; margin: 0 0 32px; }
.tag-video, .memory-video { width: 100%; max-height: 70vh; border-radius: var(--r); background: #0f1622; display: block; }
.memory-video { margin: 4px 0 10px; border-radius: var(--r-sm); }
.audio-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow); }
.memory .audio-card { box-shadow: none; background: var(--paper); margin: 4px 0 10px; }
.audio-card .icon { color: var(--accent); width: 22px; height: 22px; }
.audio-card audio { flex: 1; min-width: 0; height: 40px; }

/* Editor: template picker */
.tpl-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl-option { position: relative; cursor: pointer; --accent: var(--line); }
.tpl-option.accent-rose { --accent: var(--rose); } .tpl-option.accent-teal { --accent: var(--t-place); }
.tpl-option.accent-amber { --accent: var(--t-event); } .tpl-option.accent-violet { --accent: var(--t-memorial); } .tpl-option.accent-ink { --accent: var(--ink); }
.tpl-option input { position: absolute; opacity: 0; }
.tpl-option > span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r); transition: border-color .15s, background .15s; }
.tpl-option strong { font: 500 1.02rem/1.2 var(--serif); }
.tpl-option input:checked + span { border-color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); border-top-color: var(--accent); }
.tpl-option input:focus-visible + span { outline: 3px solid var(--rose); }

/* Editor: rich text */
.rte { border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.rte:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 42, 62, .12); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--paper); border-bottom: 1px solid var(--line); border-radius: var(--r-sm) var(--r-sm) 0 0; position: sticky; top: 64px; z-index: 3; }
.rte-toolbar[hidden] { display: none; }
.rte-toolbar button { font: 600 .85rem/1 var(--sans); min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.rte-toolbar button:hover { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.rte-toolbar button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.rte-toolbar.is-source button:not([data-source]) { opacity: .35; pointer-events: none; }
.rte-sep { width: 1px; margin: 6px 4px; background: var(--line); }
.rte-source-btn { margin-left: auto; }
.rte-area { min-height: 220px; max-height: 60vh; overflow: auto; padding: 14px 16px; outline: none; }
.rte-area[hidden] { display: none; }
.rte-area:empty::before { content: "A few lines to welcome the people who scan the code."; color: var(--muted); }
.rte .rte-source { display: block; border: 0; border-radius: 0 0 var(--r-sm) var(--r-sm); min-height: 260px; font-size: .85rem; box-shadow: none !important; }
.rte .rte-source[hidden] { display: none; }
.field-label { font-weight: 600; font-size: .93rem; }

/* Editor: media */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .media-grid { grid-template-columns: 1fr; } }
.dropzone-sm { padding: 16px 12px; font-size: .9rem; }
.dropzone-sm [data-file-label] { overflow-wrap: anywhere; }
.media-current { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.media-current img, .media-current video { border-radius: var(--r-sm); max-width: 160px; }
.media-current audio { max-width: 100%; }
.panel-details { display: block; }
.panel-details > * + * { margin-top: 16px; }
.panel-details > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
.panel-details > summary::-webkit-details-marker { display: none; }
.panel-details > summary::after { content: "+"; margin-left: auto; color: var(--rose); font: 400 1.5rem/1 var(--sans); }
.panel-details[open] > summary::after { content: "–"; }
.geo-msg { padding: 10px; font-size: .9rem; color: var(--muted); }

/* Editor & dashboard: print designs */
.design-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.design-option { position: relative; cursor: pointer; display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.design-option input { position: absolute; opacity: 0; }
.design-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), var(--shadow); }
.design-option:has(input:focus-visible) { outline: 3px solid var(--rose); }
.design-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 14px; background-color: var(--paper-2); background-image: var(--contour-img); background-size: 280px 180px; }
.design-thumb svg { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(29,42,62,.22)); }
.design-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.design-meta strong { font: 500 1rem/1.2 var(--serif); }
.design-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.design-card { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.design-card.is-chosen { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.design-card figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.design-card figcaption strong { font: 500 1rem/1.2 var(--serif); }
.design-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* Print sheet */
.print-sheet-body { background: var(--paper-2); }
.print-toolbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 0 4px; }
.print-toolbar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.print-toolbar .back-link { margin: 0; }
.print-size { font-weight: 600; margin-right: auto; }
.print-tip { margin: 8px auto 6px; }

/* Memory form: media buttons + progress */
.media-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1.5px dashed var(--contour); border-radius: var(--r); background: var(--paper); cursor: pointer; font-weight: 600; font-size: .92rem; text-align: center; }
.media-btn:hover { border-color: var(--ink); background: #fff; }
.media-btn .icon { width: 24px; height: 24px; color: var(--accent); }
.media-btn .hint { font-size: .74rem; font-weight: 500; }
input.sr-only:focus-visible + .media-btn { outline: 3px solid var(--rose); }
.photo-previews figure.preview-video, .photo-previews figure.preview-audio { width: auto; height: auto; min-height: 44px; padding: 10px 38px 10px 12px; display: flex; align-items: center; }
.preview-file { font-size: .85rem; font-weight: 600; }
.sheet-foot { flex-wrap: wrap; }
.upload-progress { flex-basis: 100%; height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.upload-progress[hidden] { display: none; }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--rose); transition: width .2s; }

/* World map search */
.map-search { position: relative; padding-right: 4px; }
.map-search-btn { min-height: 36px; padding: 0 12px; }
.map-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 600; margin: 0; }
.mod-video { border-radius: var(--r-sm); background: #000; }
.mod-audio { max-width: 220px; }
.media-tile { color: var(--ink); text-decoration: none; }
@media (max-width: 640px) { .locate-btn { top: 0; } .map-search { flex-basis: calc(100% - 56px); } }

/* v1.2 — guest tags */
.guest-notice { background: #fff; border-left: 4px solid var(--rose); }
.guest-consent { gap: 12px; }
.memory-foot { gap: 16px; }
.edit-own { font-size: .8rem; text-decoration: none; margin-right: auto; }
.guest-notice { flex-direction: column; align-items: stretch; gap: 6px; }
.guest-notice ul { margin: 0; padding-left: 1.3em; }
.guest-notice li { margin-bottom: 4px; }

/* =====================================================================
   v1.3 — Template skins. A template gives the tag its look; tags without a
   template use the default Tagality style. The same skin applies to the
   public page (body.tpl-*) and to the editor preview (.rte.tpl-*).
   ===================================================================== */
.rich .tpl-banner { background: var(--accent); color: var(--skin-on-accent, #fff); border-radius: var(--r); padding: 26px 22px; text-align: center; margin: 0 0 1.2em; background-image: var(--skin-banner-img, none); background-size: cover; }
.rich .tpl-banner h2, .rich .tpl-banner h3, .rich .tpl-banner .tpl-big { color: inherit; margin: .15em 0; }
.rich .tpl-banner p { margin: .2em 0; color: inherit; opacity: .92; }
.rich .tpl-card { background: var(--skin-card, #fff); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: var(--r); padding: 14px 18px; margin: 0 0 1em; box-shadow: 0 6px 18px -14px rgba(29,42,62,.5); }
.rich .tpl-card > :last-child { margin-bottom: 0; }
.rich .tpl-card h3 { margin-top: 0; }
.rich hr.tpl-ornament { border: 0; height: 22px; width: 170px; margin: 1.4em auto; background: var(--accent); -webkit-mask: var(--skin-ornament) center / contain no-repeat; mask: var(--skin-ornament) center / contain no-repeat; }
.rich .tpl-big { font-size: 2.1em; line-height: 1.15; color: var(--skin-ink, var(--ink)); font-weight: 500; }
.rich .tpl-accent { color: var(--accent); font-weight: 600; }
.rich .tpl-stamp { display: inline-block; border: 2px solid var(--accent); color: var(--accent); padding: 5px 13px; border-radius: 6px; transform: rotate(-3deg); font: 700 .9rem/1.3 var(--sans); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.rich .tpl-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 1em; }
.rich .tpl-columns > .tpl-card { margin: 0; }
@media (max-width: 600px) { .rich .tpl-columns { grid-template-columns: 1fr; } }
.rich .tpl-hand { font-family: var(--serif); font-style: italic; }
.rich [style*="background-color"] { padding: 0 .2em; border-radius: 3px; }
:root { --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M0 10h44M76 10h44' stroke='black' stroke-width='1'/%3E%3Ccircle cx='50' cy='10' r='2.5'/%3E%3Ccircle cx='60' cy='10' r='3.5'/%3E%3Ccircle cx='70' cy='10' r='2.5'/%3E%3C/svg%3E"); }
body[class*="tpl-"] .btn-rose { background: var(--accent); }
body[class*="tpl-"] .btn-rose:hover { background: var(--accent); filter: brightness(.9); }
body[class*="tpl-"] { background-color: var(--skin-bg, var(--paper)); background-image: var(--skin-pattern, none); }
body[class*="tpl-"] .place-hero:not(.has-cover) { background-color: var(--skin-hero, var(--skin-soft)); background-image: var(--skin-hero-img, none); border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent); }
body[class*="tpl-"] .place-hero:not(.has-cover) .place-title { color: var(--skin-ink, var(--ink)); }
body[class*="tpl-"] .posting-panel.is-closed { background: rgba(255,255,255,.6); }
.rte[class*="tpl-"] .rte-area { background-color: var(--skin-bg); background-image: var(--skin-pattern, none); color: var(--skin-ink, var(--ink-2)); }

.tpl-wedding { --accent: #9c7a3c; --skin-bg: #fbf7ef; --skin-soft: #f3ead8; --skin-ink: #3a2f22; --skin-pattern: radial-gradient(circle at 10px 10px, rgba(156,122,60,.13) 1.2px, transparent 1.6px); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M60 10c-8-9-20-9-24 0 4 7 14 6 18 0M60 10c8-9 20-9 24 0-4 7-14 6-18 0' fill='none' stroke='black' stroke-width='1.4'/%3E%3Ccircle cx='60' cy='10' r='2.6'/%3E%3Cpath d='M0 10h30M90 10h30' stroke='black' stroke-width='.8'/%3E%3Ccircle cx='30' cy='10' r='1.4'/%3E%3Ccircle cx='90' cy='10' r='1.4'/%3E%3C/svg%3E"); }
body.tpl-wedding, .rte.tpl-wedding .rte-area { background-size: 22px 22px; }
.tpl-wedding .rich .tpl-banner { background: #fffdf8; color: var(--skin-ink); border: 1px solid var(--accent); box-shadow: inset 0 0 0 5px #fffdf8, inset 0 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); }
.tpl-wedding .rich .tpl-banner h2 { font-style: italic; font-size: 2.3em; color: var(--accent); }
.tpl-wedding .rich h2, .tpl-wedding .rich h3 { font-style: italic; }
.tpl-wedding .rich .tpl-card { background: #fffdf8; }
body.tpl-wedding .place-hero:not(.has-cover) .place-title { font-style: italic; }
.tpl-party { --accent: #d1495b; --skin-bg: #fff4e8; --skin-soft: #ffe6cf; --skin-ink: #3b1d2a; --skin-pattern: radial-gradient(circle at 12px 18px, #f2a541 2.5px, transparent 3px), radial-gradient(circle at 70px 40px, #2b9e8f 2.5px, transparent 3px), radial-gradient(circle at 110px 12px, #d1495b 2px, transparent 2.5px), radial-gradient(circle at 40px 90px, #5d5490 2px, transparent 2.5px), radial-gradient(circle at 128px 100px, #f2a541 2px, transparent 2.5px); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Crect x='20' y='6' width='6' height='3' transform='rotate%2825 23 7%29'/%3E%3Ccircle cx='36' cy='13' r='2.2'/%3E%3Crect x='46' y='4' width='3' height='7' transform='rotate%28-20 47 7%29'/%3E%3Ccircle cx='58' cy='8' r='2.6'/%3E%3Crect x='66' y='11' width='7' height='3' transform='rotate%28-30 69 12%29'/%3E%3Ccircle cx='82' cy='6' r='2'/%3E%3Crect x='92' y='9' width='3' height='7' transform='rotate%2835 93 12%29'/%3E%3C/svg%3E"); }
body.tpl-party, .rte.tpl-party .rte-area { background-size: 140px 120px; }
.tpl-party .rich .tpl-banner { background: linear-gradient(135deg, #d1495b, #f2a541); }
.tpl-party .rich .tpl-banner .tpl-big, .tpl-party .rich h2 { font-family: var(--sans); font-weight: 800; letter-spacing: -.02em; }
.tpl-party .rich .tpl-stamp { transform: rotate(2deg); background: #fff; }
body.tpl-party .place-hero:not(.has-cover) .place-title { font-family: var(--sans); font-weight: 800; }
.tpl-memorial { --accent: #5d5490; --skin-bg: #f3f2f7; --skin-soft: #e8e6f1; --skin-ink: #2a2a3a; --skin-pattern: none; --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M60 2c5 4 5 12 0 16-5-4-5-12 0-16z'/%3E%3Cpath d='M60 18c-6-1-11-4-13-9 5 0 10 3 13 9zM60 18c6-1 11-4 13-9-5 0-10 3-13 9z' opacity='.7'/%3E%3Cpath d='M8 10h34M78 10h34' stroke='black' stroke-width='.7'/%3E%3C/svg%3E"); }
body.tpl-memorial, .rte.tpl-memorial .rte-area { background-size: auto; }
.tpl-memorial .rich .tpl-banner { background: linear-gradient(160deg, #4a4378, #6d64a3); }
.tpl-memorial .rich .tpl-card { box-shadow: none; background: rgba(255,255,255,.75); }
.tpl-memorial .rich blockquote { border: 0; font-size: 1.15em; color: var(--accent); }
body.tpl-memorial .place-hero:not(.has-cover) { background-image: radial-gradient(ellipse at 50% 120%, rgba(242,165,65,.18), transparent 60%); }
.tpl-monument { --accent: #2b6f68; --skin-bg: #efebe3; --skin-soft: #e4ddcf; --skin-ink: #26312f; --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 100'%3E%3Cg fill='none' stroke='%23ded7c8' stroke-width='1'%3E%3Cpath d='M0 30c20-6 40 4 60-2s40 4 60 0M0 70c25-5 45 5 70-1s30 3 50 1'/%3E%3C/g%3E%3C/svg%3E"); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M60 3l7 7-7 7-7-7z'/%3E%3Cpath d='M0 8.5h48M0 11.5h48M72 8.5h48M72 11.5h48' stroke='black' stroke-width='.7'/%3E%3C/svg%3E"); }
body.tpl-monument, .rte.tpl-monument .rte-area { background-size: 240px 200px; }
.tpl-monument .rich .tpl-banner { background: #23403c; border: 2px solid #a8834a; box-shadow: inset 0 0 0 4px #23403c, inset 0 0 0 5px #a8834a; color: #f2ead8; }
.tpl-monument .rich .tpl-banner h2 { letter-spacing: .01em; }
.tpl-monument .rich .tpl-card { background: #faf8f3; border: 0; border-top: 3px solid #a8834a; border-radius: 4px; }
.tpl-monument .rich h3 { color: var(--accent); }
.tpl-bench { --accent: #c03b67; --skin-bg: #fdf0f3; --skin-soft: #f9dde6; --skin-ink: #3d1f2a; --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M10 14c-4-2.6-6-4.6-6-6.6a2.6 2.6 0 0 1 6-1.3 2.6 2.6 0 0 1 6 1.3c0 2-2 4-6 6.6z' fill='%23e9b3c4' opacity='.55'/%3E%3C/svg%3E"); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M60 16c-6-4-9-7-9-10a4 4 0 0 1 9-2 4 4 0 0 1 9 2c0 3-3 6-9 10z'/%3E%3Cpath d='M40 14c-4-2.6-6-4.6-6-6.6a2.6 2.6 0 0 1 6-1.3 2.6 2.6 0 0 1 6 1.3c0 2-2 4-6 6.6zM80 14c-4-2.6-6-4.6-6-6.6a2.6 2.6 0 0 1 6-1.3 2.6 2.6 0 0 1 6 1.3c0 2-2 4-6 6.6z' opacity='.6'/%3E%3C/svg%3E"); }
body.tpl-bench, .rte.tpl-bench .rte-area { background-size: 46px 46px; }
.tpl-bench .rich .tpl-banner { background: linear-gradient(135deg, #c03b67, #e47c9b); }
.tpl-bench .rich .tpl-big { color: var(--accent); }
.tpl-bench .rich .tpl-card { border-radius: 22px; }
.tpl-school { --accent: #2b59a8; --skin-bg: #f5f8fd; --skin-soft: #e5edf8; --skin-ink: #1f2b44; --skin-pattern: linear-gradient(90deg, transparent 46px, rgba(209,73,91,.35) 46px, rgba(209,73,91,.35) 47px, transparent 47px), repeating-linear-gradient(180deg, transparent 0 27px, #dbe5f3 27px 28px); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M60 2l2.4 5.2 5.6.6-4.2 3.8 1.2 5.6-5-2.9-5 2.9 1.2-5.6-4.2-3.8 5.6-.6z'/%3E%3Cpath d='M36 10l1.3 2.6 2.8.3-2.1 1.9.6 2.8-2.6-1.5-2.6 1.5.6-2.8-2.1-1.9 2.8-.3zM84 10l1.3 2.6 2.8.3-2.1 1.9.6 2.8-2.6-1.5-2.6 1.5.6-2.8-2.1-1.9 2.8-.3z' opacity='.6'/%3E%3C/svg%3E"); }
body.tpl-school, .rte.tpl-school .rte-area { background-size: auto; }
.tpl-school .rich .tpl-banner { background: #2f4a3a; color: #f4f1e8; border: 6px solid #8a6a43; font-family: var(--serif); }
.tpl-school .rich .tpl-hand { color: var(--accent); }
.tpl-school .rich .tpl-stamp { color: #c0392b; border-color: #c0392b; transform: rotate(4deg); }
.tpl-school .rich .tpl-card { background: #fffef5; border-color: #e8dfae; }
.tpl-travel { --accent: #1e7f9b; --skin-bg: #eef6fb; --skin-soft: #dcedf5; --skin-ink: #173440; --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 200'%3E%3Cpath d='M-10 150C40 60 120 160 180 80s100-40 150-10' fill='none' stroke='%23b8d9e6' stroke-width='2' stroke-dasharray='6 7'/%3E%3C/svg%3E"); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M4 14c20-14 40 6 56-2s30-10 52-2' fill='none' stroke='black' stroke-width='1.6' stroke-dasharray='4 4' stroke-linecap='round'/%3E%3Ccircle cx='4' cy='14' r='3'/%3E%3Cpath d='M112 12l-6-5 1.5-1 7.5 3 3-1.5a1.5 1.5 0 0 1 1.5 2.5l-3 1.5-1 8-1.8.7-1.2-6z'/%3E%3C/svg%3E"); }
body.tpl-travel, .rte.tpl-travel .rte-area { background-size: 420px 260px; }
.tpl-travel .rich .tpl-banner { background: linear-gradient(160deg, #1e7f9b, #5bb3c9); }
.tpl-travel .rich .tpl-stamp { border-radius: 999px; border-style: dashed; transform: rotate(-6deg); }
.tpl-travel .rich .tpl-card h3 { color: var(--accent); }
.tpl-iwashere { --accent: #e2541c; --skin-bg: #e6e5df; --skin-soft: #d9d7cf; --skin-ink: #232323; --skin-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 40'%3E%3Cg fill='none' stroke='%23cfcdc4' stroke-width='1'%3E%3Cpath d='M0 .5h80M0 20.5h80M.5 0v20M40.5 20v20M0 40.5h80'/%3E%3C/g%3E%3C/svg%3E"); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M6 12c14-8 26 6 40-1s22-7 36 0 18 3 28-1' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3Cpath d='M104 4l10 6-11 4' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
body.tpl-iwashere, .rte.tpl-iwashere .rte-area { background-size: 80px 40px; }
.tpl-iwashere .rich .tpl-hand, .tpl-iwashere .rich .tpl-big { font-family: var(--sans); font-style: normal; font-weight: 800; color: var(--accent); transform: rotate(-2deg); letter-spacing: -.02em; }
.tpl-iwashere .rich .tpl-banner { background: #2b2b2b; color: #fff; }
.tpl-iwashere .rich .tpl-stamp { background: var(--accent); color: #fff; border-color: var(--accent); }
.tpl-iwashere .rich .tpl-card { background: #fbfbf8; border: 2px dashed #9b9a93; box-shadow: none; }
body.tpl-iwashere .place-hero:not(.has-cover) .place-title { font-family: var(--sans); font-weight: 800; transform: rotate(-1.5deg); }

/* Compact template picker (inside the description field) */
.tpl-details { border: 1.5px dashed var(--line); border-radius: var(--r-sm); background: var(--paper); }
.tpl-details > summary { cursor: pointer; list-style: none; padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; }
.tpl-details > summary::-webkit-details-marker { display: none; }
.tpl-details > summary .tpl-current { font-weight: 500; color: var(--muted); }
.tpl-details > summary::after { content: "Change"; margin-left: auto; color: var(--rose-dark); font-weight: 600; font-size: .85rem; }
.tpl-details[open] > summary::after { content: "Close"; }
.tpl-details .tpl-picker { padding: 0 12px 12px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tpl-sw { display: block; height: 46px; border-radius: 6px 6px 0 0; background: var(--sw-bg); position: relative; overflow: hidden; border-bottom: 4px solid var(--sw-accent); }
.tpl-sw::before { content: ""; position: absolute; left: 12px; right: 30px; top: 12px; height: 7px; border-radius: 4px; background: var(--sw-accent); }
.tpl-sw::after { content: ""; position: absolute; left: 12px; right: 50px; top: 26px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--sw-accent) 35%, transparent); }
.tpl-details .tpl-option > span { padding: 0; border-top-width: 1.5px; overflow: hidden; gap: 0; }
.tpl-details .tpl-option strong { font-size: .88rem; padding: 7px 9px 1px; }
.tpl-details .tpl-option .small { font-size: .72rem; padding: 0 9px 8px; line-height: 1.3; }
.tpl-details .tpl-option input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.rte-colors { display: inline-flex; gap: 3px; align-items: center; padding: 0 2px; }
.rte-toolbar .rte-color { min-width: 22px; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.rte-toolbar .rte-color:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--ink); background: var(--c); }
.rte-toolbar .rte-hl { border-radius: 5px; }
.field > .tpl-details { margin-bottom: 8px; }

/* v1.4 — four use cards on the home page */
.use-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.use-list a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.use-list a:hover { color: var(--accent); }

/* v1.4 — Gift & card skin */
.tpl-gift { --accent: #b5452e; --skin-bg: #f3e9da; --skin-soft: #eadcc6; --skin-ink: #3b2a1e; --skin-pattern: repeating-linear-gradient(115deg, rgba(120,90,50,.05) 0 2px, transparent 2px 9px), repeating-linear-gradient(25deg, rgba(120,90,50,.04) 0 1px, transparent 1px 13px); --skin-ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M60 10c-6-7-16-9-17-3s9 6 17 3zM60 10c6-7 16-9 17-3s-9 6-17 3z'/%3E%3Ccircle cx='60' cy='10' r='3'/%3E%3Cpath d='M58 12l-6 7M62 12l6 7' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M0 10h38M82 10h38' stroke='black' stroke-width='.8'/%3E%3C/svg%3E"); }
.tpl-gift .rich .tpl-banner { background: linear-gradient(90deg, transparent calc(50% - 14px), rgba(255,255,255,.25) calc(50% - 14px), rgba(255,255,255,.25) calc(50% - 9px), transparent calc(50% - 9px), transparent calc(50% + 9px), rgba(255,255,255,.25) calc(50% + 9px), rgba(255,255,255,.25) calc(50% + 14px), transparent calc(50% + 14px)), var(--accent); }
.tpl-gift .rich .tpl-banner h2 { font-style: italic; font-size: 2.2em; }
.tpl-gift .rich .tpl-big { color: var(--accent); }
.tpl-gift .rich .tpl-card { background: #fffaf2; border-style: dashed; }

/* =====================================================================
   v1.4 — Use-case pages (/uses)
   ===================================================================== */
.use-head .lede { margin-bottom: 0; }
.use-head .hero-actions { margin-bottom: 0; }
.use-head { padding-bottom: clamp(32px, 5vw, 56px); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.use-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 5vw, 64px); padding-top: 44px; padding-bottom: 64px; align-items: start; }
@media (max-width: 960px) { .use-layout { grid-template-columns: 1fr; } }
.use-intro { font: 400 1.12rem/1.7 var(--serif); color: var(--ink-2); max-width: 40em; }
.use-h2 { margin-top: 1.6em; }
.use-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.use-steps li { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
.use-steps .step-n { margin: 0; font-size: 2.2rem; }
.use-steps h3 { font-size: 1.2rem; margin: 4px 0 4px; }
.use-steps p { margin: 0; color: var(--ink-2); }
.use-ideas { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 22px; }
.use-ideas li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.use-ideas .icon { color: var(--rose); flex: none; }
.use-print { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: center; background: var(--card); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.use-print .design-thumb { border-radius: var(--r); aspect-ratio: 1; }
.use-print h3 { font-size: 1.25rem; margin: 0 0 6px; }
@media (max-width: 600px) { .use-print { grid-template-columns: 1fr; } }
.use-aside { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 961px) { .use-aside { position: sticky; top: 84px; } }
.preview-label { margin: 0; font: 500 1.05rem/1.3 var(--serif); }
.use-preview { border-radius: 26px; overflow: hidden; background-color: var(--skin-bg, var(--paper)); background-image: var(--skin-pattern, none); border: 8px solid #1b2433; box-shadow: var(--shadow-lift); max-height: 640px; overflow-y: auto; scrollbar-width: thin; }
.tpl-wedding.use-preview { background-size: 22px 22px; } .tpl-party.use-preview { background-size: 140px 120px; } .tpl-bench.use-preview { background-size: 46px 46px; } .tpl-iwashere.use-preview { background-size: 80px 40px; } .tpl-monument.use-preview { background-size: 240px 200px; } .tpl-travel.use-preview { background-size: 420px 260px; }
.up-bar { background: #1b2433; color: #c9d3e0; font-size: .72rem; padding: 4px 12px 8px; display: flex; gap: 8px; align-items: center; }
.up-bar span { width: 8px; height: 8px; border-radius: 50%; background: #3fbf7f; }
.up-hero { padding: 22px 16px 16px; background: var(--skin-soft, var(--paper-2)); border-bottom: 1px solid color-mix(in srgb, var(--accent, var(--rose)) 25%, transparent); }
.up-title { font: 500 1.6rem/1.15 var(--serif); margin: 10px 0 0; color: var(--skin-ink, var(--ink)); }
.tpl-wedding .up-title { font-style: italic; } .tpl-party .up-title, .tpl-iwashere .up-title { font-family: var(--sans); font-weight: 800; }
.up-body { padding: 16px 14px 18px; }
.up-body .rich { font-size: .92rem; }
.up-cta { margin: 6px 0 14px; }
.up-cta .btn { pointer-events: none; }
.use-preview .btn-rose { background: var(--accent, var(--rose)); }
.up-memory { padding: 14px 16px 6px; box-shadow: var(--shadow); }
.up-memory .memory-body { font-size: .95rem; }
.use-related { background: var(--card); }
.use-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 26px; }
.use-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; padding: 0 0 16px; transition: transform .2s var(--ease), box-shadow .2s; }
.use-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.use-card > :not(.use-card-band) { padding: 0 16px; }
.use-card strong { font: 500 1.2rem/1.2 var(--serif); margin-top: 12px; }
.use-card-band { height: 54px; background: var(--sw-bg); border-bottom: 5px solid var(--sw-accent); position: relative; }
.use-card-band::before { content: ""; position: absolute; left: 16px; top: 16px; width: 46%; height: 8px; border-radius: 4px; background: var(--sw-accent); }
.use-card-band::after { content: ""; position: absolute; left: 16px; top: 30px; width: 30%; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--sw-accent) 35%, transparent); }
.use-card-meta { color: var(--ink-2); margin-top: auto; padding-top: 6px; font-weight: 600; }
.use-cards-big { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.use-own { margin-top: 12px; }
.footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* v1.5 — lighter editor: compact print picker, guest conditions before saving */
.panel-light { display: block; padding-top: 14px; padding-bottom: 14px; box-shadow: none; border: 1.5px dashed var(--line); background: var(--paper); }
.panel-light > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; }
.panel-light > summary::-webkit-details-marker { display: none; }
.panel-light > summary .tpl-current { font-weight: 500; color: var(--muted); }
.panel-light > summary::after { content: "Change"; margin-left: auto; color: var(--rose-dark); font-weight: 600; font-size: .85rem; }
.panel-light[open] > summary::after { content: "Close"; }
.panel-light > * + * { margin-top: 12px; }
.print-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.print-chip { position: relative; cursor: pointer; }
.print-chip input { position: absolute; opacity: 0; }
.print-chip > span { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; height: 100%; }
.print-chip strong { font-size: .9rem; }
.print-chip input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.print-chip input:focus-visible + span { outline: 3px solid var(--rose); }
.guest-consent { border-left: 4px solid var(--rose); }
.guest-consent ul { margin: 0; padding-left: 1.2em; }
.guest-consent li { margin-bottom: 4px; }
.guest-consent > p { margin: 0; }
.guest-title { font: 500 1.1rem/1.3 var(--serif); display: flex; gap: 8px; align-items: center; }

/* v1.6 — mini print previews and print-sheet navigation */
.print-mini { display: flex; align-items: center; justify-content: center; height: 64px; margin: -2px -4px 8px; padding: 6px; border-radius: 6px; background: var(--paper-2); }
.print-mini svg { display: block; max-width: 100%; max-height: 100%; width: auto; height: 100%; filter: drop-shadow(0 2px 3px rgba(29,42,62,.18)); }
.print-chip > span { padding-top: 8px; }
.sheet-back { margin-right: 4px; }
.design-switcher { display: flex; gap: 8px; overflow-x: auto; padding-top: 12px; padding-bottom: 6px; scrollbar-width: thin; }
.design-switcher a { flex: 0 0 104px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink-2); font-size: .75rem; font-weight: 600; text-align: center; padding: 6px; border-radius: var(--r-sm); border: 1.5px solid transparent; }
.design-switcher a:hover { background: var(--paper); color: var(--ink); }
.design-switcher a[aria-current="page"] { border-color: var(--ink); background: var(--paper); color: var(--ink); }
.design-switcher .print-mini { margin: 0; height: 56px; }
.switch-label { line-height: 1.2; }
