:root {
    /* ── Brand ── */
    --primary: #c59b76;
    --primary-hover: #b08968;

    /* ── Surfaces ── */
    --bg: #faf8f5;
    --card-bg: #ffffff;

    /* ── Text ── */
    --text: #333333;
    --text-dim: #666666;

    /* ── Borders & shadows ── */
    --border: #e9dfd4;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    /* ── Semantic states ── */
    --danger: #ef4444;
    --success: #8ba888;
    --success-bg: #f0f4f0;
    --success-text: #5a7a58;
    --error: #b37a6b;
    --error-bg: #fdf2f0;
    --error-text: #8c5a4f;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --info: #60a5fa;
    --info-bg: #e0f2fe;
    --info-text: #0369a1;

    /* ── Typography ── */
    --font-serif: 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* ── Shape ── */
    --radius-sm: 4px;
    --radius-md: 8px;

    /* ── Motion ── */
    --transition-fast: 0.2s;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Labels ── */
    --letter-spacing-label: 1.5px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

header {
    display: flex;
    align-items: center;
    /* Vertically centers images and text */
    justify-content: center;
    height: 100px;
    /* Set your desired height here */
    overflow: hidden;
    gap: 10px;
    /* Space between images and text */
    /* Vertically centers images and text */
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 1.25rem;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.img-left {
    height: 100%;
    width: 100px;
}

.img-right {
    height: 100%;
    width: 100px;
}

.header-text {
    text-align: center;
    flex-shrink: 0;
    /* Prevents text from squishing */
}

.header-text h1 {
    margin: 0;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-family: var(--font-serif);
    font-weight: normal;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.info-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-special-box {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.admin-special-box label {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-label);
    margin-bottom: 0.75rem;
    display: block;
    font-weight: 600;
}

.link-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
}

.link-display span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsvp-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
    justify-content: center;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-dim);
    position: relative;
    transition: all var(--transition-smooth);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.35rem;
    /* Matches the border padding */
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-pane.hidden {
    display: none;
}

.wedding-date-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 1.5rem;
}

.wedding-date-header h2 {
    font-family: var(--font-serif);
    color: var(--primary);
    font-size: 1.8rem;
    margin: 0;
    font-weight: normal;
}

.info-block {
    margin-bottom: 2rem;
}

/* No bottom margin variant – used for the last block in a section */
.info-block--no-mb {
    margin-bottom: 0;
}

/* Two info-blocks side by side (locations row) */
.info-blocks-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-blocks-row .info-block {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .info-blocks-row {
        flex-direction: column;
        gap: 0;
    }

    .info-blocks-row .info-block {
        margin-bottom: 1.25rem;
    }
}

.info-header h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin: 0 0 1rem 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.info-body {
    padding-left: 0.5rem;
}

.info-body p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

.info-body,
.info-body * {
    color: inherit !important;
}

.map-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.map-link:hover {
    text-decoration: underline;
}

.schedule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.schedule-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    align-items: baseline;
}

.schedule-time {
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
    font-variant-numeric: tabular-nums;
}

.info-footer {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */

/* Monospace text */
.mono {
    font-family: var(--font-mono);
}

/* Small uppercase section heading used within content blocks */
.section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-label);
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

/* Dashed top-border separator between sections */
.section-sep {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.guest-entry>label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

input[type="text"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── Guest entries ──────────────────────────────────────────────────────────── */

.guest-entry {
    padding: 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
}

.guest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.guest-name-heading {
    border: none !important;
    background: transparent !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    padding: 0.2rem 0.5rem !important;
    margin: -0.2rem -0.5rem !important;
    color: var(--primary) !important;
    font-family: var(--font-serif) !important;
    flex-grow: 1;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), border-color var(--transition-fast);
    border-bottom: 2px solid transparent !important;
}

.guest-name-heading:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent) !important;
    border-bottom: 2px dashed var(--border) !important;
}

.guest-name-heading:focus {
    outline: none !important;
    background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
    border-bottom: 2px solid var(--primary) !important;
}

.attendance-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-smooth);
    color: var(--text-dim);
}

.toggle-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.toggle-btn:hover {
    background: var(--bg);
    color: var(--text-dim);
}

/* Green/Sage theme for Check */
.toggle-btn.check.active {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success-text);
}

/* Red/Terracotta theme for Cross */
.toggle-btn.cross.active {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error-text);
}

.guest-header .btn-small {
    margin-left: 0.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
    background: var(--primary);
    color: var(--card-bg);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background var(--transition-fast);
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: var(--card-bg) !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px dashed var(--text-dim);
}

.btn-outline:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-small {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error);
}

/* ── Checkboxes & sections ──────────────────────────────────────────────────── */

.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    font-size: 0.9rem;
    color: var(--text-dim);
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 0.5rem;
}

/* Dietary / transport / accommodation separators share the same spacing */
.dietary-section,
.transport-section,
.accommodation-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

/* Section headings within those blocks use .section-label visuals */
.dietary-section>label,
.transport-section>label,
.accommodation-section>label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-label);
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

/* ── Status pills ───────────────────────────────────────────────────────────── */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-pill svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

.status-pill.check {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-pill.cross {
    background: var(--error-bg);
    color: var(--error-text);
}

/* ── Admin guest list ─────────────────────────────────────────────────────── */

.admin-guest-line {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.guest-name {
    font-weight: 500;
    margin-right: 0.5rem;
}

.uuid-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted var(--border);
}

.uuid-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ── Admin table ─────────────────────────────────────────────────────────── */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg);
    font-weight: 600;
}

.link-cell {
    min-width: 150px;
}

/* ── Misc utility ────────────────────────────────────────────────────────── */

.visually-insignificant {
    opacity: 0.5;
    font-size: 0.8rem;
    padding: 0.5rem;
}

.visually-insignificant:hover {
    opacity: 1;
}

/* ── Status messages ─────────────────────────────────────────────────────── */

.status-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: none;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.status-msg.active {
    display: block;
    border: 1px solid transparent;
}

.status-msg.unsaved {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error);
}

.status-msg.saving {
    background: var(--bg);
    color: var(--text-dim);
    border-color: var(--border);
    animation: breathing 2s infinite ease-in-out;
}

.status-msg.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success);
}

.status-msg.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--danger);
}

@keyframes breathing {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.autosave-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* ── Modals ──────────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
    z-index: 100;
    overflow-y: auto;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    position: relative;
    padding-top: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-dim);
    line-height: 1;
}

.modal-footer {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Admin icon buttons ──────────────────────────────────────────────────── */

.admin-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-dim);
    transition: all var(--transition-fast);
    padding: 0;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.btn-icon:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon.btn-delete:hover {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error-text);
}

.btn-icon.copied {
    background: var(--success-bg) !important;
    border-color: var(--success) !important;
    color: var(--success-text) !important;
}

.btn-link {
    background: var(--bg);
}

/* ── Survey section ──────────────────────────────────────────────────────── */

.survey-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ── Custom survey questions ─────────────────────────────────────────────── */

.custom-survey-group {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.custom-q-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Editable question label – styled like guest-name-heading but smaller */
.custom-q-label-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    font-family: inherit !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: var(--radius-sm);
    border-bottom: 2px solid transparent !important;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    box-sizing: border-box;
    width: 100%;
}

.custom-q-label-input:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent) !important;
    border-bottom: 2px dashed var(--border) !important;
}

.custom-q-label-input:focus {
    outline: none !important;
    background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
    border-bottom: 2px solid var(--primary) !important;
}

.custom-q-label-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}


.survey-q-label {
    display: block;
    /*    font-family: var(--font-serif);
    font-size: 1.15rem; */
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    /* tests */
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.survey-group {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.survey-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.survey-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    transition: all var(--transition-smooth);
    min-height: 100px;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    line-height: 1.5;
}

.survey-textarea:focus {
    outline: none;
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.label-note {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 0.85em;
    text-transform: none;
}

/* ── Mobile: narrow phones (≤ 480px) – nav items only ── */
@media (max-width: 480px) {
    .rsvp-nav {
        gap: 0.25rem;
    }

    .tab-btn {
        font-size: 1rem;
        padding: 0.65rem 0.6rem;
        letter-spacing: 0;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    header {
        gap: 10px;
        left: -5%;
    }

    .img-left {
        object-position: -30% center;
    }

    .img-right {
        object-position: 110% center;
    }

    .survey-textarea {
        min-height: 8rem;
        field-sizing: content; /* auto-sizes to placeholder length where supported */
    }
}

/* ── Mobile: small phones (≤ 400px / 360px-wide devices) ── */
@media (max-width: 400px) {
    header {
        padding: 1.25rem 1rem 1rem;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.9rem;
    }

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .container {
        padding: 0 10px 24px;
    }

    .card {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
        border-radius: 6px;
    }

    .info-section {
        padding: 1rem 0.75rem;
        margin-bottom: 1rem;
    }

    .rsvp-nav {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tab-btn {
        font-size: 0.95rem;
        padding: 0.6rem 0.75rem;
    }

    .guest-entry {
        padding: 1rem 0.75rem;
        margin-bottom: 1rem;
    }

    .info-block {
        margin-bottom: 1.25rem;
    }

    .wedding-date-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .info-footer {
        padding: 0.75rem;
        margin-top: 1rem;
    }

    .admin-special-box {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }
}