:root {
    --bg: #f6f6f4;
    --paper: #ffffff;
    --paper-soft: #f0f0ee;
    --ink: #171717;
    --muted: #6f6f68;
    --faint: #9b9b94;
    --line: #deded9;
    --line-soft: #ecece8;
    --accent: #111111;
    --accent-2: #4f6f52;
    --danger: #a33a2f;
    --shadow: 0 18px 48px rgba(20, 20, 18, 0.06);
    --font-sans: "Avenir Next", "Manrope", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    background:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
        var(--bg);
    background-size: 44px 44px;
    font-family: var(--font-sans);
}

body:not(.embed-page) {
    display: flex;
    flex-direction: column;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open .search-stage,
body.modal-open .timeline-workspace,
body.modal-open .details-section,
body.modal-open .site-header,
body.modal-open .site-footer {
    filter: blur(1px);
    opacity: 0.5;
}

body.is-exporting .timeline-workspace {
    background: var(--bg);
}

body.is-exporting .timeline {
    overflow: visible;
}

body.is-exporting [data-export-ignore] {
    display: none !important;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
}

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 12px 22px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    transition: filter 160ms ease, opacity 160ms ease;
}

.site-header a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
}

.site-header a:hover {
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink);
}

.site-mark {
    letter-spacing: -0.01em;
}

.search-stage {
    display: grid;
    padding: 118px 20px 96px;
}

.search-stage-inner {
    display: grid;
    justify-items: center;
    width: min(980px, calc(100vw - 48px));
    margin: 0 auto;
}

.search-main {
    display: grid;
    justify-items: center;
    text-align: center;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(36px, 5.55vw, 64px);
    font-weight: 600;
    letter-spacing: -0.065em;
    line-height: 0.92;
}

#page-title {
    padding-bottom: 0.08em;
    color: #3a365f;
    line-height: 1;
}

h2 {
    margin-bottom: 0;
    font-size: 30px;
    font-weight: 580;
    letter-spacing: -0.025em;
}

.stage-copy {
    max-width: 640px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

.search-wrapper {
    position: relative;
    width: min(720px, calc(100vw - 32px));
    z-index: 60;
}

.search-main > :not(.search-wrapper),
.timeline-workspace,
.details-section {
    transition: filter 160ms ease, opacity 160ms ease;
}

body.search-focused .search-main > :not(.search-wrapper),
body.search-focused .timeline-workspace,
body.search-focused .details-section,
body.search-focused .site-header,
body.search-focused .site-footer {
    filter: blur(1px);
    opacity: 0.5;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 14px;
    height: 14px;
    border: 1.7px solid var(--faint);
    border-radius: 50%;
    transform: translateY(-50%);
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 7px;
    height: 1.7px;
    border-radius: 999px;
    background: var(--faint);
    transform: rotate(45deg);
}

.search-input {
    width: 100%;
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 52px 0 46px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #b8b8b0;
    background: #ffffff;
    box-shadow: 0 22px 52px rgba(20, 20, 18, 0.1);
}

.search-wrapper.has-suggestions .search-input {
    border-color: var(--line);
    border-bottom-color: transparent;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 16px 34px rgba(20, 20, 18, 0.075);
}

.search-spinner {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(112, 109, 101, 0.18);
    border-top-color: rgba(112, 109, 101, 0.68);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.82);
    transition: opacity 120ms ease, transform 120ms ease;
}

.search-wrapper.is-searching .search-spinner {
    animation: search-spin 720ms linear infinite;
    opacity: 1;
    transform: scale(1);
}

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

.suggestions {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: min(520px, calc(100vh - 260px));
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    background: #ffffff;
    box-shadow: 0 24px 48px rgba(20, 20, 18, 0.1);
    text-align: left;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(112, 109, 101, 0.32) transparent;
}

.suggestions:empty {
    display: none;
}

.suggestions::-webkit-scrollbar {
    width: 8px;
}

.suggestions::-webkit-scrollbar-thumb {
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: rgba(112, 109, 101, 0.3);
}

.suggestion {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.suggestion:last-child {
    border-bottom: 0;
}

.suggestion:hover {
    background: #f7f7f4;
}

.suggestion.is-selected {
    background: #f6f6f3;
    color: #74746c;
}

.suggestion.is-selected:hover {
    background: #f1f1ed;
}

.suggestion.is-limited {
    background: #f4f1ed;
    color: #8a867d;
    cursor: not-allowed;
}

.suggestion.is-limited:hover {
    background: #f0ece6;
}

.suggestion.is-limited .suggestion-title,
.suggestion.is-limited .suggestion-subtitle {
    opacity: 0.68;
}

.suggestion.is-limited .suggestion-meta {
    border: 1px solid rgba(184, 133, 112, 0.28);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(244, 221, 210, 0.46);
    color: #8b5f50;
    font-weight: 700;
}

.suggestion-title {
    display: block;
    margin-bottom: 3px;
    font-weight: 700;
}

.suggestion-subtitle,
.suggestion-meta,
.meta {
    color: var(--muted);
    font-size: 12px;
}

.suggestion-side {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.suggestion-remove {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #d9d9d3;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.76);
    color: #77776f;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.suggestion-remove:hover {
    border-color: #c9b5b0;
    color: var(--danger);
}

.collection-picks {
    width: min(1040px, calc(100vw - 32px));
    margin-top: 18px;
    text-align: left;
}

.collection-picks-label {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    min-width: 86px;
    padding: 0 11px;
    color: #686861;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.collection-card-grid {
    display: grid;
    grid-template-columns: 92px repeat(5, minmax(142px, 1fr));
    gap: 6px;
    overflow-x: auto;
    border-radius: 22px;
    padding: 4px;
    background: rgba(242, 242, 239, 0.82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        inset 0 -1px 0 rgba(215, 215, 209, 0.38);
}

.collection-card-grid::-webkit-scrollbar {
    display: none;
}

.collection-card {
    min-height: 68px;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 11px 14px 10px;
    background: transparent;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    opacity: 1;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, opacity 160ms ease;
}

.collection-card .preset-title {
    color: #62625b;
}

.collection-card .preset-meta {
    color: #94948c;
}

.collection-card:hover {
    background: rgba(255, 255, 255, 0.42);
}

.collection-card:hover .preset-title {
    color: #3f3f39;
}

.collection-card:hover .preset-meta {
    color: #76766e;
}

.collection-card.is-active {
    border-color: rgba(216, 216, 210, 0.96);
    background:
        linear-gradient(180deg, #ffffff, rgba(252, 251, 248, 0.96)),
        #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
    opacity: 1;
}

.collection-card.is-active .preset-title {
    color: var(--ink);
}

.collection-card.is-active .preset-meta {
    color: #6d6d65;
}

.collection-lucky-card {
    background: transparent;
}

.collection-lucky-card .preset-title {
    color: #5f5878;
}

.collection-lucky-card:hover {
    background: rgba(246, 241, 255, 0.52);
}

.collection-lucky-card.is-active {
    border-color: rgba(206, 198, 230, 0.9);
    background:
        linear-gradient(180deg, #ffffff, rgba(249, 246, 255, 0.96)),
        #ffffff;
}

.collection-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 9px 0 0 9px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.collection-more-link:hover {
    color: var(--ink);
}

.preset-title,
.preset-meta {
    display: block;
}

.preset-title {
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 580;
    letter-spacing: -0.008em;
    line-height: 1.08;
}

.preset-meta {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.preset-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(246, 246, 244, 0.28);
}

.preset-modal.hidden,
.embed-modal.hidden {
    display: none;
}

.preset-modal-panel,
.embed-modal-panel {
    width: min(620px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow: visible;
    border: 1px solid rgba(222, 222, 217, 0.92);
    border-radius: 24px;
    padding: 16px;
    background: #f8f8f5;
    box-shadow: 0 24px 64px rgba(20, 20, 18, 0.13);
}

.preset-modal-header,
.embed-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.embed-preview-header {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.embed-preview-header .eyebrow {
    margin: 0;
}

.embed-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(246, 246, 244, 0.28);
}

.embed-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(246, 246, 244, 0.38);
}

.embed-preview-modal.hidden {
    display: none;
}

.embed-modal-panel {
    display: grid;
    gap: 14px;
}

.embed-preview-modal-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    width: min(1080px, 100%);
    max-height: min(820px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid rgba(222, 222, 217, 0.92);
    border-radius: 24px;
    padding: 16px;
    background: #f8f8f5;
    box-shadow: 0 28px 74px rgba(20, 20, 18, 0.16);
}

.embed-modal-copy {
    margin: -4px 0 0;
    max-width: 520px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.embed-code {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    background: #ffffff;
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(20, 20, 18, 0.03);
    font-family: "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.55;
    outline: none;
}

.embed-code:focus {
    border-color: #b8b8b0;
}

.embed-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.embed-modal-actions .clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.embed-preview-frame-wrap {
    min-height: 0;
    max-height: calc(100vh - 164px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(20, 20, 18, 0.03);
}

.embed-preview-frame-wrap iframe {
    display: block;
    width: 100%;
    height: 320px;
    border: 0;
    background: var(--bg);
}

.modal-close-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.modal-close-button:hover {
    border-color: #bdbdb5;
    color: var(--ink);
}

.preset-search-wrapper {
    position: relative;
}

.preset-search {
    width: 100%;
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 0 18px;
    background: #ffffff;
    color: var(--ink);
    box-shadow: 0 16px 34px rgba(20, 20, 18, 0.075);
    outline: none;
}

.preset-search:focus {
    border-color: #b8b8b0;
    box-shadow: 0 14px 32px rgba(20, 20, 18, 0.08);
}

.preset-modal-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 0;
    background: transparent;
}

.preset-list-item {
    display: grid;
    gap: 4px;
    min-height: 64px;
    border: 1px solid rgba(222, 222, 217, 0.94);
    border-radius: 16px;
    padding: 14px 16px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(20, 20, 18, 0.028);
    cursor: pointer;
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.preset-list-item:hover {
    border-color: #bfbfb7;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(20, 20, 18, 0.055);
}

.preset-list-item.is-active {
    border-color: rgba(255, 255, 255, 0.98);
    background:
        linear-gradient(180deg, #ffffff, rgba(252, 251, 248, 0.96)),
        #ffffff;
    box-shadow:
        0 12px 26px rgba(20, 20, 18, 0.09),
        0 1px 2px rgba(20, 20, 18, 0.08);
}

.preset-list-item:last-child {
    border-bottom: 1px solid rgba(222, 222, 217, 0.94);
}

.preset-list-empty {
    padding: 18px;
    border: 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.timeline-workspace {
    width: 100%;
    min-height: 0;
    margin-top: auto;
    margin-bottom: 10px;
    background: transparent;
}

.workspace-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 28px 18px;
}

.workspace-title-group {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-timeline-controls {
    display: grid;
    gap: 12px;
    justify-items: center;
    width: min(980px, calc(100vw - 32px));
    margin-top: 14px;
}

.search-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.workspace-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 4px 0 13px;
    background: var(--paper);
    color: var(--muted);
    font-size: 12px;
}

.workspace-stats.is-at-limit {
    border-color: rgba(184, 133, 112, 0.42);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 232, 225, 0.78)),
        var(--paper);
    color: #7d5548;
}

.workspace-stats.is-at-limit #selected-count::after {
    content: "Limit reached";
    margin-left: 8px;
    border: 1px solid rgba(184, 133, 112, 0.26);
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.55);
    color: #8b5f50;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-button {
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
}

.clear-button:hover {
    border-color: #bcbcb4;
    background: var(--paper);
    color: var(--ink);
}

.clear-button-inline {
    height: 28px;
    border-color: #b9b9b1;
    padding: 0 10px;
    background:
        linear-gradient(180deg, #ffffff, rgba(242, 242, 238, 0.94)),
        var(--paper);
    box-shadow: 0 10px 22px rgba(20, 20, 18, 0.06);
    color: var(--ink);
}

.clear-button-inline:hover {
    border-color: #9d9d94;
    box-shadow: 0 12px 26px rgba(20, 20, 18, 0.075);
}

.collection-actions {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    height: 28px;
    border: 1px solid #b9b9b1;
    border-radius: 999px;
    background:
        linear-gradient(180deg, #ffffff, rgba(242, 242, 238, 0.94)),
        var(--paper);
    box-shadow: 0 10px 22px rgba(20, 20, 18, 0.06);
}

.collection-actions:hover {
    border-color: #9d9d94;
    box-shadow: 0 12px 26px rgba(20, 20, 18, 0.075);
}

.collection-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: 0 10px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 12px;
}

.collection-action-button + .collection-action-button {
    border-left: 1px solid rgba(157, 157, 148, 0.48);
}

.collection-action-button:hover {
    background: rgba(255, 255, 255, 0.56);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

.icon-button:hover {
    border-color: #bcbcb4;
    background: var(--paper);
}

.icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--ink);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.icon-button .check-icon {
    display: none;
}

.icon-button.is-copied {
    border-color: #b9cbb0;
    background: #f2f7ee;
}

.icon-button.is-copied .copy-icon {
    display: none;
}

.icon-button.is-copied .check-icon {
    display: block;
    stroke: #4f6f52;
}

.share-status {
    color: var(--muted);
    font-size: 12px;
}

.share-status:empty {
    display: none;
}

.selected-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 44px;
    padding: 0;
}

.selected-items.empty {
    align-items: center;
    min-height: 0;
    padding-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    border: 1px solid var(--item-border);
    border-radius: 999px;
    padding: 0 7px 0 12px;
    background: color-mix(in srgb, var(--item-color) 36%, white);
    font-size: 13px;
}

.remove-btn {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
}

.remove-btn:hover {
    color: var(--danger);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 118px;
    margin: 0;
    border: 1px dashed #cfcfca;
    background:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
        rgba(250, 250, 248, 0.8);
    background-size: 36px 36px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 720;
    letter-spacing: -0.035em;
}

.empty-state span {
    display: block;
    font-size: 13px;
}

.rotate-prompt {
    display: grid;
    grid-template-columns: auto minmax(0, 420px);
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 220px;
    margin: 0;
    border: 1px solid rgba(222, 222, 217, 0.95);
    background:
        radial-gradient(circle at 42% 18%, rgba(143, 114, 242, 0.12), transparent 32%),
        radial-gradient(circle at 64% 78%, rgba(255, 173, 111, 0.14), transparent 30%),
        rgba(255, 255, 255, 0.74);
    color: var(--muted);
    text-align: left;
}

.rotate-prompt strong {
    display: block;
    margin-bottom: 8px;
    color: #3a365f;
    font-size: 24px;
    font-weight: 560;
    letter-spacing: -0.03em;
}

.rotate-prompt span {
    display: block;
    max-width: 360px;
    font-size: 13px;
    line-height: 1.55;
}

.rotate-visual {
    position: relative;
    width: 136px;
    height: 124px;
    display: grid;
    place-items: center;
}

.rotate-phone {
    position: relative;
    display: grid;
    place-items: center;
    width: 62px;
    height: 108px;
    border: 2px solid #3a365f;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 42px rgba(58, 54, 95, 0.1);
    overflow: visible;
    transform-origin: 50% 75%;
    animation: rotate-phone 2600ms ease-in-out infinite;
}

.rotate-phone::before {
    position: absolute;
    top: 8px;
    width: 16px;
    height: 3px;
    border-radius: 999px;
    background: rgba(58, 54, 95, 0.28);
    content: "";
}

.rotate-phone-screen {
    width: 36px;
    height: 58px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(143, 114, 242, 0.22), rgba(255, 173, 111, 0.24)),
        #f8f7f5;
}

.rotate-arrow {
    position: absolute;
    top: 0;
    right: -48px;
    width: 44px;
    height: 108px;
    overflow: visible;
    opacity: 0.42;
    pointer-events: none;
}

.rotate-arrow path {
    stroke: #3a365f;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes rotate-phone {
    0%,
    18% {
        transform: rotate(0deg);
    }

    48%,
    68% {
        transform: rotate(-90deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.timeline {
    --timeline-edge-gutter: 10px;
    width: 100%;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
}

.timeline-axis {
    position: relative;
    width: calc(100% - (var(--timeline-edge-gutter) * 2));
    min-width: 0;
    height: 28px;
    margin-left: var(--timeline-edge-gutter);
    padding: 8px 0 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.timeline-axis span {
    position: absolute;
    top: 8px;
    white-space: nowrap;
    transform: translateX(-50%);
}

.timeline-axis span:first-child {
    transform: none;
}

.timeline-axis span:last-child {
    transform: translateX(-100%);
}

.timeline-rows {
    position: relative;
    min-width: 0;
    background: transparent;
}

.timeline-guide-layer {
    position: absolute;
    top: -7px;
    right: var(--timeline-edge-gutter);
    bottom: 0;
    left: var(--timeline-edge-gutter);
    z-index: 1;
    pointer-events: none;
}

.timeline-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(88, 88, 82, 0.12);
    transform: translateX(-50%);
}

.timeline-guide:first-child {
    transform: none;
}

.timeline-guide:last-child {
    transform: translateX(-100%);
}

.overlap-layer {
    position: absolute;
    top: 0;
    right: var(--timeline-edge-gutter);
    bottom: 0;
    left: var(--timeline-edge-gutter);
    z-index: 20;
    pointer-events: none;
}

.overlap-connector {
    position: absolute;
    z-index: 20;
    min-width: 5px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: help;
    outline: none;
    pointer-events: auto;
}

.overlap-connector.is-point {
    transform: translateX(-50%);
}

.overlap-connector::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-right: 1px dashed rgba(146, 146, 138, 0.42);
    border-left: 1px dashed rgba(146, 146, 138, 0.42);
    background: rgba(146, 146, 138, 0.08);
}

.overlap-connector::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: max(22px, 100%);
    transform: translateX(-50%);
}

.overlap-tooltip {
    position: absolute;
    left: 50%;
    top: 10px;
    z-index: 40;
    display: grid;
    gap: 6px;
    min-width: 220px;
    max-width: 280px;
    padding: 11px 12px 12px;
    border: 1px solid rgba(222, 222, 217, 0.92);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 245, 0.96)),
        var(--paper);
    box-shadow: 0 14px 34px rgba(20, 20, 18, 0.09);
    color: var(--ink);
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.overlap-connector:hover,
.overlap-connector:focus-visible {
    z-index: 50;
}

.overlap-connector:hover::before,
.overlap-connector:focus-visible::before {
    border-color: rgba(102, 102, 96, 0.58);
    background: rgba(126, 126, 118, 0.12);
}

.overlap-connector:hover .overlap-tooltip,
.overlap-connector:focus-visible .overlap-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.overlap-connector.near-start .overlap-tooltip {
    left: 0;
    transform: translate(0, -4px);
}

.overlap-connector.near-start:hover .overlap-tooltip,
.overlap-connector.near-start:focus-visible .overlap-tooltip {
    transform: translate(0, 0);
}

.overlap-connector.near-end .overlap-tooltip {
    right: 2px;
    left: auto;
    transform: translate(0, -4px);
}

.overlap-connector.near-end:hover .overlap-tooltip,
.overlap-connector.near-end:focus-visible .overlap-tooltip {
    transform: translate(0, 0);
}

.overlap-tooltip-title {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 620;
    line-height: 1.25;
}

.overlap-tooltip-title::before {
    content: "Period overlap";
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overlap-tooltip-range {
    justify-self: start;
    min-height: 24px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #565650;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.timeline-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 68px;
    border-bottom: 1px solid var(--line-soft);
    transition: background 160ms ease;
}

.timeline-row:hover,
.timeline-row.is-hover-match {
    background: color-mix(in srgb, var(--item-color) 12%, white);
}

.timeline-track {
    position: relative;
    margin: 0 var(--timeline-edge-gutter);
    background:
        linear-gradient(rgba(0, 0, 0, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.034) 1px, transparent 1px);
    background-position: -1px -1px;
    background-size: 28px 28px;
}

.timeline-track::before,
.timeline-track::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    width: var(--timeline-edge-gutter);
    pointer-events: none;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(88, 88, 82, 0.08) 0 1px,
            transparent 1px 5px
        );
}

.timeline-track::before {
    right: 100%;
}

.timeline-track::after {
    left: 100%;
}

.timeline-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 30px;
    z-index: 3;
    height: 20px;
    min-width: 3px;
    border: 1px solid var(--item-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--item-color) 48%, white);
    box-shadow: 0 6px 16px rgba(20, 20, 18, 0.055);
    transition: background 160ms ease, border-color 160ms ease;
}

.timeline-row:hover .timeline-bar,
.timeline-row.is-hover-match .timeline-bar {
    border-color: color-mix(in srgb, var(--item-border) 70%, #111111);
    background: color-mix(in srgb, var(--item-color) 82%, white);
}

.timeline-row.is-traditional-range .timeline-bar {
    border-style: dashed;
    background: repeating-linear-gradient(
        90deg,
        color-mix(in srgb, var(--item-color) 46%, white) 0 10px,
        color-mix(in srgb, var(--item-color) 20%, white) 10px 16px
    );
    opacity: 0.88;
}

.timeline-row.is-traditional-range:hover .timeline-bar,
.timeline-row.is-traditional-range.is-hover-match .timeline-bar {
    background: repeating-linear-gradient(
        90deg,
        color-mix(in srgb, var(--item-color) 68%, white) 0 10px,
        color-mix(in srgb, var(--item-color) 28%, white) 10px 16px
    );
}

.timeline-bar.point {
    width: 18px !important;
    border-radius: 50%;
    transform: translateX(-50%);
}

.timeline-bar-time {
    position: absolute;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    left: 50%;
    top: -23px;
    color: #4a4a45;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    transform: translateX(-50%);
}

.timeline-bar-title {
    color: var(--ink);
    font-weight: 760;
}

.timeline-bar-time.near-start {
    left: 0;
    transform: none;
}

.timeline-bar-time.near-end {
    left: auto;
    right: 0;
    transform: none;
}

.timeline-bar-qualifier {
    position: absolute;
    left: 50%;
    top: 20px;
    color: #6b6760;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
}

.timeline-bar-time.near-start + .timeline-bar-qualifier {
    left: 0;
    transform: none;
}

.timeline-bar-time.near-end + .timeline-bar-qualifier {
    left: auto;
    right: 0;
    transform: none;
}

.timeline-bar.point .timeline-bar-time {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.timeline-bar.point .timeline-bar-time.near-start {
    left: 24px;
    right: auto;
    transform: translateY(-50%);
}

.timeline-bar.point .timeline-bar-time.near-end {
    left: auto;
    right: 24px;
    transform: translateY(-50%);
}

.timeline-bar-time.is-overflowing-bar,
.timeline-bar-time.near-start.is-overflowing-bar,
.timeline-bar-time.near-end.is-overflowing-bar {
    left: 0;
    right: auto;
    justify-content: flex-start;
    text-align: left;
    transform: none;
}

.timeline-bar.point .timeline-bar-time.is-overflowing-bar,
.timeline-bar.point .timeline-bar-time.near-start.is-overflowing-bar,
.timeline-bar.point .timeline-bar-time.near-end.is-overflowing-bar {
    left: 24px;
    right: auto;
    transform: translateY(-50%);
}

.embed-page {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
        var(--bg);
    background-size: 36px 36px;
}

.embed-shell {
    width: 100%;
    padding: 0;
}

.embed-timeline-workspace {
    min-height: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.76);
}

.embed-page .selected-items {
    padding-bottom: 10px;
}

.embed-page .timeline {
    padding-bottom: 0;
}

.embed-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 16px;
}

.embed-header h1 {
    margin: 0;
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 580;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.embed-watermark {
    flex: 0 0 auto;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.embed-chip {
    padding-right: 11px;
}

.details-section {
    display: grid;
    gap: 9px;
    width: min(980px, calc(100vw - 32px));
    margin-top: 12px;
    padding: 0;
    text-align: left;
}

.details-header {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 9px;
    padding: 0;
}

.details-header .eyebrow {
    margin: 0;
    font-size: 10px;
}

.details-header h2 {
    font-size: 13px;
    font-weight: 540;
    letter-spacing: -0.01em;
}

.details {
    display: flex;
    gap: 9px;
    max-width: 100%;
    overflow-x: auto;
    padding: 1px 1px 8px;
    scrollbar-width: thin;
}

.details.empty {
    display: block;
    min-height: 140px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    padding: 18px;
    color: var(--muted);
    font-size: 13px;
}

.detail-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 min(280px, calc(100vw - 48px));
    min-height: 168px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--item-border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--item-color) 7%, white), rgba(255, 255, 255, 0.82) 72px),
        rgba(255, 255, 255, 0.78);
    padding: 14px 40px 12px 12px;
    transition: border-color 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.detail-remove-button {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.detail-remove-button:hover {
    border-color: rgba(196, 104, 91, 0.34);
    background: #ffffff;
    color: var(--danger);
}

.details.is-comparing-hover .detail-card {
    filter: blur(1px);
    opacity: 0.5;
}

.details.is-comparing-hover .detail-card.is-hover-match {
    border-color: var(--item-border);
    filter: none;
    opacity: 1;
}

.detail-card h3 {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 560;
    letter-spacing: -0.01em;
}

.detail-card p {
    margin-bottom: 8px;
    color: #3f3f3b;
    font-size: 12px;
    line-height: 1.45;
}

.detail-description {
    margin-bottom: 4px;
}

.detail-description p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.detail-description p:last-child {
    margin-bottom: 8px;
}

.detail-source {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.detail-source-link {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.64);
    color: var(--ink);
}

.detail-source-link:hover {
    border-color: var(--item-border);
    background: #ffffff;
}

.detail-source-text {
    color: var(--muted);
}

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

.detail-source-link svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.source-popover-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.source-popover-trigger {
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    color: #565650;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.source-popover-trigger:hover,
.source-popover-trigger:focus-visible,
.source-popover-trigger[aria-expanded="true"] {
    color: var(--ink);
    outline: none;
}

.source-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 80;
    width: min(280px, calc(100vw - 32px));
    border: 1px solid rgba(222, 222, 217, 0.96);
    border-radius: 14px;
    padding: 11px 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 245, 0.96)),
        var(--paper);
    box-shadow: 0 18px 42px rgba(20, 20, 18, 0.11);
    color: #4c4c46;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.site-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 56px;
    border-top: 1px solid var(--line-soft);
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    transition: filter 160ms ease, opacity 160ms ease;
}

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

.legal-shell {
    flex: 1 0 auto;
    width: min(860px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 56px 0 72px;
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.legal-back-link:hover {
    border-color: #bfbfb7;
    color: var(--ink);
}

.legal-card {
    border: 1px solid rgba(222, 222, 217, 0.92);
    border-radius: 28px;
    padding: clamp(24px, 5vw, 52px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 250, 248, 0.74)),
        var(--paper);
    box-shadow: 0 24px 64px rgba(20, 20, 18, 0.08);
}

.legal-card h1 {
    margin: 0 0 22px;
    font-size: clamp(46px, 7vw, 84px);
    font-weight: 540;
    letter-spacing: -0.07em;
    line-height: 0.92;
}

.legal-card h2 {
    margin: 34px 0 12px;
    font-size: 22px;
    font-weight: 580;
    letter-spacing: -0.02em;
}

.legal-card p {
    margin: 0 0 14px;
    color: #3f3f3b;
    font-size: 15px;
    line-height: 1.72;
}

.hidden {
    display: none;
}

@media (max-width: 760px) {
    .site-header {
        padding: 10px 14px;
    }

    .search-stage {
        padding: 82px 16px 64px;
    }

    .search-stage-inner {
        gap: 24px;
        width: 100%;
    }

    .search-main {
        justify-items: center;
        text-align: center;
    }

    h1 {
        font-size: 44px;
    }

    .workspace-header {
        align-items: start;
        flex-direction: column;
        padding: 22px 16px 14px;
    }

    .workspace-title-group,
    .workspace-actions {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .search-timeline-controls {
        width: 100%;
    }

    .search-action-row {
        justify-content: center;
    }

    .selected-items {
        padding: 0;
    }

    .empty-state {
        margin: 0;
    }

    .rotate-prompt {
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 244px;
        padding: 32px 20px;
        text-align: center;
    }

    .rotate-prompt strong {
        font-size: 22px;
    }

    .timeline-axis {
        min-width: 0;
    }

    .timeline-rows {
        min-width: 0;
        background: transparent;
    }

    .details-section {
        width: 100%;
        padding: 0;
    }

    .details-header {
        padding-left: 0;
    }

    .embed-header {
        flex-direction: column;
        padding: 18px 16px 14px;
    }

    .embed-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .embed-modal-actions .clear-button {
        width: 100%;
    }
}
