.tour-page {
    --tour-accent: #66725b;
    --tour-on-accent: #fff;
    --tour-accent-strong: #43503c;
    --tour-accent-soft: color-mix(in srgb, var(--tour-accent) 11%, transparent);
    --tour-accent-faint: color-mix(in srgb, var(--tour-accent) 5%, transparent);
    --tour-warm: #9a6841;
    --tour-past: #858a91;
    --tour-topbar-height: 64px;
    min-height: 100vh;
    color-scheme: light;
    background:
        radial-gradient(circle at 50% -10%, var(--tour-accent-faint), transparent 32rem),
        var(--bg-primary);
    color: var(--text-primary);
}

.tour-page.experimental.exp-prism,
.tour-page.experimental.exp-graphite {
    --tour-accent: #66725b;
    --tour-accent-strong: #43503c;
}

.tour-page.experimental.exp-prism.exp-dark,
.tour-page.experimental.exp-graphite.exp-dark,
.tour-page.dark-theme {
    --tour-accent: #9fac8c;
    --tour-on-accent: #16161f;
    --tour-accent-strong: #c4ceb5;
    --tour-warm: #d09b70;
    --tour-past: #818793;
    color-scheme: dark;
}

.tour-page.experimental.exp-graphite {
    --tour-accent: #626a61;
    --tour-accent-strong: #3e463e;
}

.tour-page.experimental.exp-graphite.exp-dark {
    --tour-accent: #a5aca2;
    --tour-accent-strong: #d4d8d2;
}

.tour-page.sepia-theme {
    --tour-accent: #74734f;
    --tour-accent-strong: #515033;
    --tour-warm: #94613c;
    --tour-past: #857a6c;
}

.tour-page.midnight-theme {
    --tour-accent: #aaa4c7;
    --tour-on-accent: #16161f;
    --tour-accent-strong: #d2cdea;
    --tour-warm: #d09b70;
    --tour-past: #8d899b;
    color-scheme: dark;
}

.tour-page #settingsButton { display: none !important; }
.tour-page [hidden] { display: none !important; }
.tour-page button,
.tour-page input,
.tour-page textarea,
.tour-page select { font: inherit; }
.tour-page .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tour-topbar.sidebar-header {
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100%;
    height: var(--tour-topbar-height);
    min-height: var(--tour-topbar-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem max(1rem, calc((100vw - 1180px) / 2));
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent);
    background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
    backdrop-filter: blur(18px) saturate(130%);
}

.tour-topbar h2 { margin: 0; font-size: 1rem; }
.tour-topbar h2 a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 720;
}
.tour-topbar .home-icon { width: 21px; height: 21px; color: var(--tour-accent); }
.tour-topbar-context {
    padding-left: 0.8rem;
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.025em;
}
.tour-topbar .sidebar-header-buttons {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.16rem;
    padding: 0.16rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
}
.tour-topbar .sidebar-header-buttons > button {
    width: 39px;
    height: 39px;
    min-width: 39px;
    border-radius: 50%;
}
.tour-topbar .sidebar-header-buttons > .account-btn,
.tour-topbar .sidebar-header-buttons > .settings-button-sidebar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tour-topbar .sidebar-collapse-btn { display: none !important; }

.tour-shell {
    width: min(calc(100% - 2rem), 1180px);
    margin: 0 auto;
    padding: clamp(1rem, 2.4vw, 2.1rem) 0 3.5rem;
}

.tour-person-search {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}
.tour-person-search-field {
    width: min(100%, 510px);
    min-height: 48px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.55rem 0 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: color-mix(in srgb, var(--bg-secondary) 96%, transparent);
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.tour-person-search-field:focus-within {
    border-color: color-mix(in srgb, var(--tour-accent) 62%, var(--border-color));
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--tour-accent-soft);
}
.tour-person-search-field > svg { width: 19px; height: 19px; color: var(--text-secondary); }
.tour-person-search-field input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--text-primary);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 600;
}
.tour-person-search-field input::placeholder { color: var(--text-secondary); opacity: 1; }
.tour-person-search-field input::-webkit-search-cancel-button { display: none; }
.tour-person-search-field input:focus-visible { outline: none; }
.tour-person-search-field button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    cursor: pointer;
}
.tour-person-search-field button svg { width: 16px; height: 16px; }
.tour-person-search-status { color: var(--text-secondary); font-size: 0.7rem; font-weight: 620; }
.tour-search-empty {
    min-height: 260px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.55rem;
    color: var(--text-secondary);
}
.tour-search-empty span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    color: var(--tour-accent-strong);
    background: var(--tour-accent-faint);
    font-size: 0.78rem;
    font-weight: 720;
}
.tour-search-empty p { margin: 0; font-size: 0.82rem; font-weight: 650; }
.tour-filtering .tour-hero,
.tour-filtering .tour-brief,
.tour-filtering .tour-section-nav,
.tour-filtering .tour-key-grid,
.tour-filtering .tour-schedule-section,
.tour-filtering .tour-footer { display: none; }
.tour-filtering #activities,
.tour-filtering .tour-logistics-grid > .tour-section { padding-top: 1.25rem; }
.tour-filtering .tour-logistics-grid { grid-template-columns: 1fr; gap: 0; }

.tour-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.6rem);
    min-height: 260px;
    padding: clamp(1.45rem, 4vw, 3.2rem);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 20%, var(--border-color));
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 18%, var(--tour-accent-soft), transparent 24rem),
        linear-gradient(135deg, color-mix(in srgb, var(--bg-secondary) 96%, var(--tour-accent-faint)), var(--bg-secondary));
    box-shadow: 0 22px 55px color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.tour-hero::before,
.tour-hero::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 14%, transparent);
    border-radius: 50%;
}
.tour-hero::before { width: 320px; height: 320px; right: -105px; top: -182px; }
.tour-hero::after { width: 220px; height: 220px; right: -55px; top: -125px; }
.tour-hero-copy,
.tour-hero-date,
.tour-edit-button { position: relative; z-index: 1; }
.tour-hero-eyebrow {
    margin: 0 0 0.8rem;
    color: var(--tour-accent-strong);
    font-size: 0.68rem;
    font-weight: 760;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.tour-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.25rem, 5.4vw, 4.6rem);
    font-weight: 760;
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-wrap: balance;
}
.tour-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.1rem;
}
.tour-event-state {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0.35rem 0.72rem;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 26%, var(--border-color));
    border-radius: 999px;
    color: var(--tour-accent-strong);
    background: var(--tour-accent-soft);
    font-size: 0.75rem;
    font-weight: 710;
}
.tour-event-state::before {
    content: '';
    width: 6px;
    height: 6px;
    margin-right: 0.42rem;
    border-radius: 50%;
    background: currentColor;
}
.tour-event-state.is-active { color: var(--tour-on-accent); background: var(--tour-accent); border-color: var(--tour-accent); }
.tour-event-state.is-past { color: var(--text-secondary); background: var(--bg-tertiary); border-color: var(--border-color); }
.tour-sync-status { color: var(--text-secondary); font-size: 0.73rem; }
.tour-sync-status.is-offline { color: var(--tour-warm); }
.tour-hero-date {
    width: clamp(142px, 16vw, 184px);
    aspect-ratio: 1 / 1.02;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 24%, var(--border-color));
    border-radius: 24px;
    color: var(--tour-accent-strong);
    background: color-mix(in srgb, var(--bg-primary) 72%, transparent);
    box-shadow: inset 0 1px color-mix(in srgb, white 22%, transparent);
}
.tour-hero-date strong {
    margin: 0.22rem 0;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 720;
    line-height: 1;
    letter-spacing: -0.065em;
    font-variant-numeric: tabular-nums;
}
.tour-hero-date span {
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 730;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}
.tour-edit-button,
.tour-section-edit,
.tour-add-button,
.tour-icon-button,
.tour-editor-footer button,
.tour-editor-conflict button,
.tour-picker footer button,
.tour-remove-button,
.tour-pick-people {
    border: 0;
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}
.tour-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.55rem 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
    font-size: 0.74rem;
    font-weight: 700;
}
.tour-edit-button svg { width: 17px; height: 17px; }
body:not(.no-hover) .tour-edit-button:hover,
body:not(.no-hover) .tour-section-edit:hover,
body:not(.no-hover) .tour-add-button:hover,
body:not(.no-hover) .tour-pick-people:hover {
    border-color: color-mix(in srgb, var(--tour-accent) 58%, var(--border-color));
    color: var(--tour-accent-strong);
    background: var(--tour-accent-soft);
}
.tour-edit-button:active,
.tour-section-edit:active,
.tour-add-button:active,
.tour-pick-people:active { transform: scale(0.98); }

.tour-brief {
    display: grid;
    grid-template-columns: 1.15fr 1.55fr 1fr 1fr;
    margin: 0.8rem 0 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: color-mix(in srgb, var(--bg-secondary) 96%, transparent);
}
.tour-brief-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 82px;
    padding: 0.9rem 1rem;
}
.tour-brief-item + .tour-brief-item { border-left: 1px solid var(--border-color); }
.tour-brief-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--tour-accent-strong);
    background: var(--tour-accent-soft);
}
.tour-brief-icon svg { width: 18px; height: 18px; }
.tour-brief p {
    min-width: 0;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 590;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.tour-section-nav {
    position: sticky;
    top: calc(var(--tour-topbar-height) + 0.5rem);
    z-index: 50;
    width: fit-content;
    max-width: 100%;
    display: flex;
    gap: 0.16rem;
    margin: 0.85rem auto 1.45rem;
    padding: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--text-primary) 5%, transparent);
    backdrop-filter: blur(16px) saturate(130%);
}
.tour-section-nav::-webkit-scrollbar { display: none; }
.tour-section-nav a {
    flex: 0 0 auto;
    padding: 0.56rem 0.82rem;
    border-radius: 999px;
    color: var(--text-secondary);
    text-align: center;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 670;
    white-space: nowrap;
    transition: color 140ms ease, background-color 140ms ease;
}
body:not(.no-hover) .tour-section-nav a:hover { color: var(--tour-accent-strong); background: var(--tour-accent-soft); }

.tour-key-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(360px, 1.04fr);
    gap: 0.9rem;
    align-items: stretch;
}
.tour-next-event { min-width: 0; scroll-margin-top: 130px; }
.tour-next-card {
    position: relative;
    height: 100%;
    min-height: 290px;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: center;
    gap: clamp(1rem, 2.5vw, 1.6rem);
    padding: clamp(1.25rem, 3vw, 2rem);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 22%, var(--border-color));
    border-radius: 22px;
    background:
        linear-gradient(145deg, var(--tour-accent-soft), transparent 62%),
        var(--bg-secondary);
}
.tour-next-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: var(--tour-accent);
    opacity: 0.65;
}
.tour-next-card.is-past::after { background: var(--tour-past); opacity: 0.38; }
.tour-next-date {
    display: flex;
    min-height: 108px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 24%, var(--border-color));
    border-radius: 18px;
    color: var(--tour-accent-strong);
    background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
}
.tour-next-date strong { font-size: 2.65rem; line-height: 1; letter-spacing: -0.055em; }
.tour-next-date span { margin-top: 0.32rem; color: var(--text-secondary); font-size: 0.62rem; font-weight: 710; }
.tour-next-copy { min-width: 0; }
.tour-next-eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--tour-accent-strong);
    font-size: 0.66rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.tour-next-state {
    padding: 0.24rem 0.5rem;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    font-size: 0.62rem;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}
.tour-next-state.is-active { color: var(--tour-accent-strong); background: var(--tour-accent-soft); }
.tour-next-copy h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 740;
    line-height: 1.1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.tour-next-meta,
.tour-next-detail { margin: 0.55rem 0 0; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.52; }
.tour-next-detail { color: var(--text-primary); }

.tour-section {
    padding-top: 2.8rem;
    scroll-margin-top: 125px;
}
.tour-key-grid .tour-section { padding-top: 0; }
.tour-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}
.tour-section-heading h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.3vw, 1.85rem);
    font-weight: 740;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.tour-section-edit,
.tour-add-button,
.tour-pick-people {
    min-height: 38px;
    padding: 0.48rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-size: 0.73rem;
    font-weight: 680;
}

.tour-program-section {
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 1.65rem) !important;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: var(--bg-secondary);
}
.tour-program-section .tour-section-heading { margin-bottom: 0.72rem; }
.tour-program-section .tour-section-heading h2 { font-size: 1.08rem; }
.tour-program {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}
.tour-program-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 0.56rem;
    min-height: 39px;
    padding: 0.42rem 0.5rem;
    border-top: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent);
}
.tour-program-item:nth-child(-n + 2) { border-top: 0; }
.tour-program-index {
    color: color-mix(in srgb, var(--tour-accent-strong) 70%, var(--text-secondary));
    font-size: 0.61rem;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
}
.tour-program-name { min-width: 0; color: var(--text-primary); font-size: 0.73rem; font-weight: 620; line-height: 1.3; }

.tour-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 0.8rem;
}
.tour-timeline-day {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-secondary);
}
.tour-timeline-day-header {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.9rem 1rem 0.78rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--tour-accent-faint);
}
.tour-timeline-day-header strong { color: var(--text-primary); font-size: 0.88rem; }
.tour-timeline-day-header span { color: var(--text-secondary); font-size: 0.68rem; }
.tour-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 74px 12px minmax(0, 1fr);
    gap: 0.58rem;
    align-items: start;
    padding: 0.9rem 1rem;
}
.tour-timeline-item + .tour-timeline-item { border-top: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent); }
.tour-timeline-time { padding-top: 0.05rem; color: var(--text-secondary); font-size: 0.72rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.tour-timeline-marker {
    width: 9px;
    height: 9px;
    margin: 0.25rem auto 0;
    border: 2px solid var(--tour-past);
    border-radius: 50%;
    background: var(--bg-secondary);
}
.tour-timeline-item.is-active .tour-timeline-marker { border-color: var(--tour-accent); background: var(--tour-accent); box-shadow: 0 0 0 4px var(--tour-accent-soft); }
.tour-timeline-item.is-upcoming .tour-timeline-marker { border-color: var(--tour-accent); }
.tour-timeline-body h3 { margin: 0; font-size: 0.86rem; font-weight: 700; line-height: 1.35; }
.tour-timeline-body p { margin: 0.28rem 0 0; color: var(--text-secondary); font-size: 0.72rem; line-height: 1.48; }
.tour-timeline-state {
    grid-column: 3;
    width: fit-content;
    margin-top: 0.28rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
}
.tour-timeline-item.is-active .tour-timeline-state { color: var(--tour-accent-strong); background: var(--tour-accent-soft); }
.tour-timeline-item.is-past { opacity: 1; }

.tour-card-grid,
.tour-activities {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
.tour-tent-card,
.tour-activity-card,
.tour-meal-day {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
body:not(.no-hover) .tour-activity-card:hover,
body:not(.no-hover) .tour-tent-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--tour-accent) 30%, var(--border-color));
    box-shadow: 0 10px 28px color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.tour-tent-capacity {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    font-size: 0.66rem;
    font-weight: 680;
    font-variant-numeric: tabular-nums;
}
.tour-tent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}
.tour-tent-number {
    color: var(--tour-accent-strong);
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}
.tour-tent-people {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tour-tent-person {
    min-width: 0;
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    min-height: 46px;
    padding: 0.42rem 0;
    border-top: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
}
.tour-tent-initials {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--tour-accent-strong);
    background: var(--tour-accent-soft);
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}
.tour-tent-name {
    min-width: 0;
    font-size: clamp(0.84rem, 1.25vw, 0.96rem);
    font-weight: 660;
    line-height: 1.3;
}
.tour-card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.tour-card-title-row h3 { margin: 0; font-size: 0.9rem; font-weight: 710; line-height: 1.32; }
.tour-card-title-row span { color: var(--text-secondary); font-size: 0.65rem; white-space: nowrap; }
.tour-people-list { display: flex; flex-wrap: wrap; gap: 0.38rem; margin-top: 0.7rem; }
.tour-person-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.54rem;
    border: 1px solid color-mix(in srgb, var(--tour-accent) 16%, var(--border-color));
    border-radius: 999px;
    color: var(--text-primary);
    background: var(--tour-accent-faint);
    font-size: 0.69rem;
    font-weight: 610;
}
.tour-empty {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1.25rem;
    border: 1px dashed color-mix(in srgb, var(--tour-accent) 24%, var(--border-color));
    border-radius: 16px;
    color: var(--text-secondary);
    background: var(--tour-accent-faint);
    text-align: center;
}
.tour-empty span { color: var(--tour-accent); font-size: 1.4rem; }
.tour-empty p { max-width: 260px; margin: 0; font-size: 0.76rem; line-height: 1.45; }

.tour-logistics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}
.tour-logistics-grid > .tour-section { min-width: 0; }
.tour-logistics-grid .tour-card-grid,
.tour-logistics-grid .tour-meals { grid-template-columns: 1fr; }
.tour-meals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.tour-meal-day { padding: 0; overflow: hidden; }
.tour-meal-day > header { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-color); background: var(--tour-accent-faint); }
.tour-meal-day > header h3 { margin: 0; font-size: 0.86rem; }
.tour-meal-day > header p { margin: 0.18rem 0 0; color: var(--text-secondary); font-size: 0.66rem; }
.tour-meal-slot { padding: 0.85rem 1rem; }
.tour-meal-slot + .tour-meal-slot { border-top: 1px solid var(--border-color); }
.tour-meal-slot h4 { margin: 0; font-size: 0.73rem; font-weight: 710; }
.tour-meal-slot .tour-people-list { margin-top: 0.48rem; }
.tour-meal-slot .tour-person-chip { background: var(--bg-tertiary); }
.tour-meal-note { margin: 0.42rem 0 0; color: var(--text-secondary); font-size: 0.69rem; line-height: 1.45; }

.tour-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
}
.tour-footer a { color: var(--tour-accent-strong); font-weight: 670; text-decoration: none; }

body.tour-modal-open { overflow: hidden; }
.tour-editor-overlay,
.tour-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    padding: clamp(0.7rem, 2vw, 1.5rem);
    background: rgba(8, 10, 16, 0.55);
    backdrop-filter: blur(10px);
}
.tour-editor-overlay { display: grid; place-items: center; }
.tour-editor {
    width: min(1120px, 100%);
    height: min(820px, calc(100dvh - 2rem));
    min-height: 0;
    display: grid;
    grid-template-areas: "header" "conflict" "toolbar" "content" "footer";
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-secondary);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
}
.tour-editor > * { min-width: 0; }
.tour-editor-header { grid-area: header; }
.tour-editor-conflict { grid-area: conflict; }
.tour-editor-toolbar { grid-area: toolbar; }
.tour-editor-content { grid-area: content; }
.tour-editor-footer { grid-area: footer; }
.tour-editor-header,
.tour-picker header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
}
.tour-editor-header h2,
.tour-picker header h2 { margin: 0; font-size: 1.12rem; font-weight: 730; letter-spacing: -0.02em; }
.tour-editor-header p,
.tour-picker header p {
    margin: 0 0 0.18rem;
    color: var(--tour-accent-strong);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.tour-icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}
.tour-icon-button svg { width: 18px; height: 18px; }
body:not(.no-hover) .tour-icon-button:hover { color: var(--text-primary); background: var(--tour-accent-soft); }

.tour-editor-conflict {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.72rem 1.15rem;
    border-bottom: 1px solid color-mix(in srgb, var(--tour-warm) 32%, var(--border-color));
    background: color-mix(in srgb, var(--tour-warm) 8%, var(--bg-secondary));
}
.tour-editor-conflict strong { font-size: 0.8rem; }
.tour-editor-conflict p { margin: 0.15rem 0 0; color: var(--text-secondary); font-size: 0.7rem; }
.tour-editor-conflict > div:last-child { display: flex; gap: 0.4rem; }
.tour-editor-conflict button { padding: 0.44rem 0.64rem; border: 1px solid var(--border-color); border-radius: 9px; color: var(--text-primary); background: var(--bg-secondary); font-size: 0.69rem; font-weight: 680; }

.tour-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--tour-accent-faint);
}
.tour-editor-tabs { display: flex; gap: 0.18rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tour-editor-tabs::-webkit-scrollbar { display: none; }
.tour-editor-tabs button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0.43rem 0.65rem;
    border: 0;
    border-radius: 999px;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 670;
}
.tour-editor-tabs button.is-active { color: var(--tour-accent-strong); background: var(--tour-accent-soft); }
.tour-draft-state { margin-left: auto; flex: 0 0 auto; color: var(--text-secondary); font-size: 0.68rem; }
.tour-draft-state.is-dirty { color: var(--tour-warm); }

.tour-editor-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.15rem 1.25rem 1.6rem; }
.tour-editor-panel { max-width: 980px; margin: 0 auto; }
.tour-editor-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.78rem; }
.tour-field { display: grid; gap: 0.34rem; min-width: 0; }
.tour-field-wide { grid-column: 1 / -1; }
.tour-field > span { color: var(--text-secondary); font-size: 0.67rem; font-weight: 680; }
.tour-field input,
.tour-field textarea,
.tour-field select,
.tour-picker-search input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
}
.tour-field input,
.tour-field select { min-height: 43px; padding: 0.58rem 0.7rem; }
.tour-field textarea { padding: 0.62rem 0.7rem; resize: vertical; line-height: 1.45; }
.tour-field input:focus,
.tour-field textarea:focus,
.tour-field select:focus,
.tour-picker-search:focus-within { border-color: var(--tour-accent); box-shadow: 0 0 0 3px var(--tour-accent-soft); }
.tour-editor-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.tour-editor-panel-heading h3 { margin: 0; font-size: 1rem; }
.tour-editor-panel-heading p { margin: 0.23rem 0 0; color: var(--text-secondary); font-size: 0.72rem; }
.tour-editor-list { display: grid; gap: 0.65rem; }
.tour-editor-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.62rem;
    padding: 0.88rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-primary);
}
.tour-editor-row .span-2 { grid-column: span 2; }
.tour-editor-row .span-3 { grid-column: span 3; }
.tour-editor-row .span-4 { grid-column: span 4; }
.tour-editor-row .span-5 { grid-column: span 5; }
.tour-editor-row .span-6 { grid-column: span 6; }
.tour-editor-row .span-8 { grid-column: span 8; }
.tour-editor-row .span-10 { grid-column: span 10; }
.tour-editor-row .span-12 { grid-column: 1 / -1; }
.tour-editor-row-actions { grid-column: span 2; display: flex; align-items: end; justify-content: flex-end; gap: 0.35rem; }
.tour-remove-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--error-color);
    background: var(--bg-secondary);
}
.tour-remove-button svg { width: 17px; height: 17px; }
.tour-pick-people { width: 100%; min-height: 42px; text-align: left; }
.tour-editor-selected { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 28px; }
.tour-editor-error { margin-top: 0.85rem; padding: 0.7rem 0.8rem; border: 1px solid rgba(190, 60, 60, 0.3); border-radius: 10px; color: var(--error-color); background: rgba(190, 60, 60, 0.08); font-size: 0.74rem; }

.tour-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.15rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.tour-editor-footer > span { color: var(--text-secondary); font-size: 0.68rem; }
.tour-editor-footer > div { display: flex; gap: 0.5rem; }
.tour-editor-footer button { min-height: 42px; padding: 0.55rem 0.9rem; border-radius: 11px; font-size: 0.74rem; font-weight: 700; }
.tour-editor-cancel { border: 1px solid var(--border-color) !important; color: var(--text-primary); background: var(--bg-tertiary); }
.tour-editor-save { min-width: 132px; color: var(--tour-on-accent); background: var(--tour-accent); }
.tour-editor-save:disabled { cursor: wait; opacity: 0.65; }

.tour-picker-overlay { z-index: 1300; display: grid; place-items: center end; padding: 0; }
.tour-picker {
    width: min(430px, 100%);
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border-left: 1px solid var(--border-color);
    background: var(--bg-secondary);
    box-shadow: -20px 0 70px rgba(0, 0, 0, 0.22);
}
.tour-picker-search {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    margin: 0.85rem;
    padding: 0 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--bg-primary);
}
.tour-picker-search svg { width: 18px; height: 18px; color: var(--text-secondary); }
.tour-picker-search input { min-height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none !important; }
.tour-picker-list { min-height: 0; overflow-y: auto; padding: 0 0.85rem 1rem; }
.tour-picker-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.45rem 0.55rem;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 610;
}
.tour-picker-option:hover { background: var(--tour-accent-soft); }
.tour-picker-option input { width: 17px; height: 17px; accent-color: var(--tour-accent); }
.tour-picker footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 0.9rem max(0.8rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--border-color); }
.tour-picker footer > span { color: var(--text-secondary); font-size: 0.7rem; }
.tour-picker footer > div { display: flex; gap: 0.4rem; }
.tour-picker footer button { min-height: 40px; padding: 0.5rem 0.75rem; border-radius: 9px; font-size: 0.72rem; font-weight: 690; }
#tourPickerCancel { color: var(--text-primary); background: var(--bg-tertiary); }
#tourPickerApply { color: var(--tour-on-accent); background: var(--tour-accent); }

.tour-page :focus-visible {
    outline: 2px solid color-mix(in srgb, var(--tour-accent) 72%, transparent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
    .tour-hero,
    .tour-person-search,
    .tour-brief,
    .tour-section-nav,
    .tour-key-grid,
    .tour-schedule-section,
    #activities,
    .tour-logistics-grid {
        animation: tour-reveal 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .tour-brief { animation-delay: 45ms; }
    .tour-section-nav { animation-delay: 80ms; }
    .tour-key-grid { animation-delay: 110ms; }
    .tour-schedule-section { animation-delay: 140ms; }
    #activities { animation-delay: 170ms; }
    .tour-logistics-grid { animation-delay: 200ms; }
    @keyframes tour-reveal {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 980px) {
    .tour-brief { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tour-brief-item + .tour-brief-item { border-left: 0; }
    .tour-brief-item:nth-child(even) { border-left: 1px solid var(--border-color); }
    .tour-brief-item:nth-child(n + 3) { border-top: 1px solid var(--border-color); }
    .tour-key-grid { grid-template-columns: 1fr; }
    .tour-next-card { min-height: 230px; }
    .tour-program { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tour-program-item:nth-child(-n + 3) { border-top: 0; }
    .tour-card-grid,
    .tour-activities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tour-editor-row .span-2,
    .tour-editor-row .span-3,
    .tour-editor-row .span-4 { grid-column: span 4; }
    .tour-editor-row .span-5,
    .tour-editor-row .span-6 { grid-column: span 6; }
    .tour-editor-row .span-8,
    .tour-editor-row .span-10 { grid-column: span 10; }
}

@media (max-width: 720px) {
    .tour-page { --tour-topbar-height: 58px; }
    .tour-topbar.sidebar-header { padding: 0.5rem 0.7rem; }
    .tour-topbar h2 a span { display: none; }
    .tour-topbar-context { padding-left: 0.62rem; font-size: 0.68rem; }
    .tour-topbar .sidebar-header-buttons > button { width: 37px; height: 37px; min-width: 37px; }
    .tour-shell { width: min(calc(100% - 1rem), 1180px); padding-top: 0.65rem; }
    .tour-person-search { gap: 0.5rem; margin-bottom: 0.55rem; }
    .tour-person-search-field { width: 100%; min-height: 46px; border-radius: 14px; }
    .tour-person-search-status { display: none; }
    .tour-hero { grid-template-columns: 1fr; min-height: 0; padding: 1.15rem; border-radius: 20px; }
    .tour-hero h1 { font-size: clamp(2rem, 10vw, 2.8rem); }
    .tour-hero-date {
        width: fit-content;
        max-width: 100%;
        min-height: 54px;
        aspect-ratio: auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.55rem;
        padding: 0.58rem 0.72rem;
        border-radius: 14px;
    }
    .tour-hero-date strong { margin: 0; font-size: 1.55rem; }
    .tour-hero-date span { font-size: 0.55rem; }
    .tour-brief { margin-top: 0.55rem; border-radius: 15px; }
    .tour-brief-item { min-height: 72px; padding: 0.75rem; gap: 0.58rem; }
    .tour-brief-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; }
    .tour-brief p { font-size: 0.7rem; }
    .tour-section-nav {
        top: calc(var(--tour-topbar-height) + 0.35rem);
        width: 100%;
        margin: 0.65rem 0 0.9rem;
        border-radius: 13px;
    }
    .tour-section-nav a { flex: 1 1 0; min-width: 0; padding: 0.54rem 0.22rem; font-size: 0.66rem; }
    .tour-next-card { grid-template-columns: 78px minmax(0, 1fr); min-height: 180px; gap: 0.85rem; padding: 1rem; border-radius: 17px; }
    .tour-next-date { min-height: 78px; border-radius: 13px; }
    .tour-next-date strong { font-size: 2rem; }
    .tour-next-date span { font-size: 0.56rem; }
    .tour-next-copy h2 { font-size: 1.2rem; }
    .tour-next-meta,
    .tour-next-detail { font-size: 0.73rem; }
    .tour-program-section { padding: 1rem !important; border-radius: 17px; }
    .tour-program { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tour-program-item:nth-child(3) { border-top: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent); }
    .tour-section { padding-top: 2.1rem; scroll-margin-top: 112px; }
    .tour-section-heading { margin-bottom: 0.78rem; }
    .tour-section-heading h2 { font-size: 1.3rem; }
    .tour-timeline { grid-template-columns: 1fr; }
    .tour-card-grid,
    .tour-activities,
    .tour-logistics-grid { grid-template-columns: 1fr; }
    .tour-logistics-grid { gap: 0; }
    .tour-card-title-row span,
    .tour-meal-day > header p,
    .tour-meal-note { font-size: 0.72rem; }
    .tour-footer { margin-top: 2.3rem; }
    .tour-editor-overlay { padding: 0; }
    .tour-editor { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
    .tour-editor-header { padding: 0.75rem; }
    .tour-editor-toolbar { align-items: stretch; flex-direction: column; gap: 0.42rem; padding: 0.45rem 0.75rem; }
    .tour-draft-state { margin-left: 0; }
    .tour-editor-content { padding: 0.75rem 0.75rem 1.2rem; }
    .tour-editor-form-grid { grid-template-columns: 1fr; }
    .tour-field-wide { grid-column: auto; }
    .tour-editor-panel-heading { align-items: stretch; flex-direction: column; }
    .tour-add-button { width: 100%; }
    .tour-editor-row { grid-template-columns: 1fr; padding: 0.7rem; }
    .tour-editor-row .span-2,
    .tour-editor-row .span-3,
    .tour-editor-row .span-4,
    .tour-editor-row .span-5,
    .tour-editor-row .span-6,
    .tour-editor-row .span-8,
    .tour-editor-row .span-10,
    .tour-editor-row .span-12,
    .tour-editor-row-actions { grid-column: 1; }
    .tour-editor-row-actions { justify-content: flex-end; }
    .tour-editor-footer { padding: 0.65rem 0.75rem max(0.65rem, env(safe-area-inset-bottom)); }
    .tour-editor-footer > span { display: none; }
    .tour-editor-footer > div { display: grid; grid-template-columns: 0.75fr 1.25fr; width: 100%; }
    .tour-editor-conflict { align-items: stretch; flex-direction: column; padding: 0.65rem 0.75rem; }
    .tour-editor-conflict > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
    .tour-picker { width: 100%; border-left: 0; }
}

@media (max-width: 460px) {
    .tour-hero { gap: 0.85rem; min-height: 0; }
    .tour-hero-eyebrow { margin-bottom: 0.58rem; font-size: 0.59rem; }
    .tour-hero h1 { font-size: clamp(1.8rem, 9vw, 2.3rem); }
    .tour-hero-date { width: fit-content; padding: 0.55rem 0.68rem; border-radius: 13px; }
    .tour-hero-date strong { font-size: 1.45rem; }
    .tour-hero-date span { font-size: 0.5rem; }
    .tour-brief { grid-template-columns: 1fr; }
    .tour-brief-item:nth-child(even) { border-left: 0; }
    .tour-brief-item + .tour-brief-item { border-top: 1px solid var(--border-color); }
    .tour-brief-item { min-height: 61px; }
    .tour-next-eyebrow { flex-wrap: wrap; gap: 0.3rem 0.5rem; }
    .tour-timeline-item { grid-template-columns: 68px 11px minmax(0, 1fr); padding: 0.82rem; }
    .tour-program-name { font-size: 0.69rem; }
}

@media (max-width: 360px) {
    .tour-topbar-context { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tour-section-nav a { font-size: 0.61rem; }
    .tour-next-card { grid-template-columns: 1fr; }
    .tour-next-date { width: 68px; min-height: 66px; }
    .tour-timeline-item { grid-template-columns: 1fr; }
    .tour-timeline-marker { display: none; }
    .tour-timeline-state { grid-column: 1; }
    .tour-section-edit { min-height: 36px; padding-inline: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tour-page *,
    .tour-page *::before,
    .tour-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
