/* =============================================================================
   Wünderosity — Watercolor design system
   Hand-drawn / watercolor visual identity. Not a generic SaaS theme.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Fonts
   --------------------------------------------------------------------------- */
@font-face {
    font-family: 'WunderosityHand';
    src: url('../fonts/WunderosityHand.ttf') format('truetype');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'WunderosityHand';
    src: url('../fonts/WunderosityHand.otf') format('opentype');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

/* When the client uploads a custom font via Admin → Settings it is stored in
   /uploads/fonts and an @font-face rule is injected in the page <head> so it
   replaces the bundled 'WunderosityHand' family. */
:root {
    /* Palette — Wünderosity */
    --ink: #242B35;
    --ink-soft: #5a6270;
    --ink-warm: #3D2F28;
    --moss: #5c7a4a;
    --moss-deep: #41602f;
    --fern: #8aa368;
    --cream: #f7f1e3;
    --cream-deep: #efe6d2;
    --gold: #FFD700;
    --gold-deep: #D4B800;
    --petal: #d98d7a;
    --sky: #cfe0e8;
    --paper: #FDFBF7;
    --deep-purple: #1B1F38;
    --deep-purple-soft: #2a3050;

    /* Typography ink colors */
    --text-light: #242B35;
    --text-warm: #3D2F28;
    --text-on-dark: #FFFFFF;
    --text-on-dark-soft: #F8F9FA;

    --font-hand: 'WunderosityHand', 'Segoe Script', 'Bradley Hand', cursive;
    --font-body: 'Georgia', 'Times New Roman', serif;

    --shadow-soft: 0 6px 24px rgba(27, 31, 56, 0.12);
    --shadow-lift: 0 10px 32px rgba(27, 31, 56, 0.2);

    --radius-paint: 26px 14px 26px 14px;
    --radius-ink: 14px 26px 14px 26px;

    --ease-ink: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    background-attachment: fixed;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Dark background zones — text flips to white/cream */
.bg-deep-purple,
.bg-deep-purple *,
.bg-deep-purple .badge,
.bg-deep-purple a,
.bg-deep-purple h1,
.bg-deep-purple h2,
.bg-deep-purple h3,
.bg-deep-purple h4,
.bg-deep-purple p,
.bg-deep-purple span,
.bg-deep-purple label,
.bg-deep-purple .small,
.bg-deep-purple .muted {
    color: var(--text-on-dark);
}
.bg-deep-purple .muted,
.bg-deep-purple .small {
    color: var(--text-on-dark-soft);
}
.bg-deep-purple a:hover {
    color: var(--gold);
}
.bg-deep-purple .badge-approved,
.bg-deep-purple .badge-active {
    color: var(--deep-purple);
}
.bg-deep-purple input,
.bg-deep-purple textarea,
.bg-deep-purple select {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-on-dark);
    border-color: rgba(255, 255, 255, 0.25);
}
.bg-deep-purple input::placeholder,
.bg-deep-purple textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.bg-deep-purple .btn-moss {
    background: var(--moss);
    color: #fff;
}
.bg-deep-purple .btn-gold {
    background: var(--gold);
    color: var(--deep-purple);
}
.bg-deep-purple .flash-info {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-on-dark);
    border-left-color: var(--gold);
}

/* ---------------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------------- */
.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1 1 auto;
    position: relative;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--moss-deep);
    color: #fff;
    padding: 12px 18px;
    z-index: 300;
    border-radius: 0 0 12px 0;
    font-family: var(--font-body);
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------------------
   Watercolor page background
   --------------------------------------------------------------------------- */
.wc-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
}
/* Mobile-only background (hidden on desktop) */
.wc-bg-mobile {
    display: none;
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
}
.wc-veil {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(253,250,242,0.0) 0%, rgba(253,250,242,0.35) 60%, var(--paper) 100%);
}

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */
.hand {
    font-family: var(--font-hand);
    letter-spacing: 0.01em;
}

h1, h2, h3, .heading {
    font-family: var(--font-hand);
    color: var(--moss-deep);
    line-height: 1.15;
    margin: 0 0 0.5em;
    font-weight: normal;
}

h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.7rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

p { margin: 0 0 1rem; }

.lead { font-size: 1.15rem; color: var(--ink-soft); }

a { color: var(--moss-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }

.small { font-size: 0.85rem; }
.muted { color: var(--ink-soft); }

/* ---------------------------------------------------------------------------
   Watercolor buttons
   --------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border: none;
    border-radius: var(--radius-paint);
    font-family: var(--font-hand);
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s var(--ease-ink), box-shadow 0.18s var(--ease-ink), filter 0.18s;
    box-shadow: var(--shadow-soft);
    color: var(--ink);
}
.btn:hover { transform: translateY(-2px) rotate(-0.5deg); box-shadow: var(--shadow-lift); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-moss { background: var(--moss); color: #FFFFFF; }
.btn-moss:hover { background: var(--moss-deep); color: #fff; }
/*.btn-gold { background: var(--gold); color: var(--deep-purple); }*/
.btn-gold { background: linear-gradient(135deg, #F7E078 0%, #32A1D2 22%, #D84C92 100%); color: var(--deep-purple); }
.btn-gold:hover { color: #fff; filter: brightness(1.06); }

/*.btn-gold:hover { background: var(--gold-deep); color: #fff; }*/
.btn-cream { background: var(--cream); color: var(--ink); border: 2px solid rgba(58,47,40,0.15); }
.btn-ghost { background: transparent; color: var(--moss-deep); border: 2px dashed var(--gold); box-shadow: none; }
.btn-danger { background: #b0503f; color: #fff; }
.btn-block { display: flex; width: 100%; }

/* ---------------------------------------------------------------------------
   Watercolor cards
   --------------------------------------------------------------------------- */
.paint-card {
    background: rgba(253, 250, 242, 0.82);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-paint);
    box-shadow: var(--shadow-soft);
    padding: 1.4rem;
    border: 1px solid rgba(217, 164, 91, 0.35);
    position: relative;
    overflow: hidden;
}
.paint-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 12%, rgba(217,164,91,0.10), transparent 40%),
        radial-gradient(circle at 92% 85%, rgba(92,122,74,0.12), transparent 42%);
}

.art-card {
    border-radius: var(--radius-ink);
    overflow: hidden;
    background: var(--cream);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(217, 164, 91, 0.4);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s var(--ease-ink), box-shadow 0.2s;
}
.art-card:hover { transform: translateY(-4px) rotate(0.4deg); box-shadow: var(--shadow-lift); }

.art-card .thumb {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--cream-deep);
}
.art-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.art-card .thumb .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hand);
    font-size: 3rem;
    color: var(--gold-deep);
    background:
        radial-gradient(circle at 30% 30%, rgba(217,164,91,0.25), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(92,122,74,0.22), transparent 55%),
        var(--cream-deep);
}

.art-card .body { padding: 1.1rem 1.2rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.art-card .meta { font-family: var(--font-hand); font-size: 0.95rem; color: var(--gold-deep); margin-bottom: 0.3rem; }
.art-card h3 { font-size: 1.35rem; margin-bottom: 0.3rem; }
.art-card .desc { flex: 1; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------------------
   Grid utilities
   --------------------------------------------------------------------------- */
.grid {
    display: grid;
    gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* Index card rows: fewer, larger cards so the admin-uploaded frame reads clearly. */
.grid-cards { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 940px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-cards { grid-template-columns: 1fr; } }

.container {
    width: auto;
    max-width: min(1120px, 92vw);
    margin: 0 auto;
}

.section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }

.center { text-align: center; }

/* ---------------------------------------------------------------------------
   Minimal header (non-home pages only)
   --------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
    background: rgba(253, 250, 242, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
}
.topbar.is-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.topbar-inner {
    width: min(1120px, 92vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    color: var(--moss-deep);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.brand:hover { color: var(--moss-deep); }
.brand .logo-mark { width: 34px; height: 34px; }

.topnav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.topnav a {
    font-family: var(--font-hand);
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    transition: background 0.15s;
}
.topnav a:hover { background: rgba(217, 164, 91, 0.25); color: var(--moss-deep); }
.topnav a.active { background: var(--gold); color: #fff; }
.topnav a .nav-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: -3px;
    margin-right: 0.25rem;
}

/* Hamburger toggle (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--gold);
    border-radius: 12px;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    color: var(--moss-deep);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer {
    padding: 2.5rem 0 3rem;
    text-align: center;
    color: var(--ink-soft);
    position: relative;
}
.site-footer .roots {
    font-family: var(--font-hand);
    color: var(--moss-deep);
}
.site-footer .foot-links a { margin: 0 0.7rem; }

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-family: var(--font-hand);
    font-size: 1.05rem;
    color: var(--moss-deep);
    margin-bottom: 0.3rem;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid rgba(92, 122, 74, 0.4);
    border-radius: var(--radius-paint);
    background: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217, 164, 91, 0.25);
}
.field .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.2rem; }
.field textarea { resize: vertical; min-height: 110px; }

.field .remove-check {
    display: block;
    margin-top: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--error, #a33);
    cursor: pointer;
}
.field .remove-check input { width: auto; border: none; padding: 0; }

.field-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0.6rem 0 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Checkbox / radio labels */
label.check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.5;
    margin-bottom: 0;
}
label.check input[type="checkbox"],
label.check input[type="radio"] {
    width: auto;
    min-width: 0;
    flex-shrink: 0;
    margin-top: 0.25rem;
    accent-color: var(--moss);
    border-radius: 4px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------------
   Flash messages
   --------------------------------------------------------------------------- */
.flashes { margin: 0 auto 1.5rem; width: min(720px, 92vw); }
.flash {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-paint);
    margin-bottom: 0.7rem;
    font-size: 0.98rem;
    box-shadow: var(--shadow-soft);
}
.flash-success { background: #eaf3e0; color: #3c5a2e; border-left: 6px solid var(--moss); }
.flash-error { background: #f9e4de; color: #8c3b2c; border-left: 6px solid var(--petal); }
.flash-info { background: #e3eef2; color: #31586b; border-left: 6px solid var(--sky); }

/* ---------------------------------------------------------------------------
   Status badges
   --------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-body);
}
.badge-approved { background: #d9ecd0; color: #3c6b2c; }
.badge-pending, .badge-submitted, .badge-under_review { background: #f4e6c4; color: #8a6517; }
.badge-rejected { background: #f3d5cc; color: #93382a; }
.badge-draft { background: #e4e0d8; color: var(--ink-soft); }
.badge-archived { background: #d9d4cc; color: #5c5348; }
.badge-needs_changes { background: #e0d9f0; color: #5b4a8a; }
.badge-active { background: #d9ecd0; color: #3c6b2c; }
.badge-suspended { background: #f3d5cc; color: #93382a; }

/* ---------------------------------------------------------------------------
   Tree home page — CSS/JS procedural tree art
   --------------------------------------------------------------------------- */
.tree-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tree-stage {
    position: relative;
    width: min(1000px, 100%);
    aspect-ratio: 5 / 7;
    max-height: 100vh;
    margin: 0 auto;
}

/* Custom hero image (replaces CSS tree) */
.tree-hero-custom {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
}

/* Mobile-only SVG branch fallback */
.tree-art-mobile {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: auto;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

/* === TREE CANVAS (container for all CSS art) === */
.tree-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
}

/* === CANOPY LAYERS === */
.canopy {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
}
.canopy-far {
    width: 72%; height: 34%;
    top: 2%; left: 14%;
    background: radial-gradient(ellipse at 40% 35%, #41602f 0%, #5c7a4a 40%, #6b8a52 70%, transparent 100%);
    opacity: 0.55;
    filter: blur(40px);
}
.canopy-mid {
    width: 60%; height: 28%;
    top: 6%; left: 20%;
    background: radial-gradient(ellipse at 50% 40%, #6d8c4e 0%, #5c7a4a 50%, #41602f 100%);
    opacity: 0.7;
    filter: blur(28px);
}
.canopy-near {
    width: 52%; height: 24%;
    top: 8%; left: 24%;
    background: radial-gradient(ellipse at 45% 35%, #8aa368 0%, #6b8a52 45%, #5c7a4a 100%);
    opacity: 0.82;
    filter: blur(18px);
}
.canopy-highlight {
    width: 36%; height: 16%;
    top: 10%; left: 32%;
    background: radial-gradient(ellipse at 40% 30%, #c4d9a0 0%, #a8bd84 30%, transparent 70%);
    opacity: 0.4;
    filter: blur(22px);
}

/* === BRANCHES === */
.tree-branch {
    position: absolute;
    background: linear-gradient(135deg, #5c432c, #4a3523);
    border-radius: 20px;
    transform-origin: 0% 100%;
}
.branch-left-up {
    width: 28%; height: 4%;
    bottom: 38%; left: 36%;
    transform: rotate(32deg);
    border-radius: 16px;
}
.branch-right-up {
    width: 28%; height: 4%;
    bottom: 38%; left: 36%;
    transform: rotate(-32deg) scaleX(-1);
    transform-origin: 100% 100%;
    border-radius: 16px;
}
.branch-left-down {
    width: 22%; height: 3.5%;
    bottom: 30%; left: 38%;
    transform: rotate(50deg);
    border-radius: 14px;
}
.branch-right-down {
    width: 22%; height: 3.5%;
    bottom: 30%; left: 38%;
    transform: rotate(-50deg) scaleX(-1);
    transform-origin: 100% 100%;
    border-radius: 14px;
}
.branch-center {
    width: 3%; height: 26%;
    bottom: 36%; left: 48.5%;
    background: linear-gradient(180deg, #6b5040, #5c432c);
    border-radius: 12px;
}
.branch-left-far {
    width: 18%; height: 2.5%;
    bottom: 44%; left: 34%;
    transform: rotate(60deg);
    background: linear-gradient(90deg, #6b5040, #5c432c);
    border-radius: 10px;
}
.branch-right-far {
    width: 18%; height: 2.5%;
    bottom: 44%; left: 34%;
    transform: rotate(-60deg) scaleX(-1);
    transform-origin: 100% 100%;
    background: linear-gradient(90deg, #6b5040, #5c432c);
    border-radius: 10px;
}

/* === TRUNK === */
.trunk {
    position: absolute;
    width: 14%;
    height: 38%;
    bottom: 12%;
    left: 43%;
    background: linear-gradient(180deg, #7a5c3f 0%, #5c432c 35%, #4a3523 70%, #3a2c1f 100%);
    border-radius: 30% 30% 20% 20% / 8% 8% 12% 12%;
    clip-path: polygon(
        20% 0%, 80% 0%,
        85% 15%, 90% 35%, 92% 55%, 95% 75%, 98% 100%,
        2% 100%, 5% 75%, 8% 55%, 10% 35%, 15% 15%
    );
}
.trunk-texture {
    position: absolute;
    width: 14%;
    height: 38%;
    bottom: 12%;
    left: 43%;
    background: repeating-linear-gradient(
        175deg,
        transparent 0px, transparent 8px,
        rgba(58,44,31,0.25) 8px, rgba(58,44,31,0.25) 10px
    );
    clip-path: polygon(
        20% 0%, 80% 0%,
        85% 15%, 90% 35%, 92% 55%, 95% 75%, 98% 100%,
        2% 100%, 5% 75%, 8% 55%, 10% 35%, 15% 15%
    );
    opacity: 0.5;
}

/* === DOORWAY === */
.doorway {
    position: absolute;
    width: 5.5%;
    height: 8%;
    bottom: 18%;
    left: 47.25%;
    background: #2c2018;
    border-radius: 50% 50% 5% 5%;
    border: 3px solid #a88963;
    box-shadow: inset 0 0 20px rgba(217,164,91,0.15);
}

/* === ROOTS === */
.tree-root {
    position: absolute;
    background: linear-gradient(180deg, #5c432c, #3f2c1c);
    border-radius: 0 0 50% 50%;
}
.root-left {
    width: 8%; height: 14%;
    bottom: 0; left: 32%;
    transform: rotate(20deg);
    transform-origin: top center;
}
.root-center {
    width: 6%; height: 12%;
    bottom: 0; left: 47%;
}
.root-right {
    width: 8%; height: 14%;
    bottom: 0; left: 60%;
    transform: rotate(-20deg);
    transform-origin: top center;
}
.tree-root-tendril {
    position: absolute;
    background: #6b4e33;
    border-radius: 0 0 50% 50%;
}
.tendril-1 { width: 3%; height: 8%; bottom: 0; left: 26%; transform: rotate(35deg); transform-origin: top center; }
.tendril-2 { width: 2.5%; height: 6%; bottom: 0; left: 38%; transform: rotate(10deg); transform-origin: top center; }
.tendril-3 { width: 2%; height: 7%; bottom: 0; left: 48%; }
.tendril-4 { width: 2.5%; height: 6%; bottom: 0; left: 58%; transform: rotate(-10deg); transform-origin: top center; }
.tendril-5 { width: 3%; height: 8%; bottom: 0; left: 68%; transform: rotate(-35deg); transform-origin: top center; }

/* === PORTAL GLOWS === */
.tree-portal {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(253,251,247,0.85), rgba(255,215,0,0.5) 50%, rgba(212,184,0,0.3) 80%, transparent 100%);
    box-shadow: 0 0 40px 10px rgba(255,215,0,0.15), 0 0 80px 20px rgba(255,215,0,0.08);
    animation: portalPulse 4s ease-in-out infinite;
}
.portal-1 { width: 6.5%; height: 6.5%; top: 28%; left: 18%; animation-delay: 0s; }
.portal-2 { width: 6%; height: 6%; top: 24%; left: 58%; animation-delay: 0.8s; }
.portal-3 { width: 5.5%; height: 5.5%; top: 38%; left: 38%; animation-delay: 1.6s; }
.portal-4 { width: 5%; height: 5%; top: 48%; left: 12%; animation-delay: 2.4s; }
.portal-5 { width: 5.5%; height: 5.5%; top: 50%; left: 72%; animation-delay: 3.2s; }

@keyframes portalPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.12); opacity: 1; }
}

/* === GROUND SHADOW === */
.ground-shadow {
    position: absolute;
    width: 70%;
    height: 3%;
    bottom: 0;
    left: 15%;
    background: radial-gradient(ellipse, rgba(65,96,47,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

/* === SPARKLE CANVAS === */
.sparkle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Interactive hotspots overlaying the tree artwork */
.hotspot {
    position: absolute;
    left: var(--hx, 50%);
    top: var(--hy, 20%);
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    z-index: 5;
    transition: transform 0.2s var(--ease-ink);
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.08); }
.hotspot .portal {
    width: clamp(52px, 7vw, 84px);
    height: clamp(52px, 7vw, 84px);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, rgba(253,250,242,0.9), rgba(217,164,91,0.55) 60%, rgba(184,132,63,0.5));
    box-shadow: 0 0 0 6px rgba(253,250,242,0.6), var(--shadow-lift), inset 0 0 18px rgba(253,250,242,0.8);
    border: 2px solid rgba(184,132,63,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hotspot .portal svg { width: 55%; height: 55%; color: var(--moss-deep); }
.hotspot .portal-icon {
    width: clamp(52px, 7vw, 84px);
    height: clamp(52px, 7vw, 84px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.hotspot .portal-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.hotspot .tag {
    margin-top: 0.4rem;
    font-family: var(--font-hand);
    font-size: clamp(0.85rem, 2.2vw, 1.15rem);
    color: var(--ink);
    background: rgba(253,250,242,0.85);
    padding: 0.15rem 0.8rem;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
}
.hotspot .tag.small { font-size: clamp(0.75rem, 2vw, 0.95rem); }

.tree-door {
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 4;
}
.tree-door h1 {
    font-size: clamp(2.4rem, 8vw, 5rem);
    color: #fff;
    text-shadow: 0 2px 24px rgba(27,31,56,0.6), 0 0 8px rgba(27,31,56,0.4);
    margin: 0;
}
.tree-door .tagline {
    font-family: var(--font-hand);
    color: #fff;
    font-size: clamp(1rem, 3vw, 1.5rem);
    text-shadow: 0 1px 10px rgba(58,47,40,0.5);
}

/* Tree footer stats strip */
.tree-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding: 2.5rem 1rem;
    text-align: center;
}
.tree-stats .stat-num { font-family: var(--font-hand); font-size: 2.4rem; color: var(--moss-deep); display: block; }
.tree-stats .stat-label { color: var(--ink-soft); font-size: 0.95rem; }

/* Scroll-to-discover reveal sections */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-ink), transform 0.7s var(--ease-ink);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Critical content must never be hidden by the reveal effect
   (e.g. login forms) — visible even if JavaScript fails. */
.auth-wrap .reveal, .site-shell .auth-wrap * { opacity: 1 !important; transform: none !important; }

/* ---------------------------------------------------------------------------
   Mobile: continuing branch scroll navigation
   --------------------------------------------------------------------------- */
@media (max-width: 860px) {
    /* Mobile background swap: hide desktop, show mobile */
    .wc-bg { display: none; }
    .wc-bg-mobile { display: block; }

    .tree-hero {
        min-height: 0;
        padding-top: 8vh;
    }
    /* Hide detailed desktop tree canvas on mobile */
    .tree-canvas { display: none; }
    .tree-art-mobile { display: block; }
    /* Portal positions: use the mobile coordinates (blank falls back to desktop). */
    .hotspot {
        left: var(--hx-m, var(--hx, 50%));
        top: var(--hy-m, var(--hy, 20%));
    }
    /* The tree stays a compact hero; navigation becomes the scroll-branch. */
    .mobile-branch {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0 4rem;
    }
    .mobile-branch-bg {
        position: absolute;
        inset: 0;
        background-repeat: repeat-y;
        background-size: 100% auto;
        background-position: center top;
        opacity: 0.9;
        pointer-events: none;
    }
    .branch-node {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 3.2rem 0;
        text-decoration: none;
        min-width: 44px;
        min-height: 44px;
    }
    .branch-node .node-thumb {
        width: clamp(88px, 22vw, 130px);
        height: clamp(88px, 22vw, 130px);
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-hand);
        font-size: 2.4rem;
        color: var(--gold-deep);
    }
    .branch-node .node-thumb img { width: 100%; height: 100%; object-fit: contain; }
    .branch-node .node-label {
        margin-top: 0.5rem;
        font-family: var(--font-hand);
        font-size: 1.2rem;
        color: var(--ink);
        background: rgba(253,250,242,0.9);
        padding: 0.15rem 1rem;
        border-radius: 30px;
        box-shadow: var(--shadow-soft);
    }

    .topnav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(253, 250, 242, 0.97);
        border-radius: 0 0 var(--radius-paint) var(--radius-paint);
        box-shadow: var(--shadow-lift);
        padding: 0.8rem 1rem;
        display: none;
        z-index: 100;
    }
    .topnav.open { display: flex; }
    .nav-toggle { display: inline-flex; }
}

@media (min-width: 861px) {
    .mobile-branch { display: none; }
}

/* ---------------------------------------------------------------------------
   Detail pages
   --------------------------------------------------------------------------- */
.page-head { text-align: center; padding: 2.5rem 1rem 1rem; }
.page-head h1 { margin-bottom: 0.2rem; }
.page-head .crumbs { font-family: var(--font-hand); color: var(--gold-deep); font-size: 0.95rem; }

/* Compact auth pages: keep the card a comfortable reading width. */
.auth-page .container { max-width: 460px; }
.auth-page .page-head { padding: 1.6rem 1rem 0.6rem; }
.auth-page .page-head h1 { font-size: 2rem; }
.auth-page .paint-card { padding: 1.2rem 1.25rem; }
.auth-page-wide .container { max-width: 680px; }

.work-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .work-layout { grid-template-columns: 1fr; } }

.work-visual {
    border-radius: var(--radius-ink);
    overflow: hidden;
    box-shadow: var(--shadow-lift);
    background: var(--cream);
    border: 1px solid rgba(217,164,91,0.4);
}
.work-visual img, .work-visual .embed-frame { width: 100%; display: block; }
.work-visual .embed-frame { aspect-ratio: 16 / 9; border: 0; }
/* Hand-drawn frame: a transparent PNG/SVG sits over the embed. The frame art
   should carry a transparent 16:9 window so the video shows through cleanly. */
.video-frame { position: relative; }
.video-frame .embed-frame { position: relative; z-index: 1; }
.video-frame-art {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}
.work-visual .poem-body {
    padding: 2rem;
    font-size: 1.15rem;
    font-style: italic;
    line-height: 2;
    white-space: pre-line;
    color: var(--ink);
}
/* Story frame: an admin-uploaded transparent PNG/SVG drawn around a story,
   both on the story page and on gallery/profile cards. The frame art should
   carry a transparent window in the middle so the work shows through. */
.story-frame { position: relative; }
.story-frame > img { display: block; width: 100%; }
.story-frame-art {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}
.art-card .thumb .story-frame { width: 100%; height: 100%; }
.art-card .thumb .story-frame > img { width: 100%; height: 100%; object-fit: cover; }
.art-card .thumb .story-frame > .placeholder { height: 100%; }
.art-card .thumb .story-frame > .embed-frame { width: 100%; height: 100%; border: 0; display: block; }
/* Opaque frame (e.g. a JPG with no transparent window): the frame becomes a
   border/background and the work sits inset inside it so it stays visible. */
.story-frame-border {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    padding: 10%;
    box-sizing: border-box;
}
/* A framed card adopts the frame image's own proportions (via --frame-aspect)
   so the frame is never stretched out of shape. */
.art-card .thumb:has(> .story-frame-border) { aspect-ratio: auto; }
.art-card .thumb .story-frame-border { height: auto; aspect-ratio: var(--frame-aspect, 4 / 3); }
.story-frame-border > .story-frame-inner { position: relative; z-index: 2; width: 100%; height: 100%; background: var(--frame-bg, transparent); }
.story-frame-inner > img { display: block; width: 100%; }
.story-frame-inner > .embed-frame { width: 100%; border: 0; display: block; }
.art-card .thumb .story-frame-border > .story-frame-inner > img { width: 100%; height: 100%; object-fit: contain; }
.art-card .thumb .story-frame-border > .story-frame-inner > .embed-frame { width: 100%; height: 100%; border: 0; }
.art-card .thumb .story-frame-border > .story-frame-inner > .placeholder { height: 100%; }
/* Admin live preview of the story-frame border thickness. */
.frame-preview {
    max-width: 260px;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(0,0,0,0.08);
}
.frame-preview-inner {
    width: 100%;
    height: 100%;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f0e8;
    border: 1px dashed #b9b1a0;
    color: #8a8272;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}
/* Parallax scroll icon — a decorative sprite that drifts as the page scrolls. */
.scroll-icon {
    position: fixed;
    left: 2vw;
    top: 40vh;
    width: clamp(46px, 6vw, 92px);
    height: auto;
    z-index: 5;
    pointer-events: none;
    opacity: 0.85;
    will-change: transform;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.12));
}
@media (max-width: 760px) {
    .scroll-icon { width: 46px; opacity: 0.7; }
}

/* Door page transition — an admin-uploaded image covers the screen on load,
   then swings open like a door to reveal the page beneath. */
.door-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    pointer-events: none;
}
.door-panel {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform-origin: left center;
    backface-visibility: hidden;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.35);
    animation: doorSwing 0.95s cubic-bezier(0.72, 0, 0.28, 1) forwards;
}
@keyframes doorSwing {
    from { transform: perspective(1600px) rotateY(0deg); }
    to   { transform: perspective(1600px) rotateY(-107deg); }
}
.door-transition.door-done { display: none; }
@media (prefers-reduced-motion: reduce) {
    .door-transition { display: none; }
}
/* Admin live preview of the uploaded door image. */
.door-preview {
    max-width: 220px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
    background: #f3f0e8;
}
.door-preview img { display: block; width: 100%; height: auto; }

/* Comments */
.comment { padding: 1rem 0; border-bottom: 1px dashed rgba(92,122,74,0.3); }
.comment .who { font-family: var(--font-hand); color: var(--moss-deep); }
.comment .when { font-size: 0.78rem; color: var(--ink-soft); }
.comment .text { margin-top: 0.3rem; }

/* ---------------------------------------------------------------------------
   Auth pages
   --------------------------------------------------------------------------- */
.auth-wrap { width: min(480px, 92vw); margin: 2rem auto; }
.auth-card { padding: 2.2rem 2rem; }

/* ---------------------------------------------------------------------------
   Settings tabs
   --------------------------------------------------------------------------- */
.settings-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0,0,0,0.06);
    padding-bottom: 0.5rem;
}
.settings-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-paint) var(--radius-paint) 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-soft);
    background: rgba(0,0,0,0.03);
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.2s ease;
}
.settings-tab:hover {
    background: rgba(0,0,0,0.06);
    color: var(--ink);
}
.settings-tab.active {
    background: var(--paper);
    color: var(--ink);
    border-color: rgba(217,164,91,0.3);
    box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
}
.settings-panel {
    display: none;
}
.settings-panel.active {
    display: block;
}

/* Payment sub-tabs */
.payment-subnav {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.payment-subtab {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-paint);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: rgba(0,0,0,0.04);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.payment-subtab:hover {
    background: rgba(0,0,0,0.08);
    color: var(--ink);
}
.payment-subtab.active {
    background: var(--deep-purple);
    color: var(--text-on-dark);
    border-color: var(--deep-purple);
}
.payment-subpanel {
    display: none;
}
.payment-subpanel.active {
    display: block;
}

/* ---------------------------------------------------------------------------
   Dashboard (creator + admin share a clean, simple look)
   --------------------------------------------------------------------------- */
.dash-shell {
    width: min(1120px, 94vw);
    margin: 0 auto;
    padding: 2rem 0 3rem;
}
.dash-grid { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; align-items: start; }
.dash-grid > * { min-width: 0; }
@media (max-width: 820px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-nav {
    background: rgba(253,250,242,0.85);
    border-radius: var(--radius-paint);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    border: 1px solid rgba(217,164,91,0.3);
    position: sticky;
    top: 1rem;
}
.dash-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.98rem;
    margin-bottom: 0.2rem;
    transition: background 0.15s;
}
.dash-nav a:hover { background: rgba(217,164,91,0.2); }
.dash-nav a.active { background: var(--gold); color: #fff; }
.dash-nav .dash-nav-head {
    font-family: var(--font-hand);
    font-size: 1.05rem;
    color: var(--moss-deep);
    padding: 0.4rem 0.8rem;
    border-bottom: 1px dashed rgba(92,122,74,0.4);
    margin-bottom: 0.6rem;
}
/* Attention badges in the keeper console (sidebar, topbar, dashboard). */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.32rem;
    margin-left: auto;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}
.dash-nav a.active .nav-badge { background: #fff; color: var(--gold); }
.nav-bell .nav-badge { margin-left: 0.35rem; }
.attention-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.1rem;
    background: rgba(217,164,91,0.18);
    border: 1px dashed var(--gold);
    border-radius: var(--radius-paint);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.4rem;
}
.attention-strip strong { color: var(--moss-deep); }
.attention-strip a { font-weight: 600; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-tile {
    background: rgba(253,250,242,0.85);
    border-radius: var(--radius-paint);
    box-shadow: var(--shadow-soft);
    padding: 1.1rem 1.2rem;
    text-align: center;
    border: 1px solid rgba(217,164,91,0.3);
}
.stat-tile .num { font-family: var(--font-hand); font-size: 2rem; color: var(--moss-deep); line-height: 1.1; }
.stat-tile .lbl { font-size: 0.82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
    min-width: 0;
    background: rgba(253,250,242,0.85);
    border-radius: var(--radius-paint);
    box-shadow: var(--shadow-soft);
    padding: 1.1rem 1.2rem;
    text-align: center;
    border: 1px solid rgba(217,164,91,0.3);
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.18s var(--ease-ink), box-shadow 0.18s var(--ease-ink);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.stat .num { font-family: var(--font-hand); font-size: 2rem; color: var(--moss-deep); line-height: 1.1; }
.stat .lbl { font-size: 0.82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: rgba(253,250,242,0.85); border-radius: var(--radius-paint); overflow: hidden; box-shadow: var(--shadow-soft); }
.table th, .table td { padding: 0.7rem 0.9rem; text-align: left; font-size: 0.92rem; border-bottom: 1px solid rgba(92,122,74,0.15); vertical-align: top; overflow-wrap: anywhere; }
.table th { background: rgba(217,164,91,0.18); font-family: var(--font-hand); font-size: 0.95rem; color: var(--moss-deep); }
.table tr:hover td { background: rgba(217,164,91,0.06); }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline; }
.table img.tiny { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }

/* Wide admin lists: keep rows single-line and let .table-wrap scroll instead
   of squeezing columns into tall, wrapped rows. */
.table-wide { min-width: 900px; }
.table-wide.submissions-table { min-width: 820px; }
.table-wide th, .table-wide td { white-space: nowrap; }
.table-wide td.wrap { white-space: normal; }

.pill-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.92rem; }

.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.6rem; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 0.45rem 0.9rem; border-radius: 12px; background: var(--cream); color: var(--ink); text-decoration: none; border: 1px solid rgba(217,164,91,0.4); }
.pagination a:hover { background: var(--gold); color: #fff; }
.pagination .current { background: var(--moss-deep); color: #fff; }

/* Filter tabs (admin moderation lists) */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.filter-tabs a {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink);
    text-decoration: none;
    border: 1px solid rgba(217,164,91,0.4);
    font-size: 0.9rem;
}
.filter-tabs a:hover { background: var(--gold); color: #fff; }
.filter-tabs a.active { background: var(--moss-deep); color: #fff; border-color: var(--moss-deep); }

/* Selectable pills (amount presets, payment methods) */
.amount-pills, .method-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.method-list { flex-direction: column; align-items: stretch; }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 999px; background: var(--cream); border: 1px solid rgba(217,164,91,0.45); cursor: pointer; font-size: 0.95rem; color: var(--ink); user-select: none; }
.pill input { accent-color: var(--moss-deep); margin: 0; }
.pill:hover { border-color: var(--gold); }
.pill:has(input:checked) { background: var(--moss-deep); color: #fff; border-color: var(--moss-deep); }
.pill:has(input:checked) input { accent-color: var(--gold); }
.method-pill { border-radius: 12px; }
.pill-disabled { opacity: 0.5; cursor: not-allowed; }
.pill-disabled:hover { border-color: rgba(217,164,91,0.45); }

.avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 4px solid rgba(217,164,91,0.5); box-shadow: var(--shadow-soft); }
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------------------
   Misc
   --------------------------------------------------------------------------- */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; }
.flex { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.divider { border: 0; border-top: 2px dashed rgba(217,164,91,0.5); margin: 2rem 0; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); font-family: var(--font-hand); font-size: 1.2rem; }

pre.code {
    background: #2f2a24; color: #f2e6d0; padding: 1rem; border-radius: 12px; overflow-x: auto; font-size: 0.85rem;
}

/* Search box */
.search-box { display: flex; gap: 0.5rem; max-width: 460px; margin: 0 auto; }
.search-box input { flex: 1; padding: 0.7rem 0.9rem; border: 2px solid rgba(92,122,74,0.4); border-radius: var(--radius-paint); font-size: 1rem; }
.search-box button { padding: 0.7rem 1.2rem; }

/* Map page */
.map-shell {
    background: rgba(253,250,242,0.55);
    border: 1px solid rgba(217,164,91,0.35);
    border-radius: var(--radius-paint);
    box-shadow: var(--shadow-soft);
    padding: 0.85rem;
}
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.map-tools { display: flex; gap: 0.4rem; }
.map-tool {
    width: 2.4rem; height: 2.4rem; padding: 0;
    border-radius: 50%; border: 1px solid rgba(92,122,74,0.4);
    background: rgba(253,250,242,0.92); color: var(--ink);
    font-size: 1.15rem; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.map-tool:hover { background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.map-tool-wide { width: auto; padding: 0 0.95rem; border-radius: 999px; font-size: 0.85rem; font-family: var(--font-hand); }
.map-hint { margin: 0; font-size: 0.85rem; color: var(--ink-soft); font-family: var(--font-hand); }

.map-viewport {
    position: relative; width: 100%;
    height: clamp(320px, 62vh, 620px);
    overflow: hidden;
    border-radius: var(--radius-paint);
    border: 1px solid rgba(92, 122, 74, 0.25);
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.55), transparent 62%),
        radial-gradient(circle at 76% 72%, rgba(217, 164, 91, 0.14), transparent 58%),
        rgba(231, 238, 223, 0.6);
    cursor: grab;
    touch-action: none;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
}
.map-viewport.is-grabbing { cursor: grabbing; }
.map-viewport:focus-visible { box-shadow: 0 0 0 3px rgba(217, 164, 91, 0.45); }

.map-canvas {
    position: absolute; left: 0; top: 0;
    width: 1600px; height: 800px;
    transform-origin: 0 0;
    will-change: transform;
}
.map-outline {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: fill; pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(91, 111, 78, 0.12));
}
.map-label {
    position: absolute; z-index: 1;
    transform: translate(-50%, -50%);
    white-space: nowrap; pointer-events: none;
    -webkit-user-select: none; user-select: none;
    font-family: var(--font-hand); line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}
.map-label--country {
    font-size: 0.95rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--moss-deep); opacity: 0.85;
}
.map-label--city {
    font-size: 0.72rem;
    color: var(--ink-warm); text-transform: capitalize;
    transform: translate(-50%, 8px);
}
.map-empty {
    position: absolute; inset: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft); font-family: var(--font-hand); font-size: 1.2rem;
}

.map-pin {
    position: absolute; width: 34px; height: 44px;
    transform: translate(-50%, -100%);
    cursor: pointer; outline: none; z-index: 2;
}
.map-pin-img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 4px rgba(59, 47, 36, 0.3)); transition: transform 0.15s ease; }
.map-pin:hover .map-pin-img,
.map-pin:focus-visible .map-pin-img,
.map-pin.is-open .map-pin-img { transform: scale(1.16); }
.map-pin.is-open { z-index: 5; }

.pin-pop {
    position: absolute; left: 50%; bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(6px);
    width: 224px; padding: 0.7rem 0.8rem;
    background: var(--paper); border: 1px solid rgba(217, 164, 91, 0.5);
    border-radius: 12px; box-shadow: 0 10px 26px rgba(59, 47, 36, 0.22);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    text-align: left; cursor: auto; z-index: 6;
}
.pin-pop::after {
    content: ''; position: absolute; left: 50%; top: 100%;
    transform: translateX(-50%);
    border: 7px solid transparent; border-top-color: var(--paper);
}
.map-pin.is-open .pin-pop { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.map-pin.pin-below .pin-pop { bottom: auto; top: calc(100% + 8px); }
.map-pin.pin-below .pin-pop::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--paper); }

.pin-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; float: right; margin: 0 0 0.3rem 0.4rem; border: 1px solid rgba(217, 164, 91, 0.5); }
.pin-name { display: block; font-family: var(--font-hand); font-size: 1.05rem; color: var(--ink); }
.pin-loc { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.35rem; }
.pin-work { display: flex; align-items: center; gap: 0.45rem; text-decoration: none; color: var(--moss-deep); font-size: 0.82rem; margin: 0.35rem 0; }
.pin-work img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.pin-work-ico { font-size: 1.2rem; }
.pin-work-title { text-decoration: underline; }
.pin-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.8rem; }
.pin-links a { color: var(--moss-deep); text-decoration: underline; }
.pin-links a:hover { color: var(--gold-deep); }

.map-locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.location-tile { background: rgba(253,250,242,0.85); border-radius: var(--radius-paint); padding: 1rem 1.2rem; box-shadow: var(--shadow-soft); border: 1px solid rgba(217,164,91,0.3); }
.location-tile h3 { font-size: 1.2rem; margin-bottom: 0.2rem; }
.location-tile .who-list { font-size: 0.9rem; color: var(--ink-soft); }
.location-tile .count { font-family: var(--font-hand); color: var(--gold-deep); }

/* Location picker (register + profile) */
.location-picker .picker-canvas {
    position: relative; width: 100%; aspect-ratio: 2 / 1;
    border-radius: var(--radius-paint);
    border: 1px solid rgba(92, 122, 74, 0.25);
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.55), transparent 62%),
        radial-gradient(circle at 76% 72%, rgba(217, 164, 91, 0.14), transparent 58%),
        rgba(231, 238, 223, 0.6);
    cursor: crosshair; overflow: hidden; outline: none;
    touch-action: manipulation;
}
.location-picker .picker-canvas:focus-visible { box-shadow: 0 0 0 3px rgba(217, 164, 91, 0.45); }
.picker-outline { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.picker-pin { position: absolute; width: 30px; height: 38px; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 3px 4px rgba(59, 47, 36, 0.3)); }
.picker-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.picker-readout { margin: 0; }

/* Admin creator detail — pin */
.pin-detail { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-start; }
.pin-detail-info { flex: 1 1 220px; }
.admin-mini-map {
    position: relative; flex: 0 0 300px; width: 300px; max-width: 100%;
    aspect-ratio: 2 / 1; border-radius: var(--radius-paint);
    border: 1px solid rgba(92, 122, 74, 0.25);
    background-color: rgba(231, 238, 223, 0.6);
    background-size: 100% 100%; background-repeat: no-repeat;
}
.admin-mini-pin { position: absolute; width: 26px; height: 34px; transform: translate(-50%, -100%); filter: drop-shadow(0 3px 4px rgba(59, 47, 36, 0.3)); }

@media (max-width: 640px) {
    .hide-sm { display: none; }
    .map-viewport { height: 60vh; }
    .admin-mini-map { flex-basis: 100%; width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
    .sparkle-canvas { display: none; }
}
