.geneo-tour {
    position: fixed;
    inset: 0;
    z-index: 11000;
    pointer-events: none;
}

.geneo-tour-scrim {
    position: absolute;
    background: color-mix(in srgb, var(--gg-scrim) 68%, transparent);
    pointer-events: auto;
}

.geneo-tour-target-block {
    position: absolute;
    border: 2px solid var(--brand-green-300);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px var(--surface-app);
    pointer-events: auto;
}

.geneo-tour-target-block[hidden] {
    display: none;
}

body.geneo-tour-tree-relationship-actions .tree-inspector
    [data-relationship-related-person-id="luna"] .relation-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

body.geneo-tour-tree-relationship-actions .tree-inspector
    [data-relationship-related-person-id="luna"] {
    border-color: var(--border-default);
    background: color-mix(in srgb, var(--gg-text) 4%, transparent);
}

.geneo-tour-card {
    position: absolute;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: var(--space-5);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    pointer-events: auto;
}

.geneo-tour.is-centered .geneo-tour-card {
    width: min(440px, calc(100vw - 24px));
}

.geneo-tour.is-finish .geneo-tour-card-head {
    display: none;
}

.geneo-tour.is-finish .geneo-tour-card h2 {
    margin-top: 0;
}

@media (min-width: 1260px) and (max-width: 1280px) {
    .geneo-tour.is-modal-stop.is-places-add-modal .geneo-tour-card {
        width: 248px;
    }
}

@media (min-width: 641px) {
    .geneo-tour.is-places-add-map .geneo-tour-card {
        padding: var(--space-3);
    }
}

@media (min-width: 741px) and (max-width: 800px) {
    .geneo-tour.is-places-routes .geneo-tour-card {
        width: 300px;
    }
}

@media (min-width: 741px) and (max-width: 850px) {
    .geneo-tour.is-places-filters .geneo-tour-card {
        width: 240px;
    }
}

@media (min-width: 851px) and (max-width: 1000px) {
    .geneo-tour.is-places-filters .geneo-tour-card {
        width: 300px;
    }
}

@media (min-width: 641px) and (max-width: 800px) {
    body.geneo-tour-people-popover .geneo-tour-card {
        width: 280px;
    }
}

body.geneo-tour-people-popover #peopleColumnsPopover {
    display: flex;
    flex-direction: column;
}

body.geneo-tour-people-popover #peopleColumnsPopover .people-columns-list {
    min-height: 0;
    overflow-y: auto;
}

body.geneo-tour-people-popover #peopleColumnsPopover .people-columns-header,
body.geneo-tour-people-popover #peopleColumnsPopover .people-columns-footer {
    flex: none;
}

.geneo-tour.is-welcome .geneo-tour-card {
    width: min(540px, calc(100vw - 24px));
}

.geneo-tour.is-modal-stop .geneo-tour-card {
    width: min(280px, calc(100vw - 24px));
    padding: var(--space-4);
}

.geneo-tour.is-module-map .geneo-tour-card {
    width: min(560px, calc(100vw - 24px));
}

.geneo-tour-welcome {
    display: grid;
    gap: 12px;
}

.geneo-tour.is-welcome .geneo-tour-card-head {
    display: none;
}

.geneo-tour-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 18px;
}

.geneo-tour-brand svg {
    width: 32px;
    height: 32px;
    color: var(--brand-green-300);
}

.geneo-tour-cover {
    aspect-ratio: 600 / 125;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-app) url('../../assets/ui/geneograph-tour-thread.png') center / contain no-repeat;
}

.geneo-tour.is-centered .geneo-tour-card,
.geneo-tour.is-unanchored .geneo-tour-card {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.geneo-tour-card-head {
    display: flex;
    min-height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.geneo-tour-chapter {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    gap: var(--space-2);
}

.geneo-tour.is-module-map .geneo-tour-chapter {
    display: none;
}

.geneo-tour-map-title {
    display: none;
    min-width: 0;
    margin: 0;
}

.geneo-tour.is-module-map .geneo-tour-map-title {
    display: block;
    flex: 1 1 auto;
}

.geneo-tour-browse {
    display: inline-flex;
    min-width: 0;
    min-height: 40px;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--brand-green-300);
    cursor: pointer;
}

.geneo-tour-browse:hover {
    color: var(--text-primary);
}

.geneo-tour.is-navigation-intro .geneo-tour-browse {
    padding: 0 var(--space-3);
    border: 1px solid var(--brand-green-500);
    background: var(--brand-green-900);
    color: var(--brand-green-300);
}

.geneo-tour.is-navigation-intro .geneo-tour-browse:hover {
    border-color: var(--brand-green-300);
    background: var(--brand-green-800);
}

.geneo-tour-browse svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.geneo-tour-browse [data-geneo-tour-module-name] {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-tour-map[hidden],
[data-geneo-tour-step-view][hidden] {
    display: none;
}

.geneo-tour-map-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    gap: var(--space-2);
    max-height: min(60vh, 440px);
    padding: 2px;
    overflow-y: auto;
}

.geneo-tour-map-list button {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    min-height: 68px;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-main);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.geneo-tour-map-list button:hover {
    border-color: var(--border-strong);
    background: var(--surface-card-hover);
}

.geneo-tour-map-list button.is-current {
    border-color: var(--brand-green-300);
}

.geneo-tour-map-icon,
.geneo-tour-map-current {
    display: grid;
    place-items: center;
}

.geneo-tour-map-icon svg {
    width: 22px;
    height: 22px;
    color: var(--brand-green-300);
}

.geneo-tour-map-current {
    visibility: hidden;
}

.geneo-tour-map-current svg {
    width: 18px;
    height: 18px;
    color: var(--brand-green-300);
}

.geneo-tour-map-list button.is-current .geneo-tour-map-current {
    visibility: visible;
}

.geneo-tour-map-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 650;
}

@media (max-width: 480px) {
    .geneo-tour-map-list {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-flow: row;
        max-height: min(60vh, 390px);
    }

    .geneo-tour-map-list button {
        min-height: 54px;
    }
}

.geneo-tour-map-return {
    margin-top: var(--space-3);
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--brand-green-300);
    cursor: pointer;
}

.geneo-tour-close[hidden] {
    display: none;
}

.geneo-tour-close {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 4px;
    place-items: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.geneo-tour-close svg {
    width: 18px;
    height: 18px;
}

.geneo-tour-close:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.geneo-tour-card h2 {
    margin: var(--space-3) 0 var(--space-2);
    font-size: 20px;
    line-height: 1.25;
}

.geneo-tour-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.geneo-tour-fallback:not([hidden]) {
    margin-top: var(--space-3);
    color: var(--amber);
}

.geneo-tour-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.geneo-tour-actions .button {
    min-height: 38px;
    white-space: normal;
}

.geneo-tour.is-welcome .geneo-tour-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}

.geneo-tour.is-welcome .geneo-tour-actions .button {
    min-width: 0;
}

.geneo-tour.is-finish .geneo-tour-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.geneo-tour.is-finish .geneo-tour-actions .button {
    min-width: 0;
}

.geneo-tour:not(.is-centered) .geneo-tour-actions,
.geneo-tour.is-project-intro .geneo-tour-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.geneo-tour:not(.is-centered) .geneo-tour-actions .button,
.geneo-tour.is-project-intro .geneo-tour-actions .button {
    min-width: 0;
}

.geneo-tour-card button:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

@media (max-width: 1180px) and (min-width: 641px) {
    body.geneo-tour-people-preview .people-person-sidebar {
        display: block;
        position: fixed;
        top: 60px;
        right: 0;
        z-index: 8;
        width: min(400px, 45vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }
}

body.geneo-tour-geneo-toolbar .geneo-editor-toolbar-left {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

body.geneo-tour-geneo-focus-canvas .geneo-editor-main {
    grid-template-columns: minmax(0, 1fr);
}

body.geneo-tour-geneo-focus-canvas .geneo-editor-main > .geneo-inspector {
    display: none;
}

body.geneo-tour-geneo-toolbar .geneo-editor-toolbar [data-geneo-toolbar-item] {
    display: inline-flex;
}

@media (max-width: 1100px) {
    body.geneo-tour-archive-inspector .archive-shell .archive-inspector {
        display: block;
        position: fixed;
        top: 60px;
        right: 0;
        z-index: 8;
        width: min(400px, 100vw);
        height: calc(100vh - 60px);
        box-shadow: var(--shadow-soft);
    }
}

@media (max-width: 980px) {
    body.geneo-tour-albums-inspector .albums-shell .albums-detail {
        display: block;
        position: fixed;
        top: 60px;
        right: 0;
        z-index: 8;
        width: min(400px, 100vw);
        height: calc(100vh - 60px);
        box-shadow: var(--shadow-soft);
    }
}

@media (max-width: 900px) {
    body.geneo-tour-places-sidebar .workspace .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 8;
        width: min(300px, 100vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-notes-sidebar .workspace .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 8;
        width: min(300px, 100vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-notes-tabs .topnav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.geneo-tour-notes-tabs .topbar .top-actions {
        display: none;
    }

    body.geneo-tour-notes-tabs .topnav .tab {
        padding: 0 var(--space-3);
    }

    body.geneo-tour-archive-sidebar .workspace .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 8;
        width: min(300px, 48vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-archive-tabs .topnav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.geneo-tour-archive-tabs .topbar .top-actions {
        display: none;
    }

    body.geneo-tour-archive-tabs .topnav .tab {
        padding: 0 var(--space-3);
    }

    body.geneo-tour-albums-sidebar .workspace .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 8;
        width: min(300px, 48vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-albums-tabs .topnav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.geneo-tour-albums-tabs .topbar .top-actions {
        display: none;
    }

    body.geneo-tour-albums-tabs .topnav .tab {
        padding: 0 var(--space-3);
    }

    body.geneo-tour-geneo-sidebar .workspace .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 8;
        width: min(300px, 48vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-geneo-tabs .topnav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.geneo-tour-geneo-tabs .topbar .top-actions {
        display: none;
    }

    body.geneo-tour-geneo-tabs .topnav .tab {
        padding: 0 var(--space-3);
    }

    body.geneo-tour-people-sidebar .workspace .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 8;
        width: min(300px, 48vw);
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-people-tabs .topnav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.geneo-tour-people-tabs .topbar .top-actions {
        display: none;
    }

    body.geneo-tour-people-tabs .topnav .tab {
        padding: 0 var(--space-3);
    }

    body.geneo-tour-tree-sidebar .tree-workspace .tree-inspector {
        display: block;
        position: absolute;
        inset: 0 0 0 auto;
        z-index: 8;
        width: min(360px, 100vw);
        min-width: 0;
        box-shadow: var(--shadow-soft);
    }

    body.geneo-tour-tree-tabs .topnav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.geneo-tour-tree-tabs .topbar .top-actions {
        display: none;
    }

    body.geneo-tour-tree-tabs .topnav .tab {
        padding: 0 var(--space-3);
    }
}

@media (max-width: 640px) {
    body.geneo-tour-places-popover #placesFilterPopover,
    body.geneo-tour-places-popover .places-route-popover {
        max-height: min(38vh, 240px);
        overflow-y: auto;
    }

    body.geneo-tour-notes-popover .notes-filter-popover {
        max-height: min(38vh, 240px);
    }

    body.geneo-tour-archive-sidebar .workspace .sidebar {
        width: min(300px, 100vw);
    }

    body.geneo-tour-albums-sidebar .workspace .sidebar {
        width: min(300px, 100vw);
    }

    body.geneo-tour-albums-popover #albumsFilterPopover {
        max-height: min(38vh, 240px);
        overflow-y: auto;
    }

    body.geneo-tour-geneo-sidebar .workspace .sidebar {
        width: min(300px, 100vw);
    }

    body.geneo-tour-people-popover #peopleColumnsPopover,
    body.geneo-tour-people-popover #peopleFilterPopover {
        max-height: min(38vh, 240px);
        overflow-y: auto;
    }

    body.geneo-tour-people-sidebar .workspace .sidebar {
        width: min(300px, 100vw);
    }

    .geneo-tour:not(.is-centered):not(.is-unanchored) .geneo-tour-card {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-height: min(45vh, 360px);
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        padding: var(--space-4);
    }

    .geneo-tour.is-top-sheet:not(.is-centered):not(.is-unanchored) .geneo-tour-card {
        top: 0;
        bottom: auto;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }

    .geneo-tour-card h2 {
        font-size: 18px;
    }

    .geneo-tour-close {
        width: auto;
        padding: 4px 0;
        font-size: 12px;
        text-decoration: underline;
        white-space: nowrap;
    }

    .geneo-tour-close svg,
    .geneo-tour-actions [data-geneo-tour-action="skip"] {
        display: none;
    }

    .geneo-tour:not(.is-centered) .geneo-tour-close {
        width: 28px;
        padding: 4px;
        text-decoration: none;
    }

    .geneo-tour:not(.is-centered) .geneo-tour-close svg {
        display: block;
    }

    .geneo-tour:not(.is-centered) .geneo-tour-close::after {
        display: none;
    }

    .geneo-tour-close::after {
        content: attr(aria-label);
    }
}

@media (max-width: 640px) and (max-height: 420px) {
    .geneo-tour:not(.is-centered):not(.is-unanchored) .geneo-tour-card {
        max-height: 62vh;
        padding: var(--space-3);
    }

    .geneo-tour-card h2 {
        margin: var(--space-2) 0;
    }

    .geneo-tour-actions {
        margin-top: var(--space-3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .geneo-tour, .geneo-tour * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
