/* =============================================================
   Wedding Invitation — mobile-first design system
   ============================================================= */

/* -------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------- */
:root {
    --color-gold:        #c9a961;
    --color-gold-soft:   #e6d4a1;
    --color-gold-dark:   #a18843;

    --color-bg:          #fbf7f0;
    --color-bg-elev:     #ffffff;
    --color-bg-sunken:   #f3ede1;
    --color-paper:       #fffcf5;

    --color-ink:         #1f2a37;
    --color-ink-soft:    #4b5563;
    --color-ink-muted:   #6b7280;
    --color-ink-faint:   #9ca3af;
    --color-line:        #e5e0d4;
    --color-line-soft:   #efeae0;

    --color-success:     #2f9d6b;
    --color-warning:     #d97706;
    --color-danger:      #c0392b;
    --color-info:        #2563eb;

    --color-admin-bg:    #111827;
    --color-admin-bg-2:  #1f2937;
    --color-admin-line:  #374151;
    --color-admin-ink:   #f9fafb;

    --font-display:      'Great Vibes', 'Pinyon Script', cursive;
    --font-heading:      'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body:         'Inter', 'Montserrat', system-ui, -apple-system, Segoe UI, sans-serif;

    --fs-xs:   0.75rem;
    --fs-sm:   0.875rem;
    --fs-md:   1rem;
    --fs-lg:   1.125rem;
    --fs-xl:   1.375rem;
    --fs-2xl:  1.75rem;
    --fs-3xl:  2.25rem;
    --fs-4xl:  3rem;
    --fs-5xl:  4rem;

    --lh-tight:  1.2;
    --lh-snug:   1.4;
    --lh-normal: 1.6;
    --lh-loose:  1.8;

    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.25rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-20: 5rem;
    --sp-24: 6rem;

    --r-sm:   4px;
    --r-md:   8px;
    --r-lg:   12px;
    --r-xl:   20px;
    --r-pill: 999px;

    --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --sh-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --sh-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --sh-xl: 0 24px 60px rgba(15, 23, 42, 0.18);

    --t-fast: 120ms ease;
    --t-base: 200ms ease;
    --t-slow: 400ms cubic-bezier(0.2, 0.7, 0.2, 1);

    --content-max: 760px;
    --content-wide: 1100px;
    --admin-bar-h: 56px;

    /* Per-section overrides (set via inline CSS custom properties on .section) */
    --bg-color:      #fbf7f0;
    --bg-alpha:      0.72;
    --glass-color:   #ffffff;
    --section-blur:  18px;
    --border-w:      0px;
    --border-color:  #c9a961;
    --border-alpha:  0.4;
    --shadow-alpha:  0;
    --primary-color: var(--color-gold);

    --body-bg-image: url('/media/site-bg.jpg'), linear-gradient(140deg, #f1e6d0 0%, #e8d6b3 50%, #d9c393 100%);
}

/* -------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}
body {
    max-width: 100%;
    font-family: var(--font-body);
    color: var(--color-ink);
    background: var(--color-bg);
    line-height: var(--lh-normal);
    font-size: var(--fs-md);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    min-height: 100dvh;
    position: relative;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: var(--body-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(180deg, rgba(251, 247, 240, 0.15), rgba(251, 247, 240, 0.55));
}
img, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--color-gold-dark); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--color-gold); }
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* -------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-ink);
    line-height: var(--lh-tight);
    font-weight: 500;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

.section-title {
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: clamp(2.25rem, 6vw, 3.75rem);
    text-align: center;
    margin: 0 0 var(--sp-8) 0;
    line-height: 1;
}

.section-eyebrow {
    text-align: center;
    font-size: var(--fs-xs);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
    margin-bottom: var(--sp-3);
}

.rich-text-content {
    font-size: var(--fs-md);
    line-height: var(--lh-loose);
    color: var(--color-ink-soft);
    max-width: 60ch;
    margin: 0 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.rich-text-content p + p { margin-top: var(--sp-4); }
.rich-text-content a { color: var(--color-gold-dark); text-decoration: underline; text-underline-offset: 3px; }
.rich-text-content strong { color: var(--color-ink); }
.rich-text-content img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: var(--sp-2) 0; }
.rich-text-content iframe,
.rich-text-content video { max-width: 100%; border-radius: var(--r-md); }
.rich-text-content table { display: block; max-width: 100%; overflow-x: auto; }
.rich-text-content pre { max-width: 100%; overflow-x: auto; }

/* -------------------------------------------------------------
   4. Layout — Section container with glass overlay
   ------------------------------------------------------------- */
main { display: block; }

.section {
    position: relative;
    padding: var(--sp-16) var(--sp-5);
    isolation: isolate;
    overflow-x: clip;
    border: var(--border-w) solid color-mix(in srgb, var(--border-color) calc(var(--border-alpha) * 100%), transparent);
    box-shadow: 0 24px 60px color-mix(in srgb, #000 calc(var(--shadow-alpha) * 100%), transparent);
}
.section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: color-mix(in srgb, var(--glass-color) calc(var(--bg-alpha) * 100%), transparent);
    backdrop-filter: blur(var(--section-blur));
    -webkit-backdrop-filter: blur(var(--section-blur));
    pointer-events: none;
}
.section > * { position: relative; z-index: 1; }

.section-bg-solid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: var(--bg-color);
}
.section-media {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.section-media > img {
    width: 100%; height: 100%; object-fit: cover;
}
.section-media > video {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    object-fit: cover;
}

.section__inner { width: 100%; max-width: var(--content-max); margin: 0 auto; }
.section--wide .section__inner { max-width: var(--content-wide); }
.section--text-center { text-align: center; }

body.has-admin-bar { padding-top: var(--admin-bar-h); }

/* -------------------------------------------------------------
   5. Components — Buttons
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-5);
    min-height: 44px;
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
    white-space: nowrap;
    user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--color-gold); color: #fff; }
.btn--primary:hover { background: var(--color-gold-dark); color: #fff; }
.btn--secondary { background: var(--color-bg-elev); color: var(--color-ink); border: 1px solid var(--color-line); }
.btn--secondary:hover { border-color: var(--color-gold); }
.btn--ghost { background: transparent; color: var(--color-admin-ink); border: 1px solid var(--color-admin-line); }
.btn--ghost:hover { background: var(--color-admin-bg-2); }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { background: #a93222; color: #fff; }
.btn--success { background: var(--color-success); color: #fff; }
.btn--success:hover { background: #248256; color: #fff; }
.btn--info { background: var(--color-info); color: #fff; }
.btn--purple { background: #8e44ad; color: #fff; }
.btn--teal { background: #1abc9c; color: #fff; }

.btn--sm { min-height: 36px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { min-height: 52px; padding: var(--sp-4) var(--sp-8); font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn--icon { min-width: 44px; padding: 0 var(--sp-3); }

/* -------------------------------------------------------------
   6. Components — Forms
   ------------------------------------------------------------- */
.form { display: grid; gap: var(--sp-5); }
.field { display: grid; gap: var(--sp-2); }
.field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--color-ink); }
.field__hint { font-size: var(--fs-xs); color: var(--color-ink-muted); }
.field__error { font-size: var(--fs-xs); color: var(--color-danger); }

.input, .select, .textarea {
    width: 100%;
    min-height: 44px;
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-bg-elev);
    color: var(--color-ink);
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    font-size: var(--fs-md);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-ink-faint); }
.input:focus, .select:focus, .textarea:focus {
    outline: 0;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.18);
}
.textarea { min-height: 96px; resize: vertical; line-height: var(--lh-snug); }

.choice-group { display: grid; gap: var(--sp-2); }
@media (min-width: 480px) { .choice-group { grid-template-columns: repeat(3, 1fr); } }
.choice {
    display: flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    background: var(--color-bg-elev);
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast);
    min-height: 44px;
    font-size: var(--fs-sm);
}
.choice:hover { border-color: var(--color-gold); }
.choice input { accent-color: var(--color-gold); }
.choice:has(input:checked) { border-color: var(--color-gold); background: rgba(201, 169, 97, 0.08); }

/* -------------------------------------------------------------
   7. Card / Badge / Toast
   ------------------------------------------------------------- */
.card { background: var(--color-bg-elev); border: 1px solid var(--color-line); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--sh-sm); }

.badge {
    display: inline-flex; align-items: center; gap: var(--sp-1);
    padding: 2px var(--sp-2);
    border-radius: var(--r-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge--neutral { background: var(--color-bg-sunken); color: var(--color-ink-soft); }
.badge--success { background: rgba(47, 157, 107, 0.14); color: var(--color-success); }
.badge--warning { background: rgba(217, 119, 6, 0.14); color: var(--color-warning); }
.badge--danger  { background: rgba(192, 57, 43, 0.14); color: var(--color-danger); }
.badge--info    { background: rgba(37, 99, 235, 0.14); color: var(--color-info); }
.badge--gold    { background: rgba(201, 169, 97, 0.18); color: var(--color-gold-dark); }

#toast-root {
    position: fixed;
    top: calc(var(--admin-bar-h) + var(--sp-4));
    right: var(--sp-4);
    z-index: 12000;
    display: grid;
    gap: var(--sp-2);
    pointer-events: none;
    max-width: calc(100vw - var(--sp-8));
}
.toast {
    pointer-events: auto;
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-admin-bg);
    color: var(--color-admin-ink);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    font-size: var(--fs-sm);
    display: flex; align-items: center; gap: var(--sp-3);
    min-width: 220px;
    animation: toast-in 200ms ease-out;
}
.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-danger); }
.toast--info    { border-left: 3px solid var(--color-info); }
.toast.is-leaving { animation: toast-out 200ms ease-in forwards; }
@keyframes toast-in  { from { transform: translateY(-8px); opacity: 0; } }
@keyframes toast-out { to   { transform: translateY(-8px); opacity: 0; } }

/* -------------------------------------------------------------
   8. Admin shell
   ------------------------------------------------------------- */
.admin-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9000;
    height: var(--admin-bar-h);
    background: var(--color-admin-bg);
    color: var(--color-admin-ink);
    border-bottom: 1px solid var(--color-admin-line);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-3);
    gap: var(--sp-2);
}
.admin-bar__brand {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-size: var(--fs-sm); font-weight: 600;
    color: var(--color-admin-ink);
    margin-right: auto;
}
.admin-bar__brand .dot {
    width: 8px; height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(47, 157, 107, 0.25);
}
.admin-bar__actions { display: flex; align-items: center; gap: var(--sp-2); }
.admin-bar__toggle { display: none; color: var(--color-admin-ink); padding: var(--sp-2); }
.admin-bar .btn { font-size: var(--fs-xs); min-height: 36px; }

@media (max-width: 720px) {
    .admin-bar__toggle { display: inline-flex; }
    .admin-bar__actions {
        position: absolute; top: 100%; right: var(--sp-3);
        flex-direction: column; align-items: stretch;
        background: var(--color-admin-bg);
        padding: var(--sp-3);
        border-radius: var(--r-md);
        border: 1px solid var(--color-admin-line);
        box-shadow: var(--sh-lg);
        min-width: 220px;
        display: none;
    }
    .admin-bar.is-open .admin-bar__actions { display: flex; }
    .admin-bar__actions .btn { width: 100%; justify-content: flex-start; }
}

/* Per-section admin chip */
.section-admin {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    z-index: 50;
    display: flex; align-items: center; gap: var(--sp-1);
    background: rgba(17, 24, 39, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-admin-ink);
    border-radius: var(--r-pill);
    padding: var(--sp-1);
    box-shadow: var(--sh-md);
}
.section-admin__handle {
    cursor: grab;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--color-admin-ink);
    border-radius: var(--r-pill);
}
.section-admin__handle:hover { background: rgba(255,255,255,0.1); }
.section-admin__type {
    font-size: var(--fs-xs);
    padding: 0 var(--sp-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gold-soft);
}
.section-admin__btn {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--color-admin-ink);
    border-radius: var(--r-pill);
    transition: background var(--t-fast), color var(--t-fast);
}
.section-admin__btn:hover { background: rgba(255,255,255,0.1); }
.section-admin__btn--danger:hover { background: rgba(192, 57, 43, 0.4); }
.section-admin__btn[data-active="true"] { color: var(--color-gold); }
@media (max-width: 480px) { .section-admin__type { display: none; } }

[data-editable] {
    position: relative;
    transition: outline-color var(--t-fast), background var(--t-fast);
    outline: 1px dashed transparent;
    outline-offset: 4px;
    border-radius: var(--r-sm);
}
[data-editable]:hover { outline-color: rgba(201, 169, 97, 0.5); background: rgba(201, 169, 97, 0.04); }
[data-editable]:focus { outline: 1px solid var(--color-gold); outline-offset: 4px; background: rgba(201, 169, 97, 0.06); }

#editor-toolbar-slot {
    position: fixed;
    top: var(--admin-bar-h);
    left: 0; right: 0;
    z-index: 8500;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
#editor-toolbar-slot > * {
    pointer-events: auto;
    box-shadow: var(--sh-md);
    border-radius: 0 0 var(--r-md) var(--r-md);
    max-width: 100vw;
    overflow: visible !important;
}

/* -------------------------------------------------------------
   9. Hero
   ------------------------------------------------------------- */
.section--hero {
    padding: 0;
    overflow: hidden;
    background: #0a0a0a;
    border: 0; box-shadow: none;
}
.section--hero::before { display: none; }
.hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    /* Box takes the media's own ratio (set from JS); 16:9 only until known.
       Full screen width + matching ratio => never cropped, no letterbox. */
    aspect-ratio: var(--hero-ar, 16 / 9);
    overflow: hidden;
}
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease-in-out; }
.hero__slide.is-active { opacity: 1; }
.hero__media, .hero__media img, .hero__media video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
}
.hero__media--placeholder { background: linear-gradient(135deg, #2b2114, #4a3a20); }
.hero__scrim {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0.6) 100%);
}
.hero__content {
    position: relative; z-index: 2;
    height: 100%;
    display: grid; align-content: center; justify-items: center;
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
    color: #fff;
}
.hero__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 14vw, 7rem);
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    line-height: 1;
    margin: 0;
}
.hero__title .ampersand { display: inline-block; color: var(--color-gold-soft); margin: 0 0.05em; }
.hero__subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: var(--sp-4);
    color: rgba(255,255,255,0.92);
    font-weight: 300;
}
.hero__date {
    font-size: var(--fs-md);
    margin-top: var(--sp-3);
    color: rgba(255,255,255,0.85);
    font-weight: 300;
    letter-spacing: 0.1em;
}
.hero__chevron {
    position: absolute;
    bottom: var(--sp-6);
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: var(--fs-xl);
    animation: bob 2s ease-in-out infinite;
    z-index: 3;
}
@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 8px); }
}
.hero-config-btn {
    position: absolute;
    bottom: var(--sp-6);
    left: var(--sp-5);
    z-index: 5;
}

/* -------------------------------------------------------------
   9b. Landing (empty-DB state — no media deps, no broken frames)
   ------------------------------------------------------------- */
.landing {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--sp-16) var(--sp-5);
    text-align: center;
}
body.has-admin-bar .landing { min-height: calc(100dvh - var(--admin-bar-h)); }
.landing__inner {
    width: 100%;
    max-width: 640px;
    display: grid;
    justify-items: center;
    gap: var(--sp-4);
}
.landing__eyebrow {
    font-size: var(--fs-xs);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
}
.landing__title {
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: clamp(2.75rem, 12vw, 5.5rem);
    line-height: 1;
    margin: 0;
}
.landing__title .ampersand { color: var(--color-gold-dark); margin: 0 0.05em; }
.landing__lead {
    font-family: var(--font-heading);
    font-size: clamp(1.125rem, 4vw, 1.5rem);
    color: var(--color-ink-soft);
    letter-spacing: 0.06em;
}
.landing__rule {
    width: 64px;
    height: 1px;
    background: var(--color-gold);
    opacity: 0.6;
    margin: var(--sp-2) 0;
}
.landing__note { font-size: var(--fs-sm); color: var(--color-ink-muted); }
.landing__admin {
    margin-top: var(--sp-8);
    text-align: center;
    display: grid;
    gap: var(--sp-3);
    justify-items: center;
    max-width: 460px;
}
.landing__admin-title {
    font-family: var(--font-body);
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-ink);
    margin: 0;
}
.landing__admin p { font-size: var(--fs-sm); color: var(--color-ink-soft); }

/* -------------------------------------------------------------
   10. Countdown
   ------------------------------------------------------------- */
.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
    max-width: 540px;
    margin: var(--sp-6) auto 0;
}
.countdown.has-years { grid-template-columns: repeat(5, 1fr); }
.countdown__cell {
    display: grid; place-items: center;
    padding: var(--sp-4) var(--sp-2);
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}
.countdown__num {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: 600;
    color: var(--color-gold);
    line-height: 1;
}
.countdown__lbl {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-ink-muted);
    margin-top: var(--sp-2);
}
.countdown-config {
    margin-top: var(--sp-6);
    padding: var(--sp-4);
    background: var(--color-bg-sunken);
    border-radius: var(--r-md);
    display: grid;
    gap: var(--sp-3);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* -------------------------------------------------------------
   11. Envelope
   ------------------------------------------------------------- */
.envelope { display: grid; justify-items: center; gap: var(--sp-6); text-align: center; }
.envelope__frame {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: color-mix(in srgb, var(--glass-color) calc(var(--bg-alpha) * 100%), transparent);
    backdrop-filter: blur(var(--section-blur));
    -webkit-backdrop-filter: blur(var(--section-blur));
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--r-xl);
    padding: var(--sp-6);
    box-shadow: var(--sh-lg);
    transition: background var(--t-base), backdrop-filter var(--t-base);
}
.envelope__btn { display: block; width: 100%; cursor: pointer; transition: transform var(--t-base); }
.envelope__btn:hover { transform: translateY(-4px); }
.envelope__btn.is-clicked { transform: scale(0.97); }
.envelope__img { width: 100%; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.25)); }
.envelope__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--color-bg-sunken), var(--color-bg-elev));
    border: 1px dashed var(--color-gold-soft);
    color: var(--color-gold);
    font-size: clamp(3rem, 14vw, 6rem);
}
.envelope__hint {
    margin-top: var(--sp-5);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-gold-dark);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.envelope__change-btn {
    position: absolute;
    top: -14px;
    right: -14px;
    background: var(--color-admin-bg);
    color: var(--color-admin-ink);
    border-radius: var(--r-pill);
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-xs);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: var(--sp-1);
    box-shadow: var(--sh-md);
    z-index: 10;
}

.invitation-letter {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-16px);
    transition: max-height 600ms cubic-bezier(0.2, 0.7, 0.2, 1),
                opacity 400ms ease,
                transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1),
                margin 400ms ease;
    margin-top: 0;
    width: 100%;
    max-width: 720px;
}
.invitation-letter.is-open {
    max-height: 4000px;
    opacity: 1;
    transform: translateY(0);
    margin-top: var(--sp-8);
}
.invitation-letter__paper {
    background: var(--paper-color, var(--color-paper));
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: var(--sp-10) var(--sp-6);
    box-shadow: var(--sh-lg);
    text-align: center;
    background-size: cover;
    background-position: center;
}
@media (min-width: 768px) {
    .invitation-letter__paper { padding: var(--sp-16) var(--sp-12); }
}
.invitation-letter__paper-controls {
    display: flex; flex-wrap: wrap; gap: var(--sp-2);
    justify-content: center;
    margin-bottom: var(--sp-4);
}
.envelope-children { margin-top: var(--sp-8); display: grid; gap: var(--sp-5); }
.envelope-children__add {
    margin-top: var(--sp-8);
    padding-top: var(--sp-5);
    border-top: 1px dashed var(--color-line);
    text-align: center;
}
.envelope-children__add p { color: var(--color-ink-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.envelope-children__add-buttons { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }

.child-block {
    position: relative;
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
    text-align: center;
}
.child-block__delete {
    position: absolute;
    top: -12px; right: -12px;
    width: 28px; height: 28px;
    background: var(--color-danger);
    color: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--sh-md);
    cursor: pointer;
    font-size: var(--fs-xs);
}
.child-block__upload {
    position: absolute;
    top: -12px; left: -12px;
    background: var(--color-info);
    color: #fff;
    border-radius: var(--r-pill);
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    display: inline-flex; align-items: center; gap: var(--sp-1);
    box-shadow: var(--sh-md);
    cursor: pointer;
}
.child-block__title {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-2);
}

/* -------------------------------------------------------------
   12. Timeline
   ------------------------------------------------------------- */
.timeline { position: relative; padding: var(--sp-4) 0; }
/* Alternating zig-zag at ALL widths (centre rail) */
.timeline::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--primary-color);
    opacity: 0.5;
}
.timeline__item {
    position: relative;
    list-style: none;
    width: 50%;
    padding: 0 var(--sp-4) var(--sp-8) 0;
    text-align: right;
}
.timeline__item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 var(--sp-8) var(--sp-4);
    text-align: left;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
    position: absolute;
    top: var(--sp-2);
    width: 14px; height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 1px var(--primary-color);
    z-index: 1;
}
.timeline__item:nth-child(odd) .timeline__dot { right: -8px; left: auto; }
.timeline__item:nth-child(even) .timeline__dot { left: -8px; right: auto; }
.timeline__time {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--sp-2);
}
.timeline__card {
    background: color-mix(in srgb, var(--card-color, var(--glass-color)) calc(var(--card-opacity, var(--bg-alpha)) * 100%), transparent);
    backdrop-filter: blur(var(--card-blur, var(--section-blur)));
    -webkit-backdrop-filter: blur(var(--card-blur, var(--section-blur)));
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: 0 4px 16px color-mix(in srgb, #000 calc(var(--card-shadow, 0.08) * 100%), transparent);
}
.timeline__icon {
    font-size: var(--fs-2xl);
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--sp-3);
}
.timeline__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--r-md);
    margin-bottom: var(--sp-3);
}
.timeline__desc { color: var(--color-ink-soft); line-height: var(--lh-normal); }
.timeline__actions {
    margin-top: var(--sp-4);
    padding-top: var(--sp-3);
    border-top: 1px dashed var(--color-line);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: space-between;
}
.timeline__actions .link-btn {
    font-size: var(--fs-xs);
    color: var(--color-ink-soft);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: var(--sp-1);
}
.timeline__actions .link-btn:hover { color: var(--color-gold-dark); }
.timeline__actions .link-btn--danger:hover { color: var(--color-danger); }

/* Cramped on phones (cards ~140px) — tighten card chrome */
@media (max-width: 600px) {
    .timeline__card { padding: var(--sp-3); }
    .timeline__time { font-size: var(--fs-md); }
    .timeline__icon { font-size: var(--fs-xl); }
    .timeline__actions { flex-direction: column; align-items: stretch; }
}
@media (min-width: 768px) {
    .timeline { padding: var(--sp-6) 0; }
    .timeline__item { padding: 0 var(--sp-8) var(--sp-12) 0; }
    .timeline__item:nth-child(even) { padding: 0 0 var(--sp-12) var(--sp-8); }
}

/* -------------------------------------------------------------
   13. RSVP
   ------------------------------------------------------------- */
.rsvp-card {
    max-width: 540px;
    margin: 0 auto;
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: var(--sp-8) var(--sp-5);
    box-shadow: var(--sh-md);
}
@media (min-width: 768px) {
    .rsvp-card { padding: var(--sp-10) var(--sp-10); }
}
.rsvp-greeting {
    text-align: center;
    background: rgba(201, 169, 97, 0.08);
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: var(--r-md);
    padding: var(--sp-4);
}
.rsvp-greeting strong { color: var(--color-gold-dark); }
.rsvp-greeting h3 { margin: 0; font-size: var(--fs-lg); font-family: var(--font-body); font-weight: 600; }
.rsvp-greeting p { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--color-ink-soft); }
.rsvp-fieldset { border: 0; padding: 0; margin: 0; }
.rsvp-response {
    margin-top: var(--sp-4);
    text-align: center;
    font-size: var(--fs-sm);
    min-height: 1.2em;
}
.rsvp-response.is-success { color: var(--color-success); }
.rsvp-response.is-error { color: var(--color-danger); }

/* -------------------------------------------------------------
   14. Video / Audio / Gallery
   ------------------------------------------------------------- */
.media-wrapper {
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
}
.media-wrapper--audio { border-radius: var(--r-xl); }

.section--gallery .section__inner { max-width: var(--content-wide); }
.gallery-wrapper { padding: 0; }
.gallery-wrapper .rich-text-content {
    max-width: none;
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 1fr;
}
.gallery-wrapper .rich-text-content img {
    width: 100%;
    border-radius: var(--r-md);
    margin: 0;
    box-shadow: var(--sh-sm);
}
@media (min-width: 600px) {
    .gallery-wrapper .rich-text-content {
        column-count: 2; column-gap: var(--sp-3);
        display: block;
    }
    .gallery-wrapper .rich-text-content img { display: block; break-inside: avoid; margin-bottom: var(--sp-3); }
}
@media (min-width: 1024px) {
    .gallery-wrapper .rich-text-content { column-count: 3; }
}

/* -------------------------------------------------------------
   15. Modals
   ------------------------------------------------------------- */
.modal {
    position: fixed; inset: 0;
    z-index: 11000;
    display: none;
    align-items: stretch; justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
}
.modal.is-open { display: flex; }
.modal__dialog {
    background: var(--color-bg);
    width: 100%;
    max-width: 720px;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--sh-xl);
}
@media (min-width: 720px) {
    .modal { padding: var(--sp-6); align-items: center; }
    .modal__dialog { max-height: calc(100dvh - var(--sp-12)); border-radius: var(--r-lg); }
}
.modal__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-5);
    border-bottom: 1px solid var(--color-line);
    background: var(--color-bg-elev);
}
.modal__title { margin: 0; font-size: var(--fs-xl); }
.modal__close {
    width: 40px; height: 40px;
    border-radius: var(--r-pill);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--color-ink-soft);
}
.modal__close:hover { background: var(--color-bg-sunken); color: var(--color-ink); }
.modal__body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: grid; gap: var(--sp-5); }
.modal__footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--color-line);
    background: var(--color-bg-elev);
    display: flex; gap: var(--sp-2); justify-content: flex-end;
}

.slide-list { display: grid; gap: var(--sp-4); }
.slide-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
@media (min-width: 600px) { .slide-card { grid-template-columns: 200px 1fr; } }
.slide-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--color-bg-sunken);
    cursor: move;
    overflow: hidden;
}
.slide-card__media img,
.slide-card__media video { width: 100%; height: 100%; object-fit: cover; }
.slide-card__media .audio-glyph {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: var(--color-ink-muted);
    background: var(--color-bg-sunken);
}
.slide-card__media .swap-btn {
    position: absolute;
    bottom: var(--sp-2);
    right: var(--sp-2);
    background: rgba(17, 24, 39, 0.85);
    color: #fff;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: var(--sp-1);
}
.slide-card__body { padding: var(--sp-4); display: grid; gap: var(--sp-3); }
.slide-card__row { display: grid; gap: var(--sp-3); }
@media (min-width: 480px) { .slide-card__row { grid-template-columns: 1fr 1fr; } }
.slide-card__footer {
    display: flex; flex-wrap: wrap; gap: var(--sp-2);
    justify-content: space-between; align-items: center;
    padding-top: var(--sp-2);
    border-top: 1px dashed var(--color-line);
}
.slide-card__toggle {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--color-ink-soft);
    cursor: pointer;
}

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); }
.picker-tile {
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-lg);
    padding: var(--sp-5) var(--sp-3);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--t-fast), transform var(--t-fast);
    display: grid; gap: var(--sp-2); justify-items: center;
}
.picker-tile:hover { border-color: var(--color-gold); transform: translateY(-2px); }
.picker-tile i { font-size: var(--fs-3xl); color: var(--color-gold); }
.picker-tile h4 { margin: 0; font-size: var(--fs-sm); font-family: var(--font-body); color: var(--color-ink); }

.icon-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2);
    max-height: 50vh; overflow-y: auto;
}
@media (min-width: 480px) { .icon-grid { grid-template-columns: repeat(6, 1fr); } }
.icon-grid button {
    aspect-ratio: 1;
    border-radius: var(--r-md);
    background: var(--color-bg-sunken);
    color: var(--color-ink);
    font-size: var(--fs-xl);
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.icon-grid button:hover { background: var(--color-gold); color: #fff; transform: scale(1.05); }

/* -------------------------------------------------------------
   16. Cropper modal
   ------------------------------------------------------------- */
.admin-crop-modal {
    position: fixed; inset: 0;
    z-index: 13000;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: var(--sp-4);
}
.admin-crop-modal.is-open { display: flex; }
.cropper-modal__dialog {
    background: var(--color-admin-bg-2);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    width: 100%; max-width: 900px;
    max-height: 100dvh;
    overflow-y: auto;
    color: var(--color-admin-ink);
}
.cropper-modal__title {
    margin: 0 0 var(--sp-4) 0;
    color: var(--color-admin-ink);
    font-family: var(--font-body);
    font-weight: 600;
}
.cropper-modal__stage {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 60dvh;
    background: #000;
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: var(--sp-4);
}
.cropper-modal__stage img { display: block; max-width: 100%; }
.cropper-modal__controls { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; }
.cropper-modal__group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.cropper-modal .btn { min-height: 40px; }

/* -------------------------------------------------------------
   17. Style drawer
   ------------------------------------------------------------- */
.style-drawer {
    position: fixed;
    z-index: 10500;
    background: var(--color-bg-elev);
    box-shadow: var(--sh-xl);
    transition: transform var(--t-slow), opacity var(--t-base);
    display: flex; flex-direction: column;
    overflow: hidden;
    left: 0; right: 0; bottom: 0;
    border-top-left-radius: var(--r-lg);
    border-top-right-radius: var(--r-lg);
    max-height: 85dvh;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}
.style-drawer.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
@media (min-width: 720px) {
    .style-drawer {
        left: auto; bottom: var(--sp-4);
        top: calc(var(--admin-bar-h) + var(--sp-4));
        right: var(--sp-4);
        width: 380px;
        max-height: none;
        border-radius: var(--r-lg);
        transform: translateX(110%);
    }
    .style-drawer.is-open { transform: translateX(0); }
}
.style-drawer__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--color-line);
    background: var(--color-bg-sunken);
}
.style-drawer__title { margin: 0; font-family: var(--font-body); font-size: var(--fs-md); font-weight: 600; }
.style-drawer__target {
    font-size: var(--fs-xs); color: var(--color-ink-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.style-drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: grid; gap: var(--sp-5); }
.style-section {
    display: grid; gap: var(--sp-3);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--color-line-soft);
}
.style-section:last-child { border-bottom: 0; padding-bottom: 0; }
.style-section__title {
    font-size: var(--fs-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--color-ink-muted);
    margin: 0;
}
.style-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-1);
    padding: 3px;
    background: var(--color-bg-sunken);
    border-radius: var(--r-md);
}
.style-tab {
    padding: var(--sp-2);
    text-align: center;
    font-size: var(--fs-xs); font-weight: 600;
    color: var(--color-ink-soft);
    border-radius: calc(var(--r-md) - 3px);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.style-tab:hover { color: var(--color-ink); }
.style-tab.is-active { background: var(--color-bg-elev); color: var(--color-ink); box-shadow: var(--sh-sm); }

.range-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center; }
.range-row__label { font-size: var(--fs-sm); color: var(--color-ink); }
.range-row__val {
    font-size: var(--fs-xs); color: var(--color-ink-muted);
    min-width: 44px; text-align: right;
    font-variant-numeric: tabular-nums;
}
.range-row input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--color-gold); }
.color-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center; }
.color-row input[type="color"] {
    width: 44px; height: 44px;
    padding: 2px;
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    background: transparent;
    cursor: pointer;
}
.upload-row { display: grid; gap: var(--sp-2); }
.upload-row .btn { width: 100%; }
.upload-row__preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-bg-sunken) center/cover no-repeat;
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
}
.style-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10400;
    opacity: 0; pointer-events: none;
    transition: opacity var(--t-base);
}
.style-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 720px) { .style-drawer-backdrop { display: none; } }

/* -------------------------------------------------------------
   18. Guests admin
   ------------------------------------------------------------- */
.guests-page {
    background: var(--color-bg);
    min-height: 100dvh;
    padding: var(--sp-5);
}
.guests-shell { max-width: var(--content-wide); margin: 0 auto; }
.guests-head {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}
.guests-head__title {
    flex: 1 1 auto;
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1;
}
.stat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }
.stat {
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    padding: var(--sp-4);
    text-align: center;
}
.stat__num { font-family: var(--font-heading); font-size: var(--fs-2xl); color: var(--color-ink); line-height: 1; font-weight: 600; }
.stat__lbl {
    font-size: var(--fs-xs);
    color: var(--color-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: var(--sp-2);
}
.stat--accent .stat__num { color: var(--color-success); }
.stat--accent { border-color: var(--color-success); }

.guest-add { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); margin-bottom: var(--sp-5); }
@media (min-width: 480px) { .guest-add { grid-template-columns: 1fr auto; } }

.guests-list { display: grid; gap: var(--sp-3); }
.guest-row {
    background: var(--color-bg-elev);
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    padding: var(--sp-4);
    display: grid;
    gap: var(--sp-3);
}
.guest-row.is-vip {
    border-left: 3px solid var(--color-gold);
    background: linear-gradient(to right, rgba(201, 169, 97, 0.06), var(--color-bg-elev) 30%);
}
.guest-row__main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.guest-row__name { font-weight: 600; color: var(--color-ink); flex: 1 1 auto; min-width: 0; word-break: break-word; }
.guest-row__msg {
    font-size: var(--fs-sm); color: var(--color-ink-soft);
    background: var(--color-bg-sunken);
    border-radius: var(--r-sm);
    padding: var(--sp-2) var(--sp-3);
}
.guest-row__link {
    display: flex; align-items: stretch;
    border: 1px solid var(--color-line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.guest-row__link input {
    flex: 1; border: 0;
    background: var(--color-bg-sunken);
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-xs);
    color: var(--color-ink-soft);
    min-width: 0;
}
.guest-row__link button {
    padding: 0 var(--sp-4);
    background: var(--color-bg-elev);
    border-left: 1px solid var(--color-line);
    color: var(--color-ink);
}
.guest-row__link button:hover { background: var(--color-gold); color: #fff; }
.guest-row__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.guest-row__qty { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--color-ink-soft); }
.guest-row__qty input {
    width: 64px;
    padding: var(--sp-1) var(--sp-2);
    border: 1px solid var(--color-line);
    border-radius: var(--r-sm);
    text-align: center;
}

.action-icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--color-ink-soft);
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.action-icon:hover { transform: scale(1.05); }
.action-icon.is-active { color: var(--color-gold); }
.action-icon--success:hover { background: rgba(47, 157, 107, 0.14); color: var(--color-success); }
.action-icon--warning:hover { background: rgba(217, 119, 6, 0.14); color: var(--color-warning); }
.action-icon--danger:hover  { background: rgba(192, 57, 43, 0.14); color: var(--color-danger); }
.action-icon--gold:hover    { background: rgba(201, 169, 97, 0.16); color: var(--color-gold-dark); }

/* -------------------------------------------------------------
   19. SortableJS + utilities
   ------------------------------------------------------------- */
.sortable-ghost { opacity: 0.5; }
.sortable-chosen { box-shadow: var(--sh-lg); }

.u-hidden { display: none !important; }
.u-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.u-text-center { text-align: center; }
.u-mt-4 { margin-top: var(--sp-4); }
.u-mt-6 { margin-top: var(--sp-6); }
.u-mt-8 { margin-top: var(--sp-8); }

@media (min-width: 768px) {
    .section { padding: var(--sp-20) var(--sp-6); }
    .section-title { margin-bottom: var(--sp-10); }
}
@media (min-width: 1024px) {
    .section { padding: var(--sp-24) var(--sp-8); }
}

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

/* Ensure TinyMCE popups (color picker, dialogs) are above everything else */
.tox-tinymce-aux {
    z-index: 20000 !important;
}

/* Media Audio Controls */
.media-controls { position: absolute; bottom: var(--sp-4); right: var(--sp-4); z-index: 50; display: flex; align-items: center; gap: var(--sp-2); background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-full); color: white; box-shadow: var(--sh-md); transition: background 0.3s, opacity 0.3s; pointer-events: auto; }
.media-controls:hover { background: rgba(0, 0, 0, 0.6); }
.media-controls__btn { background: none; border: none; color: inherit; font-size: 1.1rem; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; transition: color 0.2s; }
.media-controls__btn:hover { color: var(--color-primary); }
.media-controls__slider { width: 0; opacity: 0; transition: width 0.3s, opacity 0.3s; margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.media-controls:hover .media-controls__slider, .media-controls__slider:focus { width: 80px; opacity: 1; }
