/* =========================================================================
   ECTreasure Events — Event Planner
   Design tokens: warm ivory paper, deep ink text, brass accent for primary
   actions, sage for "confirmed" states, brick-rose for "declined" states.
   Display type evokes engraved invitation lettering; body type stays plain
   and legible since this is a working tool, not a brochure.
   ========================================================================= */

:root {
    --paper: #FBF8F3;
    --paper-raised: #FFFFFF;
    --ink: #24211C;
    --ink-soft: #5B564C;
    --line: #E4DCC8;
    --brass: #B8862B;
    --brass-dark: #96690F;
    --sage: #55705F;
    --sage-bg: #E8EEE7;
    --rose: #A2453F;
    --rose-bg: #F3E3E1;
    --amber-bg: #F7EEDD;
    --radius: 3px;
    --shadow: 0 1px 2px rgba(36,33,28,0.06), 0 6px 20px rgba(36,33,28,0.05);
}

[data-theme="dark"] {
    --paper: #17140F;
    --paper-raised: #211C15;
    --ink: #F1EBDD;
    --ink-soft: #B7AC97;
    --line: #3A3226;
    --brass: #D8A94A;
    --brass-dark: #F0C066;
    --sage: #8FB39B;
    --sage-bg: #1E2B23;
    --rose: #E08880;
    --rose-bg: #33201D;
    --amber-bg: #2A2318;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.35);
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

* { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, .display {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink);
    margin: 0 0 0.4em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

a { color: var(--brass-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* ---------- layout shell ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--ink);
    color: var(--paper);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.topbar .brand {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: var(--paper);
}
.topbar .brand span { color: var(--brass); }
.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.topbar nav a {
    color: var(--paper);
    opacity: 0.85;
    margin-left: 1.25rem;
    font-size: 0.9rem;
}
.topbar nav a:hover { opacity: 1; text-decoration: none; border-bottom: 1px solid var(--brass); }

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: var(--paper);
    border-radius: 8px;
    width: 40px; height: 38px;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.nav-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

@media (max-width: 760px) {
    .topbar { padding: 0.7rem 1rem; flex-wrap: nowrap; }
    .nav-toggle { display: inline-flex; }
    .topbar nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--ink);
        padding: 0.5rem 1rem 1rem;
        box-shadow: 0 12px 24px rgba(0,0,0,0.25);
        gap: 0.25rem;
    }
    .topbar nav.open { display: flex; }
    .topbar nav a {
        margin-left: 0;
        padding: 0.7rem 0.25rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .topbar nav a:hover { border-bottom: 1px solid var(--brass); }
    .topbar nav .theme-toggle { margin: 0.5rem 0 0; align-self: flex-start; }
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
.narrow { max-width: 560px; }

.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid var(--line);
}
.flash-success { background: var(--sage-bg); border-color: var(--sage); color: var(--sage); }
.flash-error { background: var(--rose-bg); border-color: var(--rose); color: var(--rose); }

/* ---------- cards ---------- */
.card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* The "invitation card" signature header used atop each event's dashboard */
.invite-header {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    text-align: center;
    background-image:
        linear-gradient(var(--paper-raised), var(--paper-raised)),
        repeating-linear-gradient(45deg, var(--line) 0, var(--line) 1px, transparent 1px, transparent 10px);
    background-clip: padding-box, border-box;
    border-image: none;
}
.invite-header::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid var(--line);
    border-radius: 2px;
    pointer-events: none;
}
.invite-emblem {
    font-size: 2rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}
.invite-header .eyebrow { margin-bottom: 0.35rem; }
.invite-header h1 { margin-bottom: 0.25rem; }
.invite-meta {
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.invite-meta span:not(:last-child)::after { content: "·"; margin: 0 0.5em; color: var(--line); }

/* ---------- grid / stats ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.stat .num { font-family: "Fraunces", serif; font-size: 1.6rem; font-weight: 600; }
.stat .label { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }

.tab-row {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.tab-row a {
    padding: 0.6rem 1rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
}
.tab-row a:hover { text-decoration: none; color: var(--ink); }
.tab-row a.active { color: var(--brass-dark); border-bottom-color: var(--brass); font-weight: 600; }

/* ---------- forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--ink); }
.field { margin-bottom: 1rem; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 180px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=tel], select, textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper-raised);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.92rem;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus, button:focus, a:focus {
    outline: 2px solid var(--brass);
    outline-offset: 1px;
}
.help { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.25rem; }

button, .btn {
    display: inline-block;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--brass);
    background: var(--brass);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .btn:hover { background: var(--brass-dark); border-color: var(--brass-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--amber-bg); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--rose); border-color: var(--rose); }
.btn-danger:hover { background: #7d332e; border-color: #7d332e; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.65rem; border-bottom: 1px solid var(--line); }
th { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
tr:hover td { background: var(--amber-bg); }

/* ---------- badges (ticket-stamp style status) ---------- */
.badge {
    display: inline-block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 2px;
    border: 1px dashed currentColor;
}
.badge-confirmed { color: var(--sage); background: var(--sage-bg); }
.badge-declined { color: var(--rose); background: var(--rose-bg); }
.badge-pending { color: var(--brass-dark); background: var(--amber-bg); }

/* ---------- misc ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.event-card {
    display: block;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    color: var(--ink);
}
.event-card:hover { text-decoration: none; border-color: var(--brass); }
.event-card .eyebrow { margin-bottom: 0.2rem; }

.progress-track {
    background: var(--amber-bg);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin-top: 0.4rem;
}
.progress-fill { background: var(--brass); height: 100%; }
.progress-fill.over { background: var(--rose); }

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ink-soft);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.seat-table {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.seat-table h3 { display: flex; justify-content: space-between; align-items: baseline; }
.seat-table .cap { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; color: var(--ink-soft); }
.seat-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.seat-list li { padding: 0.3rem 0; border-bottom: 1px dotted var(--line); display: flex; justify-content: space-between; }

.footer-note {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.8rem;
    margin-top: 3rem;
}

/* =========================================================================
   PREMIUM UI ADD-ONS — hero banners, glassmorphism, dark mode, dashboards
   ========================================================================= */

.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--paper);
    padding: 0.35rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }

/* Glassmorphism variant of .card */
.card.glass, .glass {
    background: linear-gradient(150deg, rgba(255,255,255,0.65), rgba(255,255,255,0.35));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.4);
}
[data-theme="dark"] .card.glass, [data-theme="dark"] .glass {
    background: linear-gradient(150deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
}

/* Hero banner with photographic background */
.hero-banner {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.hero-banner::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,17,12,0.15) 0%, rgba(20,17,12,0.75) 100%);
}
.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
    color: #FBF8F3;
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
    align-items: flex-start;
}
.hero-content .eyebrow,
.hero-content h1,
.hero-content .invite-meta { text-align: left; }
.hero-content .invite-meta { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 0.35rem 0; }
.hero-banner-change {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2;
}
.hero-banner-change input[type=file] { display: none; }
.hero-change-btn {
    background: rgba(20,17,12,0.55);
    border: 1px solid rgba(255,255,255,0.35);
    color: #FBF8F3;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hero-change-btn:hover {
    background: rgba(20,17,12,0.75);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}
.hero-content .eyebrow { color: #E9DCC0; }
.hero-content h1 { color: #fff; font-size: 2.1rem; }
.hero-content .invite-meta { color: #EDE6D6; }
.hero-content .invite-meta span:not(:last-child)::after { color: rgba(255,255,255,0.4); }

/* RSVP invitation hero — centered "invitation" treatment, responsive on phones. */
.hero-invite { min-height: 300px; align-items: center; }
.hero-invite .hero-content { text-align: center; }
.hero-invite .hero-content .eyebrow,
.hero-invite .hero-content h1 { text-align: center; }
.hero-invite .hero-content .invite-meta { justify-content: center; }
.hero-invite .hero-content h1 { font-size: 2.3rem; line-height: 1.12; }

/* The complimentary invitation line shown under the banner. */
.invite-message {
    max-width: 640px;
    margin: -0.25rem auto 1.5rem;
    padding: 0 1rem;
    text-align: center;
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--brass-dark, #96690F);
}

@media (max-width: 640px) {
    .hero-invite { min-height: 210px; border-radius: 8px; }
    .hero-invite .hero-content { padding: 1.4rem 1.1rem; }
    .hero-invite .hero-content h1 { font-size: 1.5rem; }
    .hero-invite .hero-content .invite-meta {
        flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.92rem;
    }
    /* Drop the "·" separators when the meta items stack vertically. */
    .hero-invite .hero-content .invite-meta span:not(:last-child)::after { content: ""; margin: 0; }
    .invite-message { font-size: 1.02rem; margin-top: 0.1rem; }
    .countdown { gap: 0.5rem; }
    .countdown .unit { min-width: 52px; }
    .countdown .num { font-size: 1.35rem; }
}

/* Dashboard-style stat cards with icon accent */
.stat-grid.premium { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat.premium {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border-radius: 10px;
}
.stat.premium .icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: var(--amber-bg);
    flex-shrink: 0;
}
.stat.premium.confirmed .icon { background: var(--sage-bg); }
.stat.premium.declined .icon { background: var(--rose-bg); }

.ring-wrap { display: flex; align-items: center; gap: 1rem; }
.progress-ring .ring-track { stroke: var(--amber-bg); }
.progress-ring .ring-fill {
    stroke: var(--brass);
    stroke-linecap: round;
    transition: stroke-dashoffset 1.1s ease;
}
.progress-ring .ring-text {
    font-family: "Fraunces", serif;
    font-size: 1rem;
    fill: var(--ink);
}

/* Guest search + filter toolbar */
.toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.25rem;
}
.toolbar input[type=search], .toolbar select {
    width: auto;
    min-width: 160px;
}
.toolbar .search-wrap { position: relative; flex: 1; min-width: 220px; }
.toolbar .search-wrap input { width: 100%; padding-left: 2.1rem; }
.toolbar .search-wrap::before {
    content: "⌕";
    position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
    color: var(--ink-soft); font-size: 1.1rem;
}

/* Guest row "card" styling inside the table */
.guest-row td { vertical-align: middle; }
.guest-name-cell { display: flex; flex-direction: column; }
.guest-name-cell .name { font-weight: 600; }
.guest-name-cell .sub { font-size: 0.78rem; color: var(--ink-soft); }
.action-btns { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.badge-maybe { color: #8A6A1E; background: #F3E6C4; }
[data-theme="dark"] .badge-maybe { color: #F0C066; background: #3A2E12; }

.checkbox-cell { width: 2rem; text-align:center; }

/* Modal (used for QR code popup) */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,17,12,0.55);
    display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--paper-raised);
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 320px;
    text-align: center;
    box-shadow: var(--shadow);
}
.modal-box img { border-radius: 6px; margin: 0.75rem 0; }
.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: var(--paper);
    padding: 0.6rem 1.2rem; border-radius: 20px; font-size: 0.85rem;
    box-shadow: var(--shadow); z-index: 60; opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.toast.show { opacity: 1; }

/* Countdown (RSVP page) */
.countdown { display: flex; gap: 0.75rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.countdown .unit { text-align: center; min-width: 60px; }
.countdown .num { font-family: "Fraunces", serif; font-size: 1.6rem; font-weight: 600; color: var(--brass-dark); }
.countdown .lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

.rsvp-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.rsvp-choice {
    border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 0.5rem; text-align: center; cursor: pointer;
    background: var(--paper-raised); font-weight: 600; font-size: 0.85rem;
}
.rsvp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rsvp-choice.sel-confirmed { border-color: var(--sage); background: var(--sage-bg); color: var(--sage); }
.rsvp-choice.sel-declined { border-color: var(--rose); background: var(--rose-bg); color: var(--rose); }
.rsvp-choice.sel-maybe { border-color: var(--brass); background: var(--amber-bg); color: var(--brass-dark); }

@media (max-width: 640px) {
    .stat-grid, .stat-grid.premium { grid-template-columns: repeat(2, 1fr); }
    .rsvp-choice-grid { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 1.6rem; }
}

/* =========================================================================
   BANNER PICKER (event create / edit)
   ========================================================================= */
.banner-preview {
    min-height: 200px;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
}

.banner-mode-tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: var(--amber-bg);
    padding: 0.25rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}
.banner-mode-tab {
    background: transparent;
    border: none;
    color: var(--ink-soft);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.banner-mode-tab:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.banner-mode-tab.active { background: var(--paper-raised); color: var(--brass-dark); box-shadow: var(--shadow); }
[data-theme="dark"] .banner-mode-tab:hover { background: rgba(255,255,255,0.05); }

.banner-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.banner-swatch {
    position: relative;
    height: 84px;
    border-radius: 10px;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: block;
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.banner-swatch:hover { transform: translateY(-2px); }
.banner-swatch.selected { border-color: var(--brass); }
.banner-swatch-label {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    text-align: left;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
    font-family: "IBM Plex Mono", monospace;
    letter-spacing: 0.02em;
}
.banner-swatch-check {
    position: absolute;
    top: 6px; right: 6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--brass);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
.banner-swatch.selected .banner-swatch-check { opacity: 1; transform: scale(1); }

.banner-upload-drop {
    position: relative;
    border: 2px dashed var(--line);
    border-radius: 12px;
    text-align: center;
    padding: 2rem 1rem;
    background: var(--amber-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.banner-upload-drop:hover, .banner-upload-drop.dragging { border-color: var(--brass); background: var(--paper-raised); }
.banner-upload-drop input[type=file] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.banner-upload-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.banner-upload-inner p { margin: 0.2rem 0; }

@media (max-width: 640px) {
    .banner-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================================
   PUBLIC PAGE SETTINGS (dashboard side): slug input, share row, checkboxes
   ========================================================================= */
.slug-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-raised);
}
.slug-prefix {
    display: flex;
    align-items: center;
    padding: 0 0.7rem;
    background: var(--amber-bg);
    color: var(--ink-soft);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    white-space: nowrap;
    border-right: 1px solid var(--line);
}
.slug-input-wrap input {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 120px;
}
.slug-input-wrap input:focus { outline: none; }
.slug-status { min-height: 1.1em; margin-top: 0.4rem; font-weight: 600; }
.slug-status.slug-ok { color: var(--sage); }
.slug-status.slug-bad { color: var(--rose); }

.share-url-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}
.share-url-row input {
    flex: 1;
    min-width: 220px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
    cursor: pointer;
}
.checkbox-label input[type=checkbox] { width: auto; }

/* =========================================================================
   GALLERY (owner management grid)
   ========================================================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.gallery-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-raised);
    display: flex;
    flex-direction: column;
}
.gallery-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #14110c;
    overflow: hidden;
}
.gallery-thumb img, .gallery-thumb video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery-badge {
    position: absolute; top: 6px; left: 6px;
    background: rgba(20,17,12,0.7); color: #fff;
    font-size: 0.68rem; padding: 0.15rem 0.45rem; border-radius: 999px;
}
.gallery-caption-form { margin: 0; padding: 0.5rem; border-bottom: 1px solid var(--line); }
.gallery-caption-form input { width: 100%; font-size: 0.82rem; padding: 0.4rem 0.5rem; }
.gallery-actions { display: flex; gap: 0.3rem; padding: 0.5rem; align-items: center; }
.gallery-actions form { margin: 0; }

/* =========================================================================
   THEME PICKER GALLERY (public page settings)
   ========================================================================= */
.theme-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
    margin-top: 0.5rem;
}
.theme-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper-raised);
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-card.selected { border-color: var(--brass); }
.theme-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch {
    display: block;
    height: 64px;
    border-radius: 6px;
    margin-bottom: 0.6rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}
.theme-swatch-dot {
    position: absolute;
    left: 10px; bottom: 10px;
    width: 16px; height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.theme-name { font-family: "Fraunces", serif; font-weight: 600; font-size: 1rem; }
.theme-desc { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.2rem; line-height: 1.35; }
.theme-check {
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--brass);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    opacity: 0; transform: scale(0.5);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
.theme-card.selected .theme-check { opacity: 1; transform: scale(1); }
@media (max-width: 640px) {
    .theme-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* Background music card (gallery management) */
.music-current {
    background: var(--amber-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.music-current-info { display: flex; align-items: center; gap: 0.75rem; }
.music-note {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--brass); color: #fff; font-size: 1.2rem; flex-shrink: 0;
}

/* Homepage banner slider (1920 x 400) */
.home-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1920 / 400;
    max-height: 400px;
    border-radius: var(--radius, 14px);
    overflow: hidden;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.4);
    margin-bottom: 1.75rem;
    outline: none;
}
.home-slider-track { position: absolute; inset: 0; }
.home-slide {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.9s ease;
    will-change: opacity;
}
.home-slide.active { opacity: 1; }

.home-slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: rgba(20,12,24,0.35); color: #fff;
    font-size: 1.6rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; z-index: 3;
}
.home-slider-arrow:hover { background: rgba(20,12,24,0.6); }
.home-slider-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.home-slider-arrow.prev { left: 14px; }
.home-slider-arrow.next { right: 14px; }

.home-slider-dots {
    position: absolute; left: 0; right: 0; bottom: 14px; z-index: 3;
    display: flex; gap: 8px; justify-content: center;
}
.home-slider-dot {
    width: 9px; height: 9px; padding: 0; border: none; border-radius: 999px;
    background: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.25s;
}
.home-slider-dot.on { background: #fff; width: 26px; }
.home-slider-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 600px) {
    .home-slider-arrow { width: 36px; height: 36px; font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
    .home-slide { transition: none; }
}

/* Gallery — banner photo selection */
.banner-controls {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--paper-raised, #faf7f0);
    border: 1px solid var(--line, #e6decb);
    border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 1rem;
}
.banner-controls-text { flex: 1; min-width: 220px; font-size: 0.9rem; color: var(--ink-soft, #5b564c); }
.banner-controls-actions { display: flex; gap: 0.5rem; }
.gallery-badge.banner-badge {
    background: rgba(184,134,43,0.92); color: #fff; left: 8px; right: auto;
}
.gallery-item.in-banner { outline: 2px solid var(--brass, #b8862b); outline-offset: 0; }
.gallery-banner-form { margin: 0.4rem 0 0; }
.gallery-banner-toggle {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.82rem; color: var(--ink-soft, #5b564c); cursor: pointer; user-select: none;
}
.gallery-banner-toggle input { accent-color: var(--brass, #b8862b); width: 15px; height: 15px; }

/* Private per-photo guest sharing */
.gallery-share { margin: 0.4rem 0 0; font-size: 0.82rem; }
.gallery-share > summary {
    cursor: pointer; color: var(--ink-soft, #5b564c); list-style: none;
    padding: 0.3rem 0.5rem; border: 1px dashed var(--line, #e6decb); border-radius: 6px;
    display: inline-flex; align-items: center; gap: 0.35rem; user-select: none;
}
.gallery-share > summary::-webkit-details-marker { display: none; }
.gallery-share[open] > summary { background: var(--amber-bg, #fbf5e9); border-style: solid; margin-bottom: 0.5rem; }
.gallery-share-list {
    max-height: 168px; overflow-y: auto;
    border: 1px solid var(--line, #e6decb); border-radius: 6px;
    padding: 0.4rem 0.55rem; margin-bottom: 0.5rem; background: #fff;
}
.gallery-share-guest {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.22rem 0; cursor: pointer;
}
.gallery-share-guest input { accent-color: var(--brass, #b8862b); width: 15px; height: 15px; flex: 0 0 auto; }
.gallery-share-grp {
    font-size: 0.72rem; color: var(--ink-soft, #5b564c);
    background: var(--amber-bg, #f3ead7); padding: 0.05rem 0.4rem; border-radius: 999px; margin-left: 0.25rem;
}

/* Banner-designs multi-picker (public settings) */
.design-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}
.design-pick {
    position: relative;
    display: block;
    border: 2px solid var(--line, #e6decb);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.design-pick:hover { transform: translateY(-1px); }
.design-pick.on { border-color: var(--brass, #b8862b); }
.design-pick input { position: absolute; opacity: 0; pointer-events: none; }
.design-pick-img {
    display: block;
    width: 100%;
    aspect-ratio: 1920 / 400;
    background-size: cover;
    background-position: center;
}
.design-pick-label {
    display: block;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink, #24211c);
    background: var(--paper-raised, #faf7f0);
}
.design-pick::after {
    content: "✓";
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--brass, #b8862b);
    color: #fff; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: scale(0.6); transition: all 0.15s;
}
.design-pick.on::after { opacity: 1; transform: scale(1); }

/* Occasion picker (registration) — choose the occasion, get a matching design */
.occasion-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}
.occasion {
    position: relative;
    display: block;
    border: 2px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--paper-raised);
    cursor: pointer;
    transition: border-color .15s, transform .1s, box-shadow .15s;
}
.occasion:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.occasion.on { border-color: var(--brass); box-shadow: 0 8px 22px -12px rgba(184,134,43,.55); }
.occasion input { position: absolute; opacity: 0; pointer-events: none; }
.occasion-img {
    display: block; position: relative; height: 82px;
    background-size: cover; background-position: center; background-color: #2b2620;
}
.occasion-img--other {
    background: linear-gradient(135deg, var(--amber-bg), var(--line));
    display: flex; align-items: center; justify-content: center;
}
.occasion-emblem {
    position: absolute; top: 6px; right: 8px; font-size: 1.15rem;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.5));
}
.occasion-img--other .occasion-emblem {
    position: static; font-size: 1.5rem; filter: none; color: var(--brass-dark);
}
.occasion-meta { display: block; padding: .55rem .7rem .65rem; }
.occasion-meta b { display: block; font-size: .9rem; line-height: 1.25; }
.occasion-meta span { display: block; font-size: .76rem; color: var(--ink-soft); }
.occasion::after {
    content: "✓";
    position: absolute; top: 6px; left: 8px;
    width: 21px; height: 21px; border-radius: 50%;
    background: var(--brass); color: #fff; font-size: .75rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: scale(.6); transition: all .15s;
}
.occasion.on::after { opacity: 1; transform: scale(1); }


/* Owner sub-navigation: single scrollable row on phones (no awkward wrapping). */
@media (max-width: 640px) {
    .tab-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; scrollbar-width: none; }
    .tab-row::-webkit-scrollbar { display: none; }
    .tab-row a { white-space: nowrap; flex: 0 0 auto; padding: 0.6rem 0.85rem; }
}

/* =========================================================================
   RESPONSIVE CARD GRID, OVERFLOW SAFETY, SCROLL BUTTONS, LOGIN BUTTON
   ========================================================================= */

/* Cards laid out in a responsive grid that reflows to the device width. */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    align-items: start;
}
.card-grid > .event-card,
.card-grid > .card { margin-bottom: 0; height: 100%; }
@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
}

/* Never let wide content force horizontal page scroll on any device. */
html { overflow-x: hidden; }
body { overflow-x: hidden; }
.wrap { width: 100%; box-sizing: border-box; }
img, video, iframe, canvas, svg { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
/* Long unbroken strings (URLs/tokens) wrap instead of stretching the layout. */
.event-card .invite-meta span, .badge, td, .help { overflow-wrap: anywhere; }
/* Wide tables scroll inside their own box rather than the whole page. */
.card table, .wrap table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Prominent header login button (shown when signed out). */
.topbar nav a.nav-login {
    border: 1px solid var(--brass, #b8862b);
    border-radius: 8px;
    padding: 0.35rem 0.9rem;
    opacity: 1;
    color: var(--paper, #fbf8f3);
    font-weight: 600;
}
.topbar nav a.nav-login:hover { background: var(--brass, #b8862b); color: #fff; border-bottom: 1px solid var(--brass, #b8862b); }

/* Floating back-to-top / back-to-bottom buttons. */
.scroll-btns {
    position: fixed;
    right: 18px; bottom: 18px;
    z-index: 1500;
    display: flex; flex-direction: column; gap: 8px;
    opacity: 0; transform: translateY(10px); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.scroll-btns.show { opacity: 1; transform: none; pointer-events: auto; }
.scroll-btn {
    width: 46px; height: 46px;
    border: none; border-radius: 50%;
    cursor: pointer;
    background: var(--brass, #b8862b);
    color: #fff;
    font-size: 1.25rem; line-height: 1;
    box-shadow: 0 5px 16px rgba(0,0,0,0.28);
    display: flex; align-items: center; justify-content: center;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.scroll-btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.scroll-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) {
    .scroll-btns { right: 12px; bottom: 12px; }
    .scroll-btn { width: 42px; height: 42px; }
}

/* =========================================================================
   CARD-BASED DASHBOARD COMPONENTS (metric tiles + user cards)
   ========================================================================= */

/* Metric tiles — label + icon chip, big value, small sub-line. */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.metric-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}
.metric-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.metric-label { font-size: 0.82rem; color: var(--ink-soft); }
.metric-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--amber-bg); font-size: 1.15rem; flex: 0 0 auto;
}
.metric-value { font-family: "Fraunces", Georgia, serif; font-size: 1.95rem; font-weight: 600; line-height: 1.1; color: var(--ink); }
.metric-sub { font-size: 0.8rem; color: var(--ink-soft); }
.metric-sub .up { color: var(--sage); font-weight: 600; }
.metric-sub .down { color: var(--rose); font-weight: 600; }
/* Accent (highlight) tile */
.metric-card.accent { background: linear-gradient(135deg, var(--brass), var(--brass-dark)); border-color: transparent; }
.metric-card.accent .metric-label, .metric-card.accent .metric-value, .metric-card.accent .metric-sub { color: #fff; }
.metric-card.accent .metric-icon { background: rgba(255,255,255,0.22); }
.metric-card.warn .metric-value { color: var(--rose); }
.metric-card.warn .metric-icon { background: var(--rose-bg); }

/* User / subscriber cards */
.user-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}
.user-card-grid.tight { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.user-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.user-card.flag { border-left: 4px solid var(--brass); }
.user-card-head { display: flex; align-items: center; gap: 0.8rem; }
.user-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--brass); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.15rem; flex: 0 0 auto; text-transform: uppercase;
}
.user-card-name { font-weight: 600; line-height: 1.2; }
.user-card-email { font-size: 0.82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.user-card-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 0.5rem; }
.user-card-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-size: 0.8rem; color: var(--ink-soft); }
.user-card-meta b { color: var(--ink); font-weight: 600; }
.user-card-notes { font-size: 0.82rem; color: var(--ink-soft); background: var(--amber-bg); border-radius: 10px; padding: 0.6rem 0.75rem; margin-top: 0.7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.user-card-actions { margin-top: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* Native disclosure for the full management controls inside a card. */
.user-card-manage { margin-top: 0.85rem; border-top: 1px solid var(--line); padding-top: 0.35rem; }
.user-card-manage > summary {
    cursor: pointer; list-style: none;
    font-size: 0.85rem; font-weight: 600; color: var(--brass-dark);
    padding: 0.5rem 0; display: inline-flex; align-items: center; gap: 0.3rem;
}
.user-card-manage > summary::-webkit-details-marker { display: none; }
.user-card-manage[open] > summary { margin-bottom: 0.5rem; }
.user-card-manage .manage-body { display: grid; gap: 1rem; }
.user-card-manage .field { margin: 0; }

/* =========================================================================
   LEFT SIDEBAR APP SHELL (replaces the old top navbar)
   ========================================================================= */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
    width: 240px;
    background: var(--ink); color: var(--paper);
    display: flex; flex-direction: column;
    /* Fixed so the menu is always visible while the page scrolls. */
    position: fixed; top: 0; left: 0;
    height: 100vh;        /* fallback */
    height: 100dvh;       /* auto-fit the device's actual visible height */
    padding: 1.15rem 0.85rem;
    box-shadow: 2px 0 18px rgba(0,0,0,0.10);
    z-index: 1200;
    transition: width 0.22s ease;
}
/* Brand row + collapse button */
.sidebar-top { display: flex; align-items: center; gap: 0.4rem; }
.sidebar-top .sidebar-brand { flex: 1 1 auto; min-width: 0; }
.sidebar-collapse {
    flex: 0 0 auto;
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06); color: var(--paper);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; line-height: 1; padding: 0;
}
.sidebar-collapse:hover { background: rgba(255,255,255,0.14); }
.sidebar-collapse .chev { display: inline-block; transition: transform 0.22s ease; }
.sidebar-brand {
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--paper); font-family: "Fraunces", Georgia, serif;
    font-size: 1.15rem; padding: 0.35rem 0.55rem 1.1rem;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-logo {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; overflow: hidden;
    background: #1b1e24; color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,0.10);
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mobile-bar .brand { display: inline-flex; align-items: center; gap: 0.45rem; }
.mobile-bar .brand-logo { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.sidebar-brand-text span { color: var(--brass); }
.sidebar-nav {
    display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: none;         /* Firefox — hide the scrollbar */
    -ms-overflow-style: none;      /* legacy Edge/IE */
}
.sidebar-nav::-webkit-scrollbar { width: 0; height: 0; }  /* Chrome / Safari / new Edge */
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.7rem 0.85rem; border-radius: 11px;
    color: rgba(255,255,255,0.82); font-size: 0.92rem;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.09); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: var(--brass); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(184,134,43,0.35); }
.sidebar-nav a .ico, .sidebar-logout .ico, .sidebar-foot .theme-toggle .ico { width: 1.5rem; text-align: center; font-size: 1.05rem; flex: 0 0 auto; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.13); padding-top: 0.55rem; margin-top: 0.55rem; display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar-foot .theme-toggle {
    background: transparent; border: none; cursor: pointer; text-align: left;
    color: rgba(255,255,255,0.82); font-size: 0.92rem; font-family: inherit;
    padding: 0.7rem 0.85rem; border-radius: 11px;
    display: flex; align-items: center; gap: 0.8rem;
}
.sidebar-foot .theme-toggle:hover { background: rgba(255,255,255,0.09); color: #fff; }
.sidebar-logout {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.7rem 0.85rem; border-radius: 11px;
    color: rgba(255,255,255,0.82); font-size: 0.92rem;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.09); color: #fff; text-decoration: none; }
.sidebar-user { font-size: 0.76rem; color: rgba(255,255,255,0.5); padding: 0.2rem 0.9rem 0.2rem; }
.sidebar-section { font-size: 0.66rem; letter-spacing: 0.6px; text-transform: uppercase; color: rgba(255,255,255,0.45); padding: 0.7rem 0.9rem 0.25rem; }
.sidebar-nav a.sidebar-event { font-size: 0.86rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.sidebar-event-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.sidebar-event-caret { margin-left: auto; flex: 0 0 auto; opacity: 0.5; font-size: 1.05rem; line-height: 1; transition: transform 0.16s ease, opacity 0.16s ease; }
.sidebar-event-item.subnav-open .sidebar-event-caret { transform: rotate(90deg); opacity: 0.9; }
.sidebar-event-item { position: relative; }
/* Hover/focus flyout: each event's pages cascade out beside its name. */
.sidebar-subnav {
    position: fixed; z-index: 1400; min-width: 210px; max-width: 280px;
    background: var(--ink); border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px; padding: 6px; box-shadow: 0 16px 38px rgba(0,0,0,0.42);
    opacity: 0; transform: translateX(-8px); pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    display: flex; flex-direction: column; gap: 1px;
    max-height: 94vh; overflow-y: auto;
    /* Hidden scrollbar — clean cascade, still scrolls (matches the main sidebar). */
    scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain;
}
.sidebar-subnav::-webkit-scrollbar { width: 0; height: 0; }
/* Compact rows so the whole cascade fits on screen without clipping items. */
.sidebar-subnav a { padding: 0.4rem 0.7rem; }
.sidebar-subnav-empty { display: block; padding: 0.4rem 0.7rem; color: rgba(255,255,255,0.45); font-size: 0.82rem; }
.sidebar-event-count { flex: 0 0 auto; font-size: 0.68rem; background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.75); border-radius: 999px; padding: 0.05rem 0.4rem; margin-left: 0.35rem; }
html.nav-collapsed .sidebar-event-count { display: none; }
.sidebar-event-item.subnav-open .sidebar-subnav { opacity: 1; transform: translateX(0); pointer-events: auto; }
.sidebar-subnav-title { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.5); padding: 0.3rem 0.7rem 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-subnav a { display: block; padding: 0.5rem 0.7rem; border-radius: 8px; color: rgba(255,255,255,0.82); font-size: 0.86rem; white-space: nowrap; }
.sidebar-subnav a:hover { background: rgba(255,255,255,0.10); color: #fff; text-decoration: none; }
.sidebar-subnav a.active { background: var(--brass); color: #fff; font-weight: 600; }
.sidebar-subnav-cancel { margin-top: 0.2rem; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 0.2rem; }
.sidebar-subnav-cancel button { display: block; width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; padding: 0.4rem 0.7rem; border-radius: 8px; color: #ffb4ab; font-size: 0.86rem; white-space: nowrap; font-family: inherit; }
.sidebar-subnav-cancel button:hover { background: rgba(184,59,48,0.85); color: #fff; }
.sidebar-subnav-owner { display: block; font-size: 0.7rem; opacity: 0.7; text-transform: none; letter-spacing: 0; font-weight: 400; margin-top: 2px; }
/* Admin sidebar event search box. */
.sidebar-evsearch { padding: 0.15rem 0.5rem 0.45rem; }
.sidebar-evsearch input { width: 100%; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.06); color: #fff; font-size: 0.82rem; }
.sidebar-evsearch input::placeholder { color: rgba(255,255,255,0.45); }
.sidebar-evsearch input:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
.sidebar-evsearch-none { color: rgba(255,255,255,0.5); font-size: 0.8rem; padding: 0.3rem 0.9rem; }
html.nav-collapsed .sidebar-evsearch { display: none; }

/* "You are here" breadcrumb trail (app pages). */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--brass-dark); text-decoration: underline; }
.crumb-sep { color: var(--line); }
.crumb-cur { color: var(--ink); font-weight: 600; }

.app-main { margin-left: 240px; min-width: 0; transition: margin-left 0.22s ease; }
.mobile-bar { display: none; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1150; }
.sidebar-backdrop.show { display: block; }

/* Desktop collapsed rail: icon-only, wider content area. */
@media (min-width: 861px) {
    html.nav-collapsed .sidebar { width: 70px; padding-left: 0.5rem; padding-right: 0.5rem; }
    html.nav-collapsed .app-main { margin-left: 70px; }
    html.nav-collapsed .sidebar-brand-text,
    html.nav-collapsed .sidebar-nav a > span:not(.ico),
    html.nav-collapsed .sidebar-logout > span:not(.ico),
    html.nav-collapsed .sidebar-foot .theme-toggle > span:not(.ico),
    html.nav-collapsed .sidebar-user,
    html.nav-collapsed .sidebar-section { display: none; }
    html.nav-collapsed .sidebar-nav a,
    html.nav-collapsed .sidebar-logout,
    html.nav-collapsed .sidebar-foot .theme-toggle { justify-content: center; gap: 0; padding-left: 0.55rem; padding-right: 0.55rem; }
    html.nav-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    html.nav-collapsed .sidebar-top { flex-direction: column; gap: 0.5rem; }
    html.nav-collapsed .sidebar-collapse .chev { transform: rotate(180deg); }
}

@media (max-width: 860px) {
    .app-shell { display: block; }
    .app-main { margin-left: 0; }          /* sidebar is an overlay drawer on phones */
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 250px;
        height: 100vh; height: 100dvh;
        transform: translateX(-100%); transition: transform 0.25s ease;
    }
    .sidebar.open { transform: none; }
    html.nav-collapsed .app-main { margin-left: 0; }
    .sidebar-collapse { display: none; }  /* mobile uses the drawer instead */
    .mobile-bar {
        display: flex; align-items: center; gap: 0.75rem;
        position: sticky; top: 0; z-index: 1100;
        background: var(--ink); color: var(--paper); padding: 0.7rem 1rem;
        box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    }
    .mobile-bar .brand { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; color: var(--paper); }
    .mobile-bar .brand span { color: var(--brass); }
    .mobile-bar .nav-toggle { display: inline-flex; }
}

/* =========================================================================
   COLLAPSE CASCADE — project-wide collapsible cards (see assets/js/collapse.js)
   A card's heading becomes a toggle; collapsing a parent cascades to any
   collapsible cards nested inside it. Cards start expanded.
   ========================================================================= */
.is-collapsible > .collapsible-head {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.is-collapsible > .collapsible-head:hover { color: var(--brass); }
.is-collapsible > .collapsible-head:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
    border-radius: 6px;
}
.collapsible-chev {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 1.15em;
    line-height: 1;
    opacity: 0.55;
    transform: rotate(90deg);            /* expanded → points down */
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.is-collapsible > .collapsible-head:hover .collapsible-chev { opacity: 0.9; }
.is-collapsible.collapsed > .collapsible-head .collapsible-chev { transform: rotate(0deg); } /* collapsed → points right */
.is-collapsible.collapsed > .collapsible-head { margin-bottom: 0; }
.is-collapsible.collapsed > .collapsible-body { display: none; }

/* Page-level Collapse all / Expand all control */
.collapse-allbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.1rem;
}
.collapse-allbar-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--ink-soft);
    margin-right: 0.15rem;
}
.collapse-allbtn {
    font: inherit;
    font-size: 0.82rem;
    line-height: 1;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--paper-raised);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.collapse-allbtn:hover { border-color: var(--brass); color: var(--brass); }

/* =========================================================================
   CUSTOM THEME BUILDER — sidebar quick-switcher + Appearance page.
   (Engine: assets/js/theme.js — writes CSS vars onto <html>.)
   ========================================================================= */

/* When a custom font is chosen, apply it across the interface. */
html[data-custom-font] body,
html[data-custom-font] h1, html[data-custom-font] h2, html[data-custom-font] h3,
html[data-custom-font] h4, html[data-custom-font] h5,
html[data-custom-font] .brand, html[data-custom-font] .sidebar-brand-text,
html[data-custom-font] input, html[data-custom-font] select,
html[data-custom-font] textarea, html[data-custom-font] button {
    font-family: var(--app-font) !important;
}

/* ---- Sidebar quick theme switcher ---- */
.theme-quick { position: relative; }
.theme-pop {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    width: 232px;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow), 0 12px 34px rgba(20,17,12,0.22);
    padding: 0.8rem;
    z-index: 1300;
}
.theme-pop[hidden] { display: none; }
.theme-pop-title {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--ink-soft); font-weight: 600; margin-bottom: 0.55rem;
}
.theme-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.theme-swatch {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 4px 4px 3px; cursor: pointer;
    border: 1px solid var(--line); border-radius: 7px; background: var(--paper);
    overflow: hidden;
}
.theme-swatch > span { height: 8px; border-radius: 2px; display: block; }
.theme-swatch > em { font-style: normal; font-size: 0.55rem; text-align: center; color: var(--ink-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-swatch:hover { border-color: var(--brass); }
.theme-accent-row {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    margin: 0.7rem 0 0.5rem; font-size: 0.82rem; color: var(--ink-soft);
}
.theme-accent-row input[type=color] { width: 40px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.theme-pop-actions { display: flex; gap: 0.4rem; }
.theme-pop-actions .btn { flex: 1; text-align: center; }
.theme-darklink {
    display: block; width: 100%; margin-top: 0.55rem; padding: 0.4rem;
    font: inherit; font-size: 0.78rem; color: var(--ink-soft);
    background: none; border: 1px dashed var(--line); border-radius: 6px; cursor: pointer;
}
.theme-darklink:hover { color: var(--brass); border-color: var(--brass); }

/* ---- Appearance builder page ---- */
.appearance-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .appearance-grid { grid-template-columns: 1fr; } }
.theme-preset-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.theme-preset-chip {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.7rem 0.4rem 0.45rem; cursor: pointer;
    background: var(--paper-raised); border: 1px solid var(--line); border-radius: 999px;
    font: inherit; font-size: 0.82rem; color: var(--ink);
}
.theme-preset-chip:hover { border-color: var(--brass); color: var(--brass); }
.chip-swatch { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.chip-swatch i { width: 11px; height: 16px; display: block; }
.theme-color-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin: 1.2rem 0; }
@media (max-width: 520px) { .theme-color-grid { grid-template-columns: 1fr; } }
.theme-color {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
.theme-color > span { flex: 1; font-size: 0.88rem; }
.theme-color code { font-size: 0.72rem; color: var(--ink-soft); font-family: "IBM Plex Mono", monospace; }
.theme-color input[type=color] { width: 42px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.theme-actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }
.appearance-preview .prev-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.page-head { margin: 0 0 1.4rem; }
.page-head h1 { margin: 0 0 0.35rem; }

/* ---- Custom public theme builder (public_settings.php) ---- */
.switch-row { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.switch-row input { width: auto; }
.pt-builder { transition: opacity 0.2s ease; }
.pt-builder.pt-off { opacity: 0.45; pointer-events: none; }
.pt-preview {
    --p-bg: #FBF8F3; --p-surface: #FFFFFF; --p-ink: #24211C; --p-soft: #5B564C; --p-line: #E6DECB; --p-accent: #B8862B; --p-font: inherit;
    margin-top: 1.3rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
    background: var(--p-bg); color: var(--p-ink); font-family: var(--p-font);
    padding: 1.6rem;
}
.pt-preview-eyebrow { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--p-accent); }
.pt-preview-title { font-size: 1.7rem; font-family: var(--p-font); margin: 0.25rem 0; color: var(--p-ink); }
.pt-preview-sub { font-style: italic; color: var(--p-soft); margin-bottom: 1.1rem; }
.pt-preview-card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 10px; padding: 1.1rem; }
.pt-preview-cardtitle { font-weight: 600; color: var(--p-ink); margin-bottom: 0.3rem; }
.pt-preview-card p { color: var(--p-soft); font-size: 0.9rem; margin: 0.3rem 0 0.9rem; }
.pt-preview-btn { display: inline-block; background: var(--p-accent); color: #fff; padding: 0.45rem 1rem; border-radius: 7px; font-size: 0.85rem; font-weight: 600; }

/* Pending-approval notice on the public responses page */
.flash-pending { background: var(--amber-bg); color: var(--ink); border: 1px solid var(--line); }

/* ── Registration: password strength meter + email-code step ─────────────── */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { flex: 1; padding-right: 3.6rem; }
.pw-toggle {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; color: var(--brass, #96690F);
    font-size: .8rem; font-weight: 600; cursor: pointer; padding: .2rem .4rem;
    width: auto; box-shadow: none;
}
.pw-toggle:hover { text-decoration: underline; }

.pw-meter { margin: .5rem 0 .25rem; }
.pw-bar { display: flex; gap: 5px; margin-bottom: .45rem; }
.pw-bar span {
    height: 6px; flex: 1; border-radius: 3px;
    background: rgba(0,0,0,.10); transition: background .2s ease;
}
.pw-label { font-size: .82rem; font-weight: 600; min-height: 1.1em; margin-bottom: .4rem; }
.pw-reqs {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .9rem;
}
.pw-reqs li {
    font-size: .8rem; color: var(--ink-soft, #6b6459);
    padding-left: 1.3rem; position: relative; line-height: 1.5;
}
.pw-reqs li::before {
    content: '○'; position: absolute; left: 0; color: var(--line, #ccc); font-size: .9em;
}
.pw-reqs li.ok { color: var(--sage, #55705F); }
.pw-reqs li.ok::before { content: '✓'; color: var(--sage, #55705F); font-weight: 700; }
.pw-match { font-size: .8rem; font-weight: 600; margin-top: .45rem; min-height: 1.1em; }

.code-input {
    font-size: 1.9rem; letter-spacing: .6rem; text-align: center;
    font-family: 'Courier New', monospace; font-weight: 700;
    padding: .7rem .5rem;
}
.reg-verify-actions { margin-top: 1.1rem; text-align: center; color: var(--ink-soft, #6b6459); }
.reg-verify-actions .reg-dot { margin: 0 .5rem; opacity: .6; }
.btn-link {
    background: transparent; border: none; box-shadow: none; width: auto;
    color: var(--brass, #96690F); font-weight: 600; cursor: pointer;
    font-size: .9rem; padding: .2rem .1rem;
}
.btn-link:hover { text-decoration: underline; }

@media (max-width: 520px) {
    .pw-reqs { grid-template-columns: 1fr; }
}

/* ── Super-admin: impersonation banner + audit + subscriber view ─────────── */
.imperson-banner {
    position: sticky; top: 0; z-index: 1200;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
    background: #7a1f1f; color: #fff; padding: .55rem 1rem; font-size: .9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.imperson-banner strong { color: #ffe1a8; }
.imperson-return {
    background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.5);
    padding: .3rem .8rem; border-radius: 6px; text-decoration: none; font-weight: 600; white-space: nowrap;
}
.imperson-return:hover { background: rgba(255,255,255,.28); }

.admin-audit-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.admin-audit-table th, .admin-audit-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-audit-table th { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.audit-action { display: inline-block; padding: .1em .55em; border-radius: 999px; font-size: .78em; font-weight: 600; background: var(--paper); border: 1px solid var(--line); }
.audit-action.danger { background: var(--rose-bg); color: var(--rose); border-color: var(--rose); }
.audit-action.warn { background: var(--amber-bg); color: var(--ink); }
.audit-action.ok { background: var(--sage-bg); color: var(--sage); }

.admin-event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.admin-event-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--paper-raised); }
.admin-event-card h4 { margin: 0 0 .2rem; }
.admin-event-card .ev-meta { font-size: .82rem; color: var(--ink-soft); margin-bottom: .6rem; }
.admin-event-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem .8rem; font-size: .84rem; }
.admin-event-stats b { color: var(--brass); }
.admin-priv-note { font-size: .82rem; color: var(--ink-soft); background: var(--amber-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; }

/* ── Activity feed (subscriber & admin dashboards) ───────────────────────── */
.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { flex: none; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); font-size: .95rem; }
.activity-body { display: flex; flex-direction: column; min-width: 0; }
.activity-text { font-size: .92rem; color: var(--ink); }
.activity-when { font-size: .76rem; color: var(--ink-soft); margin-top: .1rem; }
.activity-via { display: inline-block; font-size: .72rem; font-weight: 600; color: #7a1f1f; background: var(--rose-bg); border: 1px solid var(--rose); border-radius: 999px; padding: 0 .5em; margin-left: .3rem; vertical-align: middle; }

/* Activity log sort control */
.activity-sort { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.activity-sort-label { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }

/* Activity log — card layout (full activity page) */
.activity-cards { display: flex; flex-direction: column; gap: .7rem; }
.activity-card {
    display: flex; gap: .8rem; align-items: flex-start;
    background: var(--paper-raised); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow);
}
.activity-card .activity-icon { width: 2.2rem; height: 2.2rem; font-size: 1.05rem; }
.activity-card .activity-text { font-size: .95rem; font-weight: 500; }
.activity-card .activity-when { font-size: .8rem; }
.activity-pager { display: flex; gap: .5rem; align-items: center; justify-content: space-between; margin-top: 1.2rem; }
@media (max-width: 560px) { .activity-pager { flex-direction: column; gap: .6rem; } }

/* ── Social: share bar, follow links, social login ───────────────────────── */
.share-bar, .social-follow { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn, .social-link {
    display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
    border: 1px solid var(--line, #E4DCC8); border-radius: 999px;
    padding: .4rem .8rem; font-size: .85rem; font-weight: 600;
    text-decoration: none; color: #fff; background: #444; line-height: 1;
}
.share-btn:hover, .social-link:hover { filter: brightness(1.08); text-decoration: none; }
.share-ic, .social-ic { font-weight: 800; display: inline-flex; width: 1.1em; justify-content: center; }
.sh-fb, .sl-facebook  { background: #1877F2; border-color: #1877F2; }
.sh-x                 { background: #000;     border-color: #000; }
.sh-wa, .sl-whatsapp  { background: #25D366; border-color: #25D366; }
.sh-li, .sl-linkedin  { background: #0A66C2; border-color: #0A66C2; }
.sh-tg                { background: #229ED9; border-color: #229ED9; }
.sh-em                { background: #6b7280; border-color: #6b7280; }
.sh-cp                { background: var(--ink, #24211C); border-color: var(--ink, #24211C); }
.sl-instagram { background: #E1306C; border-color: #E1306C; }
.sl-x         { background: #000;    border-color: #000; }
.sl-tiktok    { background: #111;    border-color: #111; }
.sl-youtube   { background: #FF0000; border-color: #FF0000; }
.sl-website   { background: #475569; border-color: #475569; }

/* Public page: share/follow use the public palette surface, buttons keep brand colors */
.pub-share-widget .share-lbl, .pub-share-widget .social-lbl { white-space: nowrap; }

/* Social login buttons on auth pages */
.social-login { display: flex; flex-direction: column; gap: .55rem; margin: .25rem 0 1rem; }
.social-login-btn {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem;
    font-weight: 600; background: var(--paper-raised, #fff); color: var(--ink, #24211C);
    text-decoration: none;
}
.social-login-btn:hover { background: var(--paper, #f6f2ea); text-decoration: none; }
.social-login-btn .g-ic { font-weight: 800; color: #4285F4; }
.social-login-btn.fb { background: #1877F2; color: #fff; border-color: #1877F2; }
.social-login-btn.fb:hover { filter: brightness(1.06); background: #1877F2; }
.auth-divider { display: flex; align-items: center; gap: .6rem; color: var(--ink-soft); font-size: .82rem; margin: .4rem 0 1rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Social links editor (public settings) */
.social-fields { display: flex; flex-direction: column; gap: .45rem; }
.social-field-row { display: flex; align-items: center; gap: .55rem; }
.social-field-ic { width: 1.6rem; text-align: center; font-size: 1.05rem; flex: 0 0 auto; }
.social-field-row input { flex: 1; }
.pub-share-lead { font-size: .9rem; color: var(--pub-soft, #5B564C); margin: 0 0 .7rem; }

/* Share tool (dashboard) */
.share-link-row { display: flex; gap: .5rem; align-items: center; }
.share-link-row input { flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: .85rem; }
.share-caption { width: 100%; font-family: inherit; }

/* Admin social-sharing toggle */
.admin-social-toggle { margin: 0 0 1.2rem; }
.admin-social-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-social-row form { flex: 0 0 auto; }

/* Seating: move/switch + seat controls */
.seat-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.seat-row .seat-name { flex: 1 1 100%; font-weight: 500; }
.seat-badge { display: inline-block; font-size: .72rem; font-weight: 600; background: var(--sage-bg); color: var(--sage); border-radius: 999px; padding: .05em .55em; margin-left: .3rem; }
.seat-move-form { display: inline-flex; align-items: center; gap: .35rem; }
.seat-move-form select { max-width: 150px; padding: .3rem .4rem; }
.seat-num-input { width: 70px; padding: .3rem .4rem; }
.seat-edit { margin-top: .5rem; }
.seat-edit summary { cursor: pointer; font-size: .82rem; color: var(--brass); font-weight: 600; }

/* Seating: editable guest groups */
.group-edit-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.group-edit-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.group-rename-form { display: inline-flex; align-items: center; gap: .5rem; flex: 1 1 auto; }
.group-rename-form input[type="text"] { flex: 1 1 auto; max-width: 260px; }
.group-count { min-width: 1.6rem; text-align: center; font-size: .78rem; font-weight: 700; color: var(--brass); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .1em .5em; }

/* Share-platform picker (public settings) */
.share-platform-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem .8rem; }
.share-platform-opt { display: flex; align-items: center; gap: .45rem; font-size: .92rem; cursor: pointer; }
.share-platform-opt .share-ic { display: inline-flex; width: 1.2em; justify-content: center; font-weight: 800; color: var(--brass); }

/* --- Seating: auto-arrange + matrix --- */
.seat-auto-card { border-left: 3px solid var(--brass); }
.seat-auto-opts { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; margin-top: .7rem; }
.chk-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--ink); cursor: pointer; }
.chk-inline input { width: auto; }
.seat-matrix-card { padding-bottom: 1.1rem; }
.seat-matrix-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.seat-matrix-stat { font-size: .82rem; color: var(--ink-soft); }
.seat-matrix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.seat-matrix-table { border: 1px solid var(--line); border-radius: 10px; background: var(--paper-raised); padding: .7rem .75rem .8rem; }
.seat-matrix-title { font-weight: 600; font-size: .95rem; margin-bottom: .55rem; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.seat-matrix-title span { font-size: .78rem; color: var(--ink-soft); font-weight: 400; }
.seat-matrix-seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; }
.seat-cell { display: flex; align-items: center; gap: .4rem; border-radius: 7px; padding: .35rem .45rem; font-size: .8rem; min-width: 0; }
.seat-cell-no { flex: 0 0 auto; width: 1.4em; height: 1.4em; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; }
.seat-cell-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-cell.filled { background: var(--amber-bg); color: var(--ink); }
.seat-cell.filled .seat-cell-no { background: var(--brass); color: #fff; }
.seat-cell.empty { background: transparent; border: 1px dashed var(--line); color: var(--ink-soft); }
.seat-cell.empty .seat-cell-no { background: var(--line); color: var(--ink-soft); }
