/* Manage pages wear the builder's atelier tokens. /build/build.css sits behind the dev password gate, so the atelier block below is a copy: change both. */

:root {
    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Type scale: 1.25 ratio. rem so OS font-size prefs scale it (WCAG 1.4.4, reflows at 320px per 1.4.10). Floor is --text-xs at 13px. */
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 1.875rem;
    --text-3xl: 2.25rem;

    --leading-tight: 1.15;
    --leading-snug: 1.35;
    --leading-control: 1.4;
    --leading-body: 1.6;
    --font-mono:
        ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --radius: 6px;
    --radius-lg: 10px;
    --danger: #a8412f;
    --danger-bg: #fdf0ed;
    --danger-border: #f0cdc5;
}

/* Copy of build.css atelier: see file top. */
[data-theme="atelier"] {
    --paper: #f7f5f1;
    --panel: #fffdfb;
    --ink: #23201c;
    /* 4.98:1 on the paper. */
    --muted: #6f6a62;
    /* 4.6:1 target, matching build.css atelier --placeholder. */
    --placeholder: #736e67;
    /* 5.17:1 on the paper; also the focus ring color. */
    --accent: #7d6440;
    --border: #e6e0d5;
    --field: #ffffff;
    --field-border: #dcd5c8;
    --on-accent: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* No preview column here, so narrower than the builder's 1000px reads better. */
.brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    /* Padding, not a gap on .shell: see shared/layout.css. */
    padding-bottom: var(--shell-gap);
}

.wordmark {
    /* Shrink instead of holding the row open on narrow viewports. */
    min-width: 0;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--ink);
    text-decoration: none;
}

.brand-note {
    margin: 0;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Help link only (no self-link to Manage). Copied from the builder; can't share: /build is gated. */
.brand-links {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

/* Help (<a>) and Sign out (<button>) share one rule; the button's native box is stripped to match. */
.brand-links a,
.brand-links .signout {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.brand-links a:hover,
.brand-links .signout:not(:disabled):hover {
    color: var(--ink);
    border-bottom-color: var(--muted);
}

.brand-links a:focus-visible,
.brand-links .signout:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* 640px breakpoint is measured, not round: the dashboard header needs ~552px (516px text + 36px shell padding), so 420px overflowed. Below 640 the note hides and the row wraps. */
@media (max-width: 640px) {
    .brand {
        flex-wrap: wrap;
    }

    .brand-note {
        display: none;
    }

    .brand-links {
        gap: 13px;
    }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 24px 28px;
}

.panel-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.panel-sub {
    margin: 8px 0 0;
    max-width: 46ch;
    font-size: var(--text-sm);
    line-height: 1.65;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 6px;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 18px;
}

.label {
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 5px !important;
}

.optional {
    letter-spacing: 0.06em;
    text-transform: none;
    opacity: 0.75;
}

.input {
    width: 100%;
    padding: 11px 13px;
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.5;
    transition: border-color 0.15s ease;
}

.input::placeholder {
    /* --placeholder, not --muted: fixed-contrast dimming so it reads the same in every theme. */
    color: var(--placeholder);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
}

.input.has-error {
    border-color: var(--danger);
}

/* Mono + tracking: slug and secret are transcribed char-by-char (0 vs 8, I vs l). */
.input-mono,
.textarea-mono {
    font-family: var(--font-mono);
    font-size: var(--text-base);
    letter-spacing: 0.06em;
}

.textarea {
    resize: vertical;
    min-height: 88px;
    max-height: 260px;
    overflow-y: auto;
}

.field-hint {
    margin: 0;
    margin-bottom: 4px;
    font-size: var(--text-xs);
    line-height: 1.55;
    color: var(--muted);
}

.field-hint code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    overflow-wrap: anywhere;
}

.field-error {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--danger);
}

.alert {
    margin: 20px 0 0;
    padding: 12px 14px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.alert.is-notice {
    background: var(--field);
    border-color: var(--accent);
    color: var(--ink);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition:
        transform 0.12s ease,
        opacity 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.btn:hover:not(:disabled) {
    opacity: 0.88;
}

.btn-primary:hover:not(:disabled) {
    opacity: 1;
    filter: brightness(1.08);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--panel);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--field);
    color: var(--ink);
}

.btn:active {
    transform: translateY(1px);
}

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

.btn-primary {
    width: 100%;
    margin-top: 20px;
    background: var(--accent);
    color: var(--on-accent);
}

.btn-secondary {
    background: var(--field);
    border-color: var(--field-border);
    color: var(--ink);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}

/* Outlined, not filled: a solid red would out-pull the thing it destroys. */
.btn-danger {
    background: transparent;
    border-color: var(--danger-border);
    color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.btn-copy {
    flex-shrink: 0;
    padding: 7px 13px;
    font-size: var(--text-sm);
}

/* Confirmation opts out of .btn:disabled dimming so the one word that matters stays readable. */
.btn-copy.is-copied:disabled {
    opacity: 1;
    cursor: default;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-copy.is-failed:disabled {
    opacity: 1;
    cursor: default;
    color: var(--danger);
    border-color: var(--danger-border);
}

.spinner {
    width: 15px;
    height: 15px;
    flex: none;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
}

.url-text {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--accent);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.open-link {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    align-self: flex-start;
}

.open-link:hover {
    color: var(--accent);
}

/* Own section, separated by a rule rather than space: the destructive control reads apart. */
.danger-block {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--field-border);
}

.delete-status {
    margin: 0;
    padding: 10px 12px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    padding-top: 26px;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.foot-name {
    letter-spacing: 0.1em;
}

.foot-sep {
    opacity: 0.55;
}

.foot a {
    color: var(--muted);
    text-decoration: none;
}

.foot a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.foot a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

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

/* Held back with a class manage.js removes: a `hidden` attr in markup could never be revealed by a class toggle. Class-only can't hide pre-stylesheet, so hidden elements carry both; this [hidden] rule lets the class take over. */
.panel.is-unverified {
    visibility: hidden;
}

[hidden] {
    display: none !important;
}

.guest-list {
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
}

.guest-url {
    flex: 1 0 auto;
    text-align: right;
}

@media (max-width: 900px) {
    .guest-row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
        list-style: none;
    }

    .guest-name {
        flex: 0 0 auto;
        font-weight: 500;
        color: var(--ink);
    }

    .guest-url {
        display: none;
    }

    .guest-actions {
        display: flex;
        gap: 8px;
        flex: 0 1 auto;
    }

    .rsvp-no-answer {
        margin-top: -10px;
    }
}

.cf-turnstile {
    margin-top: 12px;
    height: 65px;
    min-height: 65px;
    line-height: 0;
}

.cf-turnstile iframe {
    display: block;
}

#copyAllRow .btn {
    min-width: 140px;
}

.rsvp-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rsvp-filter-btn {
    cursor: pointer;
}

.rsvp-filter-btn.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.rsvp-yes.active {
    text-decoration-color: currentColor;
}

.rsvp-no.active {
    text-decoration-color: currentColor;
}

.rsvp-maybe.active {
    text-decoration-color: currentColor;
}

.rsvp-no-answer.active {
    text-decoration-color: currentColor;
}

.clear-filter {
    cursor: pointer;
    color: #98948e;
    margin-right: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--ink);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    background: var(--field);
    transition: all 0.15s ease;
}

.checkbox-check {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.checkbox-label:hover .checkbox-box {
    border-color: var(--accent);
}

.checkbox-label:has(input:checked) .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label:has(input:checked) .checkbox-check {
    opacity: 1;
}
