/* --- Palette --- */
:root {
  --dark:      #1c1c1e;
  --white:     #ffffff;
  --muted:     #c7c7cc;
  --accent:    #62929e;
  --secondary: #546a7b;
  --error:     #b94a48;
  --compact-control-height: 1.7rem;
  --control-height: 2.4rem;
  --font-body:    'Lato', sans-serif;
  --font-heading: 'Roboto Serif', serif;
}

/* --- Standard theme --- */
[data-theme="standard"] {
  font-size: 15px;
}

/* --- Anniversary: warm dark, cognac, intimate --- */
[data-theme="anniversary"] {
  --dark:      #f5ede2;
  --white:     #141210;
  --muted:     #322a24;
  --accent:    #c9916a;
  --secondary: #8c6e58;
  --error:     #e07070;
  --font-heading: 'Cormorant Garamond', serif;
  --font-body:    'Jost', sans-serif;
}

[data-theme="anniversary"] body {
  background: #0a0806;
}

[data-theme="anniversary"] .card,
[data-theme="anniversary"] .custom-select__menu,
[data-theme="anniversary"] .date-picker {
  border-color: rgba(245, 237, 226, 0.07);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.45);
}

[data-theme="anniversary"] input[type="text"],
[data-theme="anniversary"] input[type="email"],
[data-theme="anniversary"] input[type="password"],
[data-theme="anniversary"] input[type="number"],
[data-theme="anniversary"] input[type="url"],
[data-theme="anniversary"] textarea,
[data-theme="anniversary"] select,
[data-theme="anniversary"] .custom-select__toggle {
  border-color: rgba(245, 237, 226, 0.12);
  color: var(--dark);
  background-color: #1e1a16;
}

[data-theme="anniversary"] select,
[data-theme="anniversary"] select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c6e58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="anniversary"] select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9916a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="anniversary"] .custom-select__toggle,
[data-theme="anniversary"] .custom-select__toggle:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c6e58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="anniversary"] .custom-select__toggle:focus-visible,
[data-theme="anniversary"] .custom-select.is-open .custom-select__toggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9916a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="anniversary"] input:focus,
[data-theme="anniversary"] textarea:focus,
[data-theme="anniversary"] .custom-select__toggle:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 145, 106, 0.22);
}

[data-theme="anniversary"] .site-header,
[data-theme="anniversary"] .site-nav {
  background: #0a0806;
  border-bottom-color: rgba(245, 237, 226, 0.07);
}

[data-theme="anniversary"] .modal__dialog {
  background: #1e1a16;
  border-color: rgba(245, 237, 226, 0.1);
}

/* --- Birthday: white, hot pink, deep purple --- */
[data-theme="birthday"] {
  --dark:      #1a0a1a;
  --white:     #ffffff;
  --muted:     #e8d0f0;
  --accent:    #d44ea0;
  --secondary: #7d3ca8;
  --error:     #c0392b;
  --font-heading: 'Fraunces', serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;
}

/* --- Wedding: white, warm, dusty rose --- */
[data-theme="wedding"] {
  --dark:      #2a2420;
  --white:     #ffffff;
  --muted:     #dcd6cf;
  --accent:    #9e7d8a;
  --secondary: #7a6270;
  --error:     #b94a48;
  --font-heading: 'Playfair Display', serif;
  --font-body:    'Karla', sans-serif;
}

[data-theme="anniversary"] strong,
[data-theme="anniversary"] b,
[data-theme="anniversary"] label,
[data-theme="anniversary"] .toggle-text,
[data-theme="birthday"] strong,
[data-theme="birthday"] b,
[data-theme="birthday"] label,
[data-theme="birthday"] .toggle-text,
[data-theme="concert"] strong,
[data-theme="concert"] b,
[data-theme="concert"] label,
[data-theme="concert"] .toggle-text,
[data-theme="other"] strong,
[data-theme="other"] b,
[data-theme="other"] label,
[data-theme="other"] .toggle-text,
[data-theme="tournament"] strong,
[data-theme="tournament"] b,
[data-theme="tournament"] label,
[data-theme="tournament"] .toggle-text,
[data-theme="workshop"] strong,
[data-theme="workshop"] b,
[data-theme="workshop"] label,
[data-theme="workshop"] .toggle-text,
[data-theme="wedding"] strong,
[data-theme="wedding"] b,
[data-theme="wedding"] label,
[data-theme="wedding"] .toggle-text {
  font-weight: 500;
}

[data-theme="wedding"] h1 strong,
[data-theme="wedding"] h2 strong,
[data-theme="wedding"] h3 strong,
[data-theme="wedding"] h4 strong,
[data-theme="wedding"] h1 b,
[data-theme="wedding"] h2 b,
[data-theme="wedding"] h3 b,
[data-theme="wedding"] h4 b {
  font-weight: 500;
}

/* --- Muted text readability: dark themes --- */
/* --- Muted text readability: dark themes --- */
[data-theme="anniversary"] .field-hint,
[data-theme="anniversary"] .field-optional,
[data-theme="anniversary"] .rule,
[data-theme="anniversary"] .custom-select__empty,
[data-theme="anniversary"] .date-picker__weekday,
[data-theme="anniversary"] .date-picker__day--other-month,
[data-theme="anniversary"] .spec-field__type,
[data-theme="anniversary"] .site-footer__inner,
[data-theme="anniversary"] .modal__member-list--empty li,
[data-theme="anniversary"] .deadline-note,
[data-theme="anniversary"] .member-count,
[data-theme="anniversary"] .badge--not-sent,
[data-theme="anniversary"] .event-countdown__date,
[data-theme="anniversary"] .stat__label,
[data-theme="anniversary"] .dashboard-limits__label,
[data-theme="anniversary"] .event-group-meta,
[data-theme="anniversary"] .guest-table th,
[data-theme="anniversary"] .status--pending,
[data-theme="anniversary"] .rsvp-detail-invite__label,
[data-theme="anniversary"] .rsvp-detail-qr__label,
[data-theme="anniversary"] .rsvp-detail-dl dt,
[data-theme="anniversary"] .empty-note,
[data-theme="anniversary"] .btn-remove,
[data-theme="anniversary"] .btn-remove-choice,
[data-theme="anniversary"] .spec-drag-handle,
[data-theme="anniversary"] .manage-types-default,
[data-theme="anniversary"] .home-privacy-note {
  color: rgba(245, 237, 226, 0.5);
}

[data-theme="concert"] .field-hint,
[data-theme="concert"] .field-optional,
[data-theme="concert"] .rule,
[data-theme="concert"] .custom-select__empty,
[data-theme="concert"] .date-picker__weekday,
[data-theme="concert"] .date-picker__day--other-month,
[data-theme="concert"] .spec-field__type,
[data-theme="concert"] .site-footer__inner,
[data-theme="concert"] .modal__member-list--empty li,
[data-theme="concert"] .deadline-note,
[data-theme="concert"] .member-count,
[data-theme="concert"] .badge--not-sent,
[data-theme="concert"] .event-countdown__date,
[data-theme="concert"] .stat__label,
[data-theme="concert"] .dashboard-limits__label,
[data-theme="concert"] .event-group-meta,
[data-theme="concert"] .guest-table th,
[data-theme="concert"] .status--pending,
[data-theme="concert"] .rsvp-detail-invite__label,
[data-theme="concert"] .rsvp-detail-qr__label,
[data-theme="concert"] .rsvp-detail-dl dt,
[data-theme="concert"] .empty-note,
[data-theme="concert"] .btn-remove,
[data-theme="concert"] .btn-remove-choice,
[data-theme="concert"] .spec-drag-handle,
[data-theme="concert"] .manage-types-default,
[data-theme="concert"] .home-privacy-note {
  color: rgba(240, 238, 255, 0.5);
}

[data-theme="tournament"] .field-hint,
[data-theme="tournament"] .field-optional,
[data-theme="tournament"] .rule,
[data-theme="tournament"] .custom-select__empty,
[data-theme="tournament"] .date-picker__weekday,
[data-theme="tournament"] .date-picker__day--other-month,
[data-theme="tournament"] .spec-field__type,
[data-theme="tournament"] .site-footer__inner,
[data-theme="tournament"] .modal__member-list--empty li,
[data-theme="tournament"] .deadline-note,
[data-theme="tournament"] .member-count,
[data-theme="tournament"] .badge--not-sent,
[data-theme="tournament"] .event-countdown__date,
[data-theme="tournament"] .stat__label,
[data-theme="tournament"] .dashboard-limits__label,
[data-theme="tournament"] .event-group-meta,
[data-theme="tournament"] .guest-table th,
[data-theme="tournament"] .status--pending,
[data-theme="tournament"] .rsvp-detail-invite__label,
[data-theme="tournament"] .rsvp-detail-qr__label,
[data-theme="tournament"] .rsvp-detail-dl dt,
[data-theme="tournament"] .empty-note,
[data-theme="tournament"] .btn-remove,
[data-theme="tournament"] .btn-remove-choice,
[data-theme="tournament"] .spec-drag-handle,
[data-theme="tournament"] .manage-types-default,
[data-theme="tournament"] .home-privacy-note {
  color: rgba(234, 245, 238, 0.5);
}

/* --- Muted text readability: light themes with near-white --muted --- */
[data-theme="birthday"] .field-hint,
[data-theme="birthday"] .field-optional,
[data-theme="birthday"] .rule,
[data-theme="birthday"] .custom-select__empty,
[data-theme="birthday"] .date-picker__weekday,
[data-theme="birthday"] .date-picker__day--other-month,
[data-theme="birthday"] .spec-field__type,
[data-theme="birthday"] .site-footer__inner,
[data-theme="birthday"] .modal__member-list--empty li,
[data-theme="birthday"] .deadline-note,
[data-theme="birthday"] .member-count,
[data-theme="birthday"] .badge--not-sent,
[data-theme="birthday"] .event-countdown__date,
[data-theme="birthday"] .stat__label,
[data-theme="birthday"] .dashboard-limits__label,
[data-theme="birthday"] .event-group-meta,
[data-theme="birthday"] .guest-table th,
[data-theme="birthday"] .status--pending,
[data-theme="birthday"] .rsvp-detail-invite__label,
[data-theme="birthday"] .rsvp-detail-qr__label,
[data-theme="birthday"] .rsvp-detail-dl dt,
[data-theme="birthday"] .empty-note,
[data-theme="birthday"] .btn-remove,
[data-theme="birthday"] .btn-remove-choice,
[data-theme="birthday"] .spec-drag-handle,
[data-theme="birthday"] .manage-types-default,
[data-theme="birthday"] .home-privacy-note,
[data-theme="wedding"] .field-hint,
[data-theme="wedding"] .field-optional,
[data-theme="wedding"] .rule,
[data-theme="wedding"] .custom-select__empty,
[data-theme="wedding"] .date-picker__weekday,
[data-theme="wedding"] .date-picker__day--other-month,
[data-theme="wedding"] .spec-field__type,
[data-theme="wedding"] .site-footer__inner,
[data-theme="wedding"] .modal__member-list--empty li,
[data-theme="wedding"] .deadline-note,
[data-theme="wedding"] .member-count,
[data-theme="wedding"] .badge--not-sent,
[data-theme="wedding"] .event-countdown__date,
[data-theme="wedding"] .stat__label,
[data-theme="wedding"] .dashboard-limits__label,
[data-theme="wedding"] .event-group-meta,
[data-theme="wedding"] .guest-table th,
[data-theme="wedding"] .status--pending,
[data-theme="wedding"] .rsvp-detail-invite__label,
[data-theme="wedding"] .rsvp-detail-qr__label,
[data-theme="wedding"] .rsvp-detail-dl dt,
[data-theme="wedding"] .empty-note,
[data-theme="wedding"] .btn-remove,
[data-theme="wedding"] .btn-remove-choice,
[data-theme="wedding"] .spec-drag-handle,
[data-theme="wedding"] .manage-types-default,
[data-theme="wedding"] .home-privacy-note,
[data-theme="other"] .field-hint,
[data-theme="other"] .field-optional,
[data-theme="other"] .rule,
[data-theme="other"] .custom-select__empty,
[data-theme="other"] .date-picker__weekday,
[data-theme="other"] .date-picker__day--other-month,
[data-theme="other"] .spec-field__type,
[data-theme="other"] .site-footer__inner,
[data-theme="other"] .modal__member-list--empty li,
[data-theme="other"] .deadline-note,
[data-theme="other"] .member-count,
[data-theme="other"] .badge--not-sent,
[data-theme="other"] .event-countdown__date,
[data-theme="other"] .stat__label,
[data-theme="other"] .dashboard-limits__label,
[data-theme="other"] .event-group-meta,
[data-theme="other"] .guest-table th,
[data-theme="other"] .status--pending,
[data-theme="other"] .rsvp-detail-invite__label,
[data-theme="other"] .rsvp-detail-qr__label,
[data-theme="other"] .rsvp-detail-dl dt,
[data-theme="other"] .empty-note,
[data-theme="other"] .btn-remove,
[data-theme="other"] .btn-remove-choice,
[data-theme="other"] .spec-drag-handle,
[data-theme="other"] .manage-types-default,
[data-theme="other"] .home-privacy-note {
  color: var(--secondary);
}

[data-theme="workshop"] .field-hint,
[data-theme="workshop"] .field-optional,
[data-theme="workshop"] .rule,
[data-theme="workshop"] .custom-select__empty,
[data-theme="workshop"] .date-picker__weekday,
[data-theme="workshop"] .date-picker__day--other-month,
[data-theme="workshop"] .spec-field__type,
[data-theme="workshop"] .site-footer__inner,
[data-theme="workshop"] .modal__member-list--empty li,
[data-theme="workshop"] .deadline-note,
[data-theme="workshop"] .member-count,
[data-theme="workshop"] .badge--not-sent,
[data-theme="workshop"] .event-countdown__date,
[data-theme="workshop"] .stat__label,
[data-theme="workshop"] .dashboard-limits__label,
[data-theme="workshop"] .event-group-meta,
[data-theme="workshop"] .guest-table th,
[data-theme="workshop"] .status--pending,
[data-theme="workshop"] .rsvp-detail-invite__label,
[data-theme="workshop"] .rsvp-detail-qr__label,
[data-theme="workshop"] .rsvp-detail-dl dt,
[data-theme="workshop"] .empty-note,
[data-theme="workshop"] .btn-remove,
[data-theme="workshop"] .btn-remove-choice,
[data-theme="workshop"] .spec-drag-handle,
[data-theme="workshop"] .manage-types-default,
[data-theme="workshop"] .home-privacy-note {
  color: var(--secondary);
}

/* --- Concert: very dark, electric violet --- */
[data-theme="concert"] {
  --dark:      #f0eeff;
  --white:     #13111e;
  --muted:     #252038;
  --accent:    #6d5ef5;
  --secondary: #9b91f5;
  --error:     #f07070;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
}

[data-theme="concert"] body {
  background: #080810;
}

[data-theme="concert"] .card,
[data-theme="concert"] .custom-select__menu,
[data-theme="concert"] .date-picker {
  border-color: rgba(240, 238, 255, 0.07);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="concert"] input[type="text"],
[data-theme="concert"] input[type="email"],
[data-theme="concert"] input[type="password"],
[data-theme="concert"] input[type="number"],
[data-theme="concert"] input[type="url"],
[data-theme="concert"] textarea,
[data-theme="concert"] select,
[data-theme="concert"] .custom-select__toggle {
  border-color: rgba(240, 238, 255, 0.12);
  color: var(--dark);
  background-color: #1c1929;
}

[data-theme="concert"] select,
[data-theme="concert"] select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b91f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="concert"] select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d5ef5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="concert"] .custom-select__toggle,
[data-theme="concert"] .custom-select__toggle:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b91f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="concert"] .custom-select__toggle:focus-visible,
[data-theme="concert"] .custom-select.is-open .custom-select__toggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d5ef5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="concert"] input:focus,
[data-theme="concert"] textarea:focus,
[data-theme="concert"] .custom-select__toggle:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 94, 245, 0.25);
}

[data-theme="concert"] .site-header,
[data-theme="concert"] .site-nav {
  background: #080810;
  border-bottom-color: rgba(240, 238, 255, 0.07);
}

[data-theme="concert"] .modal__dialog {
  background: #1c1929;
  border-color: rgba(240, 238, 255, 0.1);
}

/* --- Tournament: pitch-green dark, electric green --- */
[data-theme="tournament"] {
  --dark:      #eaf5ee;
  --white:     #101712;
  --muted:     #22301f;
  --accent:    #35d07f;
  --secondary: #7fe0ab;
  --error:     #f07070;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

[data-theme="tournament"] body {
  background: #0a0f0c;
}

[data-theme="tournament"] .card,
[data-theme="tournament"] .custom-select__menu,
[data-theme="tournament"] .date-picker {
  border-color: rgba(234, 245, 238, 0.07);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="tournament"] input[type="text"],
[data-theme="tournament"] input[type="email"],
[data-theme="tournament"] input[type="password"],
[data-theme="tournament"] input[type="number"],
[data-theme="tournament"] input[type="url"],
[data-theme="tournament"] textarea,
[data-theme="tournament"] select,
[data-theme="tournament"] .custom-select__toggle {
  border-color: rgba(234, 245, 238, 0.12);
  color: var(--dark);
  background-color: #16211a;
}

[data-theme="tournament"] select,
[data-theme="tournament"] select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237fe0ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="tournament"] select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2335d07f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="tournament"] .custom-select__toggle,
[data-theme="tournament"] .custom-select__toggle:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237fe0ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="tournament"] .custom-select__toggle:focus-visible,
[data-theme="tournament"] .custom-select.is-open .custom-select__toggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2335d07f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="tournament"] input:focus,
[data-theme="tournament"] textarea:focus,
[data-theme="tournament"] .custom-select__toggle:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 208, 127, 0.25);
}

[data-theme="tournament"] .site-header,
[data-theme="tournament"] .site-nav {
  background: #0a0f0c;
  border-bottom-color: rgba(234, 245, 238, 0.07);
}

[data-theme="tournament"] .modal__dialog {
  background: #16211a;
  border-color: rgba(234, 245, 238, 0.1);
}

[data-theme="tournament"] .tl-tp-panel {
  background: #16211a;
  border-color: rgba(234, 245, 238, 0.12);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
}

[data-theme="tournament"] .tl-tp-actions {
  border-bottom-color: rgba(234, 245, 238, 0.12);
}

[data-theme="tournament"] .tl-tp-clear {
  color: rgba(234, 245, 238, 0.5);
}

[data-theme="tournament"] .tl-tp-selection-bar {
  background: rgba(53, 208, 127, 0.12);
  border-color: rgba(53, 208, 127, 0.35);
}

[data-theme="tournament"] .tl-tp-done:hover {
  background: rgba(53, 208, 127, 0.14);
}

[data-theme="tournament"] .tl-tp-fade-top {
  background: linear-gradient(to bottom, rgba(22, 33, 26, 0.96) 0%, rgba(22, 33, 26, 0) 100%);
}

[data-theme="tournament"] .tl-tp-fade-bottom {
  background: linear-gradient(to top, rgba(22, 33, 26, 0.96) 0%, rgba(22, 33, 26, 0) 100%);
}

/* --- Other: white, clean, teal --- */
[data-theme="other"] {
  --dark:      #1c1c1e;
  --white:     #ffffff;
  --muted:     #d0d0d0;
  --accent:    #0f9688;
  --secondary: #0d7a6e;
  --error:     #b94a48;
  --font-heading: 'DM Serif Display', serif;
  --font-body:    'DM Sans', sans-serif;
}

/* --- Workshop: white, indigo on paper --- */
[data-theme="workshop"] {
  --dark:      #1d1e24;
  --white:     #ffffff;
  --muted:     #d6d8e4;
  --accent:    #4f5fc9;
  --secondary: #3a478f;
  --error:     #b94a48;
  --font-heading: 'Fraunces', serif;
  --font-body:    'Inter', sans-serif;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Base --- */
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* --- Header / Nav --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--muted);
  box-shadow: 0 1px 4px rgba(28, 28, 30, 0.07);
}

.site-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1.5rem;
}

.site-nav__brand {
  grid-column: 1;
  justify-self: start;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.site-nav__menu {
  display: contents;
}

.site-nav__links {
  grid-column: 2;
  justify-self: center;
  list-style: none;
  display: flex;
  gap: 2rem;
}

.site-nav__utility {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav__links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.site-nav__links a:hover {
  color: var(--dark);
}

.site-nav__toggle {
  grid-column: 3;
  justify-self: end;
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.site-nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
}

/* --- Host preview banner --- */
.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff8e1;
  border: 1px solid #f0c040;
  color: #7a5f00;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.preview-banner__label {
  flex-shrink: 0;
}

.preview-banner__form {
  display: flex;
  align-items: center;
  flex: 1;
}

.preview-banner__select {
  width: auto;
  height: auto;
  padding: 0.2rem 2rem 0.2rem 0.6rem;
  font-size: 0.82rem;
  border-color: #f0c040;
  border-radius: 4px;
  color: #7a5f00;
  background-color: #fffdf0;
  cursor: pointer;
}

.preview-banner__form .custom-select {
  width: 100%;
}

.preview-banner__form .custom-select__toggle {
  height: 1.7rem;
  box-sizing: border-box;
  padding: 0 1.8rem 0 0.6rem;
  font-size: 0.82rem;
  background-size: 0.7rem;
  border-color: #f0c040;
  border-radius: 4px;
  color: #7a5f00;
  background-color: #fffdf0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a5f00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.preview-banner__form .custom-select__toggle:hover {
  border-color: #d4a800;
  background-color: #fffdf0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a4400' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.preview-banner__form .custom-select__toggle:focus-visible,
.preview-banner__form .custom-select.is-open .custom-select__toggle {
  border-color: #d4a800;
  box-shadow: 0 0 0 3px rgba(240, 192, 64, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a4400' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.preview-banner__settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid #f0c040;
  border-radius: 4px;
  color: #7a5f00;
  background: #fffdf0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.preview-banner__settings:hover {
  background: #f0c040;
  color: #5a4400;
}

/* --- Flash messages --- */
.site-messages {
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--muted);
  background: var(--white);
  padding: 0.7rem 2rem;
  text-align: center;
}

.site-message {
  font-size: 0.9rem;
  color: var(--secondary);
}

.site-message--success {
  color: var(--accent);
}

.site-message--error {
  color: var(--error);
}

/* --- Main --- */
.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
}

/* --- Card --- */
.card {
  background: var(--white);
  border: 1px solid rgba(28, 28, 30, 0.08);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(28, 28, 30, 0.08), 0 1px 3px rgba(28, 28, 30, 0.06);
  padding: 2.5rem;
  max-width: 640px;
  width: 100%;
}

.card--wide {
  max-width: 960px;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: normal;
}

h1 {
  font-size: 1.9rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

h2 {
  font-size: 1.05rem;
  color: var(--secondary);
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 0.85rem;
}

/* --- Form fields --- */
.field {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(28, 28, 30, 0.14);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Single-line controls share --control-height with .btn so they always align in inline rows */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="number"],
select {
  height: var(--control-height);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  box-sizing: border-box;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23546a7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.85rem;
  cursor: pointer;
}

select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23393d3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362929e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* --- Custom select (JS-enhanced dropdown, matches the rest of the UI) --- */
.custom-select {
  position: relative;
  min-width: 0;
}

.custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}

.custom-select__toggle {
  width: 100%;
  display: block;
  text-align: left;
  height: var(--control-height);
  padding: 0.35rem 0.85rem;
  padding-right: 2.5rem;
  box-sizing: border-box;
  border: 1px solid rgba(28, 28, 30, 0.14);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--dark);
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23546a7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-select__value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__toggle:hover {
  border-color: rgba(28, 28, 30, 0.26);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23393d3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.custom-select__toggle:focus-visible,
.custom-select.is-open .custom-select__toggle {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362929e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.custom-select__menu {
  display: none;
  flex-direction: column;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  background: var(--white);
  border: 1px solid rgba(28, 28, 30, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(28, 28, 30, 0.12);
  max-height: 18rem;
  padding: 0.4rem 0;
  z-index: 30;
}

.custom-select.is-open .custom-select__menu {
  display: flex;
}

.custom-select .custom-select__search {
  width: calc(100% - 1.6rem);
  margin: 0 0.8rem 0.4rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  border: 1px solid rgba(28, 28, 30, 0.14);
  border-radius: 6px;
  flex-shrink: 0;
}

.custom-select .custom-select__search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.16);
}

.custom-select__list {
  list-style: none;
  overflow-y: auto;
}

.custom-select__option {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--secondary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.custom-select__option.is-hidden {
  display: none;
}

.custom-select__option:hover,
.custom-select__option:focus {
  outline: none;
  color: var(--dark);
  background: rgba(198, 197, 185, 0.2);
}

.custom-select__option.is-selected {
  color: var(--dark);
  font-weight: 500;
}

.custom-select__empty {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
input[type="url"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(28, 28, 30, 0.26);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.16);
}

input[type="number"] {
  max-width: 140px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  background: transparent;
}

input::placeholder {
  color: var(--muted);
}

input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--secondary);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

input[type="radio"]:hover {
  border-color: var(--accent);
}

input[type="radio"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.16);
}

input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='5' cy='5' r='2.2' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.radio-label {
  display: flex;
  align-items: center;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  color: var(--dark);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.5px solid var(--secondary);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 0.4rem;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

input[type="checkbox"]:hover {
  border-color: var(--accent);
}

input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.16);
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='white' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 65%;
}

textarea {
  resize: vertical;
}

.error {
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

/* --- Date field with custom calendar picker --- */
.date-field {
  position: relative;
  display: inline-block;
  max-width: 220px;
  width: 100%;
}

.date-field input[type="text"] {
  padding-right: 2.75rem;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.date-field__icon {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--secondary);
  transition: background 0.15s, color 0.15s;
}

.date-field__icon:hover {
  background: rgba(98, 146, 158, 0.14);
  color: var(--dark);
}

.date-field__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.date-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--white);
  border: 1px solid rgba(28, 28, 30, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(28, 28, 30, 0.13);
  width: 280px;
  padding: 1rem;
}

.date-picker__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.date-picker__month-year {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--dark);
}

.date-picker__prev,
.date-picker__next {
  background: none;
  border: none;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--secondary);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0;
  margin: 0;
  transition: background 0.15s, color 0.15s;
}

.date-picker__prev:hover,
.date-picker__next:hover {
  background: rgba(98, 146, 158, 0.12);
  color: var(--dark);
}

.date-picker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.2rem;
}

.date-picker__weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;
}

.date-picker__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.date-picker__day {
  text-align: center;
  padding: 0.4rem 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--dark);
  background: none;
  border: none;
  width: 100%;
  transition: background 0.1s, color 0.1s;
}

.date-picker__day:hover:not(.date-picker__day--selected) {
  background: rgba(98, 146, 158, 0.12);
}

.date-picker__day--today {
  font-weight: 500;
  color: var(--accent);
}

.date-picker__day--selected {
  background: var(--accent);
  color: var(--white);
}

.date-picker__day--other-month {
  color: var(--muted);
  opacity: 0.4;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.field-optional {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: none;
  font-weight: normal;
}

.form-section-heading {
  font-size: 1rem;
  color: var(--dark);
  border-bottom: none;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

/* --- Password rules --- */
.password-rules {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rule {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s;
}

.rule::before {
  content: '●';
  font-size: 0.5rem;
  flex-shrink: 0;
}

.rule.is-valid {
  color: var(--accent);
}

.rule.is-invalid {
  color: var(--error);
}

/* --- Photo slideshow --- */
.photo-slideshow {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  background: var(--muted);
}

.photo-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.photo-slide.is-active {
  opacity: 1;
}

/* --- Auth links --- */
.auth-switch {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--secondary);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--secondary);
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent);
  color: var(--white);
  height: var(--control-height);
  padding: 0 1.2rem;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: normal;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  margin-top: 1rem;
  box-shadow: 0 2px 6px rgba(98, 146, 158, 0.25);
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.btn:hover {
  background: var(--secondary);
  box-shadow: 0 6px 16px rgba(84, 106, 123, 0.3);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.3);
}

.btn--secondary {
  background: none;
  color: var(--accent);
  box-shadow: none;
  border: 1px solid var(--accent);
}

.btn--secondary:hover {
  background: rgba(98, 146, 158, 0.1);
  color: var(--dark);
  box-shadow: none;
  transform: none;
}

.btn--danger {
  background: var(--error);
  box-shadow: 0 2px 6px rgba(185, 74, 72, 0.25);
}

.btn--danger:hover {
  background: #9c3d3b;
  box-shadow: 0 6px 16px rgba(185, 74, 72, 0.3);
}

.btn--danger-outline {
  background: none;
  color: var(--error, #b94a48);
  border: 1px solid var(--error, #b94a48);
  box-shadow: none;
}

.btn--danger-outline:hover {
  background: rgba(185, 74, 72, 0.08);
  box-shadow: none;
  transform: none;
}

.btn--warning-outline {
  background: none;
  color: #b97c20;
  border: 1px solid #b97c20;
  box-shadow: none;
}

.btn--warning-outline:hover {
  background: rgba(185, 124, 32, 0.08);
  box-shadow: none;
  transform: none;
}

.btn--sm {
  height: var(--compact-control-height);
  padding: 0 0.85rem;
  box-sizing: border-box;
  font-size: 0.8rem;
  margin-top: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.btn--icon {
  width: var(--compact-control-height);
  padding: 0;
}

/* Compact single-line input/select — matches --compact-control-height so it pairs with .btn--sm */
.input-sm {
  height: var(--compact-control-height) !important;
  padding: 0 0.55rem !important;
  font-size: 0.875rem !important;
  box-sizing: border-box;
}

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 30, 0.45);
}

.modal__dialog {
  position: relative;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(28, 28, 30, 0.18), 0 1px 3px rgba(28, 28, 30, 0.08);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
}

.modal__body img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 480px) {
  .modal {
    padding: 0.75rem;
  }

  .modal__dialog {
    padding: 1.5rem 1.25rem;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
  }
}

/* Title and optional actions share one row; the spacing that used to sit on
   the title lives on the header so both stay aligned. */
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal__title {
  font-family: var(--font-heading);
  font-weight: normal;
  font-size: 1.3rem;
  color: var(--dark);
  margin-bottom: 0;
}

.modal__actions:empty {
  display: none;
}

.modal__body {
  font-size: 0.92rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

.modal__body p {
  margin-bottom: 0.5rem;
}

.modal__member-list {
  list-style: none;
  margin-top: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px solid var(--muted);
  padding-top: 0.5rem;
}

.modal__member-list li {
  padding: 0.3rem 0;
  color: var(--dark);
  font-size: 0.9rem;
}

.modal__member-list--empty li {
  color: var(--muted);
  font-style: italic;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal__footer .btn {
  margin-top: 0;
}

/* --- RSVP event info header --- */
.event-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.event-info__name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--dark);
  line-height: 1.25;
}

.event-info__meta {
  text-align: right;
  flex-shrink: 0;
}

/* The event date is the single most important fact on the RSVP page, so it is
   sized and coloured to compete with the event name rather than sit under the
   location as small print. */
.event-info__date {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.event-info__location {
  font-size: 0.88rem;
  color: var(--secondary);
}

.event-info__location a {
  color: var(--accent);
  text-decoration: none;
}

.event-info__location a:hover {
  color: var(--secondary);
}

/* Narrow screens: stack instead of letting the name and the enlarged date
   fight over one row. */
@media (max-width: 480px) {
  .event-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .event-info__meta {
    text-align: left;
  }

  .event-info__date {
    font-size: 1.2rem;
  }
}

.event-intro {
  font-size: 0.95rem;
  color: var(--secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--muted);
  font-style: italic;
}

/* --- RSVP info spec blocks --- */
.rsvp-specs {
  margin: 1.75rem 0 2rem;
  border-bottom: 1px solid var(--muted);
}

.rsvp-spec {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(198, 197, 185, 0.45);
}

.rsvp-spec:last-child {
  border-bottom: none;
}

.rsvp-spec__type {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--secondary);
  padding-top: 0.1rem;
  line-height: 1.4;
}

.rsvp-spec__content {
  font-size: 0.92rem;
  color: var(--dark);
  line-height: 1.6;
}

@media (max-width: 480px) {
  .rsvp-spec {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .rsvp-spec__type {
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
  }
}

.spec-detail-toggle {
  display: block;
  margin-top: 0.55rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--secondary);
  opacity: 0.6;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
  transition: opacity 0.15s;
}

.spec-detail-toggle:hover {
  opacity: 1;
}

.spec-detail-toggle__arrow {
  display: inline-block;
  font-style: normal;
  font-size: 0.65rem;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.spec-detail-toggle[aria-expanded="true"] .spec-detail-toggle__arrow {
  transform: rotate(180deg);
}

.spec-detail-content {
  grid-column: 1 / -1;
  padding: 0.9rem 0 0.25rem;
}

.spec-detail-content p {
  font-size: 0.88rem;
  color: var(--dark);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.spec-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.spec-photo-grid__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  cursor: zoom-in;
}

@media (max-width: 480px) {
  .spec-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- RSVP Schedule timeline --- */
.rsvp-timeline {
  grid-column: 1 / -1;
  padding: 0.25rem 0 0.5rem;
}

/* Vertical layout */
.rsvp-timeline--vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.rsvp-timeline--vertical .rsvp-tl-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(1.05rem - 1px);
  top: 2.5rem;
  bottom: -1.45rem;
  width: 2px;
  background: var(--muted);
  border-radius: 2px;
}

.rsvp-timeline--vertical .rsvp-tl-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  position: relative;
}

.rsvp-timeline--vertical .rsvp-tl-dot {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

/* Horizontal layout */
.rsvp-timeline--horizontal {
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  position: relative;
}

.rsvp-timeline--horizontal .rsvp-tl-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: calc(1.05rem - 1px);
  left: calc(50% + 1.05rem);
  right: calc(1.05rem - 50%);
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
}

.rsvp-timeline--horizontal .rsvp-tl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 80px;
  flex: 1;
  position: relative;
  text-align: center;
}

.rsvp-timeline--horizontal .rsvp-tl-dot {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.rsvp-tl-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsvp-readonly-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.rsvp-deadline-notice {
  font-size: 0.9rem;
  color: var(--secondary);
  margin-top: 1rem;
}

.rsvp-tl-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.25rem;
}

.rsvp-timeline--horizontal .rsvp-tl-body {
  align-items: center;
  padding-top: 0;
}

.rsvp-tl-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.rsvp-tl-label {
  font-size: 0.88rem;
  color: var(--dark);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .rsvp-timeline--horizontal {
    flex-direction: column;
    overflow-x: visible;
  }

  .rsvp-timeline--horizontal .rsvp-tl-item:not(:last-child)::after {
    top: 2.1rem;
    left: calc(1.05rem - 1px);
    right: auto;
    bottom: -1.05rem;
    width: 2px;
    height: auto;
  }

  .rsvp-timeline--horizontal .rsvp-tl-item {
    flex-direction: row;
    text-align: left;
    gap: 1rem;
    min-width: unset;
  }

  .rsvp-timeline--horizontal .rsvp-tl-body {
    align-items: flex-start;
  }
}

/* Photo lightbox */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  cursor: zoom-out;
  padding: 1rem;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox__img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  cursor: default;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.photo-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.photo-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* --- Spec question fields inside the RSVP form --- */
.spec-field {
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.spec-field__label-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.spec-field__label-row label {
  margin-bottom: 0;
}

.spec-field__type {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.spec-field > label {
  font-style: italic;
  color: var(--secondary);
}

.spec-field__desc {
  margin-bottom: 0.5rem;
}

/* Yes/No radio group — Django 4.x renders as nested divs */
.spec-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.spec-radio-group > div {
  display: flex;
}

.spec-radio-group > div label {
  font-style: normal;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

/* Multi-choice checkbox group */
.spec-check-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.spec-check-group > div {
  display: flex;
}

.spec-check-group > div label {
  font-style: normal;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

/* Legacy: older Django versions used ul/li for RadioSelect / CheckboxSelectMultiple */
.spec-field ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.spec-field ul li label {
  font-style: normal;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

/* --- Guest form blocks --- */
.guest-block {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--muted);
}

.guest-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guest-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 1rem;
}

/* --- Deadline note --- */
.deadline-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.deadline-countdown {
  margin-bottom: 1.5rem;
}

.deadline-countdown__value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent);
  margin-right: 0.35rem;
}

.deadline-countdown__label {
  font-size: 0.9rem;
  color: var(--accent);
}

/* --- Host nav dropdown --- */
.site-nav__host {
  position: relative;
}

.site-nav__host-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--secondary);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}

.site-nav__host-toggle:hover {
  color: var(--dark);
}

.site-nav__host-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--white);
  border: 1px solid rgba(28, 28, 30, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(28, 28, 30, 0.12);
  list-style: none;
  min-width: 150px;
  padding: 0.4rem 0;
  z-index: 20;
}

.site-nav__host-menu.is-open {
  display: block;
}

.site-nav__host-menu a,
.site-nav__logout-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.site-nav__host-menu a:hover,
.site-nav__logout-btn:hover {
  color: var(--dark);
  background: rgba(198, 197, 185, 0.2);
}

.site-nav__danger-link {
  color: var(--error) !important;
}

.site-nav__danger-link:hover {
  background: rgba(185, 74, 72, 0.08) !important;
}

.site-nav__login {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.site-nav__login:hover {
  color: var(--dark);
}

/* --- Language switcher --- */
.site-nav__lang {
  margin: 0;
}

.site-nav__lang .custom-select__toggle {
  width: auto;
  height: auto;
  padding: 0.35rem 1.8rem 0.35rem 0.7rem;
  font-size: 0.82rem;
  background-size: 0.7rem;
}

.site-nav__lang .custom-select__menu {
  left: auto;
  right: 0;
  min-width: 140px;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--muted);
  padding: 1.25rem 2rem;
}

.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer__inner a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer__inner a:hover {
  color: var(--dark);
}

/* --- Mobile --- */
@media (max-width: 600px) {
  .site-nav {
    grid-template-columns: 1fr auto;
  }

  .site-header {
    position: relative;
  }

  .site-nav__toggle {
    display: flex;
  }

  .site-nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--muted);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
    z-index: 10;
  }

  .site-nav__menu.is-open {
    display: flex;
  }

  .site-nav__links {
    justify-self: stretch;
    flex-direction: column;
    gap: 0;
  }

  .site-nav__links li a {
    display: block;
    padding: 0.75rem 2rem;
  }

  .site-nav__utility {
    justify-self: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem 2rem 0.25rem;
    border-top: 1px solid var(--muted);
  }

  .site-nav__host {
    width: 100%;
  }

  .site-nav__host-toggle {
    display: none;
  }

  .site-nav__host-menu {
    display: block;
    position: static;
    background: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    width: 100%;
    min-width: 0;
    padding: 0;
    z-index: auto;
  }

  .site-nav__host-menu a,
  .site-nav__host-menu .site-nav__logout-btn {
    padding: 0.75rem 0;
  }

  .site-nav__host-menu a:hover,
  .site-nav__host-menu .site-nav__logout-btn:hover {
    background: none;
  }

  .site-nav__login {
    padding: 0.75rem 0;
  }

  .site-nav__lang {
    padding: 0.5rem 0;
  }

  .site-nav__lang .custom-select__toggle {
    width: 100%;
  }

  .site-nav__lang .custom-select__menu {
    left: 0;
    right: 0;
  }

  .tour-replay-btn {
    align-self: flex-end;
    margin: 0.25rem 0 0.5rem;
  }

  .card {
    padding: 1.5rem 1.25rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* --- Timeline (schedule spec) editor --- */
.tl-orientation-picker {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tl-orientation-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--dark);
}

.tl-orientation-preview {
  display: flex;
  gap: 3px;
  align-items: center;
}

.tl-orientation-preview--vertical {
  flex-direction: column;
  height: 32px;
  justify-content: center;
}

.tl-orientation-preview--vertical span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}

.tl-orientation-preview--vertical span::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 4px;
  width: 2px;
  height: 8px;
  background: var(--muted);
}

.tl-orientation-preview--vertical span:last-child::before { display: none; }

.tl-orientation-preview--horizontal {
  flex-direction: row;
  width: 48px;
}

.tl-orientation-preview--horizontal span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}

.tl-orientation-preview--horizontal span::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  height: 2px;
  width: 10px;
  background: var(--muted);
}

.tl-orientation-preview--horizontal span:last-child::after { display: none; }

.tl-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.tl-item-row {
  display: grid;
  grid-template-columns: auto 5.5rem minmax(0, 1fr) var(--compact-control-height) var(--compact-control-height);
  gap: 0.35rem;
  align-items: center;
}

.tl-drag-handle {
  color: var(--muted);
  cursor: grab;
  font-size: 1rem;
  user-select: none;
  line-height: 1;
  padding: 0.25rem 0.2rem;
  touch-action: none;
}

.tl-item-row[draggable="true"]:active .tl-drag-handle,
.tl-item-row.is-dragging .tl-drag-handle {
  cursor: grabbing;
}

.tl-item-row.is-dragging {
  opacity: 0.35;
}

.tl-drop-indicator {
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  margin: 1px 0;
  pointer-events: none;
}

input.tl-time-input,
input.tl-label-input {
  height: var(--compact-control-height);
  padding: 0 0.6rem;
  font-size: 0.875rem;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(84, 106, 123, 0.25);
  border-radius: 6px;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
}

.tl-symbol-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--compact-control-height);
  height: var(--compact-control-height);
  border: 1px solid rgba(84, 106, 123, 0.25);
  border-radius: 4px;
  background: var(--white);
  color: var(--secondary);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tl-symbol-btn:hover,
.tl-symbol-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.tl-symbol-btn--chosen {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(98, 146, 158, 0.08);
}

.tl-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--compact-control-height);
  height: var(--compact-control-height);
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: color 0.15s;
}

.tl-item-remove:hover { color: var(--error); }

#tl-symbol-picker {
  position: fixed;
  z-index: 400;
  background: var(--white);
  border: 1px solid rgba(84, 106, 123, 0.2);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 0.6rem;
  width: 260px;
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
}

.tl-symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  width: 100%;
  box-sizing: border-box;
}

.tl-symbol-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  cursor: pointer;
  color: var(--secondary);
  font-size: 0.65rem;
  line-height: 1.2;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  box-sizing: border-box;
  height: 52px;
  min-width: 0;
}

.tl-symbol-option span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-symbol-option:hover {
  background: rgba(98, 146, 158, 0.1);
  border-color: rgba(98, 146, 158, 0.2);
  color: var(--accent);
}

.tl-symbol-option.is-selected {
  background: rgba(98, 146, 158, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-add-tl-item {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Timeline time button --- */
.tl-time-wrap {
  display: contents;
}

.tl-time-btn {
  width: 100%;
  height: var(--compact-control-height);
  box-sizing: border-box;
  padding: 0 0.4rem;
  border: 1px solid rgba(84, 106, 123, 0.25);
  border-radius: 6px;
  background: var(--white);
  color: var(--secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.tl-time-btn:hover,
.tl-time-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.tl-time-btn--set {
  color: var(--dark);
}

/* --- Timeline time picker (drum-roll) --- */
#tl-time-picker {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

#tl-time-picker:not([hidden]) {
  display: block;
  pointer-events: all;
}

.tl-tp-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
}

.tl-tp-panel {
  position: fixed;
  width: 128px;
  background: var(--white, #fff);
  border-radius: 12px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  border: 1px solid rgba(57, 61, 63, 0.1);
}

/* Mobile: bottom sheet */
@media (max-width: 479px) {
  .tl-tp-backdrop {
    background: rgba(0, 0, 0, 0.38);
  }

  .tl-tp-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.tl-tp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(57, 61, 63, 0.09);
}

.tl-tp-clear,
.tl-tp-done {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

.tl-tp-clear {
  color: var(--muted, #9aa0a5);
}

.tl-tp-clear:hover {
  color: var(--error, #b94a48);
  background: rgba(185, 74, 72, 0.08);
}

.tl-tp-done {
  color: var(--accent, #62929e);
}

.tl-tp-done:hover {
  background: rgba(98, 146, 158, 0.1);
}

.tl-tp-drum-area {
  position: relative;
  height: 90px; /* 3 items × 30px */
}

@media (max-width: 479px) {
  .tl-tp-drum-area {
    height: 150px; /* 5 items × 30px */
  }
}

.tl-tp-drum-cols {
  display: flex;
  height: 100%;
  align-items: stretch;
}

.tl-tp-drum {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.tl-tp-drum::-webkit-scrollbar {
  display: none;
}

.tl-tp-item {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 300;
  color: var(--dark, #2e3436);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  scroll-snap-align: center;
  user-select: none;
  cursor: pointer;
}

.tl-tp-pad {
  flex-shrink: 0;
}

.tl-tp-colon {
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 300;
  color: var(--dark, #2e3436);
  flex-shrink: 0;
  pointer-events: none;
  position: relative;
  z-index: 4;
}

.tl-tp-selection-bar {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 30px;
  transform: translateY(-50%);
  background: rgba(98, 146, 158, 0.11);
  border-radius: 6px;
  border: 1px solid rgba(98, 146, 158, 0.26);
  pointer-events: none;
  z-index: 3;
}

.tl-tp-fade-top,
.tl-tp-fade-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 38%;
  pointer-events: none;
  z-index: 2;
}

.tl-tp-fade-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0) 100%);
}

.tl-tp-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Event switcher (multi-event hosts) */
.event-switcher {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.event-switcher__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.event-switcher__label {
  font-size: 0.82rem;
  margin-bottom: 0; /* override the global block-label margin in inline rows */
  flex-shrink: 0;
}

/* Plain select (no-JS fallback; base.js normally replaces it with .custom-select) */
.event-switcher__select {
  width: auto;
  max-width: 16rem;
  font-size: 0.9rem;
}

/* JS-enhanced dropdown: undo the full-width defaults inside the inline row */
.event-switcher__form .custom-select {
  width: 12rem;
  max-width: 16rem;
  flex-shrink: 0;
}

.event-switcher__form .custom-select__toggle {
  font-size: 0.9rem;
}

.event-switcher__create {
  height: var(--control-height);
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  padding: 0 0.9rem;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0; /* .btn carries a global 1rem top margin that breaks inline rows */
}

@media (max-width: 600px) {
  .event-switcher {
    justify-content: stretch;
  }

  .event-switcher__form,
  .event-switcher__form .custom-select {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }
}

/* ---------------------------------------------------------------------------
   Onboarding tour (tour.js)
--------------------------------------------------------------------------- */

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
}

.tour-highlight {
  position: fixed;
  z-index: 1091;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease,
    height 0.25s ease;
}

.tour-card {
  position: fixed;
  z-index: 1092;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #fff;
  color: #333;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.tour-card--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tour-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
}

.tour-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 24px 8px 0;
}

.tour-card__text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.tour-card__dots {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d5d5d5;
}

.tour-dot--active {
  background: #555;
}

.tour-card__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tour-card__footer .btn {
  min-height: 44px;
}

.tour-replay-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: none;
  color: var(--secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}

.tour-replay-btn:hover {
  color: var(--dark);
}

@media (max-width: 600px) {
  .tour-card--sheet {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .tour-card--center {
    top: auto;
    left: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
