:root {
    --drawing-nameplate-background: var(--panel-background);
    --layer-base: 0;
    --layer-panel-details: 20;
    --layer-panel-search: 30;
    --layer-popup-cluster: 100;
    --layer-popup-search: 110;
    --layer-popup-event: 120;
    color-scheme: light;
    --page-background: #f3f6fa;
    --panel-background: #ffffff;
    --border-color: #cbd5e1;
    --border-strong: #94a3b8;
    --text-color: #172033;
    --muted-color: #64748b;
    --accent-color: #2563eb;
    --on-accent: #ffffff;
    --danger-color: #b91c1c;
    --danger-background: #fef2f2;
    --tooltip-background: #0f0f0f;
    --placeholder-background: #f8fafc;
    --surface-raised: #ffffff;
    --surface-overlay: #ffffff;
    --surface-inset: #f8fafc;
    --chip-background: #edf2f8;
    --hover-background: #eef3fa;
    --text-strong: #172033;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--page-background);
    color: var(--text-color);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

h1,
h2 {
    margin-bottom: 0;
}

h1 {
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

h2 {
    font-size: 1rem;
}

.app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    height: 100vh;
    padding: 12px;
    overflow: hidden;
}

.menu-bar,
.panel {
    background: var(--panel-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.menu-bar {
    display: grid;
    grid-template-columns: auto auto minmax(90px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 8px 12px;
    border-top: 3px solid var(--accent-color);
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.toolbar-right { justify-content: flex-end; }

.site-identity { flex: 0 0 auto; white-space: nowrap; }
.site-identity h1 { font-size: 1rem; }

.overview-header-placeholder {
    position: relative;
    justify-self: stretch;
    min-width: 220px;
    height: 38px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: var(--placeholder-background);
    touch-action: none;
    cursor: crosshair;
}

.overview-track {
    position: absolute;
    top: 50%;
    right: 8px;
    left: 8px;
    height: 8px;
    transform: translateY(-50%);
    border-top: 2px solid var(--border-strong);
    border-bottom: 2px solid var(--border-strong);
}

.overview-event-mark {
    position: absolute;
    top: 50%;
    height: var(--overview-range-height, 4px);
    min-width: 2px;
    border-radius: 0;
    background: rgb(var(--overview-rgb) / 0.8);
    transform: translateY(-50%);
    z-index: var(--overview-range-z, 2);
}

.overview-point-mark {
    top: 50%;
    width: var(--overview-point-size, 10px);
    min-width: var(--overview-point-size, 10px);
    height: var(--overview-point-size, 10px);
    border-radius: 50%;
    background: rgb(var(--overview-rgb) / 0.6);
    transform: translate(-50%, -50%);
    z-index: var(--overview-point-z, 1);
}

.overview-numeric-layer {
    position: absolute;
    z-index: var(--overview-numeric-z, 3);
    top: calc(50% + 8px);
    right: 0;
    left: 0;
    width: 100%;
    height: 8px;
    overflow: visible;
    transform: translateY(-50%);
    pointer-events: none;
}

.overview-numeric-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.overview-viewport-indicator,
.overview-selection-preview {
    position: absolute;
    top: -12px;
    bottom: -12px;
    min-width: 8px;
    border: 1px solid var(--accent-color);
    background: rgb(37 99 235 / 0.2);
}

.overview-viewport-indicator { cursor: grab; }
.overview-resize-handle { position: absolute; top: -1px; bottom: -1px; width: 6px; background: var(--accent-color); cursor: ew-resize; }
.overview-resize-handle::before { position: absolute; top: -5px; bottom: -5px; width: 10px; content: ""; }
.overview-resize-handle-left::before { left: -2px; } .overview-resize-handle-right::before { right: -2px; }
.overview-resize-handle-left { left: -3px; } .overview-resize-handle-right { right: -3px; }
.overview-viewport-indicator:active { cursor: grabbing; }
.overview-selection-preview { border-style: dashed; background: rgb(37 99 235 / 0.12); pointer-events: none; }

.settings-placeholder-button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    color: var(--text-color);
    font: inherit;
    font-size: 0.82rem;
}

.toolbar-actions {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    white-space: nowrap;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-background: #101214;
    --panel-background: #171a1d;
    --placeholder-background: #121518;

    --surface-raised: #1d2125;
    --surface-overlay: #23282d;
    --surface-inset: #111417;

    --chip-background: #22272c;
    --hover-background: #252b31;

    --border-color: #30363b;
    --border-strong: #49515a;

    --text-color: #e7e9ec;
    --text-strong: #f2f4f6;
    --muted-color: #969da6;

    --accent-color: #6aa4dc;
    --on-accent: #0d141b;
    --primary-action-background: #0066CC;
    --primary-action-hover: #0B7BEA;
    --primary-action-text: #F8FAFF;

    --danger-color: #e06c75;
    --danger-background: #2c181b;

    --tooltip-background: #24292e;
    --drawing-nameplate-background: #171a1d;
}

.display-mode-button {
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    color: var(--text-color);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.display-mode-button.is-active {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #ffffff;
}

.settings-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    gap: 5px;
    min-width: 150px;
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--panel-background);
    box-shadow: 0 6px 16px rgb(15 23 42 / .18);
}

.share-result {
    position: absolute;
    z-index: 35;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    gap: 5px;
    align-items: center;
    max-width: min(420px, 80vw);
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--panel-background);
    box-shadow: 0 6px 16px rgb(15 23 42 / .18);
    font-size: .8rem;
}
.display-mode-button[data-tooltip] { position: relative; }
.display-mode-button[data-tooltip]::after { position: absolute; z-index: var(--layer-popup-event); top: calc(100% + 6px); left: 50%; width: max-content; max-width: 16rem; padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity .12s ease, transform .12s ease; }
.display-mode-button[data-tooltip]:hover::after, .display-mode-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .5s; }
.display-mode-button.share-copy-success[data-tooltip]:hover::after { transition-delay: 0s; }

.eyebrow,
.panel-kicker {
    margin-bottom: 4px;
    color: var(--accent-color);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.panel {
    min-width: 0;
    padding: 16px;
}

.main-area {
    --timeline-list-width: 270px;
    display: grid;
    grid-template-columns: var(--timeline-list-width) 10px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.timeline-list,
.timeline-list-resizer,
.main-stage,
.main-view,
.details-panel {
    min-height: 0;
    overflow: hidden;
}

.settings-group { display: grid; gap: 4px; }
.settings-group > strong { font-size: .78rem; color: var(--muted-color); }
.timeline-list { overflow: visible; }
.main-area { overflow: visible; }
.search-panel {
    position: absolute;
    z-index: var(--layer-panel-search);
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(520px, 72vw);
    min-width: 320px;
    padding: 12px;
    box-shadow: 8px 10px 24px rgb(15 23 42 / 0.24);
    overflow: hidden;
}
.search-local-toggle { min-height: 30px; white-space: nowrap; }
.search-local-toggle.is-selected, .search-local-toggle[aria-pressed="true"] { border-color: var(--accent-color); background: var(--accent-color); color: #ffffff; font-weight: 700; }
html[data-theme="dark"] .search-local-toggle.is-selected, html[data-theme="dark"] .search-local-toggle[aria-pressed="true"] { background: var(--primary-action-background); border-color: var(--primary-action-background); color: var(--primary-action-text); }
html[data-theme="dark"] .search-local-toggle.is-selected:hover:not(:disabled), html[data-theme="dark"] .search-local-toggle[aria-pressed="true"]:hover:not(:disabled) { background: var(--primary-action-hover); border-color: var(--primary-action-hover); }
 .local-import-panel { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 8px; padding-top: 8px; }
 .local-import-panel[hidden] { display: none; }
 .local-import-topline { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
 .local-timeline-title { box-sizing: border-box; flex: 1 1 auto; min-width: 0; min-height: 30px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; }
 .local-import-dropzone { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 2px 12px; align-items: center; min-height: 52px; padding: 7px 10px; border: 1px dashed var(--border-strong); border-radius: 6px; background: color-mix(in srgb, var(--placeholder-background) 70%, var(--panel-background)); color: var(--muted-color); }
 .local-import-dropzone strong { color: var(--text-color); }.local-import-dropzone span { grid-column: 1; font-size: .75rem; }.local-import-file-button { grid-column: 2; grid-row: 1 / 3; min-height: 30px; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }.local-import-dropzone.is-dragover { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }
 .local-import-format-note { flex: 0 0 auto; margin: 0; color: var(--muted-color); font-size: .75rem; }
 .local-import-textarea-wrap { position: relative; display: flex; flex: 1 1 auto; min-height: 150px; width: 100%; min-width: 0; }
.normal-search-ui { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.normal-search-ui[hidden] { display: none; }
 .local-import-guide-section { flex: 0 0 auto; max-height: 11rem; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: color-mix(in srgb, var(--placeholder-background) 72%, var(--panel-background)); color: var(--muted-color); font-size: .78rem; line-height: 1.35; }
 .local-import-guide-section > strong { display: block; margin-bottom: 3px; color: var(--text-color); font-size: .9rem; }
.local-import-guide-intro, .local-import-guide-footer { margin: 0; }.local-import-guide-shortcut { display: block; margin-top: 2px; color: var(--muted-color); font-size: .72rem; }
 .local-import-example-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }.local-import-example { flex: 1 1 190px; min-width: 0; padding: 6px 8px; border: 1px solid var(--border-color); border-radius: 5px; background: color-mix(in srgb, var(--placeholder-background) 72%, var(--panel-background)); }.local-import-example > strong { color: var(--text-color); }.local-import-example-description, .local-import-example-note { display: block; margin: 2px 0 0; }.local-import-example-description { color: var(--muted-color); }.local-import-example pre { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre; font: .82rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }.local-import-example-note { color: var(--muted-color); font-size: .72rem; }.local-import-guide-footer { margin-top: 7px; }
 @media (max-width: 560px) { .local-import-example-grid { flex-direction: column; } }
 .local-import-textarea { box-sizing: border-box; flex: 1 1 auto; width: 100%; height: 100%; min-height: 150px; resize: none; overflow: auto; padding: 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: .85rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
 .local-import-unit { box-sizing: border-box; flex: 0 0 auto; width: 12rem; min-height: 30px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; }
 .local-import-status { flex: 0 0 auto; margin: 0; color: var(--muted-color); font-size: .78rem; }.local-import-status.is-error { color: var(--danger-color); }.local-import-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-color); }.local-import-actions button { padding: 5px 10px; font: inherit; cursor: pointer; }.local-import-actions button:disabled { cursor: not-allowed; opacity: .5; }
.search-header { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 6px; flex: 0 0 auto; }
.search-header > .search-target-buttons { flex: 0 0 auto; }
.search-header > .search-input-wrap { flex: 1 1 auto; min-width: 0; }
.search-header > .search-local-toggle { flex: 0 0 auto; }
.search-input, .search-target, .search-candidate, .search-result-row { border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; }
.search-input { min-width: 0; padding: 6px 8px; }
.search-target { padding: 5px 9px; cursor: pointer; }
.search-set-button { min-height: 30px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; font-size: .78rem; white-space: nowrap; cursor: pointer; }
.search-set-button:hover, .search-set-button:focus-visible, .search-set-button[aria-expanded="true"] { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); outline: none; }
.search-target { border: 0; }
.search-candidates { flex: 0 0 auto; max-height: 150px; margin-top: 0; overflow-y: auto; border: 1px solid var(--border-color); background: var(--panel-background); }
.search-candidate { display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 0; text-align: left; cursor: pointer; }
.search-candidate:hover, .search-candidate.is-active { background: var(--placeholder-background); }
.search-tags { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 28px; margin: 8px 0; }
.search-tag-control, .search-tag-input { min-height: 28px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; font-size: .8rem; }
.search-tag-chip { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 999px; white-space: nowrap; font-size: .76rem; }
.search-tag-chip button { margin-left: 4px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.search-results { flex: 1 1 auto; min-height: 0; overflow-y: auto; border-top: 1px solid var(--border-color); color: var(--muted-color); font-size: .8rem; }
.search-result-columns, .search-result-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2.25fr) minmax(0, 1.5fr) minmax(2.8rem, .75fr) minmax(1.8rem, .45fr); column-gap: 1em; width: 100%; min-width: 0; }
.search-result-columns { padding: 7px 5px; color: var(--muted-color); font-size: .72rem; }
.search-result-columns > span:last-child, .search-result-row > span:last-child { text-align: center; }
.search-result-columns.target-timeline-title > span:first-child, .search-result-row.target-timeline-title > span:first-child, .search-result-columns.target-event-title > span:nth-child(2), .search-result-row.target-event-title > span:nth-child(2) { font-weight: 700; }
.search-result-row { padding: 7px 5px; border-width: 1px 0 0; border-radius: 0; text-align: left; cursor: pointer; }
.search-result-row > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.search-result-row > span:nth-child(4), .search-result-row > span:nth-child(5), .search-result-columns > span:nth-child(4), .search-result-columns > span:nth-child(5) { text-align: center; }
.search-result-row.is-added { opacity: .65; }
.search-result-title-cell { display: flex; min-width: 0; align-items: center; gap: 5px; }
.search-result-type-icon { display: block; flex: 0 0 16px; width: 16px; height: 16px; object-fit: contain; }
.search-result-title-cell > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-preview { padding: 8px; border-bottom: 1px solid var(--border-color); background: var(--placeholder-background); color: var(--text-color); }
.search-preview p { margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: clip; }

.timeline-list-content {
    margin-top: 16px;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.timeline-list-header { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.timeline-list-controls { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.timeline-list-controls .timeline-add-select { white-space: nowrap; }

.timeline-list,
.details-panel {
    display: flex;
    flex-direction: column;
}

.timeline-list {
    position: relative;
    isolation: isolate;
    z-index: var(--layer-base);
    grid-column: 1;
    grid-row: 1;
    padding: 14px;
}

.timeline-list-resizer {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 60;
    align-self: stretch;
    min-height: 0;
    cursor: col-resize;
    touch-action: none;
}

.timeline-list-resizer::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    z-index: 1;
    border-left: 1px solid var(--border-color);
    content: "";
}

.timeline-list-resizer:hover::before,
.timeline-list-resizer.is-resizing::before { border-color: var(--accent-color); border-left-width: 2px; }
.timeline-list-resizer::after { position: absolute; top: 50%; left: 50%; z-index: 2; padding: 5px 2px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--panel-background); color: var(--muted-color); content: "⠿"; font-size: .9rem; line-height: 1; transform: translate(-50%, -50%); pointer-events: none; }
body.is-list-resizing, body.is-list-resizing * { cursor: col-resize !important; user-select: none; }

.main-stage { grid-column: 3; grid-row: 1; position: relative; min-width: 0; min-height: 0; }
.timeline-surface { --date-display-height: 76px; }

.details-panel {
    position: absolute;
    z-index: 20;
    top: 0;
    right: 0;
    bottom: auto;
    width: clamp(220px, 26vw, 320px);
    max-height: 100%;
    box-sizing: border-box;
    padding: 14px;
    box-shadow: 0 10px 24px rgb(15 23 42 / 0.18);
}
.details-panel[hidden] { display: none; }

.details-panel { overflow: hidden; }

.event-details-identity { flex: 0 0 auto; padding-bottom: 12px; background: var(--panel-background); }
.event-details-timeline { display: flex; align-items: center; gap: 6px; margin: 0; color: rgb(var(--timeline-rgb)); font-size: .82rem; font-weight: 700; }
.event-details-timeline-icon { flex: 0 0 auto; font-size: 1em; line-height: 1; }
.event-details-timeline-title { min-width: 0; }
.event-details-identity h3 { margin: 4px 0 0; font-size: 1.05rem; }
.event-details-scroll-body { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.event-details-basic, .event-details-location, .event-details-sources { display: grid; gap: 12px; padding-block: 12px; }
.event-details-basic { padding-top: 12px; }
.event-details-date { margin: 0; white-space: pre-line; color: var(--text-color); font-size: 0.82rem; }
.event-details-description { margin: 0; white-space: pre-wrap; }
.event-details-id { margin: 0; color: var(--muted-color); font-size: 0.72rem; word-break: break-all; }

.event-popup { position: fixed; z-index: var(--layer-popup-event); display: none; width: min(300px, calc(100vw - 16px)); padding: 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-background); box-shadow: 0 10px 22px rgb(15 23 42 / 0.22); pointer-events: none; }
.event-popup.is-visible { display: block; }
.event-popup p { margin: 5px 0 0; }
.event-popup-timeline { color: var(--accent-color); font-size: 0.72rem; font-weight: 700; }
.event-popup-date { color: var(--muted-color); font-size: 0.75rem; white-space: pre-line; }
.event-popup-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 0.8rem; }

.point-event, .uncertain-point-event, .range-band-event { cursor: pointer; }
.studio-range-body-grip { position: absolute; inset: 0 1.1rem; z-index: 2; cursor: grab; }
html[data-studio-editor-viewer="true"] .range-title-inside .range-band-title { cursor: grab; }
html[data-studio-editor-viewer="true"] .range-title-inside .range-band-title:active { cursor: grabbing; }
.studio-range-edge-grip { position: absolute; top: -0.35rem; bottom: -0.35rem; z-index: 3; width: 1.1rem; cursor: ew-resize; }
.studio-editor-range-guide { position:absolute; z-index:16; top:0; bottom:0; min-width:2px; border-left:2px solid #1769c2; background:rgb(23 105 194 / 14%); pointer-events:none; }
.studio-editor-range-status { position:absolute; z-index:17; top:.6rem; left:50%; padding:.35rem .55rem; border:1px solid #7fb2e8; border-radius:.3rem; background:#edf6ff; color:#164d96; font:.78rem/1.3 inherit; pointer-events:none; transform:translateX(-50%); }
.studio-range-start-grip { left: -0.55rem; }
.studio-range-end-grip { right: -0.55rem; }
.point-event:hover .point-event-title, .uncertain-point-event:hover .uncertain-point-title, .range-band-event:hover .range-band-title { text-decoration: underline; }

.timeline-controls {
    display: grid;
    gap: 10px;
}

.timeline-add-control,
.timeline-list-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-add-select,
.timeline-action-button,
.timeline-visibility-button {
    min-height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    color: var(--text-color);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.timeline-add-select {
    width: 100%;
    padding: 5px 8px;
}

.timeline-action-button,
.timeline-visibility-button {
    padding: 4px 7px;
}

.timeline-action-button:hover,
.timeline-visibility-button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.timeline-list-items {
    display: grid;
    gap: 8px;
}

.timeline-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--placeholder-background);
}

.timeline-list-item.is-hidden {
    opacity: 0.6;
}

.timeline-list-item { border-color: var(--border-strong); }

.timeline-drag-handle {
    color: var(--muted-color);
    cursor: grab;
    font-weight: 700;
}

.timeline-list-item-title {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
}

.set-editor-draft-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--muted-color);
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.35;
    vertical-align: middle;
    white-space: nowrap;
}

.timeline-list-item-meta {
    grid-column: 2 / -1;
    margin: -3px 0 0;
    color: var(--muted-color);
    font-size: 0.72rem;
}

.timeline-list-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.timeline-color-input {
    width: 34px;
    height: 28px;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    cursor: pointer;
}

.timeline-lane {
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.timeline-lane:last-child {
    border-bottom: 0;
}

.integrated-timeline {
    position: relative;
}

.integrated-timeline-label {
    position: absolute;
    z-index: 4;
    top: 5px;
    left: 9px;
    margin: 0;
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
}

.timeline-lane-header {
    position: absolute;
    z-index: 4;
    top: 5px;
    left: 9px;
    margin: 0;
    color: var(--text-color);
    font-size: 1.44rem;
    font-weight: 700;
    -webkit-text-stroke: 1px rgb(var(--timeline-rgb));
}

.timeline-lane-header::before {
    content: none;
}

/* Recommendation-first Viewer list.  The label is intentionally an overlay: it
   never consumes temporal X space or catches Event pointer interaction. */
.timeline-lane-label { position: absolute; z-index: 5; top: 5px; left: 5px; display: flex; flex-direction: column; align-items: center; max-width: 2.4rem; max-height: calc(100% - 10px); padding: 4px 3px; overflow: hidden; border: 1px solid rgb(var(--timeline-rgb) / .9); border-radius: 4px; background: rgb(var(--timeline-rgb) / .1); pointer-events: none; user-select: none; -webkit-user-select: none; }
.timeline-lane-label-icon { flex: 0 0 auto; font-size: 1.25rem; line-height: 1; -webkit-text-stroke: 1px currentColor; user-select: none; -webkit-user-select: none; pointer-events: none; }
.timeline-lane-label-title { min-height: 0; overflow: hidden; font-size: .72rem; font-weight: 700; line-height: 1.25; writing-mode: vertical-rl; text-orientation: upright; white-space: nowrap; word-break: keep-all; text-wrap: nowrap; overflow-wrap: normal; user-select: none; -webkit-user-select: none; }

.timeline-summary {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--placeholder-background);
}

.timeline-summary-title {
    margin-bottom: 6px;
    font-size: 1rem;
}

.timeline-summary-description,
.timeline-summary-meta {
    margin-bottom: 6px;
    color: var(--muted-color);
    font-size: 0.85rem;
}

.timeline-summary-meta {
    margin-bottom: 0;
}

.load-error {
    padding: 10px;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.85rem;
}

.main-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 12px;
    overflow: hidden;
}

.timeline-surface {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    margin-top: 0;
    border: 1px dashed var(--border-strong);
    background: var(--placeholder-background);
    touch-action: none;
    cursor: grab;
}

.toolbar-date-controls, .date-hud-group { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.date-hud-label { color: var(--muted-color); font-size: 0.72rem; white-space: nowrap; }
.date-hud-input, .date-hud-button {
    min-height: 28px; border: 1px solid var(--border-strong); border-radius: 4px;
    background: var(--panel-background); color: var(--text-color); font: inherit; font-size: 0.74rem;
}
.date-hud-input { width: 30px; padding: 3px; user-select: text; }
.date-hud-input.year { width: 56px; }
.historical-year-hint { max-width: 72px; overflow: hidden; color: var(--muted-color); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.date-hud-button { padding: 3px 6px; cursor: pointer; }

.list-mode-tab { min-height: 28px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); font: inherit; font-size: .78rem; cursor: pointer; }
.list-mode-tab.is-active { border-color: var(--accent-color); background: var(--accent-color); color: #fff; }
.event-table { --date-column-width: 62px; --event-column-min: 150px; position: relative; display: grid; grid-template-columns: var(--date-column-width) repeat(var(--event-column-count), minmax(var(--event-column-min), 1fr)); min-width: calc(var(--date-column-width) + var(--event-column-count) * var(--event-column-min)); padding-bottom: calc(50vh + 100px); }
.timeline-list-content.is-event-table-mode { overflow: hidden; }
.event-table-scroll { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: auto; }
.event-table-scroll .event-table { width: 100%; min-width: calc(var(--date-column-width) + var(--event-column-count) * var(--event-column-min)); }
.event-table-integrated { --event-column-min: 190px; }
.event-table-header { display: contents; }
.event-date-header, .event-timeline-header { position: sticky; z-index: 6; top: 0; min-width: 0; min-height: 34px; padding: 7px 6px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-strong); background: var(--panel-background); font-size: .72rem; font-weight: 700; }
.event-date-header { left: 0; z-index: 9; }
.event-year-context { color: var(--text-color); }
.event-timeline-header { overflow: visible; background: color-mix(in srgb, rgb(var(--timeline-rgb, 71 85 105)) 8%, var(--panel-background)); color: rgb(var(--timeline-rgb)); cursor: grab; text-overflow: ellipsis; white-space: nowrap; }
.event-table-row { display: contents; }
.event-date-cell { position: sticky; z-index: 5; left: 0; padding: 8px 6px; border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-color); background: var(--panel-background); color: var(--muted-color); font-size: .72rem; font-weight: 700; white-space: pre-line; }
.event-table-cell { display: grid; min-width: 0; align-content: start; gap: 4px; min-height: 44px; padding: 5px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); background: var(--placeholder-background); }
.event-table-event { display: -webkit-box; overflow: hidden; min-width: 0; padding: 3px 4px 3px 8px; border: 0; border-left: 3px solid rgb(var(--timeline-rgb)); border-radius: 3px; background: transparent; color: var(--text-color); font: inherit; font-size: .76rem; line-height: 1.3; text-align: left; cursor: pointer; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.event-table-event:hover, .event-table-event:focus, .event-table-event.is-selected { background: rgb(var(--timeline-rgb) / .14); outline: 1px solid var(--accent-color); outline-offset: 1px; }

.high-contrast {
    --page-background: #ffffff;
    --panel-background: #ffffff;
    --placeholder-background: #f1f5f9;
    --text-color: #020617;
    --muted-color: #334155;
    --border-color: #475569;
    --border-strong: #0f172a;
    --accent-color: #0037b3;
}
.high-contrast .panel, .high-contrast .menu-bar, .high-contrast .event-popup, .high-contrast .cluster-member-popup { border-width: 2px; box-shadow: 0 0 0 1px rgb(15 23 42 / .16); }
.high-contrast button, .high-contrast select, .high-contrast input { border-color: var(--border-strong); }
.high-contrast .display-mode-button, .high-contrast .list-mode-tab[aria-pressed="true"], .high-contrast #high-contrast-toggle[aria-pressed="true"] { border-width: 2px; }
.high-contrast .overview-viewport-indicator { border-width: 2px; background: rgb(0 55 179 / .3); }
.high-contrast .approximate-point-shape, .high-contrast .range-band-start-fade, .high-contrast .range-band-end-fade { filter: contrast(1.2); }
.high-contrast .range-band-possible-envelope { outline: 1px dashed currentColor; }

.timeline-surface.is-panning {
    cursor: grabbing;
}

.time-axis-controls {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.time-axis-control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: var(--muted-color);
    font-size: 0.78rem;
}

.time-axis-button,
.time-axis-year-input {
    min-height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    color: var(--text-color);
    font: inherit;
}

.time-axis-button {
    padding: 4px 9px;
    cursor: pointer;
}

.time-axis-year-input {
    width: 76px;
    padding: 4px 7px;
}

.viewport-range-label {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.78rem;
}

.timeline-event-layer {
    position: absolute;
    inset: 0;
    z-index: var(--layer-base);
}

.date-display-area {
    position: relative;
    z-index: 2;
    flex: 0 0 var(--date-display-height);
    height: var(--date-display-height);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    user-select: none;
    border-bottom: 1px solid var(--border-strong);
    background: var(--panel-background);
}

.timeline-date-grid { position: absolute; z-index: 1; inset: 0; pointer-events: none; overflow: hidden; }
.timeline-date-line { position: absolute; top: var(--date-display-height); bottom: 0; border-left: 1px solid rgb(100 116 139 / .2); }
.timeline-date-line.context { top: 0; border-left: 2px solid rgb(71 85 105 / .42); }
.timeline-date-line.detail { top: 38px; border-left: 1px solid rgb(71 85 105 / .34); }
.timeline-date-line.minor { top: var(--date-display-height); border-left-color: rgb(100 116 139 / .18); }
.date-display-line-layer { position: absolute; z-index: 1; inset: 0; pointer-events: none; overflow: hidden; }
.date-display-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgb(71 85 105 / .34); }
.date-display-line.context { border-left-width: 2px; border-left-color: rgb(71 85 105 / .42); }
.date-display-line.detail { top: 38px; bottom: 0; }
.timeline-surface.date-display-bottom .timeline-date-line.context { bottom: 0; top: 0; }
.timeline-surface.date-display-bottom .timeline-date-line.detail { top: 0; bottom: 38px; }
.timeline-surface.date-display-bottom .timeline-date-line.minor { top: 0; bottom: var(--date-display-height); }
.timeline-surface.date-display-bottom .date-display-line.detail { top: 0; bottom: 38px; }

.date-display-context, .date-display-detail { position: relative; z-index: 2; height: 38px; overflow: hidden; }
.date-display-context { border-bottom: 1px solid var(--border-color); }
.date-position-button { position: absolute; z-index: 2; top: 4px; left: 4px; min-width: 26px; min-height: 26px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; pointer-events: auto; }
.date-display-tick { position: absolute; z-index: 1; display: block; opacity: 1; visibility: visible; white-space: nowrap; transform: translateX(3px); }
.date-display-context .date-display-tick:first-of-type { margin-left: 32px; }
.date-display-tick.context { top: 6px; color: var(--text-color); font-size: 1.15rem; font-weight: 700; transform: translateX(-50%); }
.date-display-tick.detail { top: 7px; color: var(--muted-color); font-size: 1.1rem; }
.timeline-surface.date-display-bottom { flex-direction: column-reverse; }
.timeline-surface.date-display-bottom .date-display-area { border-top: 1px solid var(--border-strong); border-bottom: 0; }
.timeline-surface.date-display-bottom .date-display-context { border-top: 0; border-bottom: 0; }
.timeline-surface.date-display-bottom .date-display-detail { border-top: 0; border-bottom: 1px solid var(--border-color); }
.timeline-surface.date-display-bottom .timeline-debug-horizontal-guide { display: none; }
.timeline-surface [data-event-id], .timeline-surface .timeline-event-layer, .timeline-surface .timeline-debug-grid {
    -webkit-user-drag: none;
    user-drag: none;
}

.temporal-debug-guides, .approximate-debug-bounds { display: none !important; }

.cluster-event {
    position: absolute;
    top: calc(var(--event-lane-center) - 19px);
    z-index: 6;
    min-width: 14px;
    height: 46px;
    color: rgb(var(--timeline-rgb, 71 85 105));
    cursor: grab;
    user-select: none;
}
.cluster-event.cluster-integrated { color: #475569; }
.cluster-glyph { position: absolute; top: 10px; left: 0; display: block; min-width: 18px; height: 18px; }
.cluster-point-only .cluster-glyph,
.cluster-mixed .cluster-glyph { border: 3px double currentColor; border-radius: 50%; background: var(--panel-background); }
.cluster-mixed .cluster-glyph { z-index: 1; left: 50%; transform: translateX(-50%); }
.cluster-member-popup {
    position: absolute;
    top: 32px;
    left: 0;
    z-index: 20;
    display: none;
    width: min(300px, 52vw);
    max-height: 170px;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    box-shadow: 0 8px 16px rgb(15 23 42 / 0.18);
    color: var(--text-color);
    cursor: default;
}
.cluster-event:hover .cluster-member-popup,
.cluster-event:focus-within .cluster-member-popup { display: block; }
.cluster-popup-align-end { right: 0; left: auto; }
.cluster-popup-heading, .cluster-member-row { margin: 0 0 var(--cluster-member-row-gap, 5px); font-size: 0.76rem; }
.cluster-popup-heading { color: var(--muted-color); font-weight: 700; }
.cluster-member-scroll-region { --cluster-member-row-height: calc(1em + 6px); --cluster-member-row-gap: 5px; max-height: calc(var(--cluster-member-row-height) * 5 + var(--cluster-member-row-gap) * 4); overflow-y: auto; overscroll-behavior: contain; }
.cluster-member-row { display: flex; align-items: center; gap: 6px; min-height: var(--cluster-member-row-height); box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cluster-member-row { padding: 3px 4px; border-radius: 3px; cursor: pointer; }
.cluster-member-row:hover, .cluster-member-row:focus-visible { background: rgb(37 99 235 / 0.1); outline: 1px solid rgb(37 99 235 / 0.4); }
.cluster-member-icon { display: inline-grid; flex: 0 0 auto; place-items: center; min-width: 1em; font-size: .9rem; font-weight: 700; line-height: 1; }

.event-details-scroll-body { container-type: inline-size; }
.event-details-image,
.event-details-location-image {
    display: grid;
    gap: .2rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}
.event-details-image img,
.event-details-location-image img {
    display: block;
    box-sizing: border-box;
    width: auto;
    height: auto;
    max-width: min(300px, 100%);
    max-height: 300px;
    border-radius: 4px;
    background: var(--placeholder-background);
    object-fit: contain;
}
.event-details-image figcaption, .event-details-location-image figcaption, .event-details-location-label { margin: 0; color: var(--muted-color); font-size: 0.8rem; text-align: center; }
.event-details-map { display: block; width: 100%; max-width: 100%; min-height: 220px; margin: 0; border: 0; }
.event-details-map-config { margin: 0; color: var(--muted-color); font-size: .8rem; }
.event-details-separator { flex: 0 0 auto; height: 1px; background: var(--border-color); }
.event-details-sources article { display: grid; gap: .35rem; overflow-wrap: anywhere; margin: 0; }
.event-details-sources a { overflow-wrap: anywhere; }

.timeline-surface { display: flex; flex-direction: column; }
.timeline-event-region { position: relative; z-index: 1; display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.timeline-lane, .integrated-timeline { flex: 1 1 0; min-height: 0; overflow: hidden; }
.timeline-lane { position: relative; }
.integrated-timeline { position: relative; }
.timeline-lane-header, .integrated-timeline-label, .point-event-title, .uncertain-point-title,
.range-band-title, .approximate-debug-label, .temporal-debug-row-label { user-select: none; }
.event-timeline-header { display: flex; align-items: center; gap: 4px; }
.event-timeline-header-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-timeline-remove { display: inline-grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; margin-left: auto; padding: 5px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--panel-background); color: var(--text-color); font: inherit; font-size: .7rem; cursor: pointer; }

.point-event {
    position: absolute;
    top: var(--event-lane-center);
    width: 0;
    height: 0;
}

.point-event-marker {
    position: absolute;
    top: -7px;
    left: -7px;
}

.point-event-title, .uncertain-point-title, .range-band-title {
    box-sizing: border-box;
    z-index: 3;
    padding: 2px 4px;
    border: 1px solid rgb(var(--timeline-rgb) / .72);
    border-radius: 3px;
    background: rgb(var(--timeline-rgb) / .14);
    color: var(--text-color);
}

.point-event-title {
    position: absolute;
    top: -0.75rem;
    left: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    white-space: nowrap;
}

.point-event-end .point-event-title {
    right: 12px;
    left: auto;
    transform: translateX(-100%);
}

.point-event-marker {
    width: 14px;
    height: 14px;
    border: 2px solid rgb(var(--timeline-rgb) / 0.95);
    border-radius: 50%;
    background: rgb(var(--timeline-rgb) / 0.62);
}

.timeline-debug-grid {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
}

.timeline-debug-month-line {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    border-left: 2px solid rgba(100, 116, 139, 0.34);
}

.timeline-debug-month-label {
    position: absolute;
    top: 4px;
    left: 4px;
    color: rgba(71, 85, 105, 0.72);
    font-size: 0.7rem;
    white-space: nowrap;
}

.timeline-debug-horizontal-guide {
    position: absolute;
    right: 0;
    left: 0;
    border-top: 1px solid rgba(100, 116, 139, 0.28);
    color: rgba(71, 85, 105, 0.62);
    font-size: 0.65rem;
    line-height: 1;
    text-align: right;
}

.timeline-debug-day-line {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    border-left: 1px solid rgba(148, 163, 184, 0.15);
}

.timeline-debug-range-guide {
    top: 25px;
}

.timeline-debug-point-guide {
    top: 33px;
}

.range-band-event {
    position: absolute;
    top: calc(var(--event-lane-center) - 22px);
    height: 78px;
    z-index: 1;
}

.range-band-start-shoulder,
.range-band-start-fade,
.range-band-start-precision,
.range-band-core,
.range-band-end-precision,
.range-band-end-fade,
.range-band-end-shoulder,
.range-band-possible-envelope {
    position: absolute;
    top: 0;
    height: 18px;
}

.range-band-possible-envelope {
    right: 0;
    left: 0;
}

.range-band-start-fade {
    background: linear-gradient(
        to right,
        rgb(var(--timeline-rgb) / 0) 0%,
        rgb(var(--timeline-rgb) / 0.72) 100%
    );
}

.range-band-start-shoulder {
    background: rgb(var(--timeline-rgb) / 0.72);
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.range-band-core {
    background: rgb(var(--timeline-rgb) / 0.72);
}

.range-band-start-precision,
.range-band-end-precision {
    background: rgb(var(--timeline-rgb) / 0.72);
}

.range-band-end-fade {
    background: linear-gradient(
        to right,
        rgb(var(--timeline-rgb) / 0.72) 0%,
        rgb(var(--timeline-rgb) / 0) 100%
    );
}

.range-band-end-shoulder {
    background: rgb(var(--timeline-rgb) / 0.72);
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.range-band-title {
    position: absolute;
    top: 37px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-color);
    font-size: 0.9rem;
    white-space: nowrap;
}

.range-band-title-start .range-band-title {
    left: 0;
    transform: none;
}

.range-band-title-end .range-band-title {
    right: 0;
    left: auto;
    transform: translateX(-100%);
}

.uncertain-point-event {
    position: absolute;
    top: calc(var(--event-lane-center) - 19px);
    height: 58px;
}

.uncertain-point-shape {
    position: absolute;
    top: 10px;
    right: 0;
    left: 0;
    height: 18px;
    background: linear-gradient(
        to right,
        rgb(var(--timeline-rgb) / 0) 0%,
        rgb(var(--timeline-rgb) / 0.8) var(--left-fade-end),
        rgb(var(--timeline-rgb) / 0.8) var(--right-fade-start),
        rgb(var(--timeline-rgb) / 0) 100%
    );
    clip-path: polygon(0 50%, 11% 0, 89% 0, 100% 50%, 89% 100%, 11% 100%);
}

.uncertain-point-marker {
    position: absolute;
    top: 12px;
    transform: translateX(-50%);
}

.uncertain-point-title {
    position: absolute;
    top: 33px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-color);
    font-size: 0.9rem;
    white-space: nowrap;
}

.event-title-leader-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.event-title-leader-layer line {
    stroke: rgb(var(--timeline-rgb) / 0.62);
    stroke-width: 1;
}

.uncertain-point-title-start .uncertain-point-title {
    left: 0;
    transform: none;
}

.uncertain-point-title-end .uncertain-point-title {
    right: 0;
    left: auto;
    transform: translateX(-100%);
}

.uncertain-point-zero-width .uncertain-point-shape {
    left: -0.5px;
    width: 1px;
    clip-path: none;
    border-radius: 50%;
}

.approximate-debug-bounds {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
}

.approximate-debug-earliest,
.approximate-debug-center,
.approximate-debug-latest {
    position: absolute;
    top: 42%;
    height: 34%;
    border-left: 1px dashed rgba(100, 116, 139, 0.5);
}

.approximate-debug-center {
    border-left-color: rgba(100, 116, 139, 0.24);
}

.approximate-debug-label {
    position: absolute;
    top: 100%;
    left: 3px;
    color: rgba(71, 85, 105, 0.62);
    font-size: 0.62rem;
    white-space: nowrap;
}

.temporal-debug-guides {
    position: absolute;
    z-index: 3;
    inset: 0;
    pointer-events: none;
}

.temporal-debug-guide {
    position: absolute;
    top: var(--debug-guide-top);
    height: 18%;
    border-left: 1px dashed rgba(100, 116, 139, 0.58);
}

.temporal-debug-connector {
    position: absolute;
    top: var(--debug-guide-top);
    height: 0;
    border-top: 1px dotted rgba(100, 116, 139, 0.38);
    transform: translateY(6px);
}

.temporal-debug-row-label {
    position: absolute;
    top: calc(var(--debug-guide-top) - 0.95rem);
    left: 5px;
    color: rgba(51, 65, 85, 0.78);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.temporal-debug-center {
    border-left-color: rgb(var(--timeline-rgb, 37 99 235) / 0.58);
}

.temporal-debug-hard {
    border-left-style: solid;
    border-left-color: rgba(15, 23, 42, 0.68);
}


.time-axis,
.overview-map {
    min-height: 112px;
}

@media (max-width: 760px), (max-height: 620px) {
    html, body { height: auto; }
    .app-shell { height: auto; min-height: 100vh; overflow: visible; }
    .main-area { min-height: 620px; overflow: visible; }
    .menu-bar { flex-wrap: wrap; }
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.axis-placeholder,
.overview-placeholder {
    position: relative;
    height: 42px;
    margin-top: 14px;
    border: 1px dashed var(--border-strong);
    background: var(--placeholder-background);
}

.axis-placeholder span,
.overview-placeholder span {
    position: absolute;
    top: 50%;
    right: 12px;
    left: 12px;
    border-top: 2px solid var(--border-strong);
}

.overview-placeholder span {
    border-top-style: dotted;
}

.placeholder-note,
.placeholder-label {
    color: var(--muted-color);
    font-size: 0.85rem;
}

.placeholder-note {
    margin-bottom: 0;
}

.placeholder-label {
    margin: 0;
    padding: 8px;
    text-align: center;
}

@media (max-width: 900px) {
    .main-area { --timeline-list-width: 220px; }
    .details-panel { width: clamp(190px, 32vw, 280px); }
}

@media (max-width: 600px) {
    .app-shell {
        padding: 8px;
    }

    .menu-bar,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-area { --timeline-list-width: 190px; }
    .details-panel { width: min(82vw, 320px); }
}


.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ui-icon { display: block; width: 16px; height: 16px; color: currentColor; }
.icon-button { position: relative; display: inline-grid; place-items: center; box-sizing: border-box; width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 5px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: #0f0f0f; cursor: pointer; }
.icon-button[data-tooltip]::after { position: absolute; z-index: 120; top: calc(100% + 6px); right: 0; width: max-content; max-width: 16rem; padding: 4px 6px; border-radius: 4px; background: #0f0f0f; color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease; }
.icon-button[data-tooltip]:hover::after, .icon-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translateY(0); transition-delay: .5s; }
.date-position-button[data-tooltip] { position: absolute; }
.date-position-button[data-tooltip]::after { position: absolute; z-index: 120; top: calc(100% + 6px); left: 50%; width: max-content; padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity .12s ease, transform .12s ease; }
.date-position-button[data-tooltip]:hover::after, .date-position-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .5s; }
.icon-button:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.color-tooltip { padding: 4px; cursor: pointer; }
.color-tooltip .timeline-color-input { width: 20px; height: 20px; padding: 0; border: 0; cursor: pointer; }
.timeline-delete-button:hover, .timeline-delete-button:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); }
.timeline-delete-button:hover .ui-icon, .timeline-delete-button:focus-visible .ui-icon { color: var(--danger-color); }
.search-header { grid-template-columns: max-content minmax(0, 1fr); }
.search-input-wrap { position: relative; display: block; min-width: 0; }
.search-input-wrap .search-input, .search-input-wrap .search-tag-input { box-sizing: border-box; width: 100%; max-width: none; }
.search-result-item { position: relative; }
.search-preview { position: fixed; z-index: 60; width: min(320px, calc(100vw - 16px)); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: 0 10px 22px rgb(15 23 42 / .22); pointer-events: none; }
.search-preview-tags { white-space: normal !important; }
.search-preview-tags { padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.search-pager { display: flex; align-items: center; gap: 3px; margin-top: 3px; font-size: .72rem; }
.search-pager button { min-width: 24px; padding: 1px 4px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--panel-background); color: inherit; cursor: pointer; }
.search-pager button:disabled { opacity: .42; cursor: default; }
.list-mode-segmented { flex: 0 0 auto; }
.timeline-set-button { padding: 4px 7px; background: var(--panel-background); color: var(--text-color); font: inherit; font-size: .78rem; }
.timeline-set-button:hover, .timeline-set-button:focus-visible, .timeline-set-button[aria-expanded="true"] { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); outline: none; }
.list-mode-segmented span { min-width: 2.55em; padding: 2px 5px; font: inherit; font-size: .78rem; white-space: nowrap; }
.timeline-list-header { justify-content: flex-start; }
.timeline-list-item { padding: 6px 8px; cursor: grab; }
.timeline-list-item:active { cursor: grabbing; }
.timeline-list-item-actions button { cursor: pointer; }
.timeline-list-item-actions { grid-column: auto; }
.timeline-list-item-meta { grid-column: 1 / 2; }

.timeline-list-controls { justify-content: flex-start; min-height: 30px; }
.timeline-add-select, .list-mode-segmented, .list-mode-tab { box-sizing: border-box; min-height: 30px; white-space: nowrap; }
.list-mode-segmented { writing-mode: horizontal-tb; white-space: nowrap; }
.list-mode-tab { flex: 0 0 auto; min-width: 68px; padding-inline: 5px; } .list-mode-tab:disabled { opacity: .42; cursor: default; }

.search-target { min-height: 26px; }
.list-mode-tab { min-width: 56px; padding-inline: 3px; }

.event-details-date.is-uncertain { position: relative; cursor: pointer; padding-right: 1.25em; border-radius: 3px; text-decoration: none; }
.event-details-date.is-uncertain::after { position: absolute; top: 50%; right: .15em; color: var(--muted-color); content: "▼"; font-size: .7em; line-height: 1; transform: translateY(-50%); }
.event-details-date.is-uncertain[aria-expanded="true"]::after { content: "▲"; }
.event-details-date.is-uncertain:hover { background: transparent; color: var(--accent-color); outline: none; border-color: transparent; }
.event-details-date.is-uncertain:focus-visible { background: transparent; color: var(--accent-color); outline: 1px solid color-mix(in srgb, var(--accent-color) 55%, transparent); outline-offset: 1px; }
.event-details-date.is-uncertain:hover::after, .event-details-date.is-uncertain:focus-visible::after { color: var(--accent-color); }
.event-details-date.is-uncertain[data-tooltip]::before { position: absolute; z-index: var(--layer-popup-event); top: calc(100% + 6px); right: 0; width: max-content; max-width: min(16rem, calc(100% - 8px)); padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease; }
.event-details-date.is-uncertain[data-tooltip]:hover::before, .event-details-date.is-uncertain[data-tooltip]:focus-visible::before { opacity: 1; transform: translateY(0); transition-delay: .5s; }
.event-details-uncertainty { display: grid; gap: 2px; margin: -4px 0 0; color: var(--text-color); font-size: .82rem; }
.event-details-uncertainty[hidden] { display: none; }
.event-details-uncertainty-row { display: grid; grid-template-columns: 3em minmax(0, 1fr); column-gap: .1em; }
.event-details-uncertainty-label { white-space: pre; }
.event-details-date-block { display: grid; gap: 0; margin: 0; }
.event-details-date { margin: 0; white-space: pre-line; color: var(--text-color); font-size: 0.82rem; line-height: 1.5; }
.event-details-duration { margin: 0; color: var(--text-color); font-size: 0.82rem; line-height: 1.5; font-weight: 400; }

/* Current UI refinement: shared interactive states and resilient narrow-list controls. */
.search-target[aria-pressed="true"] { border: 1px solid var(--accent-color); border-radius: 3px; background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); font-weight: 700; }
.search-tag-input { flex: 0 1 auto; width: 6.5em; min-width: 6.5em; max-width: 6.5em; }
.search-tag-input { min-width: 6.5em; width: 6.5em; max-width: 6.5em; }
.search-panel { position: absolute; }
.search-tag-candidate-region { position: absolute; z-index: 90; }
.search-tag-candidate-region .search-candidates { margin-top: 0; max-height: 170px; box-shadow: 0 8px 18px rgb(15 23 42 / .22); }
.search-tag-candidate-region .search-candidate { max-height: none; }
.search-result-row:hover, .search-result-row:focus-visible { background: color-mix(in srgb, var(--accent-color) 8%, var(--panel-background)); outline: 1px solid var(--accent-color); }
.search-result-columns { position: sticky; top: 0; z-index: 2; background: var(--panel-background); }
.timeline-list-item { grid-template-columns: 24px minmax(0, 1fr); align-items: start; }
.timeline-list-item { position: relative; }
.timeline-drag-handle { position: absolute; z-index: 2; top: 50%; left: -8px; grid-column: auto; grid-row: auto; width: 16px; text-align: center; transform: translateY(-50%); }
.timeline-list-item-title { grid-column: 2; white-space: normal; overflow-wrap: anywhere; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.timeline-list-item-title:hover, .timeline-list-item-title:focus-visible { color: inherit; background: color-mix(in srgb, var(--accent-color) 8%, transparent); text-decoration: none; outline: none; cursor: default; }
.timeline-list-item-actions { display: flex; flex-wrap: nowrap; flex-shrink: 0; white-space: nowrap; }
.timeline-list-item-actions button, .timeline-color-input { flex: 0 0 auto; min-width: max-content; }
.color-tooltip:hover, .color-tooltip:focus-within { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); }
.event-timeline-remove.timeline-delete-button:hover, .event-timeline-remove.timeline-delete-button:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: inherit; }
.event-timeline-remove.timeline-delete-button:hover .ui-icon, .event-timeline-remove.timeline-delete-button:focus-visible .ui-icon { color: var(--danger-color); }
.timeline-list-item-meta { grid-column: 2; }
.timeline-list-item-count { align-self: center; margin-right: 2px; color: var(--muted-color); font-size: .72rem; white-space: nowrap; }
.timeline-list-item-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0; }
.timeline-card-tag { display: inline-block; padding: 2px 5px; border: 1px solid var(--border-color); border-radius: 999px; white-space: nowrap; font-size: .72rem; }
.timeline-card-genre, .search-genre-chip { border-radius: 3px; }
.search-genre-candidate { font-weight: 700; }
.timeline-list-item-footer { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; margin-top: 5px; }
.timeline-list-item-actions { display: flex; gap: 3px; justify-content: end; }
.timeline-card-config { position: relative; display: inline-flex; }
.timeline-config-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; overflow: visible; border-color: var(--border-strong); line-height: 1; text-align: center; }
.timeline-symbol-glyph { display: block; font-size: 1.2rem; line-height: 1; transform-origin: center; pointer-events: none; }
.timeline-symbol-glyph.is-basic-symbol { transform: scale(1.4); }
.timeline-config-button .timeline-symbol-glyph.is-basic-symbol { transform: scale(.9333); }
.timeline-config-button:hover, .timeline-config-button:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }
.timeline-card-config-panel { position: fixed; z-index: var(--layer-popup-search); visibility: hidden; display: grid; grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(6, 28px); gap: 3px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); box-shadow: 0 6px 14px rgb(15 23 42 / .2); }
.timeline-color-palette { grid-column: 1 / 3; grid-row: 1 / 5; display: grid; grid-template-columns: repeat(2, 30px); grid-template-rows: repeat(4, 28px); gap: 3px; }
.timeline-color-choice { width: 30px; height: 28px; border: 2px solid var(--panel-background); border-radius: 3px; cursor: pointer; }
.timeline-color-choice.is-selected { outline: 2px solid var(--accent-color); outline-offset: 1px; }
.timeline-palette-launch { position: relative; display: grid; place-items: center; grid-column: 1 / 3; grid-row: 5 / 7; place-self: center; width: 48px; height: 48px; padding: 0; overflow: hidden; border: 1px solid var(--border-color); border-radius: 50%; background: var(--panel-background); color: var(--text-color); cursor: pointer; }
.timeline-palette-launch::after { grid-area: 1 / 1; display: block; width: 24px; height: 24px; margin: 0; border: 1px solid rgb(15 23 42 / .42); border-radius: 2px; background: var(--palette-color, transparent); content: ""; pointer-events: none; }
.timeline-palette-native-input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.timeline-palette-launch:has(.timeline-palette-native-input:focus-visible) { border-color: var(--accent-color); outline: 2px solid var(--accent-color); outline-offset: 1px; }
.timeline-palette-launch.is-selected, .timeline-palette-launch:hover { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 14%, var(--panel-background)); color: var(--accent-color); }
.timeline-icon-choice-list { grid-column: 3; grid-row: 1 / 7; display: grid; grid-template-rows: repeat(6, 28px); gap: 3px; }
.timeline-icon-choice { display: grid; place-items: center; width: 30px; height: 28px; padding: 0; overflow: hidden; border: 1px solid var(--border-color); border-radius: 3px; background: var(--panel-background); color: var(--text-color); line-height: 1; cursor: pointer; }
.timeline-icon-choice.is-selected, .timeline-icon-choice:hover { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 14%, var(--panel-background)); color: var(--accent-color); }
.timeline-list-item-count { margin: 0; }
.event-year-context { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.event-mode-toggle { min-width: 26px; padding: 0 3px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--muted-color); font: 700 .72rem/1 monospace; letter-spacing: -1px; cursor: pointer; }
.event-mode-toggle:hover, .event-mode-toggle:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); outline: none; }
.event-year-label { display: block; }

.timeline-summary-popup { position: fixed; z-index: var(--layer-popup-event); box-sizing: border-box; width: min(360px, calc(100vw - 16px)); max-height: min(70vh, 520px); overflow: auto; padding: 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-background); box-shadow: 0 8px 24px rgb(15 23 42 / .2); opacity:1; transition:opacity .2s ease; }
.timeline-summary-popup.is-hiding { opacity:0; }
.timeline-summary-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.timeline-summary-title { min-width: 0; overflow-wrap: anywhere; }
.timeline-summary-count { flex: 0 0 auto; color: var(--muted-color); font-size: .78rem; font-weight: 400; white-space: nowrap; }
.timeline-summary-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.timeline-summary-date, .timeline-summary-memo, .timeline-summary-events p { margin: 7px 0 0; overflow-wrap: anywhere; }
.timeline-summary-memo { white-space: pre-wrap; }
.timeline-summary-events p { font-size: .85rem; }
.timeline-summary-separator { height: 0; margin: 8px 0 0; border: 0; border-top: 1px solid var(--border-color); }
.event-mode-toggle { width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0; font-family: serif; font-size: 1rem; line-height: 1; }
.timeline-reset-button { min-height: 30px; padding: 4px; writing-mode: horizontal-tb; white-space: nowrap; }
.timeline-add-select { min-height: 36px; padding: 6px 10px; font-size: 1rem; font-weight: 800; }
.timeline-list-header { display: block; }
.timeline-list-controls { display: block; width: 100%; }
.viewer-list-tabs { display: flex; width: calc(100% + 28px); margin: -14px -14px 0; border-radius: 7px 7px 0 0; overflow: hidden; }
.viewer-list-tabs::after { flex: 1 1 auto; min-width: 0; content: ""; }
.viewer-list-tabs button { flex: 0 1 135px; min-width: 0; min-height: 34px; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; background: color-mix(in srgb, var(--panel-background) 88%, var(--muted-color)); color: var(--muted-color); font: 700 .84rem/1 inherit; cursor: pointer; }
.viewer-list-tabs button + button { border-left: 1px solid var(--border-color); }
.viewer-list-tabs button[aria-pressed="true"] { position: relative; z-index: 1; border-bottom-color: transparent; background: var(--panel-background); color: var(--text-color); }
.viewer-list-tabs.is-recommendations-active::after { border-bottom: 1px solid var(--border-color); background: color-mix(in srgb, var(--panel-background) 88%, var(--muted-color)); }
.viewer-list-tabs.is-timelines-active::after { border-bottom: 1px solid transparent; background: var(--panel-background); }
.timeline-list-controls > .timeline-add-select, .timeline-list-controls > .list-mode-segmented, .timeline-list-controls > .timeline-coloring-button, .timeline-list-controls > .timeline-reset-button { margin-top: 8px; }
.timeline-management-toolbar { position: relative; z-index: 0; display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 8px; flex-wrap: nowrap; }
.timeline-management-toolbar .timeline-add-select { flex: 0 0 auto; width: auto; min-width: max-content; min-height: 30px; padding: 4px 9px; }
.timeline-management-toolbar .timeline-add-select { background: var(--accent-color); border-color: var(--accent-color); color: #fff; font-weight: 700; }
.timeline-management-toolbar .timeline-add-select:hover:not(:disabled), .timeline-management-toolbar .timeline-add-select:focus-visible:not(:disabled) { background: color-mix(in srgb, var(--accent-color) 88%, #000); border-color: color-mix(in srgb, var(--accent-color) 88%, #000); }
.recommendation-controls { position: relative; display: grid; gap: 7px; padding: 9px 0 8px; border-bottom: 1px solid var(--border-color); }
.recommendation-word-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px 30px; gap: 4px; }
.recommendation-word-row input, .recommendation-tags input { min-width: 0; min-height: 30px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; }
.recommendation-random { display: grid; place-items: center; padding: 0; font-size: 1rem; }
.recommendation-random .ui-icon { display: none; }
.recommendation-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.recommendation-tags input { flex: 0 0 6.5em; width: 6.5em; min-width: 6.5em; max-width: 6.5em; }
.recommendation-tag-candidates { position: absolute; z-index: var(--layer-popup-search); top: auto; left: auto; width: min(12rem, 100%); box-shadow: 0 8px 18px rgb(15 23 42 / .22); }
.recommendation-random-panel { position: fixed; z-index: var(--layer-popup-search); top: 0; left: 0; display: grid; gap: 8px; width: min(300px, calc(100vw - 16px)); padding: 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--placeholder-background); box-shadow: 0 8px 18px rgb(15 23 42 / .22); font-size: .8rem; }
.recommendation-random-panel::before { content: "ランダム設定"; font-weight: 700; }
.recommendation-random-panel > div { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.recommendation-random-panel > div > span { flex-basis: 100%; font-weight: 700; }
.recommendation-random-panel > div > span { font-weight: 400; }
.recommendation-random-count-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 5px; }
.recommendation-random-count-row > span { flex: 0 0 auto; }
.recommendation-random-panel > div:first-of-type { flex-wrap: nowrap; }
.recommendation-random-panel > div:first-of-type > span { flex: 0 0 auto; }
.recommendation-random-panel > div:first-of-type > div { display: inline-flex; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 5px; }
.recommendation-random-panel > div:first-of-type > div button { border: 0; border-radius: 3px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }
.recommendation-random-panel > div button:first-of-type, .recommendation-random-panel > div button:nth-of-type(2) { width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.recommendation-random-panel output { min-width: 2em; padding: 3px 6px; border: 1px solid var(--border-color); border-radius: 999px; text-align: center; }
.recommendation-random-panel button[aria-pressed="true"] { border-color: var(--accent-color); color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }
.recommendation-random-panel input[type="range"] { width: min(12rem, 60%); margin-left: 6px; vertical-align: middle; }
.recommendation-random-explanation { margin: 0; color: var(--muted-color); line-height: 1.45; white-space: nowrap; }
.recommendation-random-explanation br { display: none; }
.recommendation-status { margin: 0; color: var(--muted-color); font-size: .78rem; }
.recommendation-cards { display: grid; gap: 8px; }
.recommendation-card { position: relative; display: grid; gap: 6px; padding: 9px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--placeholder-background); }
.recommendation-card.is-active { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 7%, var(--panel-background)); }
.recommendation-card h3, .recommendation-card p { margin: 0; }
.recommendation-title { min-width: 0; overflow: visible; padding: 0; border: 0; background: transparent; color: var(--text-color); font: inherit; font-size: .9rem; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.recommendation-title:hover, .recommendation-title:focus-visible { color: var(--accent-color); outline: none; }
.recommendation-card .recommendation-memo { margin-top: 2px; padding-top: 6px; border-top: 1px solid var(--border-color); overflow-wrap: anywhere; white-space: pre-wrap; color: var(--muted-color); font-size: .8rem; }
.recommendation-date { color: var(--muted-color); font-size: .77rem; }
.recommendation-card-tags { display: flex; gap: 4px; min-width: 0; }
.recommendation-card-tags.is-compact { flex-wrap: nowrap; overflow: hidden; }
.recommendation-card-tags.is-expanded { flex-wrap: wrap; overflow: visible; }
.recommendation-card-tags .timeline-card-tag { flex: 0 0 auto; max-width: 100%; }
.recommendation-more { flex: 0 0 auto; color: var(--muted-color); font-size: .74rem; }
.recommendation-members { display: grid; gap: 2px; min-width: 0; }
.recommendation-members p { overflow: hidden; color: var(--muted-color); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.recommendation-member-title { display: block; min-width: 0; overflow: hidden; padding: 2px 3px; border-radius: 3px; color: var(--text-color); font: inherit; font-size: .84rem; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.recommendation-member-title:hover, .recommendation-member-title:focus-visible { background: color-mix(in srgb, var(--accent-color) 8%, transparent); outline: none; }
.recommendation-title[data-tooltip] { position: relative; overflow: visible; }
.recommendation-title[data-tooltip]::after, .recommendation-actions button[data-tooltip]::after { position: absolute; z-index: 120; top: calc(100% + 4px); left: 0; width: max-content; max-width: 16rem; padding: 4px 6px; border-radius: 4px; background: #0f0f0f; color: #fff; content: attr(data-tooltip); font-size: .72rem; font-weight: 400; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease; }
.recommendation-title[data-tooltip]:hover::after, .recommendation-title[data-tooltip]:focus-visible::after, .recommendation-actions button[data-tooltip]:hover::after, .recommendation-actions button[data-tooltip]:focus-visible::after { opacity: 1; transform: translateY(0); transition-delay: .5s; }
.recommendation-members .is-unavailable { text-decoration: line-through; }
.recommendation-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.recommendation-actions button { min-height: 30px; padding: 4px 8px; border-radius: 5px; font-size: .76rem; cursor: pointer; }
.recommendation-actions button:not(.ui-button--primary) { border: 1px solid var(--border-strong); background: var(--panel-background); color: var(--text-color); }
.recommendation-random { width: 34px; height: 34px; min-width: 34px; min-height: 34px; box-sizing: border-box; }
.recommendation-random, .recommendation-random-settings, .recommendation-actions button { transition: background-color .15s ease, border-color .15s ease; }
.recommendation-random:hover, .recommendation-random:focus-visible, .recommendation-random-settings:hover, .recommendation-random-settings:focus-visible, .recommendation-actions button:not(.ui-button--primary):hover, .recommendation-actions button:not(.ui-button--primary):focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); outline: none; }
.recommendation-random-die { display: inline-block; }
.recommendation-random.is-loading .recommendation-random-die { animation: recommendation-dice-spin .45s linear infinite; }
.recommendation-random:hover .recommendation-random-die, .recommendation-random:focus-visible .recommendation-random-die { animation: recommendation-dice-spin .1s ease-out 1; }
@keyframes recommendation-dice-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.recommendation-detail-toggle { margin-left: auto; }
.recommendation-active { position: absolute; top: 8px; right: 8px; padding: 2px 5px; border-radius: 999px; background: color-mix(in srgb, var(--accent-color) 16%, var(--panel-background)); color: var(--accent-color); font-size: .7rem; font-weight: 700; }
.timeline-coloring-button:hover, .timeline-coloring-button:focus-visible, .timeline-coloring-button.is-active { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }
.timeline-coloring-button:hover .ui-icon, .timeline-coloring-button:focus-visible .ui-icon, .timeline-coloring-button.is-active .ui-icon { color: var(--accent-color); }
.event-table-row:hover > .event-table-cell, .event-table-row:hover > .event-date-cell { background: color-mix(in srgb, var(--accent-color) 7%, var(--placeholder-background)) !important; }
.event-timeline-remove { background: transparent; }
.main-stage { isolation: isolate; }
.main-view, .timeline-surface, .timeline-lane, .integrated-timeline { overflow: hidden; }

/* Drawing Block v2: marker semantics, stable nameplates, and integrated axis. */
.drawing-point-event, .drawing-range-event, .cluster-event {
    --drawing-marker-fill: rgb(var(--timeline-rgb) / .68);
    --drawing-marker-stroke: rgb(var(--timeline-rgb) / .98);
    --drawing-uncertainty-fill: rgb(var(--timeline-rgb) / .76);
    --drawing-range-fill: rgb(var(--timeline-rgb) / .78);
    --drawing-cluster-outline: rgb(var(--timeline-rgb) / .95);
    --drawing-selected-halo: rgb(var(--timeline-rgb) / .35);
    --drawing-stem: rgb(var(--timeline-rgb) / .52);
}
.drawing-point-marker {
    background: var(--drawing-marker-fill);
    border-color: var(--drawing-marker-stroke);
}
.drawing-point-lens {
    background: linear-gradient(to right,
        rgb(var(--timeline-rgb) / 0) 0%,
        var(--drawing-uncertainty-fill) var(--left-fade-end),
        var(--drawing-uncertainty-fill) var(--right-fade-start),
        rgb(var(--timeline-rgb) / 0) 100%);
    height: 8px;
    border-radius: 999px;
    -webkit-mask-image: radial-gradient(ellipse 48% 78% at 50% 50%, #000 52%, transparent 100%);
    mask-image: radial-gradient(ellipse 48% 78% at 50% 50%, #000 52%, transparent 100%);
    z-index: 1;
    top: 15px;
}
.uncertain-point-event { overflow: visible; isolation: isolate; }
.uncertain-point-shape { z-index: 1; }
.uncertain-point-marker {
    z-index: 2;
    top: 12px;
    width: 14px;
    height: 14px;
    border-color: rgb(var(--timeline-rgb) / 1);
    background: rgb(var(--timeline-rgb) / .92);
}
.range-band-core { background: var(--drawing-range-fill); opacity: .92; }
.range-band-start-precision,
.range-band-end-precision {
    background: var(--drawing-range-fill);
    opacity: .92;
}
.range-band-event { top: var(--range-band-y); }
.range-exact-boundary { position: absolute; z-index: 4; top: 0; width: 5px; height: var(--range-visual-height, 18px); background: rgb(var(--timeline-rgb) / .9); pointer-events: none; }
.range-exact-boundary-start { left: 0; transform: translateX(-50%); }
.range-exact-boundary-end { right: 0; transform: translateX(50%); }
.range-title-inside { --range-visual-height: 28px; }
.range-title-inside .range-band-title {
    z-index: 5;
    overflow: hidden;
    max-width: calc(100% - 10px);
    height: 28px;
    padding: 4px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    line-height: 20px;
    text-overflow: ellipsis;
}
.range-title-inside .range-band-core, .range-title-inside .range-band-possible-envelope, .range-title-inside .range-band-start-precision, .range-title-inside .range-band-start-shoulder, .range-title-inside .range-band-start-fade, .range-title-inside .range-band-end-precision, .range-title-inside .range-band-end-fade, .range-title-inside .range-band-end-shoulder { top: 0; height: 28px; }
.range-title-full .range-band-title, .range-title-ellipsis-long .range-band-title, .range-title-ellipsis-short .range-band-title { z-index: 5; max-width: calc(100% - 10px); height: 28px; padding: 4px 8px; border: 0; border-radius: 0; background: transparent; color: #fff; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.point-event-title, .uncertain-point-title, .range-band-title, .integrated-point-media-group, .range-event-media-group {
    transition: left 150ms ease-out, top 150ms ease-out, transform 150ms ease-out;
    will-change: left, top;
}
.is-title-initial { transition: none !important; }
.is-title-interacting .point-event-title, .is-title-interacting .uncertain-point-title, .is-title-interacting .range-band-title, .is-title-interacting .integrated-point-media-group, .is-title-interacting .range-event-media-group, .is-title-interacting .cluster-title { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .point-event-title, .uncertain-point-title, .range-band-title { transition: none; }
}

.cluster-event { color: var(--drawing-cluster-outline); }
.cluster-point-only .cluster-glyph,
.cluster-mixed .cluster-glyph {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border: 2px solid currentColor;
    background: transparent;
}
.cluster-point-core { position: absolute; inset: 5px; border-radius: 50%; background: currentColor; }
.cluster-range-glyph {
    position: absolute;
    top: 8px;
    right: 0;
    left: 0;
    border: 2px solid currentColor;
    height: 48px;
    background: rgb(var(--timeline-rgb, 71 85 105) / .5);
}
.cluster-range-miniature { position: absolute; top: 12px; right: 7px; left: 7px; height: 40px; display: block; pointer-events: none; }
.cluster-range-miniature-line { position: absolute; top: var(--mini-track-y, 2px); height: 4px; background: currentColor; opacity: .76; }
.cluster-range-only, .cluster-mixed { height: 68px; top: var(--cluster-range-y, calc(var(--event-lane-center) - 34px)); }
.cluster-title-shell { position: absolute; z-index: 7; font-size: .9rem; }
.cluster-summary-expanded { display: none; gap: 2px; padding: 4px 6px; border: 1px solid rgb(var(--cluster-title-rgb) / .9); border-radius: 3px; background: rgb(var(--cluster-title-rgb) / .14); color: var(--text-color); white-space: nowrap; }
.cluster-summary-member { margin: 0; padding: 0; border: 0; background: transparent; }
.cluster-summary-compressed { display: block; padding: 2px 4px; border: 1px solid rgb(var(--cluster-title-rgb) / .95); border-radius: 3px; background: rgb(var(--cluster-title-rgb) / .80); color: #fff; white-space: nowrap; }
.cluster-event.cluster-expanded .cluster-summary-expanded { display: grid; }
.cluster-event.cluster-expanded .cluster-summary-compressed { display: none; }
.point-cluster-span-rail { position: absolute; z-index: 3; height: 2px; background: rgb(var(--timeline-rgb) / .48); pointer-events: none; }
.is-integrated-event-layer .point-cluster-span-rail { top: calc(var(--integrated-axis-y) - 1px); }

.integrated-timeline { --integrated-axis-y: 11.5px; }
.integrated-time-axis {
    position: absolute;
    z-index: 0;
    top: calc(var(--integrated-axis-y) - 1px);
    right: 0;
    left: 0;
    height: 3px;
    background: var(--border-strong);
    box-shadow: 0 1px 0 rgb(255 255 255 / .45);
    pointer-events: none;
}
.is-integrated-event-layer { z-index: 3; pointer-events: none; }
.is-integrated-event-layer [data-event-id],
.is-integrated-event-layer .cluster-event { pointer-events: auto; }
.is-integrated-event-layer .integrated-point-event,
.is-integrated-event-layer .uncertain-point-event,
.is-integrated-event-layer .cluster-event { z-index: auto; isolation: auto; }
.integrated-event-stem {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 2px;
    height: 0;
    background: rgb(var(--timeline-rgb) / .52);
    pointer-events: none;
}
.is-integrated-event-layer .point-event-title,
.is-integrated-event-layer .uncertain-point-title { z-index: 7; }
.integrated-point-axis-marker { z-index: 6; }
.integrated-point-media-group { position: absolute; z-index: 7; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.integrated-point-media-group .event-point-thumbnail { position: static; flex: 0 0 auto; transform: none; }
.integrated-point-media-group .point-event-title { position: static; flex: 0 0 auto; top: auto; right: auto; left: auto; transform: none; }
.integrated-cluster-media-group { position: absolute; z-index: 7; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.integrated-cluster-media-group .cluster-point-thumbnail { position: static; flex: 0 0 auto; inset: auto; transform: none; }
.integrated-cluster-media-group .cluster-title-shell { position: static; flex: 0 0 auto; inset: auto; transform: none; }
.range-event-media-group { position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.range-event-media-group .event-range-thumbnail { position: static; flex: 0 0 auto; top: auto; left: auto; transform: none; }
.range-event-media-group .range-band-title { position: static; flex: 0 0 auto; top: auto; right: auto; left: auto; transform: none; }
.is-integrated-event-layer .cluster-title { z-index: 7; }
.is-integrated-event-layer .point-event-marker,
.is-integrated-event-layer .uncertain-point-shape,
.is-integrated-event-layer .uncertain-point-marker,
.is-integrated-event-layer .cluster-glyph { z-index: 6; }
.is-integrated-event-layer .integrated-range-event,
.is-integrated-event-layer .cluster-range-only { z-index: 4; }
.integrated-range-event {
    z-index: 4;
    top: var(--range-band-y);
}
.timeline-surface.date-display-bottom .integrated-time-axis { top: calc(var(--integrated-axis-y) - 1px); }
.cluster-member-popup { z-index: var(--layer-popup-cluster); }
.cluster-member-popup.global-popup { position: fixed; z-index: var(--layer-popup-cluster); display: none; pointer-events: auto; }
.cluster-member-popup.global-popup.is-visible { display: block; }
.main-stage { isolation: isolate; }
.main-view, .timeline-surface, .timeline-lane, .integrated-timeline { overflow: hidden; }
.details-panel { position: absolute; z-index: var(--layer-panel-details); bottom: auto; max-height: 100%; }

/* Timeline Set is intentionally a small, movable functional panel. Final
   placement/card polish belongs to the later Viewer refinement phase. */
.timeline-set-panel { position: absolute; z-index: var(--layer-popup-search); top: 8px; right: 8px; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 620px); overflow: auto; padding: 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-background); box-shadow: 0 10px 22px rgb(15 23 42 / .18); }
.timeline-set-card { display: grid; gap: 5px; padding: 8px; border: 1px solid var(--border-color); border-radius: 5px; }
.timeline-set-card h3, .timeline-set-card p { margin: 0; }
.timeline-set-card button { justify-self: start; }
.timeline-set-unavailable { color: var(--muted-color); text-decoration: line-through; }

.set-url-copy-button:disabled {
    border-color: var(--border-color);
    background: var(--placeholder-background);
    color: var(--muted-color);
    opacity: .65;
    cursor: default;
}

.timeline-set-copy[data-tooltip] {
    position: relative;
    overflow: visible;
}

.timeline-set-copy[data-tooltip]::after {
    position: absolute;
    z-index: var(--layer-popup-event);
    right: auto;
    bottom: calc(100% + 4px);
    left: 0;
    width: max-content;
    max-width: 16rem;
    padding: 4px 6px;
    border-radius: 4px;
    background: var(--tooltip-background);
    color: #fff;
    content: attr(data-tooltip);
    font-size: .72rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity .12s ease, transform .12s ease;
}

.timeline-set-copy[data-tooltip]:hover::after,
.timeline-set-copy[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
    transition-delay: .5s;
}

/* UI-A Viewer foundation: visual hierarchy and explicit interactive states.
   These rules intentionally do not alter layout measurements or viewport mapping. */
.menu-bar {
    border-color: color-mix(in srgb, var(--border-color) 72%, var(--panel-background));
    box-shadow: 0 1px 2px rgb(15 23 42 / .05);
}

.toolbar-actions {
    align-items: center;
    padding-left: 8px;
    border-left: 1px solid color-mix(in srgb, var(--border-color) 52%, transparent);
}


.display-mode-button,
.timeline-add-select,
.list-mode-tab,
.timeline-visibility-button,
.timeline-action-button,
.time-axis-button,
.date-position-button,
.search-retry {
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.display-mode-button:hover:not(:disabled),
.timeline-add-select:hover:not(:disabled),
.list-mode-tab:hover:not(:disabled),
.timeline-visibility-button:hover:not(:disabled),
.timeline-action-button:hover:not(:disabled),
.time-axis-button:hover:not(:disabled),
.date-position-button:hover:not(:disabled),
.search-retry:hover:not(:disabled) {
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 7%, var(--panel-background));
}

button:focus-visible,
input:focus-visible,
.timeline-list-resizer:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-color) 48%, transparent);
    outline-offset: 2px;
}

.overview-map {
    border-radius: 6px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--placeholder-background) 68%, var(--panel-background)), var(--panel-background));
}

.overview-track {
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 17%, var(--panel-background));
}

.overview-viewport-indicator {
    z-index: var(--overview-viewport-z, 4);
    border-width: 2px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgb(255 255 255 / .8), 0 3px 8px rgb(37 99 235 / .16);
    transition: background-color .12s ease, box-shadow .12s ease;
}

.overview-viewport-indicator:hover,
.overview-map.is-interacting .overview-viewport-indicator {
    background: rgb(37 99 235 / .32);
    box-shadow: 0 0 0 2px rgb(37 99 235 / .18), 0 4px 10px rgb(37 99 235 / .2);
}

.overview-resize-handle {
    width: 8px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--panel-background);
}

.overview-resize-handle::before {
    top: -10px;
    bottom: -10px;
    width: 18px;
}

.overview-map.is-interacting .overview-resize-handle { background: #002b8a; }

.timeline-list-header {
    padding-bottom: 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 44%, transparent);
}

.timeline-list-content { margin-top: 10px; }

.timeline-list-item {
    border-color: color-mix(in srgb, var(--border-color) 62%, var(--panel-background));
    box-shadow: 0 1px 1px rgb(15 23 42 / .03);
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.timeline-list-item:hover,
.timeline-list-item:focus-within {
    border-color: color-mix(in srgb, var(--accent-color) 55%, var(--border-color));
    background: color-mix(in srgb, var(--accent-color) 5%, var(--panel-background));
    box-shadow: 0 2px 8px rgb(15 23 42 / .08);
}

.timeline-list-item.is-hidden { background: color-mix(in srgb, var(--placeholder-background) 72%, var(--panel-background)); }
/* Visibility is stateful but deliberately uses the same neutral treatment as other card controls. */
.timeline-visibility-button[aria-pressed="true"] { color: #0f0f0f; }
.timeline-list-item.is-drag-source { opacity: .38; filter: grayscale(.8); }
.timeline-drag-image { position: fixed; top: -1000px; left: -1000px; width: min(300px, 70vw); border: 1px solid var(--border-strong); border-radius: 6px; background: linear-gradient(135deg, rgb(100 116 139 / .62), rgb(100 116 139 / .18)); box-shadow: 0 10px 24px rgb(15 23 42 / .18); opacity: .72; pointer-events: none; }
.timeline-list-item.is-drop-before, .timeline-list-item.is-drop-after { position: relative; }
.timeline-list-item.is-drop-before::before, .timeline-list-item.is-drop-after::after { position: absolute; right: -2px; left: -2px; height: 3px; border-radius: 999px; background: var(--accent-color); box-shadow: 0 0 0 2px var(--panel-background), 0 2px 6px rgb(37 99 235 / .28); content: ""; pointer-events: none; }
.timeline-list-item.is-drop-before::before { top: -7px; }
.timeline-list-item.is-drop-after::after { bottom: -7px; }

.search-panel {
    border-color: color-mix(in srgb, var(--border-strong) 72%, var(--border-color));
    box-shadow: 12px 0 28px rgb(15 23 42 / .14);
}

.search-header,
.search-tags {
    padding: 2px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--placeholder-background) 56%, var(--panel-background));
}

.search-tags { padding: 6px; }
.search-input:focus-visible,
.search-tag-input:focus-visible { background: var(--panel-background); }
.search-candidate:hover,
.search-candidate:focus-visible,
.search-candidate.is-active { background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); }
.search-tag-chip { border-color: color-mix(in srgb, var(--accent-color) 36%, var(--border-color)); background: color-mix(in srgb, var(--accent-color) 6%, var(--panel-background)); }
.search-tag-chip button:focus-visible { border-radius: 50%; }
.search-result-row { min-height: 36px; border-color: color-mix(in srgb, var(--border-color) 55%, var(--panel-background)); }
.search-result-row.is-added { opacity: 1; background: color-mix(in srgb, var(--accent-color) 9%, var(--panel-background)); color: var(--text-color); }
.search-result-row.is-added:hover,
.search-result-row.is-added:focus-visible { background: color-mix(in srgb, #b91c1c 7%, var(--panel-background)); outline-color: #b91c1c; }
.search-status { margin: 14px 8px 8px; color: var(--muted-color); }
.search-status-error { color: #b91c1c; font-weight: 700; }
.search-retry { margin: 0 8px 12px; min-height: 32px; padding: 4px 9px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }

@media (max-width: 900px) {
    .toolbar-actions { padding-left: 0; border-left: 0; }
    .timeline-list-controls { flex-wrap: wrap; }
    .search-result-columns, .search-result-row { column-gap: .65em; }
}

@media (prefers-reduced-motion: reduce) {
    .display-mode-button, .timeline-add-select, .list-mode-tab, .timeline-visibility-button, .timeline-action-button, .time-axis-button, .date-position-button, .search-retry, .overview-viewport-indicator, .timeline-list-item { transition: none; }
}

/* Recommendation/search tag controls share one compact width. */
:root { --tag-input-width: 4.7em; }
.recommendation-tags input, .search-tag-input { width: var(--tag-input-width); min-width: var(--tag-input-width); max-width: var(--tag-input-width); }
.search-tag-input-wrap { width: var(--tag-input-width); min-width: var(--tag-input-width); max-width: var(--tag-input-width); }
.search-tag-input-wrap .search-tag-input { width: 100%; min-width: 0; max-width: none; }
.recommendation-actions { min-width: 0; max-width: 100%; }
.recommendation-actions button[data-tooltip]::after { left: 50%; right: auto; transform: translate(-50%, -2px); }
.recommendation-actions button[data-tooltip] { position: relative; overflow: visible; }
.recommendation-actions button[data-tooltip]::after { display: none; }
.recommendation-global-tooltip { position: fixed; z-index: 1000; padding: 4px 6px; border-radius: 4px; background: #0f0f0f; color: #fff; font-size: .72rem; pointer-events: none; white-space: nowrap; }
.recommendation-random-panel > div button:first-of-type, .recommendation-random-panel > div button:nth-of-type(2) { border: 1px solid var(--border-color); background: var(--panel-background); color: var(--text-color); }
.recommendation-random-panel > div button:first-of-type:hover:not(:disabled), .recommendation-random-panel > div button:nth-of-type(2):hover:not(:disabled) { border-color: var(--border-strong); background: color-mix(in srgb, var(--accent-color) 6%, var(--panel-background)); }
.recommendation-random-panel > div button:disabled { border-color: var(--border-color); background: var(--placeholder-background); color: var(--muted-color); opacity: .55; cursor: default; }
.recommendation-random-count-value { min-width: 2em; padding: 3px 6px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--panel-background); text-align: center; }
.recommendation-random-panel output.recommendation-random-count-value { display: inline-grid; place-items: center; min-width: 28px; min-height: 26px; border-radius: 3px; }
.recommendation-overlap-value { min-width: 2em; padding: 3px 6px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--panel-background); text-align: center; }
.recommendation-random-mode { flex: 0 0 auto; width: auto; min-width: max-content; }
.recommendation-actions button[data-tooltip]:hover::after, .recommendation-actions button[data-tooltip]:focus-visible::after { transform: translate(-50%, 0); }
.recommendation-cards, .recommendation-card, .recommendation-controls, .recommendation-members, .recommendation-title, .recommendation-card-tags, .recommendation-actions { min-width: 0; max-width: 100%; }
.recommendation-controls { overflow: visible; }
.recommendation-card { overflow: visible; }
.timeline-list-content { overflow-x: hidden; }
.recommendation-tag-candidates { z-index: 200; max-height: none; overflow: visible; }
.recommendation-word-row input:focus-visible, .recommendation-tags input:focus-visible { background: var(--panel-background); }

/* Final tag input sizing and management button interaction overrides. */
.recommendation-tags input { flex: 0 0 7em; width: 7em; min-width: 7em; max-width: 7em; min-height: 28px; padding: 4px 8px; font: inherit; font-size: .8rem; }
.search-tag-input-wrap { width: 6.2em; min-width: 6.2em; max-width: 6.2em; }
.recommendation-tag-candidates,
.search-tag-candidate-region {
    width: min(15em, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
}
.recommendation-tag-candidates .search-candidate,
.search-tag-candidate-region .search-candidate {
    width: 100%;
    min-height: 30px;
    max-height: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.35;
}
.search-tag-input-wrap .search-tag-input { width: 100%; min-width: 0; max-width: none; }
.timeline-management-toolbar .timeline-add-select { background: var(--accent-color); border-color: var(--accent-color); color: #fff; font-weight: 700; }
.timeline-management-toolbar .timeline-add-select:hover:not(:disabled), .timeline-management-toolbar .timeline-add-select:focus-visible:not(:disabled) { background: color-mix(in srgb, var(--accent-color) 88%, #000); border-color: color-mix(in srgb, var(--accent-color) 88%, #000); color: #fff; }
.timeline-reset-button:hover, .timeline-reset-button:focus-visible { border-color: var(--accent-color); background: var(--danger-background); color: var(--danger-color); }
.timeline-reset-button:hover .ui-icon, .timeline-reset-button:focus-visible .ui-icon { color: var(--danger-color); }

/* Viewer UI canonical component families.  Instance selectors below only
   provide layout variants; state visuals live here. */
.ui-button,
.recommendation-actions button,
.timeline-add-select,
.event-mode-toggle,
.search-pager button {
    min-height: 30px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--panel-background);
    color: var(--text-color);
}
.ui-button:hover:not(:disabled),
.recommendation-actions button:not(.ui-button--primary):hover:not(:disabled),
.event-mode-toggle:hover:not(:disabled),
.search-pager button:hover:not(:disabled) {
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background));
}
.ui-button:focus-visible,
.recommendation-actions button:not(.ui-button--primary):focus-visible,
.event-mode-toggle:focus-visible,
.search-pager button:focus-visible {
    border-color: var(--accent-color);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
.ui-button:disabled,
.recommendation-actions button:disabled,
.event-mode-toggle:disabled,
.search-pager button:disabled,
.display-mode-segmented:disabled { opacity: .55; cursor: default; }
.ui-button--primary,
.timeline-management-toolbar .timeline-add-select {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--on-accent);
    font-weight: 700;
}
.ui-button--primary:hover:not(:disabled),
.ui-button--primary:focus-visible:not(:disabled),
.timeline-management-toolbar .timeline-add-select:hover:not(:disabled),
.timeline-management-toolbar .timeline-add-select:focus-visible:not(:disabled) {
    background: color-mix(in srgb, var(--accent-color) 88%, #000);
    border-color: color-mix(in srgb, var(--accent-color) 88%, #000);
    color: var(--on-accent);
}
.search-candidates,
.recommendation-tag-candidates {
    max-height: none;
    overflow: visible;
}
.search-candidates .search-candidate:nth-child(n + 6) { display: none; }
.search-genre-candidate { font-weight: inherit; }
.search-filter-row { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 6px 0; }
.search-filter-row .search-tags { display: flex; flex: 1 1 auto; align-items: center; gap: 4px; min-width: 0; }
.search-sort-direction, .search-sort-select { min-height: 30px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; }
.search-sort-direction { width: 30px; padding: 2px; cursor: pointer; }
.search-sort-select { max-width: 5.5em; padding: 2px 4px; }
.timeline-event-region {
    flex: 1 1 0;
    min-height: 0;
}
.timeline-event-region > .timeline-lane {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
}
.tag-reset-button {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 5px;
}
.recommendation-tag-candidates,
.search-tag-candidate-region {
    width: min(15em, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
}
.timeline-management-toolbar .timeline-add-select.is-search-open,
.timeline-management-toolbar .timeline-add-select.is-search-open:hover,
.timeline-management-toolbar .timeline-add-select.is-search-open:focus-visible {
    background: #94a3b8;
    border-color: #94a3b8;
    color: #ffffff;
    opacity: .7;
    cursor: pointer;
}
.timeline-management-toolbar .timeline-add-select:disabled,
.timeline-management-toolbar .timeline-add-select:disabled:hover,
.timeline-management-toolbar .timeline-add-select:disabled:focus-visible {
    background: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: #fff !important;
    opacity: .7;
    cursor: default;
}
.numeric-timeline-lane { position: relative; overflow: hidden; min-height: 120px; }
.numeric-graph-layer { position: absolute; inset: 4px 6px 4px 82px; z-index: 1; pointer-events: none; }
.numeric-graph-layer.is-integrated-numeric-graph { inset: 8px 44px 8px 44px; }
.numeric-graph-svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: auto; }
.numeric-y-axis { position: absolute; top: 6px; font-size: .68rem; color: var(--muted-text); white-space: nowrap; }
.numeric-y-axis-left { left: -78px; } .numeric-y-axis-right { right: -38px; }
.integrated-timeline { position: relative; }
.graph-stack-control { position: absolute; z-index: 8; right: 6px; top: 6px; }
.graph-stack-panel,.graph-settings-panel { position: absolute; z-index: 30; background: var(--panel-background); border: 1px solid var(--border-color); border-radius: 5px; box-shadow: 0 6px 20px rgb(0 0 0 / .18); padding: 8px; min-width: 220px; }
.graph-stack-panel { right: 0; top: 32px; display: grid; gap: 5px; } .graph-stack-panel label { display: flex; gap: 5px; align-items: center; font-size: .78rem; }
.graph-settings-wrap { position: relative; } .graph-settings-panel { right: 0; bottom: calc(100% + 4px); display: grid; gap: 6px; }

/* Numeric Graph visual corrections: keep the plot, label, and axis in
   explicit zones so chart geometry cannot consume the label gutter. */
.numeric-timeline-lane { min-height: 128px; }
.numeric-timeline-lane .numeric-graph-layer { left: 92px; right: 8px; inset-block: 8px; }
.numeric-graph-layer.is-integrated-numeric-graph { left: 52px; right: 52px; }
.numeric-graph-svg { overflow: visible; }
.numeric-y-axis { left: -48px; width: 42px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 1px 4px 1px 0; border-right: 1px solid var(--border-color); color: var(--muted-color); font-size: .65rem; line-height: 1; white-space: nowrap; }
.numeric-y-axis-right { left: auto; right: -48px; align-items: flex-start; padding: 1px 0 1px 4px; border-right: 0; border-left: 1px solid var(--border-color); }
.numeric-y-axis b { color: var(--text-color); font-size: .66rem; }
.graph-settings-panel { position: fixed; right: auto; bottom: auto; min-width: 280px; overflow: visible; }
.graph-setting-row { display: grid; grid-template-columns: 4.5rem 1fr; gap: 6px; align-items: center; }
.graph-setting-row button.is-selected { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 14%, var(--panel-background)); }
.graph-setting-option { min-height: 28px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); }
.graph-setting-option:hover:not(.is-selected),.graph-setting-option:focus-visible:not(.is-selected) { border-color: var(--accent-color); background: var(--panel-background); color: var(--text-color); }
.graph-type-button.graph-setting-option { inline-size: 31px; block-size: 31px; padding: 3px; }
.graph-setting-row:nth-child(2) .graph-setting-option { min-inline-size: 48px; }
.graph-stack-panel { max-width: min(280px, calc(100vw - 16px)); overflow: visible; }
.graph-setting-row { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; } .graph-setting-row > span { width: 3.4em; font-size: .75rem; }
.graph-setting-row button { min-height: 26px; padding: 3px 6px; font-size: .73rem; }
.graph-type-button .ui-icon { width: 17px; height: 17px; }
.graph-type-button.is-selected .ui-icon, .graph-type-button[aria-pressed="true"] .ui-icon, .graph-stack-button.is-configured .ui-icon, .graph-stack-button.is-active .ui-icon { color: var(--accent-color); }
.numeric-graph-tooltip { position: fixed; z-index: 1000; width: max-content; max-width: min(34rem, calc(100vw - 16px)); padding: 6px 8px; border: 1px solid rgb(var(--timeline-rgb, 148 163 184) / .72); border-radius: 4px; background: #111827; color: white; box-shadow: 0 8px 18px rgb(15 23 42 / .28), 0 0 0 1px rgb(var(--timeline-rgb, 148 163 184) / .18); font-size: .78rem; pointer-events: none; }
.numeric-graph-tooltip-primary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    white-space: normal;
}
.numeric-graph-tooltip-note {
    margin-top: 3px;
    color: rgb(255 255 255 / .82);
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Numeric Graph final chrome.  Keep these after the provisional graph rules above. */
.numeric-y-axis, .numeric-y-guide { user-select: none; -webkit-user-select: none; pointer-events: none; }
.numeric-y-axis-left { left: -44px; }
.numeric-y-guide { position: absolute; z-index: 0; left: 0; right: 0; border-top: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent); }
.numeric-graph-svg { position: relative; z-index: 1; }
.numeric-graph-layer.is-integrated-numeric-graph .numeric-graph-svg { pointer-events: none; }
.numeric-y-axis { z-index: 2; border-color: rgb(var(--timeline-rgb) / .7); color: rgb(var(--timeline-rgb) / .95); }
.numeric-y-axis span { display: block; }
.graph-settings-panel { z-index: 1200; }
.graph-settings-button:hover, .graph-settings-button:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }
.graph-setting-row button.is-selected { background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); }
.v1-measure-summary strong { font-size: .95rem; }
.v1-series-list { display: grid; gap: 5px; margin-top: 8px; }
.v1-series-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid var(--border-color); background: color-mix(in srgb, var(--panel-background) 92%, var(--accent-color)); border-radius: 4px; padding: 5px 6px; font-size: .78rem; }
.v1-series-remove, .v1-series-add, .v1-series-confirm, .v1-series-close { min-height: 26px; padding: 3px 7px; font-size: .75rem; }
.v1-dimension-group { border-top: 1px solid var(--border-color); padding: 5px 0; }
.v1-dimension-group summary { cursor: pointer; font-weight: 600; font-size: .82rem; }
.v1-member-subheading { margin: 5px 0 2px; color: var(--muted-color); font-size: .7rem; }
.v1-member-row { display: flex; align-items: center; gap: 6px; min-height: 27px; cursor: pointer; font-size: .78rem; position: relative; }
.v1-member-unavailable { margin-left: auto; font-size: .67rem; }
.v1-series-preview { display: grid; gap: 4px; border-top: 1px solid var(--border-color); margin-top: 8px; padding-top: 8px; font-size: .76rem; }
.v1-series-preview p { margin: 2px 0; color: var(--muted-color); }
@media (max-width: 700px) { .v1-series-settings-layout { grid-template-columns: 1fr; } .v1-series-composer { border-left: 0; border-top: 1px solid var(--border-color); } }
.graph-setting-option[data-tooltip], .graph-segmented button[data-tooltip] { position: relative; overflow: visible; }
.graph-setting-option[data-tooltip]::after, .graph-segmented button[data-tooltip]::after { position: absolute; z-index: 1300; top: calc(100% + 6px); left: 50%; width: max-content; max-width: min(18rem, calc(100vw - 16px)); padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity .12s ease, transform .12s ease; }
.graph-setting-option[data-tooltip]:hover::after, .graph-setting-option[data-tooltip]:focus-visible::after, .graph-segmented button[data-tooltip]:hover::after, .graph-segmented button[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .5s; }
.binary-segmented-toggle > span[data-tooltip] { position: relative; }
.binary-segmented-toggle > span[data-tooltip]::after { position: absolute; z-index: 1300; top: calc(100% + 6px); left: 50%; width: max-content; max-width: min(18rem, calc(100vw - 16px)); padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity .12s ease, transform .12s ease; }
.binary-segmented-toggle > span[data-tooltip]:hover::after, .binary-segmented-toggle > span[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .5s; }
.graph-line-sample { display: block; inline-size: 38px; block-size: 2px; background: currentColor; }
.graph-line-sample.is-dashed { background: repeating-linear-gradient(to right, currentColor 0 7px, transparent 7px 11px); }
.graph-line-sample.is-dash-dot { background: repeating-linear-gradient(to right, currentColor 0 7px, transparent 7px 10px, currentColor 10px 12px, transparent 12px 15px); }
.graph-bar-sample { display: block; width: 12px; height: 16px; border: 1px solid currentColor; background: currentColor; }
.graph-bar-sample.is-hatched { background: repeating-linear-gradient(135deg, transparent 0 3px, currentColor 3px 5px); }
.graph-bar-sample.is-dotted { background: radial-gradient(circle, currentColor 1.3px, transparent 1.5px) 0 0 / 5px 5px; }
.graph-stack-control { left: 6px; right: auto; top: calc(2px + 16px); }
.graph-stack-panel { position: fixed; left: auto; right: auto; top: auto; min-width: 240px; z-index: 1200; }
.graph-stack-panel h2 { margin: 0; font-size: .9rem; }
.graph-stack-panel select { min-height: 30px; }
.graph-stack-section-label { font-size: .75rem; color: var(--muted-color); }
.graph-stack-toggle-row { display: flex; align-items: center; gap: 6px; }
.graph-settings-panel { gap: 8px; }
.graph-setting-row { margin-bottom: 2px; }
.graph-stack-all-row, .graph-stack-candidate-row { display: flex; align-items: center; gap: 5px; padding: 3px 4px; border-radius: 3px; cursor: pointer; }
.graph-stack-candidate-row:hover, .graph-stack-all-row:hover { background: color-mix(in srgb, var(--accent-color) 8%, var(--panel-background)); }
.event-table-numeric-value { display: block; color: var(--text-color); font-size: .72rem; line-height: 1.25; }
.graph-stack-mode { min-height: 30px; }
.graph-stack-button.is-active, .graph-stack-button.is-configured { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }

/* Measured numeric-lane geometry: label edge + 5px, compact tick column, then plot. */
.numeric-timeline-lane { --numeric-axis-start: 48px; --numeric-axis-width: 42px; }
.numeric-timeline-lane .numeric-graph-layer { left: calc(var(--numeric-axis-start) + var(--numeric-axis-width) + 4px); right: 8px; }
.numeric-timeline-lane .numeric-y-axis-left { left: calc(-1 * (var(--numeric-axis-width) + 4px)); width: var(--numeric-axis-width); }
.numeric-timeline-lane.has-right-numeric-axis .numeric-graph-layer { left: calc(var(--numeric-axis-start) + 4px); right: 8px; }
.numeric-timeline-lane .numeric-y-axis-right { left: auto; right: calc(-1 * (var(--numeric-axis-width) + 4px)); width: var(--numeric-axis-width); }
.numeric-timeline-lane.has-right-numeric-axis .numeric-y-axis-right { right: calc(-1 * var(--numeric-axis-width) - 8px); }
.numeric-timeline-lane.has-left-numeric-axis .numeric-graph-layer { left: calc(var(--numeric-axis-start) + var(--numeric-axis-width) + 4px); }
.date-display-detail .graph-stack-button { margin-right: 5px; vertical-align: middle; }
.date-display-detail .graph-stack-button { position: relative; z-index: 3; pointer-events: auto; }
.graph-stack-filter-row { display: grid; grid-template-columns: 2.4rem 1fr; align-items: center; gap: 6px; font-size: .78rem; }
.numeric-graph-layer.is-integrated-numeric-graph { left: 8px; right: 8px; }
.is-integrated-numeric-graph .numeric-y-axis-left { left: calc(-4px - var(--integrated-axis-offset)); width: 42px; }
.is-integrated-numeric-graph .numeric-y-axis-right { left: auto; right: calc(-4px - var(--integrated-axis-offset)); width: 42px; }
.numeric-graph-group-member-layer .numeric-y-axis-left { transform: translateX(calc(-1 * var(--numeric-group-axis-offset, 0px))); }
.numeric-graph-group-member-layer .numeric-y-axis-right { transform: translateX(var(--numeric-group-axis-offset, 0px)); }
.numeric-y-axis-tick { display: block; text-align: inherit; }
.numeric-y-axis-tick-middle { position: absolute; transform: translateY(-50%); }
.numeric-y-axis-value, .numeric-y-axis-unit { display: block; }
.numeric-y-axis-unit { font-size: .86em; line-height: 1.05; opacity: .9; text-shadow: 0 1px 2px rgb(255 255 255 / .8); }
.numeric-y-axis { background: rgb(var(--surface-rgb, 255 255 255) / .62); padding-top: 2px; padding-bottom: 2px; }
.timeline-summary-popup.is-pinned { outline: 2px solid var(--accent-color); }
.timeline-summary-pin { margin-left: auto; }
.timeline-summary-scroll-body { max-height: 15rem; overflow-y: auto; }
.timeline-summary-more { float: right; color: var(--muted-color); }
.timeline-summary-sources { display: grid; gap: 4px; }
.timeline-list-item-title, .recommendation-member-title { cursor: pointer; }

/* Viewer fixes 01–06: Numeric axes are overlays and never redefine time X. */
.numeric-y-axis { background: transparent; border: 0; }
.numeric-y-axis-value, .numeric-y-axis-unit { width: max-content; max-width: 100%; padding: 1px 2px; border-radius: 3px; background: rgb(var(--surface-rgb, 255 255 255) / .78); }
.numeric-area-fill { pointer-events: none; }
.numeric-line-hit, .numeric-bar-hit, .numeric-bar-top-hit { cursor: crosshair; }
.numeric-timeline-lane .numeric-graph-layer,
.numeric-timeline-lane.has-right-numeric-axis .numeric-graph-layer,
.numeric-timeline-lane.has-left-numeric-axis .numeric-graph-layer { left: 8px; right: 8px; }
.numeric-timeline-lane .numeric-y-axis-left { left: var(--numeric-axis-start); width: var(--numeric-axis-width); align-items: flex-start; }
.numeric-timeline-lane .numeric-y-axis-right,
.numeric-timeline-lane.has-right-numeric-axis .numeric-y-axis-right { left: auto; right: 4px; width: var(--numeric-axis-width); }
.is-integrated-numeric-graph .numeric-y-axis-left { left: calc(var(--integrated-axis-offset) - 42px); width: 42px; }
.is-integrated-numeric-graph .numeric-y-axis-right { left: auto; right: calc(var(--integrated-axis-offset) - 42px); width: 42px; }
.graph-stack-candidate-row.is-incompatible { opacity: .5; cursor: not-allowed; }
.graph-settings-button.is-stack-member .ui-icon { color: var(--accent-color); }

/* Integrated Event axis: Point zone is always above and Range zone below. */
.integrated-timeline { --integrated-axis-y: 50%; }
.integrated-axis-grip:focus-visible, .lane-resize-grip:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.integrated-axis-grip { position: absolute; z-index: 9; top: var(--integrated-axis-y); left: 4px; width: 28px; height: 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: ns-resize; touch-action: none; pointer-events: auto; transform: translateY(-50%); }
.lane-resize-grip { position: absolute; left: 4px; width: 28px; height: 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: ns-resize; touch-action: none; pointer-events: auto; transform: translateY(-50%); }
.integrated-axis-grip::before, .lane-resize-grip::before { position: absolute; left: 3px; top: 2.5px; width: 22px; height: 2.4px; border: 0; border-radius: 1.2px; background: rgb(71 85 105 / .43); content: ""; }
.timeline-event-region.is-lane-overflowing { overflow-x: hidden; overflow-y: auto; }
.timeline-event-region.is-lane-resizing .integrated-event-stem,
.timeline-event-region.is-lane-resizing .temporal-debug-connector { visibility: hidden !important; transition: none !important; animation: none !important; }
.lane-resize-grip-layer { position: absolute; z-index: 8; inset: 0 0 0 0; pointer-events: none; }
.lane-resize-grip.is-dragging { outline: 2px solid var(--accent-color); outline-offset: 1px; }
.integrated-axis-grip:hover::before, .integrated-axis-grip:focus-visible::before, .lane-resize-grip:hover::before, .lane-resize-grip:focus-visible::before, .lane-resize-grip.is-dragging::before { background: rgb(71 85 105 / .63); }
html[data-theme="dark"] .integrated-axis-grip::before, html[data-theme="dark"] .lane-resize-grip::before { background: rgb(203 213 225 / .38); }
html[data-theme="dark"] .integrated-axis-grip:hover::before, html[data-theme="dark"] .integrated-axis-grip:focus-visible::before, html[data-theme="dark"] .lane-resize-grip:hover::before, html[data-theme="dark"] .lane-resize-grip:focus-visible::before, html[data-theme="dark"] .lane-resize-grip.is-dragging::before { background: rgb(203 213 225 / .58); }
.numeric-timeline-lane { min-height: 0; }
.cluster-summary-member { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cluster-summary-member:hover, .cluster-summary-member:focus-visible { text-decoration: underline; }
.cluster-range-miniature-line { transition: opacity .12s ease, filter .12s ease; }
.cluster-range-miniature-line.is-highlighted { height: 5px; opacity: 1; filter: drop-shadow(0 0 3px currentColor); }

/* Viewer fixes 01–06: Event media, popup, local search and temporal guides. */
.event-point-thumbnail { position: absolute; z-index: 6; top: 0; left: 0; box-sizing: border-box; width: 28px; height: 28px; border: 2px solid rgb(var(--timeline-rgb) / .96); border-radius: 50%; background: var(--panel-background); box-shadow: 0 0 0 1px var(--panel-background), 0 2px 5px rgb(15 23 42 / .22); object-fit: cover; transform: translate(-50%, -50%); }
.uncertain-point-thumbnail { top: 0; }
.drawing-point-event.is-important .event-point-thumbnail { width: 34px; height: 34px; border-width: 3px; }
.drawing-point-event.is-important [data-event-title] { font-size: .96rem; font-weight: 700; }
.event-range-thumbnail { position: absolute; z-index: 6; top: -3px; left: 50%; box-sizing: border-box; width: 28px; height: 24px; border: 2px solid rgb(var(--timeline-rgb) / .96); border-radius: 3px; background: var(--panel-background); box-shadow: 0 0 0 1px var(--panel-background); object-fit: cover; transform: translateX(calc(-100% - 3px)); }
.range-band-event.is-important .event-range-thumbnail { width: 32px; height: 27px; }
.range-band-event.is-important [data-event-title] { font-size: .96rem; font-weight: 700; }
.cluster-point-thumbnail { position: absolute; inset: 50% auto auto 50%; box-sizing: border-box; width: 28px; height: 28px; border: 2px solid rgb(var(--timeline-rgb) / .98); border-radius: 50%; box-shadow: 0 0 0 3px var(--panel-background), 0 0 0 5px rgb(var(--timeline-rgb) / .76); object-fit: cover; transform: translate(-50%, -50%); }
.is-local-search-hover .point-event-title, .is-local-search-hover .uncertain-point-title, .is-local-search-hover .range-band-title { text-decoration: underline; outline: 2px solid rgb(var(--timeline-rgb) / .55); outline-offset: 2px; }
.is-local-search-hover .event-point-thumbnail, .is-local-search-hover .event-range-thumbnail { outline: 3px solid rgb(var(--timeline-rgb) / .42); outline-offset: 2px; }

.event-popup { display: grid; grid-template-columns: 1fr; gap: 8px; visibility: hidden; opacity: 0; transition: opacity .2s ease, visibility 0s linear .2s; }
.event-popup.has-image { grid-template-columns: 72px minmax(0, 1fr); width: min(390px, calc(100vw - 16px)); }
.event-popup.is-visible { display: grid; visibility: visible; opacity: 1; transition-delay: 0s; }
.event-popup-image { width: 72px; height: 72px; border: 2px solid rgb(var(--timeline-rgb) / .9); border-radius: 5px; object-fit: contain; background: var(--panel-background); }
.event-popup-body { min-width: 0; }
.event-popup-timeline { display: flex; align-items: center; gap: 4px; color: rgb(var(--timeline-rgb) / 1); }
.event-popup-timeline-icon { font-size: 1rem; }
.event-details-navigation { display: flex; gap: 4px; margin-left: auto; }
.event-details-navigation button { min-height: 28px; padding: 2px 7px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); }
.event-details-relative-date { margin: 0; color: var(--muted-color); font-size: .78rem; }
.event-details-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--border-color); }
.event-details-video p { margin: 5px 0 0; color: var(--muted-color); font-size: .8rem; }

.local-event-search { position: absolute; z-index: var(--layer-popup-search); top: 4px; right: 6px; width: min(172px, calc(100% - 12px)); pointer-events: auto; }
.local-event-search input { box-sizing: border-box; width: 100%; height: 28px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); }
.local-event-search-results { position: absolute; z-index: var(--layer-popup-search); top: calc(100% + 2px); right: 0; width: 100%; max-height: min(48vh, 360px); overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 0 0 5px 5px; background: var(--panel-background); box-shadow: 0 8px 20px rgb(15 23 42 / .2); }
.local-event-search-results[hidden] { display: none; }
.local-event-search-row { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); align-items: center; width: 100%; padding: 6px; border: 0; border-bottom: 1px solid var(--border-color); background: transparent; color: var(--text-color); text-align: left; cursor: pointer; }
.local-event-search-row:hover, .local-event-search-row:focus-visible { background: color-mix(in srgb, rgb(var(--timeline-rgb)) 12%, var(--panel-background)); }
.local-event-search-icon { color: rgb(var(--timeline-rgb) / 1); }
.local-event-search-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-event-search-results p { margin: 0; padding: 8px; color: var(--muted-color); font-size: .78rem; }

.timeline-special-line { position: absolute; z-index: 11; top: var(--date-display-height); bottom: 0; width: 0; border-left-style: solid; pointer-events: none; }
.timeline-special-line.is-date-pointer { border-left-width: 1px; border-left-color: rgb(100 116 139 / .42); }
.timeline-special-line.is-today { border-left-width: 1px; border-left-color: rgb(220 38 38 / .72); }
.timeline-special-line.is-bce-ce { border-left-width: 2px; border-left-color: rgb(71 85 105 / .62); }
.date-today-dot { position: absolute; z-index: 12; bottom: -4px; width: 7px; height: 7px; border-radius: 50%; background: #dc2626; transform: translateX(-50%); pointer-events: auto; }
.date-pointer-box { position: absolute; z-index: 14; top: 1px; display: grid; width: 144px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); box-shadow: 0 2px 7px rgb(15 23 42 / .18); font-size: .72rem; line-height: 1.25; text-align: center; pointer-events: none; }
.date-pointer-box[hidden] { display: none; }
.date-pointer-box > span { overflow: hidden; padding: 2px 4px; text-overflow: ellipsis; white-space: nowrap; }
.date-pointer-arrow { font-weight: 800; }
.date-pointer-relative { border-bottom: 1px solid var(--border-color); color: #2563eb; }
.date-pointer-relative.is-future { color: #15803d; }

@media (prefers-reduced-motion: reduce) { .event-popup, .cluster-range-miniature-line { transition: none !important; } }

.menu-bar { grid-template-columns: max-content max-content minmax(90px, 1fr) max-content; flex-wrap: nowrap; overflow: visible; }
.toolbar-right, .toolbar-actions { flex-wrap: nowrap; white-space: nowrap; }
.overview-header-placeholder { min-width: 90px; }
.toolbar-icon-button { display: inline-flex; align-items: center; gap: 2px; }
.toolbar-icon-button .ui-icon { width: 15px; height: 15px; }
.share-unavailable-notice { position: fixed; z-index: 1500; inset-inline-end: 12px; bottom: 12px; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 24px); padding: 8px 12px; background: var(--panel-background); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 6px; }
.operations-menu { position: absolute; z-index: 1500; top: calc(100% + 5px); right: 0; display: grid; min-width: 210px; padding: 7px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-background); box-shadow: 0 10px 24px rgb(15 23 42 / .2); }
.viewer-sidebar-utilities { position: relative; }
.viewer-sidebar-utilities .viewer-operations-menu { top: auto; bottom: 42px; left: calc(100% + 8px); right: auto; max-width: calc(100vw - 64px); }
.operations-menu button, .operations-menu a { padding: 7px; border: 0; background: transparent; color: var(--text-color); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.operations-menu button:hover, .operations-menu a:hover { background: color-mix(in srgb, var(--accent-color) 9%, var(--panel-background)); }
.operations-menu small { padding: 5px 7px; color: var(--muted-color); }

.viewer-info-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding-top: 6px; }
.viewer-info-row button { min-height: 30px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }
.viewer-help-button { display: inline-flex; align-items: center; justify-content: center; }
.viewer-help-button .ui-icon { width: 17px; height: 17px; }
.viewer-books-button { position: relative; overflow: visible; }
.viewer-books-button[data-tooltip]::after { position: absolute; z-index: 1500; top: calc(100% + 5px); right: 0; display: none; width: max-content; max-width: 250px; padding: 5px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; white-space: pre-line; }
.viewer-books-button:hover::after { display: block; transition-delay: .5s; }
.viewer-like-button { flex: 0 0 auto; min-height: 26px; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }
.viewer-like-button.has-error { border-color: var(--border-strong); box-shadow: none; }
.viewer-like-button:disabled { opacity: .55; }
.timeline-list-item-title-row { display: flex; grid-column: 2; align-items: flex-start; gap: 5px; min-width: 0; }
.recommendation-title-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.timeline-list-item-title-row .timeline-list-item-title, .recommendation-title-row .recommendation-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recommendation-title-row .viewer-like-button { flex: 0 0 auto; }
.recommendation-actions { display: grid; grid-template-columns: minmax(0, 1fr) max-content 30px; align-items: center; gap: 5px; width: 100%; }
.recommendation-actions > button { min-width: 0; white-space: nowrap; }
.recommendation-actions > .recommendation-copy { width: 30px; min-width: 30px; padding-inline: 0; }
.timeline-summary-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.timeline-summary-actions > button { min-height: 25px; }

.body-level-panel { position: fixed; z-index: 1600; top: max(54px, 7vh); left: 50%; box-sizing: border-box; width: min(680px, calc(100vw - 24px)); max-height: min(86vh, 820px); overflow-y: auto; padding: 18px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel-background); color: var(--text-color); box-shadow: 0 20px 55px rgb(15 23 42 / .28); transform: translateX(-50%); }
.body-level-panel h2 { margin: 0 0 12px; }
.body-level-panel label { display: grid; gap: 4px; margin: 8px 0; }
.body-level-panel textarea, .body-level-panel input { box-sizing: border-box; width: 100%; padding: 7px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); font: inherit; }
.body-level-panel button, .body-level-panel a { margin: 4px; padding: 6px 10px; }
.book-cards { display: grid; gap: 9px; }
.book-card { display: grid; grid-template-columns: minmax(0, 135px) 1fr; gap: 10px; padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; }
.book-card img { width: 100%; max-width: 135px; max-height: 135px; object-fit: contain; }
.book-card h3, .book-card p { margin: 0 0 5px; }
.books-disclosure { color: var(--muted-color); }
.correction-event-row { display: block; padding: 7px 0; border-top: 1px solid var(--border-color); }
.correction-event-row textarea { width: 100%; }

/* Phase 3: Help, tutorials, and shared interaction motion. */
.body-panel-backdrop { position: fixed; z-index: 1590; inset: 0; background: rgb(15 23 42 / .18); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.body-panel-backdrop.is-open { opacity: 1; pointer-events: auto; }
.body-panel-backdrop.is-closing { opacity: 0; pointer-events: none; }
.body-level-panel { z-index: 1600; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; transform: translate(-50%, -6px); }
.body-level-panel.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.body-level-panel.is-closing { opacity: 0; pointer-events: none; transform: translate(-50%, -6px); }
.body-level-panel h2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.body-panel-close { box-sizing: border-box; display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; min-width: 32px; min-height: 32px; margin: 0 !important; padding: 0 !important; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--panel-background); color: var(--text-color); font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.body-panel-close:hover, .body-panel-close:focus-visible { border-color: var(--accent-color); outline: 2px solid var(--accent-color); outline-offset: 2px; }
.update-history-list { display: grid; gap: 14px; }
.update-history-item { padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.update-history-item:first-child { padding-top: 0; }
.update-history-item:last-child { border-bottom: 0; }
.update-history-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--muted-color); font-size: .82rem; }
.update-history-category { display: inline-flex; align-items: center; min-height: 1.55rem; padding: 2px 8px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--surface-inset); color: var(--text-color); }
.update-history-date { color: var(--muted-color); }
.update-history-title { margin: 0 0 6px; color: var(--text-strong, var(--text-color)); font-size: 1rem; line-height: 1.4; }
.update-history-body { margin: 0; color: var(--text-color); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.update-history-more { display: block; width: 100%; margin: 12px 0 0; border: 1px solid var(--border-color); border-radius: 5px; background: var(--surface-inset); color: var(--accent-color); cursor: pointer; }
.update-history-more:hover:not(:disabled), .update-history-more:focus-visible:not(:disabled) { border-color: var(--accent-color); background: var(--hover-background); outline: 2px solid var(--accent-color); outline-offset: 1px; }
.update-history-more:disabled { cursor: wait; opacity: .7; }
.update-history-error { margin: 12px 0 0; color: var(--danger-color); }
.help-panel.body-level-panel { top: 58%; display: grid; grid-template-rows: max-content minmax(0, 1fr); width: min(560px, calc(100vw - 24px)); height: min(470px, calc(100vh - 24px)); max-height: min(76vh, 680px); overflow: hidden; transform: translate(-50%, calc(-50% - 6px)); }
.help-panel.body-level-panel.is-open { transform: translate(-50%, -50%); }
.help-panel.body-level-panel.is-closing { transform: translate(-50%, calc(-50% - 6px)); }
.viewer-help { display: grid; grid-template-rows: max-content minmax(0, 1fr); min-height: 0; height: 100%; gap: 12px; }
.viewer-help-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-color); }
.viewer-help-tabs { display: flex; gap: 5px; border-bottom: 0; }
.viewer-help-tabs button { min-height: 34px; padding: 6px 11px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; background: transparent; color: var(--text-color); font: inherit; cursor: pointer; }
.viewer-help-tabs button[aria-selected="true"] { border-color: var(--border-strong); background: var(--placeholder-background); color: var(--accent-color); font-weight: 700; }
.help-tutorial-launch { min-height: 34px; margin: 0 0 4px !important; padding: 6px 12px; font: inherit; cursor: pointer; }
.viewer-help-body { min-height: 0; overflow-y: auto; animation: phase3-content-fade .16s ease both; }
.help-lead { font-size: 1.25rem; font-weight: 700; }
.help-area-list { display: grid; gap: 5px; }.help-tree-root { min-width: 0; }.help-tree-children { margin: 0; padding: 0 0 0 22px; list-style: none; }.help-tree-child { position: relative; margin: 0; padding: 0 0 0 16px; }.help-tree-child::before { position: absolute; top: 0; bottom: 0; left: 0; border-left: 1px solid var(--border-strong); content: ""; }.help-tree-child::after { position: absolute; top: 17px; left: 0; width: 12px; border-top: 1px solid var(--border-strong); content: ""; }.help-tree-child:last-child::before { bottom: calc(100% - 17px); }.help-area-item { display: flex; align-items: baseline; width: 100%; min-height: 34px; margin: 0 !important; border: 0; background: transparent; color: var(--text-color); font: inherit; text-align: left; cursor: pointer; }.help-area-item-major { padding: 7px 5px; font-size: .98rem; font-weight: 700; }.help-area-item:hover, .help-area-item:focus-visible, .help-area-item.is-active { background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--accent-color); outline: none; }
.help-guide-overlay { position: fixed; z-index: 1540; inset: 0; pointer-events: none; }.help-guide-dim-svg { position: fixed; z-index: 1540; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }.help-guide-dim-fill { fill: rgb(15 23 42 / .28); }.help-major-frame, .help-guide-frame, .help-callout { position: fixed; pointer-events: none; }.help-major-frame { z-index: 1541; border: 2px solid var(--accent-color); border-radius: 6px; }.help-guide-frame { z-index: 1545; border: 3px solid var(--accent-color); border-radius: 6px; }.help-callout-leader-layer { position: fixed; z-index: 1579; inset: 0; width: 100vw; height: 100vh; overflow: visible; pointer-events: none; }.help-callout-leader-layer line { stroke: var(--accent-color); stroke-width: 3; stroke-linecap: round; }.help-callout { z-index: 1580; box-sizing: border-box; width: max-content; max-width: min(360px, calc(100vw - 16px)); padding: 10px 13px; border: 1px solid var(--accent-color); border-radius: 7px; background: var(--accent-color); color: var(--on-accent); box-shadow: 0 7px 24px rgb(15 23 42 / .28); font-size: 1.16rem; font-weight: 600; line-height: 1.45; white-space: pre-line; }.help-books-guide-panel { position: fixed; z-index: 1546; box-sizing: border-box; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 80px); overflow: auto; padding: 12px; border: 2px solid var(--accent-color); border-radius: 7px; background: var(--panel-background); color: var(--text-color); box-shadow: 0 7px 24px rgb(15 23 42 / .28); pointer-events: none; }

.tutorial-panel { position: fixed; z-index: 1720; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel-background); color: var(--text-color); box-shadow: 0 10px 30px rgb(15 23 42 / .24); animation: phase3-content-fade .16s ease both; }.tutorial-progress { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at center, var(--panel-background) 57%, transparent 59%), conic-gradient(var(--accent-color) calc(var(--tutorial-progress) * 1turn), var(--border-color) 0); font-size: .82rem; font-weight: 700; }.tutorial-copy strong { font-size: 1rem; }.tutorial-copy p { margin: 3px 0 0; }.tutorial-quit { min-height: 32px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }.tutorial-complete { font-weight: 700; }.tutorial-panel:has(.tutorial-complete) { grid-template-columns: minmax(0, 1fr) auto auto; }
.tutorial-spotlight { position: fixed; z-index: 1650; border: 0; border-radius: 6px; box-shadow: 0 0 0 9999px rgb(15 23 42 / .24); pointer-events: none; transition: left .16s ease, top .16s ease, width .16s ease, height .16s ease; }.tutorial-spotlight-hint { position: fixed; z-index: 1680; box-sizing: border-box; width: max-content; max-width: min(360px, calc(100vw - 20px)); padding: 10px 13px; border: 1px solid var(--accent-color); border-radius: 7px; background: var(--accent-color); color: var(--on-accent); box-shadow: 0 7px 24px rgb(15 23 42 / .28); font-size: 1.16rem; font-weight: 600; line-height: 1.45; pointer-events: none; white-space: pre-line; }.tutorial-spotlight-hint::before { position: absolute; width: 0; height: 0; content: ""; }.tutorial-spotlight-hint[data-side="right"]::before { top: var(--guide-tail-anchor); left: calc(-1 * var(--guide-tail-length)); border-top: 9px solid transparent; border-right: var(--guide-tail-length) solid var(--accent-color); border-bottom: 9px solid transparent; transform: translateY(-50%); }.tutorial-spotlight-hint[data-side="left"]::before { top: var(--guide-tail-anchor); right: calc(-1 * var(--guide-tail-length)); border-top: 9px solid transparent; border-left: var(--guide-tail-length) solid var(--accent-color); border-bottom: 9px solid transparent; transform: translateY(-50%); }.tutorial-spotlight-hint[data-side="bottom"]::before { top: calc(-1 * var(--guide-tail-length)); left: var(--guide-tail-anchor); border-right: 9px solid transparent; border-bottom: var(--guide-tail-length) solid var(--accent-color); border-left: 9px solid transparent; transform: translateX(-50%); }.tutorial-spotlight-hint[data-side="top"]::before { bottom: calc(-1 * var(--guide-tail-length)); left: var(--guide-tail-anchor); border-right: 9px solid transparent; border-top: var(--guide-tail-length) solid var(--accent-color); border-left: 9px solid transparent; transform: translateX(-50%); }.tutorial-target, .tutorial-result { position: relative !important; z-index: 1651 !important; }.tutorial-drag-gesture { position: fixed; z-index: 1685; display: flex; align-items: center; gap: 42px; pointer-events: none; transform: translate(-50%, -50%); }.tutorial-pan-gesture { position: relative; display: grid; place-items: center; }.tutorial-drag-arrows { font-size: 3rem; line-height: 1; color: var(--accent-color); text-shadow: 0 1px 4px rgb(255 255 255 / .9); }.tutorial-drag-hand { position: absolute; font-size: 2rem; line-height: 1; animation: tutorial-drag-hand-motion 1.35s ease-in-out infinite; }.tutorial-wheel-gesture { display: grid; place-items: center; gap: 2px; color: var(--accent-color); font-weight: 700; line-height: 1; }.tutorial-wheel-arrow { font-size: 1.65rem; }.tutorial-wheel-mouse { font-size: 2rem; line-height: 1; }@keyframes tutorial-drag-hand-motion { 0% { transform: translateX(-22px) scale(1); } 35% { transform: translateX(-22px) scale(.88); } 70% { transform: translateX(22px) scale(.88); } 100% { transform: translateX(22px) scale(1); } }

/* Help and tutorial explanations share the Viewer primary callout treatment. */
.viewer-primary-callout { --viewer-primary-callout-background: var(--accent-color); --viewer-primary-callout-text: var(--on-accent); border-color: var(--viewer-primary-callout-background); background: var(--viewer-primary-callout-background); color: var(--viewer-primary-callout-text); }
.help-guide-overlay { --viewer-primary-callout-background: var(--accent-color); }
.help-callout-leader-layer line { stroke: var(--viewer-primary-callout-background); }
.tutorial-spotlight-hint[data-side="right"]::before { border-right-color: var(--viewer-primary-callout-background); }.tutorial-spotlight-hint[data-side="left"]::before { border-left-color: var(--viewer-primary-callout-background); }.tutorial-spotlight-hint[data-side="bottom"]::before { border-bottom-color: var(--viewer-primary-callout-background); }.tutorial-spotlight-hint[data-side="top"]::before { border-top-color: var(--viewer-primary-callout-background); }
html[data-theme="dark"] .viewer-primary-callout, html[data-theme="dark"] .help-guide-overlay { --viewer-primary-callout-background: var(--primary-action-background); --viewer-primary-callout-text: var(--primary-action-text); }

.timeline-list-item { max-height: 800px; transition: opacity .18s ease, max-height .18s ease, margin .18s ease, padding-block .18s ease, transform .2s cubic-bezier(.2,.8,.2,1); }.timeline-list-item.is-removing { max-height: 0; margin-block: 0; padding-block: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.main-area.is-width-easing { transition: grid-template-columns .24s cubic-bezier(.2,.85,.25,1); }.timeline-list-content.is-content-switching { animation: phase3-content-fade .16s ease both; }
@keyframes phase3-content-fade { from { opacity: .35; } to { opacity: 1; } }

/* Binary controls use one button so the selected segment is presentation, not nested interaction. */
.binary-segmented-toggle { --segment-index: 0; position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; box-sizing: border-box; gap: 0; min-height: 30px; padding: 2px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--panel-background); color: var(--text-color); font: inherit; white-space: nowrap; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.binary-segmented-toggle::before { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / 2); border-radius: 999px; content: ""; transform: translateX(calc(var(--segment-index) * 100%)); transition: transform .18s ease-out, background-color .15s ease, border-color .15s ease; }
.binary-segmented-toggle > span { position: relative; z-index: 1; display: grid; place-items: center; min-width: 0; padding-inline: 7px; color: var(--text-color); pointer-events: none; transition: color .15s ease; }
.binary-segmented-toggle:hover:not(:disabled), .binary-segmented-toggle:focus-visible:not(:disabled) { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); outline: none; }
.binary-segmented-toggle--primary::before { border: 1px solid var(--accent-color); background: var(--accent-color); }
.binary-segmented-toggle--primary > .is-selected { color: #fff; font-weight: 700; }
.binary-segmented-toggle--secondary::before { border: 1px solid var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); }
.binary-segmented-toggle--secondary > .is-selected { color: var(--text-color); font-weight: 700; }
.graph-segmented { --segment-count: 2; --segment-index: 0; position: relative; display: grid; grid-template-columns: repeat(var(--segment-count), minmax(0, 1fr)); min-height: 30px; padding: 2px; isolation: isolate; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--panel-background); }.graph-segmented::before { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--segment-count)); border-radius: 999px; background: var(--accent-color); content: ""; transform: translateX(calc(var(--segment-index) * 100%)); }.graph-segmented > button { position: relative; z-index: 1; min-width: 0; min-height: 26px; padding: 2px 8px; border: 0; background: transparent; color: var(--text-color); font: inherit; cursor: pointer; }.graph-segmented > button.is-selected { color: #fff; }
.search-target-buttons { width: max-content; justify-self: start; }
.settings-group .text-switch { min-width: 205px; overflow: hidden; transition: color .16s ease, background-color .16s ease; }.settings-group .text-switch .text-switch-label { display: inline-block; animation: phase3-content-fade .16s ease both; }

/* Keep only the possible uncertainty envelope as an extra drawing edge. */
.range-band-possible-envelope { outline: 1px solid rgb(var(--timeline-rgb) / .72); outline-offset: 1px; border-style: dashed; }.event-table-event.is-selected { outline: 3px solid var(--accent-color) !important; outline-offset: 3px; }.event-table-event:hover { filter: contrast(1.1); }.timeline-lane-label-icon, .timeline-summary-identity-icon, .event-details-timeline-icon { text-shadow: 0 0 1px var(--panel-background), 0 0 3px var(--panel-background); }

@media (prefers-reduced-motion: reduce) { .body-panel-backdrop, .body-level-panel, .viewer-help-body, .tutorial-panel, .tutorial-spotlight, .timeline-list-item, .main-area.is-width-easing, .timeline-list-content.is-content-switching, .tutorial-drag-hand { animation: none !important; transition-duration: 0s !important; } .binary-segmented-toggle::before { transition-duration: 0s !important; } }

.toolbar-actions > .display-mode-button, .toolbar-actions > .binary-segmented-toggle, .toolbar-actions > .operations-button { min-height: 30px; }
.toolbar-actions > .display-mode-segmented.binary-segmented-toggle { box-sizing: border-box; flex: 0 0 128px; width: 128px; min-width: 128px; max-width: 128px; }
.toolbar-icon-button { box-sizing: border-box; width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 5px; }
.toolbar-action-divider { align-self: stretch; width: 1px; min-width: 1px; margin: 3px 2px; background: var(--border-color); pointer-events: none; }
.settings-menu { min-width: 280px; }
.settings-option-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 12px; }
.compound-control { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel-background); }
.compound-control > button, .compound-control > select { box-sizing: border-box; min-height: 30px; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--text-color); font: inherit; }
.compound-control > * + * { border-left: 1px solid var(--border-strong); }
.compound-control > button:hover:not(:disabled), .compound-control > button:focus-visible:not(:disabled), .compound-control > select:hover:not(:disabled), .compound-control > select:focus-visible:not(:disabled) { background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); box-shadow: inset 0 0 0 1px var(--accent-color); outline: none; }
.recommendation-word-row { grid-template-columns: minmax(0, 1fr) max-content; }
.date-hud-dial { display: inline-grid; }
.date-hud-dial-display { box-sizing: border-box; min-height: 30px; padding: 2px 5px; border: 1px solid var(--border-strong); border-radius: 4px; background: linear-gradient(to bottom, color-mix(in srgb, var(--panel-background) 82%, white) 0%, var(--panel-background) 48%, color-mix(in srgb, var(--panel-background) 88%, var(--border-color)) 100%); color: var(--text-color); font: inherit; font-variant-numeric: tabular-nums; text-align: center; cursor: text; }
.date-hud-dial-year .date-hud-dial-display { min-width: 4.6em; }.date-hud-dial-month .date-hud-dial-display, .date-hud-dial-day .date-hud-dial-display { min-width: 2.7em; }
.main-area { grid-template-rows: auto minmax(0, 1fr); }
.viewer-info-block { grid-column: 1; grid-row: 1; align-self: start; box-sizing: border-box; min-width: 0; padding: 6px 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--panel-background); margin-bottom: 6px; }
.timeline-list { grid-column: 1; grid-row: 2; }.timeline-list-resizer { grid-column: 2; grid-row: 1 / 3; }.main-stage { grid-column: 3; grid-row: 1 / 3; }.viewer-info-row { padding: 0; }
.search-panel { width: min(680px, calc(100% - 12px)); overflow-x: hidden; }
.search-result-columns, .search-result-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .5fr) max-content; }
.search-result-columns > span, .search-result-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-list-item { grid-template-columns: 14px minmax(0, 1fr); column-gap: 3px; align-items: start; }.timeline-drag-handle { left: 0; width: 14px; }
.viewer-like-button { display: inline-flex; align-items: center; gap: 4px; }.viewer-like-button.is-liked { border-color: var(--border-strong); color: var(--text-color); }.viewer-like-button:hover:not(:disabled), .viewer-like-button:focus-visible:not(:disabled) { border-color: var(--accent-color); color: var(--accent-color); }.viewer-like-button.is-liked .viewer-like-heart { color: var(--muted-color); }
.event-point-thumbnail { width: 42px; height: 42px; }.drawing-point-event.is-important .event-point-thumbnail { width: 51px; height: 51px; }.event-range-thumbnail { width: 42px; height: 36px; }.range-band-event.is-important .event-range-thumbnail { width: 48px; height: 41px; }.event-point-thumbnail, .event-range-thumbnail, .event-popup-image { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.event-popup.has-image { width: min(300px, calc(100vw - 16px)); grid-template-columns: 1fr; }.event-popup-top { display: grid; grid-template-columns: 86.4px minmax(0, 1fr); align-items: start; gap: 8px; }.event-popup-header { display: grid; gap: 3px; min-width: 0; }.event-popup-header h3 { overflow-wrap:anywhere; word-break:break-word; white-space:normal; }.event-popup-image { width: 86.4px; height: 86.4px; border: 0; border-radius: 0; object-fit: cover; }.event-popup-description { -webkit-line-clamp: 2; }
.event-details-identity-row { display: flex; align-items: center; gap: 6px; min-width: 0; }.event-details-identity-row .event-details-timeline { flex: 1 1 auto; min-width: 0; }.event-details-navigation { flex: 0 0 auto; margin-left: auto; }.event-details-title-row { min-width: 0; }.event-details-title-row h3 { margin: 4px 0 0; }.event-details-location { gap: 12px; }.event-details-location-group { display: grid; gap: 4px; }.correction-report-button { color: var(--accent-color); }

@media (max-width: 900px) { .site-identity { display: none; } .toolbar-date-controls { max-width: 145px; } .toolbar-actions .display-mode-button { padding-inline: 5px; } }

/* Chrome acceptance follow-up: viewer-only interaction chrome. */
.drawing-point-event:is(:hover, :focus-within, .is-selected) .point-event-marker { box-shadow: 0 0 0 4px var(--drawing-marker-fill); }
.drawing-point-event:is(:hover, :focus-within, .is-selected) .event-point-thumbnail { box-shadow: 0 0 0 4px var(--drawing-marker-fill), 0 2px 5px rgb(15 23 42 / .22); }
.range-band-event:is(:hover, :focus-within, .is-selected) .range-band-core,
.range-band-event:is(:hover, :focus-within, .is-selected) .range-band-possible-envelope { outline: 4px solid var(--drawing-range-fill); outline-offset: 2px; }

.event-details-nav-button { min-height: 24px; height: 24px; padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }
.event-details-nav-button:disabled {
    border-color: var(--border-color);
    background: var(--panel-background);
    color: var(--muted-color);
    opacity: .42;
    cursor: default;
    pointer-events: none;
}
.event-details-navigation button:hover:not(:disabled), .event-details-navigation button:focus-visible:not(:disabled) { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); outline: none; }
.event-details-timeline-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-details-date-block { display: grid; gap: 2px; }
.event-details-date-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-width: 0; }
.event-details-date-meta-line { color: var(--muted-color); font-size: .78rem; }
.event-details-duration, .event-details-relative-date { margin: 0; }

.viewer-like-button { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.viewer-like-button:hover:not(:disabled), .viewer-like-button:focus-visible:not(:disabled) { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); outline: none; }
.viewer-like-button.is-liked .viewer-like-heart { color: #94a3b8; }
.viewer-like-button[data-tooltip]::after { position: absolute; z-index: 120; top: calc(100% + 4px); left: 50%; width: max-content; padding: 4px 6px; border-radius: 4px; background: #0f0f0f; color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity .12s ease, transform .12s ease; }
.viewer-like-button[data-tooltip]:hover::after, .viewer-like-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .5s; }

.recommendation-random, .recommendation-random-settings { box-sizing: border-box; width: 34px; height: 34px; min-width: 34px; min-height: 34px; padding: 0; }
.date-display-context, .date-display-detail { position: relative; height: 38px; }
.date-display-context { z-index: 3; overflow: visible; border-bottom: 1px solid var(--border-color); }
.date-display-detail { z-index: 2; overflow: visible; }
.timeline-surface.date-display-bottom .date-today-dot { top: -4px; bottom: auto; }
.local-event-search { width: min(172px, calc(100% - 12px)); }
.details-panel { top: 50px; max-height: calc(100% - 50px); }

.viewer-help-button { box-sizing: border-box; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 6px; border-color: var(--accent-color); border-radius: 50%; background: var(--accent-color); color:#fff; }
.viewer-help-button .ui-icon { width: 18px; height: 18px; }
.viewer-help-button:hover:not(:disabled), .viewer-help-button:focus-visible:not(:disabled) { background: color-mix(in srgb, var(--accent-color) 88%, #000); border-color: color-mix(in srgb, var(--accent-color) 88%, #000); color:#fff; outline: none; }
.viewer-books-block { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; padding: 5px 8px; border-top: 1px solid var(--border-color); background: var(--panel-background); }
.viewer-books-label { padding-right: 7px; border-right: 1px solid var(--border-color); color: var(--muted-color); font-size: .78rem; white-space: nowrap; }
.viewer-books-button { min-width: 0; overflow: hidden; border: 0; background: transparent; color: var(--text-color); font: inherit; text-align: left; cursor: pointer; }
.viewer-books-marquee { display: block; overflow: hidden; white-space: nowrap; }
.viewer-books-marquee-track { display: inline-block; min-width: max-content; transform: translateX(0); }
.viewer-books-marquee-track.is-marquee-active { animation: viewer-books-marquee var(--book-marquee-duration) linear forwards; }
.viewer-books-button:hover, .viewer-books-button:focus-visible { border: 0; background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); box-shadow: none; outline: none; }
@keyframes viewer-books-marquee { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--book-marquee-distance))); } }
.main-area { grid-template-rows: minmax(0, 1fr) auto; }
.timeline-list { grid-column: 1; grid-row: 1; }
.viewer-books-block[hidden] { display: none !important; }
.main-area.viewer-books-hidden { grid-template-rows: minmax(0, 1fr); }
.main-area.viewer-books-hidden .timeline-list,
.main-area.viewer-books-hidden .timeline-list-resizer,
.main-area.viewer-books-hidden .main-stage { grid-row: 1; }

.operations-studio-link { position: relative; }
.operations-studio-link[data-tooltip]::after { position: absolute; z-index: 1501; top: calc(100% + 4px); left: 0; width: max-content; padding: 4px 6px; border-radius: 4px; background: #0f0f0f; color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease; }
.operations-studio-link:hover::after, .operations-studio-link:focus-visible::after { opacity: 1; transform: translateY(0); transition-delay: .5s; }

.date-hud-dial-display { position: relative; box-sizing: border-box; display: inline-grid; align-items: center; height: 30px; min-height: 30px; max-height: 30px; overflow: hidden; padding: 2px; line-height: 1; background: linear-gradient(to bottom, color-mix(in srgb, var(--panel-background) 82%, white) 0%, var(--panel-background) 48%, color-mix(in srgb, var(--panel-background) 88%, var(--border-color)) 100%); box-shadow: inset 0 1px 2px rgb(15 23 42 / .14), inset 0 -1px 2px rgb(15 23 42 / .12); }
.date-hud-dial-current { position: relative; display: inline-flex; align-items: stretch; height: 24px; min-height: 24px; max-height: 24px; line-height: 1; }
.date-hud-dial-digit { position: relative; display: inline-grid; place-items: center; min-width: 1.25em; height: 24px; min-height: 24px; max-height: 24px; overflow: hidden; border-left: 1px solid var(--border-color); background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 42%, #e2e8f0 50%, #ffffff 58%, #f1f5f9 100%); box-shadow: inset 0 1px 1px rgb(15 23 42 / .12), inset 0 -1px 1px rgb(15 23 42 / .12); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; line-height: 1; }
.date-hud-dial-current .date-hud-dial-digit:first-child { border-left: 0; }
.date-hud-dial-digit.is-sign { min-width: .8em; }
.date-hud-dial-digit-current, .date-hud-dial-digit-previous { display: grid; width: 100%; height: 24px; min-height: 24px; max-height: 24px; place-items: center; line-height: 1; }
.date-hud-dial-digit-previous { position: absolute; inset: 0; }
.date-hud-dial-digit.is-rolling-up .date-hud-dial-digit-current { animation: dial-digit-up-current .18s ease-out both; }
.date-hud-dial-digit.is-rolling-up .date-hud-dial-digit-previous { animation: dial-digit-up-previous .18s ease-out both; }
.date-hud-dial-digit.is-rolling-down .date-hud-dial-digit-current { animation: dial-digit-down-current .18s ease-out both; }
.date-hud-dial-digit.is-rolling-down .date-hud-dial-digit-previous { animation: dial-digit-down-previous .18s ease-out both; }
@keyframes dial-digit-up-current { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes dial-digit-up-previous { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-100%); } }
@keyframes dial-digit-down-current { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes dial-digit-down-previous { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(100%); } }

.recommendation-members { display: grid; gap: 0; min-width: 0; }.recommendation-member-title { display: block; box-sizing: border-box; width: 100%; min-width: 0; overflow: hidden; padding: 3px 0; border: 0; border-radius: 0; background: transparent; color: var(--text-color); font: inherit; font-size: .84rem; text-align: left; text-overflow: ellipsis; white-space: nowrap; }.recommendation-members > .recommendation-member-title + .recommendation-member-title { border-top: 1px solid var(--border-color); }.recommendation-member-title:hover, .recommendation-member-title:focus-visible { background: transparent; color: var(--accent-color); outline: none; }

.correction-panel.body-level-panel { width: min(720px, calc(100vw - 24px)); }
.correction-panel-content { display: grid; gap: 10px; min-height: 0; }.correction-panel-heading-actions, .correction-panel-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }.correction-panel-button { min-height: 30px; padding: 4px 9px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--panel-background); color: var(--text-color); font: inherit; cursor: pointer; }.correction-panel-send { border-color: var(--accent-color); background: var(--accent-color); color: #fff; }.correction-panel-danger { border-color: #dc2626; color: #b91c1c; }.correction-timeline-input, .correction-event-input { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 2.4rem; max-height: 160px; resize: none; overflow-x: hidden; overflow-y: hidden; }.correction-event-scroll { display: grid; gap: 0; max-height: min(48vh, 420px); min-width: 0; overflow-x: hidden; overflow-y: auto; border-top: 1px solid var(--border-color); }.correction-event-row { display: block; min-width: 0; padding: 7px 0; border-top: 1px solid var(--border-color); }.correction-event-scroll .correction-event-row:first-child { border-top: 0; }.correction-event-summary { display: grid; grid-template-columns: minmax(8.5rem, 9.5rem) minmax(0, 1fr) 4.5rem; align-items: center; gap: 7px; width: 100%; min-width: 0; }.correction-event-date, .correction-event-end { color: var(--text-color); font-size: .88rem; white-space: nowrap; }.correction-event-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.correction-event-toggle { box-sizing: border-box; width: 4.5rem; min-width: 4.5rem; min-height: 26px; margin: 0; padding: 2px 7px; justify-self: stretch; white-space: nowrap; }.correction-discard-confirmation { margin: 0; }

.correction-panel.body-level-panel { display: grid; grid-template-rows: max-content minmax(0, 1fr); overflow: hidden; }
.correction-panel-content { grid-template-rows: max-content max-content minmax(0, 1fr); overflow: hidden; }
.correction-timeline-name { color: rgb(var(--timeline-rgb)); font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.correction-event-scroll { overflow-y: auto; }
.correction-event-row.has-message { background: color-mix(in srgb, var(--accent-color) 8%, var(--panel-background)); }
.correction-event-date-cell { display: grid; min-width: 0; color: var(--text-color); font-size: .88rem; line-height: 1.35; white-space: nowrap; }
.correction-event-date-cell > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correction-event-input { box-sizing: border-box; width: 100%; margin-top: 6px; }
.correction-event-title { min-width: 0; margin: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--text-color); font: inherit; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.correction-event-title:hover, .correction-event-title:focus-visible { color: var(--accent-color); outline: none; }
.correction-event-toggle:hover:not(:disabled), .correction-event-toggle:focus-visible:not(:disabled) { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); outline: none; }

.recommendation-sort-control { min-height: 26px; height: 26px; font-size: .74rem; }
.recommendation-sort-control > button, .recommendation-sort-control > select { min-height: 24px; height: 24px; padding-block: 1px; }
.recommendation-sort-direction { width: 24px; min-width: 24px; padding-inline: 3px; }
.recommendation-sort-control > select { padding-inline: 5px; }
.recommendation-sort-control > * + *, .recommendation-random-compound > * + * { border-left: 0; }
.recommendation-sort-control, .recommendation-random-compound { position: relative; }
.recommendation-sort-control::after, .recommendation-random-compound::after { position: absolute; z-index: 3; top: 3px; bottom: 3px; width: 1px; background: var(--border-strong); content: ""; pointer-events: none; }
.recommendation-sort-control::after { left: 24px; }
.recommendation-random-compound::after { left: 34px; }
.operations-menu hr { width: 100%; height: 0; margin: 4px 0; border: 0; border-top: 1px solid var(--border-color); }
.date-today-dot[data-tooltip] { position: absolute; }.date-today-dot[data-tooltip]::after { position: absolute; z-index: 120; top: calc(100% + 5px); left: 50%; width: max-content; padding: 4px 6px; border-radius: 4px; background: #0f0f0f; color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity .12s ease, transform .12s ease; }.date-today-dot[data-tooltip]:hover::after, .date-today-dot[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0s; }
.correction-report-button:hover, .correction-report-button:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); }
.correction-report-icon {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
    pointer-events: none;
}
html[data-theme="dark"] .correction-report-icon,
html.high-contrast[data-theme="dark"] .correction-report-icon {
    filter: brightness(0) invert(1);
}
html[data-theme="dark"] .search-result-type-icon {
    filter: brightness(0) invert(1);
}
.settings-option-row[data-tooltip] { position: relative; }
.settings-option-row[data-tooltip]::after { position: absolute; z-index: var(--layer-popup-event); top: calc(100% + 5px); left: 0; width: max-content; max-width: 18rem; padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; content: attr(data-tooltip); font-size: .72rem; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease; }
.settings-option-row[data-tooltip]:hover::after, .settings-option-row[data-tooltip]:focus-within::after { opacity: 1; transform: translateY(0); transition-delay: .5s; }

@media (prefers-reduced-motion: reduce) { .viewer-books-marquee-track, .date-hud-dial-digit-current, .date-hud-dial-digit-previous { animation: none !important; } }
html[data-studio-editor-viewer="true"],
html[data-studio-editor-viewer="true"] body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

html[data-studio-editor-viewer="true"] .app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

html[data-studio-editor-viewer="true"] .editor-viewer-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

html[data-studio-editor-viewer="true"] #menu-bar {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
}

html[data-studio-editor-viewer="true"] #overview-map {
  width: auto;
  min-width: 0;
}

html[data-studio-editor-viewer="true"] .site-identity,
html[data-studio-editor-viewer="true"] #viewer-books-block {
  display: none !important;
}

html[data-studio-editor-viewer="true"] #main-area { min-width: 0; overflow: hidden; }

html[data-studio-editor-viewer="true"] #main-stage,
html[data-studio-editor-viewer="true"] #main-view,
html[data-studio-editor-viewer="true"] #timeline-surface,
html[data-studio-editor-viewer="true"] .timeline-event-region {
  height: 100%;
  min-height: 0;
}
.numeric-note-marker { cursor: pointer; }
.settings-menu { width: min(330px, calc(100vw - 24px)); min-width: min(330px, calc(100vw - 24px)); }
.theme-segmented-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 210px; min-width: 210px; padding: 2px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--placeholder-background); }
.theme-segmented-control button { min-width: 0; min-height: 27px; padding: 3px 6px; border: 0; border-left: 1px solid var(--border-color); background: transparent; color: var(--muted-color); font: inherit; font-size: .76rem; white-space: nowrap; cursor: pointer; }
.theme-segmented-control button:first-child { border-left: 0; }
.theme-segmented-control button:hover,.theme-segmented-control button:focus-visible { background: color-mix(in srgb, var(--accent-color) 10%, var(--panel-background)); color: var(--text-color); outline: none; }
.theme-segmented-control button.is-selected { background: var(--accent-color); color: var(--on-accent); font-weight: 700; }
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .toolbar-icon-button { color: var(--text-color); }
html[data-theme="dark"] .timeline-lane-label {
    background:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 12%,
            var(--surface-raised)
        );
    border-color:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 52%,
            var(--border-color)
        );
}
html[data-theme="dark"] .point-event-title,
html[data-theme="dark"] .uncertain-point-title,
html[data-theme="dark"] .cluster-summary-expanded {
    background:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 16%,
            var(--panel-background)
        );
}
html[data-theme="dark"] .event-table-event:hover,html[data-theme="dark"] .event-table-event:focus,html[data-theme="dark"] .event-table-event.is-selected { background: rgb(var(--timeline-rgb) / .18); }
html[data-theme="dark"] .local-event-search-row:hover,html[data-theme="dark"] .local-event-search-row:focus-visible { background: color-mix(in srgb, rgb(var(--timeline-rgb)) 18%, var(--panel-background)); }
html[data-theme="dark"] .overview-viewport-indicator,html[data-theme="dark"] .overview-selection-preview { background: rgb(93 169 255 / .20); }
html[data-theme="dark"] .timeline-date-line.minor { border-left-color: rgb(91 112 139 / .20); }
html[data-theme="dark"] .date-display-line { border-left-color: rgb(91 112 139 / .30); }
html[data-theme="dark"] .date-display-line.context { border-left-color: rgb(112 137 168 / .42); }
html[data-theme="dark"] .date-hud-dial-display { background: linear-gradient(to bottom,#152131 0%,#101823 48%,#0b1119 100%); box-shadow: inset 0 1px 2px rgb(0 0 0 / .42),inset 0 -1px 2px rgb(0 0 0 / .34); }
html[data-theme="dark"] .date-hud-dial-digit { background: linear-gradient(to bottom,#172232 0%,#111a27 42%,#213047 50%,#111a27 58%,#0c131d 100%); color: var(--text-color); box-shadow: inset 0 1px 1px rgb(0 0 0 / .36),inset 0 -1px 1px rgb(0 0 0 / .36); }
html[data-theme="dark"] .display-mode-button.is-active,html[data-theme="dark"] .list-mode-tab.is-active,html[data-theme="dark"] .binary-segmented-toggle--primary > .is-selected,html[data-theme="dark"] .graph-segmented > button.is-selected,html[data-theme="dark"] .timeline-management-toolbar .timeline-add-select,html[data-theme="dark"] .correction-panel-send { color: var(--on-accent); }
html[data-theme="dark"] .viewer-help-button,html.high-contrast .viewer-help-button { color:#fff; }
html[data-theme="dark"] .viewer-help-button .ui-icon { filter: none; }
html.high-contrast[data-theme="dark"] { --page-background: #03060a; --panel-background: #080d14; --placeholder-background: #0b121c; --border-color: #60748e; --border-strong: #8ca1bb; --text-color: #f4f7fb; --muted-color: #c1ccd8; --accent-color: #75b7ff; --on-accent: #04101d; --danger-color: #ff8792; --danger-background: #38151c; --tooltip-background: #203750; --drawing-nameplate-background: #080d14; }
.ui-icon-asset-mask { display:block; background-color:currentColor; -webkit-mask:var(--ui-icon-mask) center / contain no-repeat; mask:var(--ui-icon-mask) center / contain no-repeat; }
.graph-type-button .ui-icon { width:17px; height:17px; }
.viewer-help-button .ui-icon { filter:none; }
.range-band-possible-envelope { border:0; outline:0; }
.range-band-event:is(:hover,:focus-within,.is-selected) .range-band-core { outline:4px solid var(--drawing-range-fill); outline-offset:2px; }
.range-band-event:is(:hover,:focus-within,.is-selected) .range-band-possible-envelope { border:0; outline:0; filter:drop-shadow(0 0 1px rgb(var(--timeline-rgb) / .95)) drop-shadow(0 0 3px rgb(var(--timeline-rgb) / .35)); }
.high-contrast .range-band-possible-envelope { border:0; outline:0; filter:contrast(1.2) drop-shadow(0 0 1px rgb(var(--timeline-rgb) / .95)); }
html[data-theme="dark"] .range-title-inside .range-band-title { background:transparent; box-shadow:none; }

/* Dark primary actions: keep the viewer accent independent from CTA emphasis. */
html[data-theme="dark"] .ui-button--primary,
html[data-theme="dark"] .timeline-management-toolbar .timeline-add-select {
    background: var(--primary-action-background);
    border-color: var(--primary-action-background);
    color: var(--primary-action-text);
}
html[data-theme="dark"] .ui-button--primary:hover:not(:disabled),
html[data-theme="dark"] .ui-button--primary:focus-visible:not(:disabled),
html[data-theme="dark"] .timeline-management-toolbar .timeline-add-select:hover:not(:disabled),
html[data-theme="dark"] .timeline-management-toolbar .timeline-add-select:focus-visible:not(:disabled) {
    background: var(--primary-action-hover);
    border-color: var(--primary-action-hover);
    color: var(--primary-action-text);
}
html[data-theme="dark"] .binary-segmented-toggle--primary::before { background: var(--primary-action-background); border-color: var(--primary-action-background); }
html[data-theme="dark"] .binary-segmented-toggle--primary > .is-selected { color: var(--primary-action-text); }
html[data-theme="dark"] .display-mode-button.is-active { background: var(--primary-action-background); border-color: var(--primary-action-background); color: var(--primary-action-text); }
html[data-theme="dark"] .display-mode-button.is-active:hover:not(:disabled),
html[data-theme="dark"] .display-mode-button.is-active:focus-visible:not(:disabled) { background: var(--primary-action-hover); border-color: var(--primary-action-hover); color: var(--primary-action-text); }
html[data-theme="dark"] .viewer-help-button { background: var(--primary-action-background); border-color: var(--primary-action-background); color: var(--primary-action-text); }
html[data-theme="dark"] .viewer-help-button:hover:not(:disabled),
html[data-theme="dark"] .viewer-help-button:focus-visible:not(:disabled) { background: var(--primary-action-hover); border-color: var(--primary-action-hover); color: var(--primary-action-text); }
html[data-theme="dark"] .range-title-outside .range-band-title {
    background:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 16%,
            var(--panel-background)
        );
}
html[data-theme="dark"] .point-event-title,
html[data-theme="dark"] .uncertain-point-title,
html[data-theme="dark"] .cluster-summary-expanded {
    background:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 16%,
            var(--panel-background)
        );
}

html[data-theme="dark"] .numeric-y-axis-value,
html[data-theme="dark"] .numeric-y-axis-unit {
    background:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 9%,
            var(--surface-raised)
        );
    color:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 64%,
            var(--text-color)
        );
    border:
        1px solid
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 20%,
            var(--border-color)
        );
    box-shadow: none;
}

html[data-theme="dark"] .numeric-y-axis-unit {
    text-shadow: none;
}

html[data-theme="dark"] .numeric-y-guide {
    border-top-color:
        color-mix(
            in srgb,
            var(--border-color) 72%,
            transparent
        );
}

html[data-theme="dark"] .numeric-y-axis {
    color:
        color-mix(
            in srgb,
            rgb(var(--timeline-rgb)) 70%,
            var(--text-color)
        );
}

html[data-theme="dark"] .timeline-surface {
    background: var(--surface-inset);
}

html[data-theme="dark"] .timeline-event-region {
    background: transparent;
}

html[data-theme="dark"] .date-display-area {
    background: var(--panel-background);
}

html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .details-panel {
    background: var(--panel-background);
}

html[data-theme="dark"] .settings-menu,
html[data-theme="dark"] .operations-menu,
html[data-theme="dark"] .timeline-card-config-panel {
    background: var(--surface-overlay);
}

html[data-theme="dark"] .timeline-date-line {
    border-left-color: rgb(148 163 184 / .18);
}

html[data-theme="dark"] .timeline-date-line.context {
    border-left-color: rgb(148 163 184 / .40);
}

html[data-theme="dark"] .timeline-date-line.detail {
    border-left-color: rgb(148 163 184 / .28);
}

html[data-theme="dark"] .timeline-date-line.minor {
    border-left-color: rgb(148 163 184 / .14);
}

html[data-theme="dark"] .date-display-line {
    border-left-color: rgb(148 163 184 / .28);
}

html[data-theme="dark"] .date-display-line.context {
    border-left-color: rgb(148 163 184 / .40);
}

html[data-theme="dark"] .date-display-line.detail {
    border-left-color: rgb(148 163 184 / .28);
}

.graph-settings-panel.is-v1-series-settings { width: min(620px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: hidden; }
.v1-series-settings-layout { display: grid; grid-template-columns: minmax(300px, 360px) minmax(180px, 230px); min-width: 0; max-height: calc(100vh - 32px); }
.v1-series-settings-left, .v1-series-composer { min-width: 0; max-height: calc(100vh - 32px); overflow-y: auto; padding: 8px; }
.v1-series-composer { border-left: 1px solid var(--border-color); }
.v1-measure-summary { display: grid; gap: 2px; margin-bottom: 8px; }
.v1-measure-summary span { color: var(--muted-color); font-size: .86em; }
.v1-global-settings-button { margin-bottom: 8px; }
.v1-settings-heading { margin: 8px 0 6px; font-size: .9em; }
.v1-series-row { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 6px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--surface-raised); }
.v1-series-row + .v1-series-row { margin-top: 4px; }
.v1-series-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v1-series-actions { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.graph-group-dissolve-button:hover:not(:disabled), .graph-group-dissolve-button:focus-visible:not(:disabled), .graph-group-member-remove:hover:not(:disabled), .graph-group-member-remove:focus-visible:not(:disabled) { color: var(--danger-color, #dc2626); }
.v1-series-remove:disabled { cursor: not-allowed; opacity: .45; }
.v1-member-list { max-height: calc(10 * 30px); overflow-y: auto; border-top: 1px solid var(--border-color); }
.v1-member-row { display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 5px; cursor: pointer; }
.v1-member-row.is-unavailable { color: var(--muted-color); opacity: .52; }
.v1-member-row:hover { background: var(--surface-raised); }
.v1-dimension-group h4 { margin: 10px 0 4px; }
.v1-global-settings-popover, .v1-series-presentation-popover { margin: 4px 0 8px; padding: 7px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--surface-raised); }
.v1-series-presentation-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
.v1-series-presentation-row > span { min-width: 4em; color: var(--muted-color); }
.v1-series-color-options { display: flex; gap: 5px; flex-wrap: wrap; }
.v1-series-color-options button { width: 20px; height: 20px; padding: 0; border: 2px solid transparent; border-radius: 50%; }
.v1-series-color-options button.is-selected { border-color: var(--text-color); outline: 1px solid var(--border-color); }
@media (max-width: 720px) { .v1-series-settings-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.v1-settings-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; border-bottom: 1px solid var(--border-color); }
.v1-global-settings-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 72px; flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; margin: 0; padding: 3px 8px; }
.v1-global-settings-icon { color: var(--text-color); }
.v1-global-settings-button { color: var(--text-color); background: var(--surface-raised); border: 1px solid var(--border-color); }
.v1-global-settings-button:hover, .v1-global-settings-button:focus-visible { background: var(--surface-inset); border-color: var(--border-strong); }
.v1-series-settings-left { display: flex; flex-direction: column; min-height: 0; }
.v1-series-list { display: flex; flex: 1 1 auto; flex-direction: column; max-height: none; min-height: 0; overflow-y: auto; }
.v1-series-row { display: flex; flex: 0 0 auto; align-self: auto; height: auto; min-height: 38px; padding: 4px 7px; }
.v1-series-row .icon-button { width: 28px; height: 28px; }
.v1-series-row .ui-icon { width: 16px; height: 16px; }
.v1-dimension-group { margin: 0 0 8px; }
.v1-dimension-group > summary { cursor: pointer; padding: 5px 2px; font-weight: 600; }
.v1-member-list { max-height: calc(5 * 30px); overflow-y: auto; }
.v1-global-settings-popover, .v1-series-presentation-popover { position: fixed; z-index: 1200; min-width: 250px; max-width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: visible; box-shadow: 0 8px 24px rgb(0 0 0 / .2); }
.v1-line-option { width: 42px; height: 28px; padding: 3px 5px; flex: 0 0 42px; }
.v1-line-option .graph-line-sample { display: block; width: 28px; }
.v1-bar-style-option { display: inline-flex; align-items: center; justify-content: center; }
.v1-bar-style-image { display: block; width: 28px; height: 18px; object-fit: contain; pointer-events: none; }
html[data-theme="dark"] .v1-bar-style-image,
html.high-contrast[data-theme="dark"] .v1-bar-style-image { filter: brightness(0) invert(1); }
.v1-icon-option { width: 30px; height: 30px; padding: 4px; }
.v1-icon-option .ui-icon { width: 18px; height: 18px; }
.v1-series-presentation-reset { display: block; margin: 6px 0 0 auto; }
.numeric-graph-tooltip { z-index: 1300; max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; }
.numeric-graph-tooltip-series-block { display: flex; flex-direction: column; gap: 1px; min-width: 0; width: 100%; }
.numeric-graph-tooltip-series-row { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.numeric-series-style-marker { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; min-width: 24px; height: 16px; color: inherit; }
.numeric-graph-tooltip-series-marker { flex-basis: 24px; }
.numeric-series-style-marker .graph-line-sample { display: block; width: 20px; inline-size: 20px; }
.numeric-series-style-dash-dot { position: relative; display: block; width: 24px; height: 8px; flex: 0 0 24px; background: radial-gradient(circle at 50% 50%, currentColor 0 1.5px, transparent 1.6px); }
.numeric-series-style-dash-dot::before,
.numeric-series-style-dash-dot::after { position: absolute; top: 50%; width: 8px; height: 2px; border-radius: 999px; background: currentColor; content: ""; transform: translateY(-50%); }
.numeric-series-style-dash-dot::before { left: 0; }
.numeric-series-style-dash-dot::after { right: 0; }
.numeric-series-style-bar-icon { width: 14px; height: 14px; color: currentColor; }
.numeric-series-style-marker .ui-icon { width: 14px; height: 14px; color: currentColor; }
.numeric-graph-tooltip-series-label { flex: 1 1 auto; min-width: 0; text-align: left; white-space: nowrap; }
.numeric-graph-tooltip-series-value { flex: 0 0 auto; margin-left: auto; text-align: right; white-space: nowrap; }
.numeric-graph-tooltip-series-date { margin-left: 30px; color: var(--muted-color); font-size: .9em; }
.numeric-graph-tooltip-series-note { margin-left: 30px; padding-left: 0; color: var(--muted-color); font-size: .92em; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; margin-top: -1px; margin-bottom: 2px; }
.numeric-graph-tooltip-series-note.is-system-note { opacity: .82; }
.numeric-graph-tooltip-group-heading { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 5px; color: var(--text-color); font-size: .9em; white-space: nowrap; }
.numeric-graph-tooltip-group-heading::after { border-top-color: rgb(255 255 255 / .28); opacity: 1; }
html:not([data-theme="dark"]) .numeric-graph-tooltip-group-heading { color: rgb(255 255 255 / .92); }
.numeric-graph-tooltip-group-heading:first-child { margin-top: 0; }
.numeric-graph-tooltip-group-heading span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.numeric-graph-tooltip-group-heading::after { flex: 1 1 auto; min-width: 12px; border-top: 1px solid var(--border-color); opacity: .5; content: ""; }
.numeric-graph-tooltip-note { white-space: pre-line; }
.graph-setting-label { color: var(--text-color); font-size: .75rem; }
.graph-setting-option.is-selected,.graph-setting-option.is-selected:hover,.graph-setting-option.is-selected:focus-visible { border-color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 12%, var(--panel-background)); color: var(--accent-color); }
.graph-setting-option.is-selected .ui-icon { color: var(--accent-color); }
.v1-settings-header-actions { display: inline-flex; align-items: center; gap: 4px; }
.v1-series-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; }
.v1-series-heading-row .v1-settings-heading { margin: 8px 0 6px; }
.v1-series-reset-button { flex: 0 0 28px; width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 4px; }
.v1-series-presentation-row > .graph-setting-label { min-width: 4em; color: var(--text-color); }
.numeric-series-legend { position: absolute; z-index: 4; top: 4px; left: calc(var(--numeric-axis-start, 92px) + 8px); right: 8px; display: flex; align-items: center; min-width: 0; height: 22px; overflow: hidden; white-space: nowrap; pointer-events: none; }
.numeric-series-legend-content { display: inline-flex; align-items: center; gap: 10px; width: max-content; max-width: none; min-width: max-content; min-height: 20px; padding: 1px 4px; border-radius: 3px; background: color-mix(in srgb, var(--panel-background) 82%, transparent); white-space: nowrap; }
.numeric-series-legend-more { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 20px; height: 20px; color: var(--text-color); background: var(--panel-background); font-size: .8rem; font-weight: 700; }
.numeric-series-legend-more[hidden] { display: none; }
.numeric-timeline-lane.has-right-numeric-axis .numeric-series-legend { right: calc(var(--numeric-axis-width, 42px) + 10px); }
.numeric-series-legend-item { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.numeric-series-legend-marker { flex: 0 0 24px; width: 24px; }
.numeric-series-legend-label { color: var(--text-color); font-size: .68rem; line-height: 1; white-space: nowrap; }
.numeric-series-legend-stack { flex: 0 0 auto; color: var(--accent-color); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.numeric-timeline-lane .numeric-graph-layer { top: 28px; bottom: 8px; }
.numeric-graph-group-label-rail { position: absolute; z-index: 5; top: 5px; bottom: 5px; left: 5px; display: flex; flex-direction: column; width: max-content; max-width: 2.4rem; gap: 0; pointer-events: none; }
.numeric-graph-group-label-rail > .timeline-lane-label { position: relative; top: auto; left: auto; flex: 1 1 0; min-height: 0; width: auto; max-width: 2.4rem; max-height: none; box-sizing: border-box; overflow: hidden; }
.numeric-graph-group-label-rail > .timeline-lane-label .timeline-lane-label-title { min-height: 0; max-height: 100%; }
.numeric-graph-group-lane .numeric-graph-layer { top: 28px; }
.numeric-graph-group-member-layer .numeric-y-axis-left { left: calc(var(--numeric-group-axis-start, 48px) + var(--numeric-group-axis-offset, 0px)); width: var(--numeric-group-axis-width, 42px); transform: none; }
.numeric-graph-group-member-layer .numeric-y-axis-right { left: auto; right: calc(4px + var(--numeric-group-axis-offset, 0px)); width: var(--numeric-group-axis-width, 42px); transform: none; }
.numeric-graph-group-lane .numeric-series-legend { left: calc(var(--numeric-axis-start, 48px) + 8px); right: calc(var(--numeric-group-right-axis-total, 0px) + 10px); }
.numeric-graph-tooltip-series-row.is-highlighted .numeric-graph-tooltip-series-label,
.numeric-graph-tooltip-series-row.is-highlighted .numeric-graph-tooltip-series-value { font-weight: inherit; text-decoration-line: underline; text-decoration-color: var(--numeric-tooltip-series-color); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.timeline-list-item { position: relative; }
.timeline-group-drop-zone { position: absolute; z-index: 6; top: 25%; right: 12.5%; bottom: 25%; left: 62.5%; display: none; align-items: center; justify-content: center; border: 1px dashed var(--accent-color); border-radius: 5px; color: var(--accent-color); background: transparent; font-size: .72rem; font-weight: 700; pointer-events: none; }
.timeline-list.is-dragging-graph .timeline-list-item.is-group-target-eligible .timeline-group-drop-zone { display: flex; }
.timeline-list-item.is-drop-group .timeline-group-drop-zone { display: flex; border-width: 2px; background: color-mix(in srgb, var(--accent-color) 10%, transparent); }
.graph-group-card { border-style: dashed; }
.graph-group-settings-panel { display: flex; flex-direction: column; width: min(var(--graph-group-panel-width, 390px), calc(100vw - 16px)); max-width: calc(100vw - 16px); max-height: min(560px, calc(100vh - 16px)); overflow: hidden; background: var(--panel-background); }
.graph-group-settings-popover { position: fixed; z-index: 1200; min-width: 180px; max-width: min(320px, calc(100vw - 16px)); padding: 8px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--panel-background); box-shadow: 0 8px 24px rgb(15 23 42 / 18%); }
.graph-settings-tooltip-overlay { position: fixed; z-index: 1400; max-width: min(18rem, calc(100vw - 16px)); padding: 4px 6px; border-radius: 4px; background: var(--tooltip-background); color: #fff; font-size: .72rem; line-height: 1.35; pointer-events: none; }
.graph-settings-panel .icon-button[data-tooltip]::after,
.graph-settings-panel .graph-setting-option[data-tooltip]::after,
.graph-settings-panel .graph-segmented button[data-tooltip]::after,
.graph-group-settings-popover .icon-button[data-tooltip]::after,
.graph-group-settings-popover .graph-setting-option[data-tooltip]::after,
.v1-global-settings-popover .icon-button[data-tooltip]::after,
.v1-global-settings-popover .graph-setting-option[data-tooltip]::after,
.v1-series-presentation-popover .icon-button[data-tooltip]::after,
.v1-series-presentation-popover .graph-setting-option[data-tooltip]::after { display: none; }
.graph-group-settings-layout { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 10px; width: 100%; flex: 1 1 auto; min-height: 0; max-height: 100%; align-items: stretch; overflow: hidden; }
.graph-group-settings-layout.has-no-filter-pane { grid-template-columns: minmax(240px, 360px); }
.graph-group-series-pane { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.graph-group-filter-pane { display: flex; align-items: stretch; gap: 8px; width: min(var(--graph-group-filter-width, 676px), 100%); max-width: 100%; min-width: 0; min-height: 0; overflow-x: auto; overflow-y: hidden; }
.graph-group-filter-column { width: 220px; height: 100%; max-height: 100%; flex: 0 0 220px; min-width: 220px; max-width: 220px; overflow-y: auto; }
.graph-group-member-section { padding: 7px 0; border-bottom: 1px solid var(--border-color); }
.graph-group-member-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.graph-group-member-heading h3, .graph-group-filter-column h3 { margin: 0; font-size: .86rem; }
.graph-group-member-detach { color: var(--muted-color); }
.graph-group-panel-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 34px; }
.graph-group-member-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.graph-group-member-actions { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.graph-group-member-heading h3, .graph-group-filter-column h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-group-panel-header h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-group-panel-header-actions { display: inline-flex; flex: 0 0 auto; gap: 4px; }
.graph-group-member-heading { min-height: 30px; overflow: hidden; }
.graph-group-member-heading h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-group-member-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; }
.graph-group-member-unit { min-width: 3.5em; color: var(--muted-color); font-size: .78rem; text-align: right; white-space: nowrap; }
.graph-group-global-settings-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto; min-width: 72px; flex: 0 0 auto; white-space: nowrap; border-radius: 5px; }
.graph-group-member-heading .v1-global-settings-button { flex-direction: row-reverse; }
.graph-group-member-series-scroll { display: grid; gap: 5px; max-height: 190px; overflow-y: auto; overflow-x: hidden; }
.graph-group-member-series-scroll .v1-series-row { min-height: 34px; }
.numeric-graph-group-lane .numeric-graph-layer { top: 28px; }
.numeric-graph-group-member-layer { pointer-events: none; }
.numeric-graph-group-member-layer > .numeric-graph-svg { pointer-events: none; }
.numeric-graph-group-member-layer .numeric-hit-target, .numeric-graph-group-member-layer .numeric-note-marker, .numeric-graph-group-member-layer .numeric-bar-hit, .numeric-graph-group-member-layer .numeric-bar-top-hit { pointer-events: auto; }
.numeric-series-render.is-hover-emphasis { stroke-width: 3px !important; }
/* DISC-P P05 prototype: intentionally isolated and query-gated. */
.disc-p-suggestion-prototype {
    margin: 12px 0 0;
    padding: 12px;
    border: 1px solid var(--border-color, #d8dce3);
    border-radius: 10px;
    background: var(--panel-background, #fff);
    color: var(--text-color, #20242b);
}
.disc-p-suggestion-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.disc-p-suggestion-heading h3 { margin: 0; font-size: 15px; }
.disc-p-suggestion-fixture-note { color: var(--muted-text, #6b7280); font-size: 11px; }
.disc-p-suggestion-controls { display: grid; gap: 7px; margin-bottom: 9px; }
.disc-p-suggestion-control { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.disc-p-suggestion-mode { width: 100%; min-height: 30px; }
.disc-p-suggestion-control input[type="range"] { flex: 1; min-width: 70px; }
.disc-p-suggestion-control output { min-width: 34px; text-align: right; }
.disc-p-suggestion-containment { cursor: pointer; }
.disc-p-suggestion-status { margin: 0 0 8px; color: var(--muted-text, #6b7280); font-size: 11px; }
.disc-p-suggestion-cards { display: grid; gap: 7px; }
.disc-p-suggestion-card { padding: 8px; border: 1px solid var(--border-color, #e2e5ea); border-radius: 7px; background: color-mix(in srgb, var(--panel-background, #fff) 94%, var(--accent-color, #2563eb)); }
.disc-p-suggestion-card h4 { margin: 0 0 3px; font-size: 13px; }
.disc-p-suggestion-kind { display: inline-block; color: var(--muted-text, #6b7280); font-size: 10px; }
.disc-p-suggestion-period, .disc-p-suggestion-meta, .disc-p-suggestion-debug { margin: 3px 0 0; font-size: 11px; line-height: 1.35; }
.disc-p-suggestion-meta { color: var(--muted-text, #6b7280); }
.disc-p-suggestion-debug { color: var(--muted-text, #6b7280); font-size: 10px; }

/* RELEASE-R Phase 1: keep all integrated panels usable within the viewport. */
.disc-p-suggestion-prototype { flex: 0 0 auto; max-height: min(420px, 48vh); overflow: auto; }
.disc-p-suggestion-heading { cursor: pointer; flex-wrap: wrap; }
.disc-p-suggestion-heading h3 { display: inline; font-size: .9rem; }
details.disc-p-suggestion-prototype:not([open]) { overflow: visible; }
details.disc-p-suggestion-prototype:not([open]) > :not(summary) { display: none; }
.disc-p-suggestion-controls { flex-wrap: wrap; }
@media (max-width: 700px) {
 .graph-settings-panel.is-v1-series-settings { overflow-y: auto; }
 .v1-series-settings-layout { grid-template-columns: minmax(0, 1fr); max-height: none; }
 .v1-series-settings-left, .v1-series-composer { max-height: 45vh; }
 .v1-series-composer { border-left: 0; border-top: 1px solid var(--border-color); }
 .graph-group-settings-layout { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
 .graph-group-filter-pane { min-height: 200px; }
 .search-panel { position: fixed; inset: 100px 8px 12px; width: auto; max-width: none; max-height: none; }
 .search-header { flex-wrap: wrap; }
 .search-header > .search-input-wrap { flex-basis: 45%; }
 .local-import-guide-section { max-height: 7rem; }
}@media (max-width: 700px) {
 .main-area { grid-template-columns: minmax(170px, min(var(--timeline-list-width), calc(100% - 190px))) 10px minmax(180px, 1fr); }
 .menu-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
 .toolbar-left { grid-column: 1; grid-row: 1; }
 .toolbar-right { display: contents; }
 #viewport-end-controls { grid-column: 2; grid-row: 1; justify-self: end; }
 #overview-map { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; }
 #toolbar-actions { grid-column: 1 / -1; grid-row: 3; justify-content: space-between; flex-wrap: wrap; }
 .search-panel { top: 176px; }
}
@media (max-width: 700px) {
 .app-shell { height: 100dvh; min-height: 0; overflow: hidden; }
 .main-area { min-height: 0; min-width: 0; }
 #viewport-start-controls, #viewport-end-controls { max-width: 100%; overflow-x: auto; }
 #timeline-surface .date-display-area { min-width: 0; }
}
/* R15-V01: local discovery UI; no Studio selectors or formal Set contract changes. */
.discovery-toggle[aria-pressed="true"] { background: var(--accent-color); color: var(--panel-background); }
.discovery-editor { position: fixed; z-index: 1100; right: 12px; top: 100px; width: min(330px, calc(100vw - 24px)); max-height: calc(100dvh - 130px); overflow: auto; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--panel-background); color: var(--text-color); box-shadow: 0 6px 24px #0003; font-size: .8rem; }
.discovery-editor input:not([type="checkbox"]), .discovery-editor textarea, .discovery-editor select, .discovery-list-controls input { box-sizing: border-box; width: 100%; margin-block: 4px; background: var(--panel-background); color: inherit; border: 1px solid var(--border-color); padding: 5px; }
.discovery-editor textarea { min-height: 56px; resize: vertical; }
.discovery-editor label { display: block; }
.discovery-editor p, .discovery-list-controls p, .discovery-card p { font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.discovery-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.discovery-editor button, .discovery-card button, .discovery-tools button { padding: 4px 7px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--panel-background); color: inherit; cursor: pointer; }
.discovery-editor button:disabled, .discovery-card button:disabled { opacity: .5; cursor: default; }
.discovery-card { display: grid; gap: 4px; margin: 8px 0; padding: 9px; border: 1px solid var(--border-color); border-radius: 6px; }
.discovery-list-controls { padding: 8px; }
.discovery-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; overflow: hidden; }
.discovery-overlay path { stroke: #b45309; stroke-width: 3; fill: none; pointer-events: stroke; cursor: pointer; }
.discovery-overlay path.is-selected { stroke: #2563eb; stroke-width: 5; }
.discovery-callout { pointer-events: auto; cursor: pointer; padding: 5px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--panel-background); color: var(--text-color); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 80px; overflow: auto; }
.discovery-event-group-lane .timeline-lane-label { display: flex; flex-direction: column; gap: 2px; max-height: 100%; overflow: hidden; }
.discovery-search-split { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.discovery-search-split .timeline-list-header { grid-row: 1; }
.discovery-search-split .timeline-list-content { grid-row: 2; min-height: 0; overflow: auto; }
.discovery-splitter { grid-row: 3; cursor: row-resize; touch-action: none; background: var(--border-color); border-block: 3px solid var(--panel-background); }
.discovery-search-split .discovery-suggestion-bottom { grid-row: 3; min-height: 0; height: auto; max-height: none; overflow: hidden; margin: 0; }
.discovery-search-split .discovery-suggestion-bottom:not([open]) { overflow: auto; }
.disc-p-suggestion-prototype[hidden], .discovery-splitter[hidden] { display: none !important; }
.discovery-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.discovery-editor.is-collapsed > :not(.discovery-editor-heading) { display: none; }
.discovery-connect-handle { fill: var(--panel-background); stroke: #D97706; stroke-width: 3; cursor: crosshair; touch-action: none; }
.discovery-connect-candidate .point-event-marker, .discovery-connect-candidate .range-band-core { outline: 3px solid #D97706; outline-offset: 3px; }
.discovery-callout { height: 60px; box-sizing: border-box; touch-action: none; }
.discovery-callout.is-selected { box-shadow: 0 0 0 2px var(--link-accent); }
.discovery-overlay path.is-selected { filter: drop-shadow(0 0 2px var(--link-accent)); }
.discovery-palette { display: flex; flex-wrap: wrap; gap: 4px; }
.discovery-palette button { width: 25px; height: 25px; overflow: hidden; font-size: 0; border: 1px solid var(--text-color); }
.discovery-overlay .discovery-bubble-leader { stroke-width: 2; }
/* R21 editor: overlay does not participate in Viewer layout. */
#toolbar-actions .discovery-toggle[aria-pressed="true"] { background: #2563eb; color: white; border-color: #1d4ed8; transition: none; }
#timeline-surface.is-discovery-editing { outline: 2px solid var(--accent-color, #2563eb); outline-offset: -2px; }
.discovery-editor { width: min(390px, calc(100vw - 24px)); height: min(800px, calc(100dvh - 120px)); max-height: calc(100dvh - 120px); display: flex; flex-direction: column; overflow: hidden; padding: 10px; gap: 6px; }
.discovery-editor-heading { flex: 0 0 auto; flex-wrap: wrap; }
.discovery-editor-fixed { flex: 0 1 auto; min-height: 0; max-height: 72%; overflow: auto; }
.discovery-editor.is-collapsed { height: auto; }
.discovery-editor textarea { min-height: 40px; max-height: 100px; }
.discovery-save-state { margin: 2px 0; color: var(--accent-color, #2563eb); }
.discovery-link-settings { margin: 6px 0; max-height: 30vh; overflow: auto; }
.discovery-icon-choices { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; margin-block: 5px; }
.discovery-icon-choices > span { width: 62px; }
.discovery-icon-choices button { display: inline-flex; flex-direction: column; align-items: center; padding: 3px; font-size: 10px; }
.discovery-icon-choices svg { width: 32px; height: 20px; }
.discovery-icon-choices button[aria-pressed="true"] { outline: 2px solid var(--accent-color, #2563eb); outline-offset: -2px; }
.discovery-link-list { flex: 1 1 130px; min-height: 70px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--border-color); }
.discovery-link-row { padding: 7px 3px; border-bottom: 1px solid var(--border-color); }
.discovery-link-row.is-selected { background: color-mix(in srgb, var(--accent-color, #2563eb) 15%, transparent); }
.discovery-link-row > button:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; text-align: left; gap: 4px; }
.discovery-link-row small { grid-column: 2; display: block; overflow-wrap: anywhere; }
.discovery-link-unavailable { color: var(--muted-color); }
.has-discovery-content .timeline-event-region { z-index: auto; }
.has-discovery-content .timeline-event-layer { z-index: auto; }
.has-discovery-content .point-event, .has-discovery-content .range-band-event, .has-discovery-content .uncertain-point-event { z-index: 4; }
.discovery-lines-layer { z-index: 2; }
.discovery-annotations-layer { z-index: 12; }
.discovery-overlay path.is-selected { filter: drop-shadow(0 0 3px var(--link-accent)); }
.discovery-overlay .discovery-link-hit { stroke: transparent; fill: none; }
.discovery-overlay .discovery-callout { box-sizing: border-box; height: 60px; max-height: 60px; border-radius: 8px; }
.discovery-callout.is-capsule { border-radius: 30px; padding-inline: 14px; }
.discovery-endpoint-handle, .discovery-numeric-ring { fill: var(--panel-background); stroke: var(--accent-color, #2563eb); stroke-width: 2; cursor: crosshair; }
.discovery-endpoint-selected, .discovery-connect-candidate { filter: drop-shadow(0 0 4px #2563eb); }
.is-discovery-editing .point-event-marker, .is-discovery-editing .range-band-core { cursor: crosshair; touch-action: none; }
@media(max-height: 620px) { .discovery-editor { top: 70px; height: calc(100dvh - 85px); max-height: calc(100dvh - 85px); }.discovery-editor-fixed { max-height: 70%; }.discovery-link-settings { max-height: 20vh; } }
/* R22: seven compact control rows occupy exactly the upper half. */
.discovery-editor { box-sizing: border-box; width: min(460px, calc(100vw - 24px)); height: calc(100dvh - 112px); max-height: calc(100dvh - 112px); padding: 6px; display: grid; grid-template-rows: minmax(0,1fr) minmax(0,1fr); gap: 0; overflow: hidden; }
.discovery-editor > .discovery-editor-fixed { box-sizing: border-box; min-height: 0; max-height: none; overflow: hidden; display: flex; flex-direction: column; gap: 3px; padding-bottom: 4px; }
.discovery-editor .discovery-compact-row, .discovery-setting-row, .discovery-bubble-input-row { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 0 0 auto; }
.discovery-editor .discovery-compact-row { height: 28px; }
.discovery-editor .discovery-compact-row > input { flex: 1 1 0; min-width: 35px; }
.discovery-editor input:not([type="checkbox"]), .discovery-editor textarea { margin: 0; min-height: 0; height: 27px; padding: 3px 5px; font-size: 11px; }
.discovery-editor button { min-height: 26px; height: 26px; padding: 2px 5px; font-size: 11px; white-space: nowrap; flex: 0 0 auto; }
.discovery-editor button:has(svg) { width: 28px; padding: 3px; }
.discovery-editor button svg { width: 19px; height: 19px; display: block; }
.discovery-editor .discovery-link-settings { margin: 0; max-height: none; overflow: hidden; display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.discovery-editor .discovery-icon-choices { margin: 0; padding: 2px; border: 1px solid var(--border-color); border-radius: 4px; display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; }
.discovery-editor .discovery-icon-choices > span { width: auto; font-size: 10px; padding-inline: 2px; }
.discovery-editor .discovery-icon-choices button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent-color) 20%, var(--panel-background)); outline: 2px solid var(--accent-color); outline-offset: -2px; }
.discovery-editor .discovery-bubble-input-row textarea { min-width: 0; flex: 1 1 0; resize: none; max-height: 27px; }
.discovery-text-counter { font-size: 10px; white-space: nowrap; }
.discovery-editor .discovery-palette { display: flex; flex-wrap: nowrap; gap: 5px; align-items: center; height: 28px; }
.discovery-editor .discovery-palette button { width: 25px; height: 25px; border: 2px solid transparent; border-radius: 3px; padding: 0; }
.discovery-editor .discovery-palette button[aria-pressed="true"] { outline: 2px solid var(--text-color); outline-offset: -4px; border-color: var(--panel-background); }
.discovery-editor .discovery-palette input { width: 32px; height: 27px; padding: 1px; margin-left: auto; }
.discovery-compact-status { display: flex; align-items: baseline; gap: 4px; font-size: 10px; line-height: 12px; min-height: 12px; overflow: hidden; }
.discovery-compact-status .discovery-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discovery-editor .discovery-link-list { min-height: 0; height: 100%; overflow-y: auto; padding: 0; }
.discovery-editor .discovery-link-row { display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; gap: 3px; padding: 4px; border: 1px solid var(--border-color); border-radius: 3px; margin-block: 3px; }
.discovery-editor .discovery-link-row.is-selected { border-color: var(--accent-color); }
.discovery-editor .discovery-link-select { width: 100%; min-width: 0; height: auto; white-space: normal; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 3px; text-align: left; border: 0; background: transparent; padding: 3px; }
.discovery-link-select > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.discovery-editor .discovery-link-row small { grid-column: 2; font-size: 10px; }
.discovery-editor .discovery-link-trash { width: 27px; padding: 3px; }
.discovery-link-trash img { width: 19px; height: 19px; }
.discovery-editor.is-collapsed { height: auto; max-height: none; grid-template-rows: auto; }
.discovery-editor.is-collapsed > .discovery-editor-fixed { padding: 0; }
.discovery-editor.is-collapsed .discovery-editor-fixed > :not(:first-child), .discovery-editor.is-collapsed .discovery-link-list { display: none; }
.discovery-overlay .discovery-callout { width: 100%; height: 100%; min-height: 0; max-height: none; padding: 6px 11px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; color: #000; background: color-mix(in srgb, color-mix(in srgb, var(--bubble-color) 25%, white) 80%, transparent); border: 1px solid var(--bubble-color); opacity: 1; border-radius: 8px; overflow: hidden; }
.discovery-overlay .discovery-callout.is-capsule { border-radius: 999px; }
.discovery-callout-tail { fill: color-mix(in srgb, color-mix(in srgb, var(--bubble-color) 25%, white) 80%, transparent); }
/* R23: fixed discovery header, one scrollable list, and settings inside the selected card. */
.discovery-editor { box-sizing: border-box; top: 74px; width: min(560px, calc(100vw - 24px)); height: calc(100dvh - 86px); max-height: calc(100dvh - 86px); display: flex; flex-direction: column; overflow: hidden; padding: 12px; gap: 10px; }
.discovery-editor-header { flex: 0 0 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.discovery-header-row { display: flex; min-width: 0; align-items: center; gap: 6px; }
.discovery-header-title-row { min-height: 36px; }
.discovery-header-description-row { min-height: 36px; }
.discovery-editor .discovery-header-title-row > input { flex: 1 1 120px; min-width: 72px; height: 34px; font-size: 13px; }
.discovery-temporary-group { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.discovery-temporary-state { width: 12px; height: 12px; flex: 0 0 12px; border: 1px solid currentColor; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 0 1px var(--panel-background); }
.discovery-temporary-state.is-saved { background: #3B82F6; }
.discovery-temporary-state.is-unsaved { background: #F59E0B; }
.discovery-editor .discovery-header-title-row > button { height: 32px; min-height: 32px; padding-inline: 8px; font-size: 12px; }
.discovery-editor .discovery-header-title-row .discovery-collapse-button { width: 32px; padding: 5px; }
.discovery-editor .discovery-header-description-row > input { flex: 1 1 auto; min-width: 0; height: 34px; font-size: 12px; }
.discovery-editor .discovery-header-description-row > button { width: 32px; height: 32px; min-height: 32px; padding: 5px; }
.discovery-editor .discovery-editor-status { display: flex; min-height: 14px; gap: 8px; align-items: center; overflow: hidden; font-size: 10px; color: var(--muted-color); }
.discovery-editor .discovery-editor-status .discovery-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discovery-editor .discovery-link-list { flex: 1 1 0; min-height: 0; height: auto; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--border-color); padding: 4px 2px; }
.discovery-editor .discovery-link-row { display: block; margin: 5px 0; padding: 5px; border: 1px solid var(--border-color); border-radius: 8px; background: color-mix(in srgb, var(--panel-background) 96%, var(--text-color)); }
.discovery-editor .discovery-link-row.is-selected { border-color: var(--accent-color, #2563eb); background: color-mix(in srgb, var(--accent-color, #2563eb) 9%, var(--panel-background)); box-shadow: 0 1px 4px #0002; }
.discovery-link-card-heading { display: grid; grid-template-columns: minmax(0,1fr) 34px; align-items: center; gap: 5px; }
.discovery-editor .discovery-link-select { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; width: 100%; min-width: 0; min-height: 34px; height: auto; padding: 4px 6px; border: 0; background: transparent; text-align: left; white-space: normal; }
.discovery-link-swatch { font-size: 20px; line-height: 1; text-align: center; }
.discovery-link-names { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.discovery-link-names strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.discovery-link-summary-text { overflow: hidden; color: var(--muted-color); text-overflow: ellipsis; white-space: nowrap; }
.discovery-editor .discovery-link-editing-label { grid-column: 3; color: var(--accent-color, #2563eb); font-size: 10px; }
.discovery-editor .discovery-link-unavailable { grid-column: 2 / 4; }
.discovery-editor .discovery-link-trash { display: grid; width: 34px; height: 34px; min-height: 34px; place-items: center; padding: 5px; border-radius: 7px; }
.discovery-editor .discovery-link-trash img { width: 20px; height: 20px; }
.theme-dark .discovery-link-trash img, [data-theme="dark"] .discovery-link-trash img { filter: invert(1); }
.discovery-card-settings { display: flex; flex-direction: column; gap: 5px; padding: 7px 4px 3px; border-top: 1px solid var(--border-color); }
.discovery-card-settings .discovery-setting-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.discovery-card-settings .discovery-icon-choices { display: flex; flex-wrap: nowrap; align-items: center; gap: 3px; margin: 0; padding: 3px; border: 1px solid var(--border-color); border-radius: 7px; }
.discovery-card-settings .discovery-icon-choices > span { width: auto; padding: 0 2px; font-size: 10px; white-space: nowrap; }
.discovery-card-settings .discovery-icon-choices button { display: inline-flex; width: auto; height: 32px; min-width: 34px; min-height: 32px; align-items: center; justify-content: center; gap: 2px; padding: 3px 5px; border-radius: 7px; font-size: 10px; }
.discovery-card-settings .discovery-icon-choices button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.discovery-card-settings .discovery-icon-choices button[aria-pressed="true"] { border-color: var(--accent-color, #2563eb); background: color-mix(in srgb, var(--accent-color, #2563eb) 16%, var(--panel-background)); box-shadow: inset 0 0 0 1px var(--accent-color, #2563eb); }
.discovery-card-settings .discovery-arrow-row { flex-wrap: nowrap; }
.discovery-card-settings .discovery-single-arrow-wrap { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; }
.discovery-card-settings .discovery-reverse-button { position: relative; width: 26px; height: 26px; min-width: 26px; min-height: 26px; margin-left: -7px; padding: 3px; border-radius: 50%; z-index: 2; background: var(--panel-background); box-shadow: 0 1px 3px #0005; }
.discovery-card-settings .discovery-reverse-button svg { width: 16px; height: 16px; }
.discovery-bubble-field { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; align-items: center; font-size: 11px; }
.discovery-bubble-field textarea { grid-column: 1; width: 100%; min-width: 0; min-height: 34px; height: 34px; resize: vertical; padding: 6px; font-size: 12px; }
.discovery-bubble-field .discovery-text-counter { grid-column: 2; grid-row: 2; font-variant-numeric: tabular-nums; font-size: 10px; }
.discovery-card-settings .discovery-palette { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.discovery-card-settings .discovery-palette > span { font-size: 11px; }
.discovery-card-settings .discovery-palette button { width: 26px; height: 26px; min-width: 26px; min-height: 26px; padding: 0; border: 2px solid transparent; border-radius: 50%; }
.discovery-card-settings .discovery-palette button[aria-pressed="true"] { outline: 2px solid var(--text-color); outline-offset: 1px; }
.discovery-card-settings .discovery-palette input { width: 34px; height: 30px; margin-left: auto; padding: 1px; }
.discovery-editor.is-collapsed { height: auto; max-height: none; }
.discovery-editor.is-collapsed > .discovery-editor-header { display: flex !important; }
.discovery-editor.is-collapsed .discovery-header-description-row, .discovery-editor.is-collapsed .discovery-editor-status, .discovery-editor.is-collapsed .discovery-link-list { display: none; }
@media(max-width:520px) { .discovery-editor .discovery-header-title-row { gap: 3px; } .discovery-editor .discovery-header-title-row > button { padding-inline: 5px; font-size: 11px; } .discovery-temporary-group { gap: 2px; } .discovery-editor .discovery-header-title-row .discovery-collapse-button { width: 28px; } .discovery-card-settings .discovery-setting-row { gap: 3px; } }
.discovery-editor .discovery-temporary-state { color: #F59E0B; }
.discovery-editor .discovery-temporary-state.is-saved { color: #3B82F6; }
.discovery-editor .discovery-temporary-state.is-unsaved { color: #F59E0B; }
.discovery-callout-shape { fill: color-mix(in srgb, color-mix(in srgb, var(--bubble-color) 25%, white) 80%, transparent); stroke-width: 1; opacity: 1; }
.discovery-overlay .discovery-callout.has-integrated-tail { border: 0; background: transparent; color: #000; outline: 0; box-shadow: none; }
.discovery-callout-shape.is-selected { filter: drop-shadow(0 0 3px var(--link-accent)); }
html[data-theme="dark"] .discovery-callout-shape { fill: color-mix(in srgb, color-mix(in srgb, var(--bubble-color) 65%, black) 80%, transparent); }
html[data-theme="dark"] .discovery-overlay .discovery-callout.has-integrated-tail { color: #fff; }
html[data-theme="dark"] .discovery-editor .discovery-link-trash img { filter: invert(1); }
html[data-theme="dark"] .discovery-overlay .discovery-callout { color: #fff; background: color-mix(in srgb, color-mix(in srgb, var(--bubble-color) 65%, black) 80%, transparent); }
html[data-theme="dark"] .discovery-callout-tail { fill: color-mix(in srgb, color-mix(in srgb, var(--bubble-color) 65%, black) 80%, transparent); }
.discovery-overlay .discovery-callout.is-selected { outline: 2px solid var(--text-color); outline-offset: -3px; }
.discovery-annotations-layer { pointer-events: none; }
@media(max-width: 480px) { .discovery-editor button { padding-inline: 3px; font-size: 10px; }.discovery-editor button:has(svg) { width: 25px; }.discovery-editor .discovery-icon-choices > span { font-size: 9px; }.discovery-editor .discovery-compact-row { gap: 2px; } }
@media(max-height: 620px) { .discovery-editor { top: 70px; height: calc(100dvh - 80px); max-height: calc(100dvh - 80px); }.discovery-editor .discovery-icon-choices button { height: 22px; min-height: 22px; }.discovery-editor .discovery-link-settings { gap: 1px; } }
.discovery-editor.is-collapsed > .discovery-editor-fixed { display: flex; }
html[data-theme="dark"] .discovery-link-trash img { filter: invert(1); }
/* R23 mockup follow-up: readable controls and descriptions before appearance settings. */
.discovery-editor-header { gap: 7px; }
.discovery-header-label { font-size: 12px; color: var(--muted-color); }
.discovery-editor .discovery-header-title-row > input,
.discovery-editor .discovery-header-description-row > input { height: 38px; padding: 8px; border-radius: 7px; font-size: 13px; }
.discovery-editor .discovery-header-title-row > button,
.discovery-editor .discovery-temporary-group > button { height: 38px; min-height: 38px; padding-inline: 10px; border-radius: 7px; font-size: 12px; }
.discovery-editor .discovery-primary-save { background: #0669ef; border-color: #398bff; color: #fff; }
.discovery-editor .discovery-header-description-row > button { width: 38px; height: 38px; min-height: 38px; border-radius: 7px; }
.discovery-editor .discovery-editor-status:has(.discovery-status:empty):has(.discovery-connect-status:empty) { display: none; }
.discovery-relations-heading { flex: 0 0 auto; padding: 8px 2px 0; border-top: 1px solid var(--border-color); font-size: 15px; font-weight: 600; }
.discovery-editor .discovery-link-list { border-top: 0; padding-top: 0; }
.discovery-editor .discovery-link-row { margin: 0 0 8px; padding: 7px; border-radius: 9px; }
.discovery-editor .discovery-link-row.is-selected { box-shadow: inset 0 0 0 1px #328cff, 0 0 8px #007aff20; }
.discovery-editor .discovery-link-select { grid-template-columns: 48px minmax(0,1fr) auto; min-height: 38px; gap: 7px; padding: 3px; }
.discovery-editor .discovery-link-swatch { width: 48px; height: 30px; }
.discovery-link-names strong { font-size: 13px; line-height: 1.5; }
.discovery-link-summary-text { font-size: 11px; line-height: 1.5; }
.discovery-editor .discovery-link-row .discovery-link-editing-label { grid-column: 3; grid-row: 1; font-size: 0; }
.discovery-editor .discovery-link-editing-label::after { content: '⌃'; font-size: 18px; }
.discovery-card-settings { gap: 12px; padding: 12px 5px 5px; border-top: 0; }
.discovery-card-settings .discovery-setting-row { display: grid; gap: 12px; align-items: start; }
.discovery-card-settings .discovery-line-settings { grid-template-columns: 1fr 2fr; }
.discovery-card-settings .discovery-bubble-settings { grid-template-columns: 1fr 1fr 1fr; }
.discovery-card-settings .discovery-arrow-row { grid-template-columns: 2fr 1fr; }
.discovery-editor .discovery-card-settings .discovery-icon-choices { display: flex; flex-direction: column; align-items: stretch; min-width: 0; margin: 0; padding: 0; gap: 6px; border: 0; }
.discovery-editor .discovery-card-settings .discovery-icon-choices > span { font-size: 12px; padding: 0; }
.discovery-choice-buttons { display: flex; gap: 6px; min-width: 0; }
.discovery-editor .discovery-card-settings .discovery-icon-choices button { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; width: auto; height: 54px; min-height: 54px; padding: 5px; gap: 3px; border-radius: 9px; font-size: 12px; background: color-mix(in srgb, var(--panel-background) 92%, var(--text-color)); }
.discovery-editor .discovery-card-settings .discovery-icon-choices button svg { flex: 0 0 23px; width: 28px; height: 23px; }
.discovery-editor .discovery-card-settings .discovery-icon-choices button[aria-pressed="true"] { color: #fff; background: linear-gradient(#2479d9,#0756b8); border-color: #70baff; box-shadow: inset 0 0 0 1px #70baff, 0 0 5px #007aff70; outline: 0; }
.discovery-editor .discovery-card-settings .discovery-icon-choices button[aria-label="通常"] svg { width: 20px; }
.discovery-editor .discovery-card-settings .discovery-icon-choices button[aria-label="大"] svg { width: 32px; }
.discovery-card-settings .discovery-single-arrow-wrap { flex: 1.4 1 0; min-width: 0; }
.discovery-editor .discovery-card-settings .discovery-single-arrow-wrap > button:first-child { padding-right: 20px; }
.discovery-editor .discovery-card-settings .discovery-icon-choices .discovery-reverse-button { position: absolute; right: 3px; top: 6px; flex: none; width: 24px; height: 24px; min-height: 24px; padding: 3px; margin: 0; border-radius: 50%; }
.discovery-editor .discovery-card-settings .discovery-reverse-button svg { width: 16px; height: 16px; flex-basis: 16px; }
.discovery-editor .discovery-bubble-field { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: 12px; }
.discovery-bubble-field textarea { grid-column: 1 / -1; grid-row: 2; min-height: 62px; height: 62px; padding: 9px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.discovery-bubble-field .discovery-text-counter { grid-column: 2; grid-row: 1; font-size: 11px; }
.discovery-card-settings .discovery-palette { gap: 10px; min-height: 34px; }
.discovery-card-settings .discovery-palette button { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
.discovery-overlay .discovery-callout.has-integrated-tail,
html[data-theme="dark"] .discovery-overlay .discovery-callout.has-integrated-tail { background: transparent; outline: 0; box-shadow: none; border: 0; }
.discovery-editor.is-collapsed .discovery-header-label,
.discovery-editor.is-collapsed .discovery-relations-heading { display: none; }
@media(max-width: 520px) {
  .discovery-editor { padding: 9px; }
  .discovery-editor .discovery-header-title-row { flex-wrap: wrap; }
  .discovery-editor .discovery-header-title-row > input { flex-basis: 100%; }
  .discovery-editor .discovery-header-title-row > button { flex: 1 1 auto; }
  .discovery-editor .discovery-header-title-row > .discovery-collapse-button { flex: 0 0 32px; }
  .discovery-card-settings { padding-inline: 0; }
  .discovery-card-settings .discovery-setting-row { gap: 8px; }
  .discovery-choice-buttons { gap: 4px; }
  .discovery-editor .discovery-card-settings .discovery-icon-choices button { font-size: 11px; height: 50px; min-height: 50px; padding-inline: 3px; }
  .discovery-card-settings .discovery-palette { gap: 7px; }
  .discovery-card-settings .discovery-palette button { width: 26px; height: 26px; min-width: 26px; min-height: 26px; }
}
/* R24 layout authority: memo follows line/arrow settings; cache has no save UI. */
.discovery-editor .discovery-header-row { display: grid; gap: 8px; align-items: center; }
.discovery-editor .discovery-header-title-row { grid-template-columns: 64px minmax(0,1fr) 48px 48px 36px; }
.discovery-editor .discovery-header-description-row { grid-template-columns: 64px minmax(0,1fr) 38px 38px; }
.discovery-header-inline-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.discovery-editor .discovery-header-title-row > input { width: 100%; min-width: 0; }
.discovery-editor .discovery-header-title-row > button { padding-inline: 4px; }
.discovery-editor .discovery-header-title-row .discovery-collapse-button { width: 36px; }
.discovery-editor .discovery-card-settings .discovery-palette { flex-wrap: wrap; height: auto; }
.discovery-card-settings .discovery-palette button.discovery-style-reset { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: auto; min-width: 88px; height: 34px; padding: 5px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--panel-background); font-size: 12px; }
.discovery-style-reset svg { width: 18px; height: 18px; }
.discovery-card-settings .discovery-palette .discovery-color-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.discovery-card-settings .discovery-palette button.discovery-custom-color-button { width: 34px; height: 34px; min-width: 34px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--panel-background); padding: 6px; margin-left: auto; }
.discovery-custom-color-button svg { width: 20px; height: 20px; }
.discovery-editor.is-collapsed .discovery-header-title-row > .discovery-header-inline-label { display: none; }
.discovery-editor.is-collapsed .discovery-header-title-row { grid-template-columns: minmax(0,1fr) 48px 48px 36px; }
@media(max-width:520px) {
  .discovery-editor .discovery-header-row { gap: 5px; }
  .discovery-editor .discovery-header-title-row { grid-template-columns: 55px minmax(0,1fr) 44px 44px 32px; }
  .discovery-editor .discovery-header-description-row { grid-template-columns: 55px minmax(0,1fr) 34px 34px; }
  .discovery-header-inline-label { font-size: 12px; }
  .discovery-editor .discovery-header-title-row .discovery-collapse-button { width: 32px; }
  .discovery-card-settings .discovery-palette { gap: 6px; }
}

/* Reverse is a momentary endpoint-swap action, not a selected direction. */
.discovery-editor .discovery-card-settings .discovery-icon-choices .discovery-reverse-button { background: var(--panel-background); color: var(--text-color); border-color: var(--border-color); box-shadow: none; outline: none; }
.discovery-editor .discovery-card-settings .discovery-icon-choices .discovery-reverse-button:not(:disabled):hover,
.discovery-editor .discovery-card-settings .discovery-icon-choices .discovery-reverse-button:focus-visible { background: #0756b8; color: #fff; border-color: #70baff; }

/* R27: bounded lazy thumbnail; failed images never remove the card or row. */
.timeline-thumbnail{display:inline-flex;position:relative;flex:0 0 32px;width:32px;height:32px;overflow:hidden;border-radius:4px;vertical-align:middle;background:var(--panel-bg,transparent);}
.timeline-thumbnail img{width:100%;height:100%;object-fit:cover;}
.timeline-thumbnail img[hidden]{display:none;}
.timeline-thumbnail.has-error{background:transparent;}
.timeline-list-item-title-row .timeline-thumbnail{margin-right:8px;}
.search-result-title{display:flex;align-items:center;gap:6px;min-width:0;}
.search-result-title .timeline-thumbnail{flex-basis:28px;width:28px;height:28px;}

/* V03: scoped public Discovery catalog; normal search/editor styles stay independent. */
#timeline-list-content.discovery-catalog-list { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.discovery-catalog-list .discovery-catalog-controls { flex:0 0 auto; padding:8px 0; }
.discovery-catalog-toolbar { display:flex; flex-wrap:nowrap; gap:4px; align-items:center; }
.discovery-catalog-toolbar button { flex:0 0 auto; min-height:28px; padding:3px 7px; }
.discovery-catalog-toolbar button[aria-pressed=true] { background:var(--hover-background); border-color:var(--accent-color); color:var(--accent-color); }
.discovery-catalog-controls .discovery-catalog-toolbar input { min-width:0; width:0; flex:1 1 0; margin:0; height:28px; box-sizing:border-box; }
.discovery-catalog-controls .discovery-status { margin:0; font-size:12px; overflow-wrap:anywhere; }
.discovery-catalog-controls .discovery-status:empty,.discovery-catalog-status:empty { display:none; }
.discovery-catalog-scroll { min-height:0; flex:1 1 auto; overflow-y:auto; overflow-x:hidden; }
.discovery-catalog-list .discovery-catalog-card { display:flex; height:70px; box-sizing:border-box; gap:8px; margin:0; padding:0; border:0; border-bottom:1px solid var(--border-color); border-radius:0; }
.discovery-card-media { position:relative; flex:0 0 69px; width:69px; height:69px; display:grid; place-items:center; background:var(--placeholder-background); border-radius:4px; overflow:hidden; }
.discovery-card-media img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; }
.discovery-kind-icon { display:block; width:28px; height:28px; background:currentColor; mask-position:center; mask-size:contain; mask-repeat:no-repeat; -webkit-mask-position:center; -webkit-mask-size:contain; -webkit-mask-repeat:no-repeat; color:var(--muted-color); }
.discovery-kind-icon.is-neutral { background:none; font-size:28px; line-height:28px; text-align:center; }
.discovery-card-body { min-width:0; flex:1; display:flex; flex-direction:column; justify-content:space-between; padding:5px 0; }
.discovery-card-title { overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-height:17px; font-size:13px; overflow-wrap:anywhere; }
.discovery-card-actions { display:flex; gap:3px; align-items:center; }
.discovery-catalog-card .discovery-card-actions button { width:auto; min-width:0; margin:0; padding:1px 4px; font-size:12px; line-height:18px; white-space:nowrap; background:var(--panel-background); color:var(--text-color); }
.discovery-catalog-card button:hover { background:var(--hover-background); }
.discovery-catalog-list button:focus-visible,.discovery-catalog-list input:focus-visible { outline:2px solid var(--accent-color); outline-offset:1px; }
.discovery-catalog-pagination { display:flex; align-items:center; justify-content:center; gap:8px; padding:8px 0; }

/* V04: title-led Discovery cards and detail popover; Viewer catalog only. */
.discovery-catalog-toolbar .discovery-catalog-segments { display:flex; flex:0 0 auto; height:28px; box-sizing:border-box; border:1px solid var(--border-color); border-radius:6px; overflow:hidden; }
.discovery-catalog-segments button { min-height:0; height:26px; margin:0; border:0; border-radius:0; padding:3px 7px; color:var(--text-color); background:var(--panel-background); }
.discovery-catalog-segments button+button { border-left:1px solid var(--border-color); }
.discovery-catalog-segments button[aria-pressed=true] { color:var(--accent-color); background:var(--hover-background); }
.discovery-catalog-segments button:hover { background:var(--hover-background); }
.discovery-catalog-segments button:focus-visible { outline-offset:-2px; }
.discovery-catalog-controls .discovery-catalog-toolbar input { border-radius:14px; padding-inline:9px; }
.discovery-catalog-list .discovery-catalog-card { height:78px; gap:9px; margin-bottom:4px; border:1px solid var(--border-color); border-radius:5px; background:var(--placeholder-background); }
.discovery-catalog-list .discovery-catalog-card:hover { background:var(--hover-background); }
.discovery-catalog-card .discovery-card-media { flex-basis:76px; width:76px; height:76px; border-radius:4px 0 0 4px; }
.discovery-catalog-card .discovery-card-body { padding:5px 6px 5px 0; }
.discovery-catalog-card button.discovery-card-title { display:-webkit-box; width:100%; min-width:0; margin:0; padding:0; border:0; border-radius:2px; color:var(--text-color); background:transparent; font-family:inherit; font-size:15px; font-weight:600; line-height:19px; text-align:left; white-space:normal; cursor:pointer; }
.discovery-catalog-card button.discovery-card-title:hover,.discovery-catalog-card button.discovery-card-title:focus-visible { color:var(--accent-color); text-decoration:underline; background:transparent; text-underline-offset:2px; }
.discovery-catalog-card .discovery-card-actions { justify-content:flex-end; gap:5px; }
.discovery-catalog-card .discovery-card-actions button { display:inline-flex; align-items:center; justify-content:center; height:25px; padding:2px 6px; border-radius:4px; line-height:19px; background:var(--panel-background); }
.discovery-catalog-card .discovery-card-actions button.discovery-card-share { width:27px; padding:4px; }
.discovery-share-icon { display:block; width:16px; height:16px; background:currentColor; mask:url('/icons/ui-a/share.png') center/contain no-repeat; -webkit-mask:url('/icons/ui-a/share.png') center/contain no-repeat; }
.discovery-detail-tooltip { position:fixed; inset:auto; margin:0; box-sizing:border-box; width:min(320px,calc(100vw - 16px)); max-height:min(360px,calc(100dvh - 16px)); padding:12px; overflow:auto; overscroll-behavior:contain; touch-action:pan-y; border:1px solid var(--border-color); border-radius:6px; color:var(--text-color); background:var(--panel-background); font:13px/1.55 sans-serif; overflow-wrap:anywhere; text-align:left; }
.discovery-detail-tooltip .discovery-detail-title { display:block; font-size:14px; line-height:1.45; }
.discovery-detail-tooltip .discovery-detail-description { white-space:pre-wrap; margin:8px 0; }
.discovery-detail-tooltip .discovery-detail-heading { margin-top:8px; font-weight:600; }
.discovery-detail-tooltip ul { padding-left:20px; margin:4px 0 0; }
.discovery-detail-tooltip p { margin:4px 0 0; }
.discovery-detail-tooltip:focus-visible { outline:2px solid var(--accent-color); outline-offset:-2px; }

/* V05: normal Viewer cards only. Discovery/Studio/editor selectors stay unchanged. */
.viewer-card-layout .timeline-list-items { padding-inline:2px 0; gap:4px; }
.viewer-card-layout .timeline-list-item:not(.graph-group-card) { display:grid; grid-template-columns:72px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:2px 7px; min-height:74px; padding:0; border-radius:5px; }
.viewer-card-layout .timeline-list-item>.timeline-thumbnail { grid-column:1; grid-row:1/3; position:relative; display:grid; place-items:center; flex:none; margin:0; width:72px; height:72px; aspect-ratio:1; border-radius:4px 0 0 4px; background:var(--placeholder-background); overflow:hidden; }
.viewer-card-layout .timeline-thumbnail img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; }
.viewer-card-layout .timeline-thumbnail img[hidden] { display:none; }
.timeline-kind-fallback { width:27px; height:27px; display:block; background:currentColor; color:var(--muted-color); mask-position:center; mask-size:contain; mask-repeat:no-repeat; }
.viewer-card-layout .timeline-list-item-title-row { grid-column:2; grid-row:1; padding:5px 5px 0 0; min-width:0; }
.viewer-card-layout .timeline-list-item-title-row .timeline-list-item-title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; font-size:14px; font-weight:600; line-height:17px; max-height:34px; overflow:hidden; }
.viewer-card-layout .timeline-list-item-title-row .timeline-list-item-title { text-overflow:ellipsis; }
.viewer-card-layout .timeline-list-item-meta { display:none; }
.viewer-card-layout .timeline-list-item-footer { grid-column:2; grid-row:2; display:flex; justify-content:flex-end; padding:0 5px 5px 0; min-width:0; }
.viewer-card-layout .timeline-list-item-count { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.viewer-card-layout .timeline-list-item-actions { display:flex; justify-content:flex-end; flex-wrap:nowrap; gap:3px; min-width:0; }
.viewer-card-layout .timeline-list-item-actions button { flex:0 0 auto; width:22px; height:24px; min-width:0; min-height:0; padding:3px; border:1px solid var(--border-color); border-radius:4px; background:var(--panel-background); color:var(--text-color); }
.viewer-card-layout .timeline-list-item-actions .viewer-like-button { width:auto; min-width:30px; display:inline-flex; gap:3px; align-items:center; justify-content:center; padding:2px 4px; font-size:12px; line-height:19px; }
.viewer-card-layout .viewer-like-heart { font-size:12px; }
.viewer-card-layout .viewer-like-button.is-liked { color:var(--accent-color); }
.viewer-card-layout .timeline-list-item-actions button:hover { background:var(--hover-background); }
.viewer-card-layout .timeline-drag-handle { left:-6px; width:14px; height:28px; display:grid; place-items:center; border:1px solid var(--border-color); border-radius:5px; background:var(--panel-background); cursor:grab; z-index:2; }

.discovery-search-split .discovery-suggestion-bottom { display:flex; flex-direction:column; padding:7px 0; box-sizing:border-box; overflow:hidden; }
.discovery-search-split .discovery-suggestion-bottom[hidden] { display:none; }
.disc-p-suggestion-prototype { flex:0 0 auto; max-height:none; overflow:visible; margin-top:auto; justify-content:flex-end; }
.disc-p-suggestion-prototype .disc-p-suggestion-heading { display:flex; align-items:center; justify-content:space-between; margin:0; padding:4px 8px 4px 4px; gap:6px; flex:0 0 auto; }
.disc-p-suggestion-heading h3 { margin:0; font-size:14px; color:var(--accent-color); }
.disc-p-suggestion-toggle { min-width:0; padding:2px 4px; border:0; border-radius:4px; background:transparent; color:var(--accent-color); font:inherit; font-weight:700; text-align:left; cursor:pointer; }
.disc-p-suggestion-toggle::before { content:"▾"; display:inline-block; margin-right:5px; transition:transform .15s ease; }
.disc-p-suggestion-prototype.is-collapsed .disc-p-suggestion-toggle::before { transform:rotate(-90deg); }
.disc-p-suggestion-toggle:hover,.disc-p-suggestion-toggle:focus-visible { background:color-mix(in srgb,var(--accent-color) 10%,var(--panel-background)); outline:none; }
.disc-p-suggestion-settings-button { width:27px; height:26px; display:grid; place-items:center; border:1px solid var(--border-color); border-radius:5px; background:var(--panel-background); color:var(--text-color); cursor:pointer; }
.disc-p-suggestion-settings-icon { width:16px; height:16px; background:currentColor; mask:url('/icons/ui-a/option.png') center/contain no-repeat; }
.disc-p-suggestion-prototype .disc-p-suggestion-cards { display:grid; grid-auto-rows:42px; gap:4px; max-height:226px; overflow-y:auto; overflow-x:hidden; min-height:0; scrollbar-gutter:auto; }
.disc-p-suggestion-status:empty { display:none; }
.disc-p-suggestion-body { display:grid; grid-template-rows:minmax(0,1fr); flex:0 0 auto; min-height:0; overflow:hidden; transition:grid-template-rows .22s ease; }
.disc-p-suggestion-body-inner { min-height:0; overflow:hidden; }
.disc-p-suggestion-prototype.is-collapsed .disc-p-suggestion-body { grid-template-rows:minmax(0,0fr); }
.disc-p-suggestion-prototype .disc-p-suggestion-card { display:grid; grid-template-columns:36px minmax(0,1fr) 25px; align-items:center; gap:6px; padding:3px; min-height:42px; box-sizing:border-box; margin:0; border:1px solid var(--border-color); border-radius:5px; background:var(--placeholder-background); }
.disc-p-suggestion-empty-row { min-height:42px; }
.disc-p-suggestion-prototype .disc-p-suggestion-card { cursor:pointer; transition:border-color .12s ease,background-color .12s ease,box-shadow .12s ease; }
.disc-p-suggestion-prototype .disc-p-suggestion-card:hover,.disc-p-suggestion-prototype .disc-p-suggestion-card:focus-visible { border-color:var(--accent-color); background:color-mix(in srgb,var(--accent-color) 10%,var(--placeholder-background)); box-shadow:0 0 0 1px color-mix(in srgb,var(--accent-color) 28%,transparent); outline:none; }
.disc-p-suggestion-prototype .disc-p-suggestion-card:focus-visible { outline:2px solid var(--accent-color); outline-offset:1px; }
.disc-p-suggestion-card strong { font-size:12px; font-weight:600; line-height:16px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; }
.disc-p-suggestion-prototype .disc-p-suggestion-card strong { text-overflow:ellipsis; }
.disc-p-suggestion-thumbnail { display:grid; place-items:center; position:relative; width:36px; height:36px; border-radius:4px; overflow:hidden; }
.disc-p-suggestion-kind-icon { width:20px; height:20px; background:currentColor; color:var(--muted-color); mask-size:contain; mask-position:center; mask-repeat:no-repeat; }
.disc-p-suggestion-thumbnail img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; }
.disc-p-suggestion-add { width:25px; height:25px; padding:0; border:1px solid var(--border-color); border-radius:5px; background:var(--panel-background); color:var(--text-color); cursor:pointer; }
.disc-p-suggestion-status { margin:0 0 4px; font-size:12px; }.disc-p-suggestion-status:empty { display:none; }
.viewer-suggestion-settings { position:fixed; inset:auto; margin:0; width:min(290px,calc(100vw - 16px)); max-height:calc(100dvh - 16px); overflow:auto; box-sizing:border-box; padding:12px; border:1px solid var(--border-color); border-radius:7px; background:var(--panel-background); color:var(--text-color); }
.viewer-suggestion-settings h3 { margin:0 0 12px; font-size:15px; }
.viewer-suggestion-settings .disc-p-suggestion-control { display:flex; gap:7px; align-items:center; margin:9px 0; font-size:12px; }
.viewer-suggestion-settings .viewer-suggestion-mode-row { display:grid; grid-template-columns:3.5rem minmax(0,1fr); align-items:center; }
.viewer-suggestion-mode { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); min-width:0; padding:2px; border:1px solid var(--border-strong); border-radius:6px; background:var(--v19-toggle-surface,var(--panel-background)); }
.viewer-suggestion-mode-option { min-width:0; min-height:28px; padding:3px 4px; border:0; border-radius:4px; background:transparent; color:var(--text-color); font:inherit; font-size:12px; cursor:pointer; }
.viewer-suggestion-mode-option[aria-pressed="true"] { background:var(--v19-toggle-selected,color-mix(in srgb,var(--accent-color) 16%,var(--panel-background))); color:var(--v19-toggle-selected-text,var(--accent-color)); font-weight:700; box-shadow:inset 0 0 0 1px var(--accent-color); }
.viewer-suggestion-mode-option:hover,.viewer-suggestion-mode-option:focus-visible { background:var(--v19-toggle-hover,color-mix(in srgb,var(--accent-color) 10%,var(--panel-background))); outline:none; }
/* Keep the approved mode control's geometry, colors and interaction. Move only
   its existing selected fill/border onto an animated indicator underneath. */
.viewer-suggestion-mode { --segment-count:3; position:relative; isolation:isolate; }
.viewer-suggestion-mode::before { content:""; position:absolute; z-index:0; inset-block:2px; left:2px; width:calc((100% - 4px) / var(--segment-count)); border-radius:4px; background:var(--v19-toggle-selected,color-mix(in srgb,var(--accent-color) 16%,var(--panel-background))); box-shadow:inset 0 0 0 1px var(--accent-color); pointer-events:none; transform:translateX(calc(var(--segment-index) * 100%)); transition:transform 180ms ease-out; }
.viewer-suggestion-mode-option { position:relative; z-index:1; }
.viewer-suggestion-mode > .viewer-suggestion-mode-option[aria-pressed="true"] { background:transparent; box-shadow:none; }
.viewer-suggestion-mode:has(> [aria-pressed="true"]:is(:hover,:focus-visible))::before { background:var(--v19-toggle-hover,color-mix(in srgb,var(--accent-color) 10%,var(--panel-background))); }
.viewer-suggestion-mode:hover { border-color:var(--accent-color); }
@media(prefers-reduced-motion:reduce) { .viewer-suggestion-mode::before { transition:none; } }
.viewer-suggestion-settings input[type=range] { flex:1; min-width:50px; }
.viewer-suggestion-settings output { min-width:30px; }

/* Narrow Viewer controls retain all actions without a horizontal scrollbar. */
.viewer-card-layout .timeline-management-toolbar { flex-wrap:wrap; }
.viewer-card-layout .timeline-list-content { scrollbar-gutter:stable; }
.viewer-card-layout .timeline-list-item-title-row .timeline-list-item-title { padding:0; min-height:0; border:0; }
.viewer-card-layout .timeline-list-item-actions .viewer-like-button::after { left:auto; right:0; transform:translateY(-2px); }
.viewer-card-layout .timeline-list-item-actions .viewer-like-button:hover::after,.viewer-card-layout .timeline-list-item-actions .viewer-like-button:focus-visible::after { transform:translateY(0); }

/* At the existing 170px panel minimum, keep actions below the media/title row. */
#timeline-list.viewer-card-layout { container-type:inline-size; container-name:viewer-list; }
@container viewer-list (max-width:220px) {
  .viewer-card-layout .timeline-list-item:not(.graph-group-card) { grid-template-columns:40px minmax(0,1fr); }
  .viewer-card-layout .timeline-list-item>.timeline-thumbnail { grid-row:1; width:40px; height:40px; }
  .viewer-card-layout .timeline-list-item-footer { grid-column:1/-1; margin-top:0; }
}

@media (prefers-reduced-motion: reduce) { .disc-p-suggestion-body { transition:none; } }
/* Studio reuses the Viewer relationship editor with metadata in the parent overlay. */
.discovery-editor.is-studio-embedded .discovery-header-title-row { display:flex; align-items:center; gap:8px; }
.discovery-editor.is-studio-embedded .discovery-header-title-row strong { flex:1; min-width:0; font-size:13px; }
.discovery-editor.is-studio-embedded .discovery-primary-save { width:auto; flex:none; }


.range-band-event.range-image-centered > .event-range-thumbnail { left: 50%; top: calc(var(--range-visual-height, 28px) / 2); transform: translate(-50%, -50%); }

.numeric-next-filter-group { margin: 0 0 8px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 8px; background: var(--surface-inset); }
.numeric-next-filter-header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 6px 8px; border-bottom: 1px solid var(--border-color); background: var(--surface-raised); }
.numeric-next-filter-toggle { display: inline-flex; align-items: center; gap: 5px; flex: 1 1 7rem; min-width: 0; padding: 3px 0; border: 0; background: transparent; color: var(--text-color); font: inherit; font-weight: 600; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.numeric-next-filter-toggle:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.numeric-next-filter-auto { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.numeric-next-filter-auto > label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-color); font-size: .85em; white-space: nowrap; cursor: pointer; }
.numeric-next-filter-auto input { margin: 0; }
.numeric-next-filter-group > .v1-member-list { border-top: 0; padding: 4px 8px; scrollbar-gutter: stable; }
.numeric-next-filter-group > .v1-member-list[hidden] { display: none; }
@media (min-width: 701px) { .v1-series-settings-layout:has(.numeric-next-filter-group) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* V17 follow-up: keep the Numeric settings overlay compact vertically; each column scrolls. */
.graph-settings-panel.is-v1-series-settings { max-height: 66vh; }
.v1-series-settings-layout { max-height: calc(66vh - 16px); }
.v1-series-settings-left, .v1-series-composer { max-height: calc(66vh - 32px); }
@media (max-width: 700px) {
  .graph-settings-panel.is-v1-series-settings { max-height: 66vh; }
  .v1-series-settings-layout { max-height: none; }
  .v1-series-settings-left, .v1-series-composer { max-height: 45vh; }
}

/* V16: condition eligibility is independent from a retained Filter selection. */
.numeric-next-filter-group .v1-member-row.is-inactive-condition { color: var(--muted-color); }
.numeric-next-filter-group .is-inactive-condition input { opacity: .5; }
.numeric-next-filter-group .is-removal-blocked, .numeric-next-filter-group input:disabled { cursor: not-allowed; }

/* V16 floating Event detail panel. Handles affect only this overlay. */
.event-details-move-grip { cursor: grab; touch-action: none; user-select: none; }
.details-panel.is-moving .event-details-move-grip { cursor: grabbing; }
.details-panel.is-moving, .details-panel.is-resizing { user-select: none; }
.event-details-resize-handle { position: absolute; z-index: 4; touch-action: none; }
.event-details-resize-handle.resize-n, .event-details-resize-handle.resize-s { left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.event-details-resize-handle.resize-n { top: 0; }.event-details-resize-handle.resize-s { bottom: 0; }
.event-details-resize-handle.resize-e, .event-details-resize-handle.resize-w { top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.event-details-resize-handle.resize-e { right: 0; }.event-details-resize-handle.resize-w { left: 0; }
.event-details-resize-handle.resize-nw, .event-details-resize-handle.resize-ne, .event-details-resize-handle.resize-sw, .event-details-resize-handle.resize-se { width: 10px; height: 10px; }
.event-details-resize-handle.resize-nw, .event-details-resize-handle.resize-ne { top: 0; }.event-details-resize-handle.resize-sw, .event-details-resize-handle.resize-se { bottom: 0; }.event-details-resize-handle.resize-nw, .event-details-resize-handle.resize-sw { left: 0; }.event-details-resize-handle.resize-ne, .event-details-resize-handle.resize-se { right: 0; }
.event-details-resize-handle.resize-nw, .event-details-resize-handle.resize-se { cursor: nwse-resize; }
.event-details-resize-handle.resize-ne, .event-details-resize-handle.resize-sw { cursor: nesw-resize; }

.event-group-settings-panel { position: fixed; z-index: 180; left: min(290px, 5vw); top: 100px; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 112px); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; background: var(--panel-background); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 10px 24px #0004; }
.event-group-settings-panel > header { display: flex; gap: 8px; justify-content: space-between; }
.event-group-settings-panel > header input { min-width: 0; flex: 1; }
.event-group-member-list { overflow: auto; min-height: 0; display: grid; gap: 6px; padding-left: 8px; }
.event-group-member-list .timeline-list-item { width: auto; margin: 0; }
.event-image-setting-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; grid-column: 1 / -1; }

.viewer-card-layout .graph-group-card { display:grid; grid-template-columns:72px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:2px 7px; min-height:74px; padding:0; border-radius:5px; }
.viewer-card-layout .graph-group-card .timeline-list-item-count { position:static; width:auto; height:auto; clip-path:none; font-size:11px; margin-right:auto; }
@media (max-width:700px) { .viewer-card-layout .graph-group-card { grid-template-columns:40px minmax(0,1fr); } }

.viewer-card-layout .timeline-card-config-panel { min-width: 240px; max-width: calc(100vw - 16px); }
.event-image-setting-row .event-image-segment { flex: 0 0 108px; width:108px; }
.viewer-card-layout .event-image-segment > button { width:auto; min-height:26px; height:auto; padding:2px 8px; border:0; background:transparent; }

.timeline-config-portal { position: fixed; inset: 0; z-index: 180; pointer-events: none; }
.timeline-config-portal .timeline-card-config-panel { pointer-events: auto; }

.viewer-card-layout .timeline-card-config-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.event-image-setting-row { white-space: nowrap; font-size: .85rem; }

/* V19: UI dictionary control families, scoped to the normal Viewer. Layout
   containers and the help/local-load controls retain their existing rules. */
.viewer-ui-v19 {
  --v19-surface: #fff; --v19-text: #1f2937; --v19-border: #cbd5e1;
  --v19-hover: #eaf1fb; --v19-selected: #dbeafe; --v19-accent: #2563eb;
  --v19-disabled: #f1f5f9; --v19-muted: #94a3b8; --v19-height: 30px;
}
html[data-theme="dark"] .viewer-ui-v19 {
  --v19-surface: #172235; --v19-text: #f1f5f9; --v19-border: #475569;
  --v19-hover: #2b3e59; --v19-selected: #1d3c62; --v19-accent: #93c5fd;
  --v19-disabled: #28354a; --v19-muted: #90a1b8;
  /* 2026-10-27: controls use a black face; blue is a border/text accent. */
  --v19-control-surface: #101214; --v19-control-hover: #101214;
  --v19-control-selected: #101214; --v19-control-disabled: #101214;
  --v19-toggle-selected-text: #dbeafe; --v19-toggle-surface: #101214; --v19-toggle-selected: color-mix(in srgb,var(--accent-color) 24%,#101214); --v19-toggle-hover: color-mix(in srgb,var(--accent-color) 14%,#101214);
}
.viewer-ui-v19 .v19-button.v19-button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  gap: 4px; min-height: var(--v19-height); height: var(--v19-height); padding: 0 8px;
  border: 1px solid var(--v19-border); border-radius: 6px;
  background: var(--v19-control-surface, var(--v19-surface)); color: var(--v19-text); font: inherit; font-size: 13px;
  cursor: pointer; transition: background-color 120ms, border-color 120ms, color 120ms;
}
.viewer-ui-v19 .v19-button.v19-button:hover:not(:disabled) { background: var(--v19-control-hover, var(--v19-hover)); border-color: var(--v19-accent); }
.viewer-ui-v19 .v19-button.v19-button:active:not(:disabled) { background: var(--v19-control-selected, var(--v19-selected)); }
.viewer-ui-v19 .v19-button.v19-button:focus-visible, .viewer-ui-v19 .v19-input:focus {
  outline: 2px solid var(--v19-accent); outline-offset: 1px; border-color: var(--v19-accent);
}
.viewer-ui-v19 .v19-button.v19-button:disabled { background: var(--v19-control-disabled, var(--v19-disabled)); color: var(--v19-muted); border-color: var(--v19-border); cursor: not-allowed; opacity: .6; }
.viewer-ui-v19 .v19-button.v19-icon { width: var(--v19-height); min-width: var(--v19-height); padding: 0; flex-shrink: 0; }
.viewer-ui-v19 .v19-button .ui-icon { width: 16px; height: 16px; }
.viewer-ui-v19 .v19-primary.v19-button { --v19-height: 34px; background: #2563eb; color: #fff; border-color: transparent; font-weight: 600; }
.viewer-ui-v19 .v19-primary.v19-button:hover:not(:disabled) { background: #2057ce; border-color: transparent; }
.viewer-ui-v19 .v19-primary.v19-button:active:not(:disabled) { background: #1c4bb3; }
.viewer-ui-v19 .v19-button.timeline-delete-button:hover:not(:disabled) .ui-icon { color: var(--danger-color); }
.viewer-ui-v19 :is(.timeline-list-item-actions,.discovery-card-actions,.timeline-summary-actions) { --v19-height: 24px; }
.viewer-ui-v19 .timeline-summary-actions .viewer-like-button { min-width: 42px; border-radius: 6px; }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-height:34px; height:34px; padding:2px; gap:0; isolation:isolate; border:1px solid var(--border-strong); border-radius:6px; background:var(--v19-toggle-surface,var(--panel-background)); color:var(--text-color); font-size:12px; }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle::before { border:0; border-radius:4px; background:var(--v19-toggle-selected,color-mix(in srgb,var(--accent-color) 16%,var(--panel-background))); box-shadow:inset 0 0 0 1px var(--accent-color); transition:transform 180ms ease-out; }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle > span { min-width:0; padding:3px 4px; border-radius:4px; color:var(--text-color); font-size:12px; }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle > .is-selected { color:var(--v19-toggle-selected-text,var(--accent-color)); font-weight:700; }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle:hover:not(:disabled),.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle:active:not(:disabled) { border-color:var(--border-strong); background:var(--v19-toggle-surface,var(--panel-background)); }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle:hover:not(:disabled) { border-color:var(--accent-color); }
.viewer-ui-v19 .binary-segmented-toggle.binary-segmented-toggle:hover:not(:disabled)::before { background:var(--v19-toggle-hover,color-mix(in srgb,var(--accent-color) 10%,var(--panel-background))); }
.viewer-ui-v19 .settings-menu .v19-toggle { width: 88px; min-width: 88px; }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented:not(.binary-segmented-toggle)) { position:relative; isolation:isolate; padding:2px; min-height:34px; height:34px; box-sizing:border-box; border:1px solid var(--border-strong); border-radius:6px; background:var(--v19-toggle-surface,var(--panel-background)); }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented:not(.binary-segmented-toggle))::before { content:""; position:absolute; z-index:0; inset-block:2px; left:2px; width:calc((100% - 4px) / var(--segment-count,3)); border-radius:4px; background:var(--v19-toggle-selected,color-mix(in srgb,var(--accent-color) 16%,var(--panel-background))); box-shadow:inset 0 0 0 1px var(--accent-color); transform:translateX(calc(var(--segment-index) * 100%)); transition:transform 180ms ease-out; pointer-events:none; }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented) > button:is(button,.v19-button) { position:relative; z-index:1; min-height:28px; height:28px; min-width:0; padding:3px 4px; border:0; border-radius:4px; background:transparent; color:var(--text-color); font:inherit; font-size:12px; box-shadow:none; }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented) > button:is(button,.v19-button).is-selected { color:var(--v19-toggle-selected-text,var(--accent-color)); font-weight:700; }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented) > button:is(button,.v19-button):hover:not(:disabled) { background:var(--v19-toggle-hover,color-mix(in srgb,var(--accent-color) 10%,var(--panel-background))); box-shadow:none; }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented):has(> .is-selected:is(:hover,:focus-visible))::before { background:var(--v19-toggle-hover,color-mix(in srgb,var(--accent-color) 10%,var(--panel-background))); }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented) > button:is(button,.v19-button).is-selected:is(:hover,:focus-visible) { background:transparent; }
.viewer-ui-v19 :is(.v19-mode,.graph-segmented):hover { border-color:var(--accent-color); }
.viewer-ui-v19 .v19-input.v19-input {
  box-sizing: border-box; min-height: 36px; height: 36px; min-width: 0; padding: 4px 10px;
  border: 1px solid var(--v19-border); border-radius: 999px; background: var(--v19-control-surface, var(--v19-surface));
  color: var(--v19-text); font: inherit; font-size: 13px;
}
.viewer-ui-v19 input:is([type="text"],[type="search"],[type="url"],[type="email"],[type="number"],[type="password"],:not([type])) { box-sizing:border-box; min-height:36px; height:36px; border-radius:999px; }
.viewer-ui-v19 .search-header :is(.search-target-buttons,.search-local-toggle) { min-height:36px; height:36px; }
.viewer-ui-v19 .v19-input::placeholder { color: var(--v19-muted); opacity: 1; }
.viewer-ui-v19 .v19-input:hover:not(:disabled):not([readonly]) { border-color: var(--v19-accent); }
html[data-theme="dark"] .viewer-ui-v19 input:is([type="text"],[type="search"],[type="url"],[type="email"],[type="number"],[type="password"],:not([type])) { background:var(--v19-control-surface); color:var(--v19-text); color-scheme:dark; }
html[data-theme="dark"] .viewer-ui-v19 .v19-button.v19-button:active:not(:disabled):not(.v19-primary) { box-shadow:inset 0 0 0 1px var(--v19-accent); }
.viewer-ui-v19 .discovery-catalog-list .discovery-catalog-card { height: 76px; }
.viewer-ui-v19 .discovery-catalog-card .discovery-card-media { width: 72px; height: 74px; flex-basis: 72px; }
.viewer-ui-v19 .discovery-catalog-card .discovery-card-title { font-size: 14px; line-height: 17px; }
.viewer-ui-v19 .search-results { border: 1px solid var(--v19-border); border-radius: 6px; color: var(--v19-text); }
.viewer-ui-v19 .search-results { overflow: auto; }
.viewer-ui-v19 .search-result-columns, .viewer-ui-v19 .search-result-row { min-width: 580px; }
.viewer-ui-v19 .search-result-columns { background: var(--v19-surface); border-bottom: 1px solid var(--v19-border); color: var(--v19-text); }
.viewer-ui-v19 .search-result-columns > span { padding: 3px 5px; }
.viewer-ui-v19 .search-result-row { min-height: 38px; padding: 5px; border-bottom: 1px solid var(--v19-border); border-top: 0; color: var(--v19-text); background: transparent; }
.viewer-ui-v19 .search-result-row > span { padding-inline: 5px; border-inline-end: 0; }
.viewer-ui-v19 .search-result-row > span:last-child { border-inline-end: 0; text-align: end; }
.viewer-ui-v19 .search-result-row:hover, .viewer-ui-v19 .search-result-row:focus-visible { background: var(--v19-hover); outline: 1px solid var(--v19-accent); outline-offset: -1px; }
.viewer-ui-v19 .search-result-row.is-added { background: var(--v19-selected); }
.viewer-ui-v19 .search-result-columns > span:first-child { overflow: visible; white-space: normal; }
.viewer-ui-v19 .v19-table-sort.v19-input { max-width: 100%; width: 100%; height: 26px; min-height: 26px; padding: 1px 3px; font-size: 11px; }
.viewer-ui-v19 .v19-table-direction.v19-button { --v19-height: 24px; width: 24px; padding: 0; }
.viewer-ui-v19 .search-pager { display: inline-flex; align-items: center; gap: 4px; }
.viewer-ui-v19 .search-pager .v19-button { --v19-height: 28px; min-width: 28px; padding: 0 5px; }
.viewer-search-pager { display:flex; flex:0 0 auto; align-items:center; justify-content:center; gap:.2rem; min-height:1.7rem; padding:5px 0; border:1px solid var(--v19-border); border-top:0; border-radius:0 0 6px 6px; background:var(--panel-background); white-space:nowrap; }
.viewer-search-pager[hidden] { display:none; }
.viewer-range-page { --compact-pager-current-bg:var(--accent-color,#2563eb); --compact-pager-current-fg:#fff; box-sizing:border-box; min-width:2rem; height:1.45rem; padding:0 .25rem; border:1px solid var(--border-color,#cbd5e1); border-radius:.2rem; background:transparent; color:var(--text-color,#17243a); font:inherit; font-size:.78rem; line-height:1; cursor:pointer; }
.viewer-range-page:not(:disabled):is(:hover,:focus-visible) { text-decoration:underline; }
.viewer-range-page[aria-current="page"] { border-color:var(--compact-pager-current-bg); background:var(--compact-pager-current-bg); color:var(--compact-pager-current-fg); cursor:default; }
.viewer-range-page:disabled:not([aria-current="page"]) { opacity:.45; cursor:not-allowed; }
.viewer-range-ellipsis { display:inline-block; min-width:1.1rem; color:var(--muted-color,#667085); text-align:center; }
html[data-theme="dark"] .viewer-range-page { --compact-pager-current-bg:#214f87; --compact-pager-current-fg:#eef6ff; }
.viewer-ui-v19 .v19-button[data-tooltip]::after, .viewer-ui-v19 .v19-toggle > span[data-tooltip]::after { display: none !important; }
#viewer-ui-tooltip-root { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.v19-tooltip {
  position: fixed; box-sizing: border-box; max-width: min(280px,calc(100vw - 16px));
  padding: 6px 9px; border: 1px solid #4c5666; border-radius: 6px;
  background: #1f2937; color: #fff; box-shadow: 0 4px 12px #0003;
  font: 500 12px/1.45 system-ui,sans-serif; white-space: pre-line; overflow-wrap: anywhere;
  opacity: 0; transition: opacity 100ms ease-out; pointer-events: none;
}
.v19-tooltip[data-open="true"] { opacity: 1; }
.viewer-ui-v19 .discovery-detail-tooltip { width: min(280px,calc(100vw - 16px)); padding: 6px 9px; border: 1px solid #4c5666; border-radius: 6px; background: #1f2937; color: #fff; box-shadow: 0 4px 12px #0003; font: 500 12px/1.45 system-ui,sans-serif; }
@media (prefers-reduced-motion: reduce) { .viewer-ui-v19 .v19-button, .viewer-ui-v19 :is(.binary-segmented-toggle,.v19-mode,.graph-segmented)::before, .v19-tooltip { transition: none; } }

/* VIEW-V V23: one persistent sidebar and one content panel. Studio never mounts this class. */
.main-area.viewer-sidebar-layout {position:relative;grid-template-columns:48px var(--viewer-panel-width,300px) 8px minmax(0,1fr);gap:0;transition:grid-template-columns 180ms ease-out;}
.viewer-sidebar-layout.is-sidebar-resizing {transition:none;}
.viewer-sidebar {display:flex;flex-direction:column;align-items:center;gap:10px;padding:8px 4px;background:var(--panel-background);border:1px solid var(--border-color);border-radius:6px;min-height:0;}
.viewer-ui-v19 .viewer-sidebar-button.v19-button {position:relative;--v19-height:36px;flex-shrink:0;}
.viewer-sidebar-icon,.viewer-search-input-icon {display:inline-block;width:20px;height:20px;background:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center;}
.viewer-sidebar-button[aria-pressed="true"] {color:var(--v19-toggle-selected-text,var(--accent-color));border-color:var(--accent-color);box-shadow:inset 3px 0 var(--accent-color);}
.viewer-sidebar-layout .viewer-side-panel {min-width:0;overflow:hidden;display:flex;flex-direction:column;border-radius:6px;}
.viewer-sidebar-layout .timeline-list-header {flex:0 0 auto;}
.viewer-sidebar-layout #timeline-list-controls {display:flex;align-items:center;}
.viewer-panel-title {font-size:14px;margin:4px 0;flex:1;}
.viewer-sidebar-layout #timeline-list-content {overflow:auto;}
.viewer-sidebar-layout.is-sidebar-collapsed .viewer-side-panel {visibility:hidden;border:0;pointer-events:none;}
.viewer-suggestion-dock {position:absolute;z-index:25;left:48px;bottom:0;width:var(--viewer-dock-width,300px);max-width:calc(100% - 64px);padding:5px 7px;box-sizing:border-box;background:var(--panel-background);border:1px solid var(--border-color);border-radius:6px;}
.viewer-suggestion-dock .disc-p-suggestion-prototype {margin:0;width:auto;height:auto;max-height:min(360px,50vh);}
.viewer-suggestion-dock .disc-p-suggestion-cards {max-height:min(270px,36vh);}
.viewer-suggestion-dock .disc-p-suggestion-card {grid-template-columns:36px minmax(0,1fr);}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel {inset:auto!important;width:100%!important;min-width:0!important;max-width:none!important;height:100%;max-height:none!important;box-shadow:none;border:0;padding:0;box-sizing:border-box;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .normal-search-ui {display:flex;flex-direction:column;min-height:0;height:100%;gap:8px;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-header {display:flex;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-input-wrap {display:flex;align-items:center;min-width:0;width:100%;position:relative;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-input {width:100%;padding-left:30px;}
.viewer-search-input-icon {position:absolute;left:9px;width:14px;height:14px;color:var(--muted-color);pointer-events:none;}
.viewer-search-genre-row {display:flex;align-items:center;justify-content:space-between;gap:4px;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-filter-row {display:block;flex:none;min-height:0;padding:0;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tags {display:flex;flex-wrap:wrap;gap:4px;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input {width:100%;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-results {min-height:80px;flex:1;overflow:auto;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .viewer-search-pager {position:static;flex:none;}
.viewer-search-card {display:grid;grid-template-rows:auto auto;width:100%;text-align:left;background:var(--panel-background);color:var(--text-color);border:1px solid var(--border-strong);border-radius:6px;cursor:pointer;}
.viewer-search-card .timeline-thumbnail {grid-row:1/3;position:relative!important;inset:auto!important;}
.viewer-search-card strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.viewer-search-card small {color:var(--accent-color);min-height:12px;}
.viewer-search-card:hover,.viewer-search-card:focus-visible,.viewer-search-card.is-added {border-color:var(--accent-color);box-shadow:inset 0 0 0 1px var(--accent-color);}
.viewer-sidebar-layout .is-simple-search .search-result-columns {display:none;}
.viewer-sidebar-layout .local-import-panel {min-width:0;}
.viewer-sidebar-layout .local-import-dropzone {grid-template-columns:minmax(0,1fr);}
.viewer-sidebar-layout .local-import-example-grid {grid-template-columns:minmax(0,1fr);}
.viewer-sidebar-layout .timeline-list-item.is-hidden {opacity:.5;}
.discovery-catalog-card[aria-checked="true"] {border-color:var(--accent-color);box-shadow:inset 0 0 0 1px var(--accent-color);}
.timeline-lane-label[role="button"] {cursor:pointer;pointer-events:auto;}
.timeline-lane-label[role="button"]:hover,.timeline-lane-label[role="button"]:focus-visible {outline:1px solid var(--accent-color);outline-offset:1px;}
body.viewer-ui-v19 .timeline-summary-popup {display:flex;flex-direction:column;gap:8px;width:min(390px,calc(100vw - 16px));max-height:calc(100dvh - 24px);overflow:hidden;}
body.viewer-ui-v19 .timeline-summary-title-row {flex:none;min-width:0;}
body.viewer-ui-v19 .timeline-summary-title {white-space:normal;overflow-wrap:anywhere;}
body.viewer-ui-v19 .timeline-summary-scroll-body {min-height:0;max-height:calc(100dvh - 150px);overflow:auto;flex:0 1 auto;white-space:normal;overflow-wrap:anywhere;}
body.viewer-ui-v19 .timeline-summary-scroll-body :is(p,.timeline-summary-tags,.timeline-summary-sources) {max-height:none;overflow:visible;white-space:normal;-webkit-line-clamp:unset;}
body.viewer-ui-v19 .timeline-summary-sources {display:block;}
body.viewer-ui-v19 .timeline-summary-actions {display:flex;flex:none;justify-content:flex-end;gap:4px;}
@media(prefers-reduced-motion:reduce){.main-area.viewer-sidebar-layout{transition:none;}}
@media(max-width:600px){.viewer-sidebar{gap:7px;}.viewer-suggestion-dock{max-width:calc(100% - 58px);}.viewer-sidebar-layout #timeline-list-content{padding-inline:4px;}}

.viewer-sidebar-layout > .viewer-sidebar {grid-column:1;grid-row:1;}
.viewer-sidebar-layout > #timeline-list {grid-column:2;grid-row:1;}
.viewer-sidebar-layout > #timeline-list-resizer {grid-column:3;grid-row:1;}
.viewer-sidebar-layout > #main-stage {grid-column:4;grid-row:1;}
.viewer-sidebar-layout > .viewer-suggestion-dock {grid-column:auto;grid-row:auto;}

.viewer-suggestion-dock .disc-p-suggestion-thumbnail {position:relative;grid-column:1;grid-row:1;width:36px;height:36px;}
.viewer-suggestion-dock .disc-p-suggestion-card > strong {grid-column:2;grid-row:1;text-align:left;}
.viewer-sidebar-layout .timeline-list-content:has(> #search-panel) {display:flex;flex-direction:column;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel {flex:1;min-height:0;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-input-wrap > .search-input {padding-left:30px;}
.tutorial-panel .tutorial-copy {min-width:0;}

.viewer-search-card .timeline-thumbnail {display:grid;place-items:center;}
.viewer-search-card .timeline-thumbnail > :is(img,.timeline-kind-fallback) {position:absolute;}
.viewer-search-card .timeline-thumbnail > img {inset:0;width:100%;height:100%;object-fit:cover;}
.viewer-search-card .timeline-kind-fallback {width:27px;height:27px;flex-shrink:0;}
.viewer-suggestion-dock .disc-p-suggestion-thumbnail > img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
.viewer-suggestion-dock .disc-p-suggestion-kind-icon {position:absolute;inset:5px;}

/* User correction: the fixed-width suggestion Overlay never allocates content height. */
.viewer-sidebar-layout .viewer-side-panel {align-self:start;}
.viewer-sidebar-layout #timeline-list-content {padding-bottom:8px;}
.viewer-suggestion-dock {width:var(--viewer-dock-width,300px);bottom:0;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-results {overflow-x:hidden;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-result-columns,:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-result-row {min-width:0;grid-template-columns:minmax(0,2.8fr) minmax(0,1.5fr) minmax(0,1.8fr) minmax(0,1.2fr) minmax(18px,.45fr) minmax(18px,.3fr);column-gap:7px;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-result-row > span,:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-result-columns > span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.viewer-search-card {grid-template-columns:36px minmax(0,1fr);min-height:42px;height:42px;padding:3px;gap:2px 6px;max-width:282px;margin-bottom:4px;}
.viewer-search-card .timeline-thumbnail {width:36px!important;height:36px!important;}
.viewer-search-card strong {font-size:12px;align-self:center;}
.viewer-search-card small {grid-column:2;grid-row:2;position:absolute;right:3px;bottom:1px;font-size:9px;line-height:10px;}
.viewer-search-card {position:relative;}
.viewer-search-card.is-added strong {padding-bottom:8px;}
.viewer-sidebar-layout .is-simple-search .search-results {border:0;background:transparent;}
@media(max-width:600px){.viewer-sidebar-layout #timeline-list-content{padding-bottom:8px;}}
.viewer-suggestion-dock .disc-p-suggestion-prototype {padding:4px;}
.viewer-search-card,.viewer-suggestion-dock .disc-p-suggestion-card {box-sizing:border-box;width:min(100%,274px);max-width:274px;height:42px;}

.viewer-sidebar-layout.is-sidebar-collapsed .viewer-side-panel {padding:0;}
.viewer-search-genre-row {flex-wrap:wrap;}
.viewer-search-view {margin-left:auto;}

/* Final user layout: one search row, inline tag icon, compact Overlay header. */
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-header {flex-direction:row;align-items:center;gap:6px;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-target-buttons {flex:0 0 94px;align-self:center;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-header>.search-input-wrap {flex:1;min-width:0;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap {position:relative;min-width:0;flex:1;width:100%;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input {padding-left:34px;}
.viewer-ui-v19 .viewer-lane-reset.v19-button {position:absolute;left:4px;top:4px;z-index:8;--v19-height:28px;}
.viewer-suggestion-dock {padding:2px 4px;}
.viewer-suggestion-dock .disc-p-suggestion-prototype {padding:0;border:0;}
.viewer-suggestion-dock .disc-p-suggestion-heading {height:26px;min-height:26px;padding:0 4px;box-sizing:border-box;}
.viewer-ui-v19 .viewer-suggestion-dock .disc-p-suggestion-settings-button {--v19-height:24px;height:24px;min-height:24px;width:24px;}
.viewer-suggestion-dock .disc-p-suggestion-toggle {min-height:24px;height:24px;font-size:12px;}
@media(max-width:600px){:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-target-buttons{flex-basis:82px;}:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-header{gap:4px;}:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel .search-input{padding-left:25px;padding-right:4px;}}

.viewer-ui-v19 :is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input.v19-input {padding-left:34px;}

/* V23 final panel sizing and controls. The collapsed dock never owns list space. */
.viewer-sidebar-layout.is-sidebar-collapsed #timeline-list-resizer {visibility:visible;pointer-events:auto;}
.viewer-sidebar-layout .viewer-sidebar-utilities {margin-top:auto;display:flex;flex-direction:column;gap:6px;align-items:center;}
.viewer-sidebar-layout .viewer-sidebar {padding-bottom:8px;}
.viewer-sidebar-layout .viewer-sidebar-utilities .viewer-sidebar-button {width:36px;height:36px;border-radius:4px;background:var(--v19-control-surface,var(--v19-surface,#fff));}
.viewer-ui-v19 .viewer-sidebar-settings-menu {position:fixed;right:auto;top:auto;z-index:100;max-width:calc(100vw - 64px);}
.viewer-sidebar-layout .timeline-list-controls {justify-content:flex-start;gap:10px;}
.viewer-sidebar-layout .viewer-panel-title {flex:0 0 auto;}
.viewer-sidebar-layout .viewer-search-view {margin-left:0;flex-shrink:0;}
.viewer-search-order {display:none;gap:2px;margin-bottom:6px;}
.is-simple-search .viewer-search-order {display:flex;}
.viewer-search-order [aria-selected="true"] {font-weight:700;color:var(--text-color);border-color:var(--accent-color);}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap {display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-height:36px;height:auto;padding:4px 6px 4px 32px;border:1px solid var(--border-strong);border-radius:18px;background:var(--v19-control-surface,var(--v19-surface,#fff));}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap:focus-within {border-color:var(--accent-color);box-shadow:0 0 0 1px var(--accent-color);}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap .viewer-tag-icon {pointer-events:none;left:7px;top:7px;transform:none;width:20px;height:20px;}
.viewer-ui-v19 :is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap input {flex:1 1 80px;min-width:60px;width:auto;padding:0!important;height:26px;min-height:26px;border:0!important;border-radius:0;box-shadow:none!important;background:transparent;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap .search-tag-chip {margin:0;max-width:100%;}
.viewer-sidebar-layout .event-table {padding-bottom:0;}
.viewer-sidebar-layout .event-table-scroll {min-height:0;}
.viewer-ui-v19 .viewer-lane-reset.v19-button {pointer-events:auto;}

:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap .viewer-tag-icon {position:absolute;}
.viewer-sidebar-layout .event-table {align-content:start;}

:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap {max-width:none;box-sizing:border-box;}

:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel {position:relative!important;}

/* Leave the local framework indicator clear of the bottom utility button. */
.viewer-sidebar-layout .viewer-sidebar-utilities {margin-bottom:36px;}
@media (max-width:600px) {
}

:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap {cursor:text;}
.viewer-ui-v19 :is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap input:focus {outline:none!important;outline-offset:0;}

/* Resize chrome stays below floating Event details, including its full-height rail. */
.viewer-sidebar-layout > #timeline-list-resizer {z-index:var(--layer-base);}
.viewer-sidebar-layout > #main-stage {z-index:1;}
.viewer-sidebar-layout .event-table-individual {--event-column-min:215px;}

/* V23 follow-up: independent panel tabs, segmented genres, compact search. */
.viewer-tabs {display:flex;align-items:stretch;gap:0;flex:none;min-width:0;height:32px;border:0;background:transparent;}
.viewer-tabs > button {position:relative;min-width:0;padding:4px 9px;border:0;border-bottom:2px solid var(--border-color);border-radius:0;background:transparent;color:var(--muted-color);font:inherit;font-size:12px;cursor:pointer;white-space:nowrap;}
.viewer-tabs > button[aria-selected="true"] {color:var(--text-color);font-weight:700;border-bottom-color:var(--accent-color);}
.viewer-tabs > button:hover {color:var(--text-color);background:var(--hover-background);}
.viewer-tabs > button:focus-visible {outline:2px solid var(--accent-color);outline-offset:-2px;}
.viewer-sidebar-layout #timeline-list-controls {gap:10px;flex-wrap:nowrap;justify-content:flex-start;}
.viewer-sidebar-layout .viewer-search-view {margin:0;height:32px;}
.viewer-sidebar-layout .viewer-search-genre-row {justify-content:flex-start;flex-wrap:nowrap;gap:6px;}
.viewer-genre-label {font-size:11px;flex:none;}
.viewer-genre-segments {display:flex;flex:1;min-width:0;border:1px solid var(--border-strong);border-radius:999px;overflow:hidden;height:32px;}
.viewer-genre-segments > .viewer-genre-chip {min-width:0;padding:2px 3px;border-right:1px solid var(--border-strong);border-radius:0;background:var(--v19-control-surface,var(--panel-background));color:var(--text-color);font:inherit;font-size:10px;cursor:pointer;white-space:nowrap;}
.viewer-genre-segments > .viewer-genre-chip:last-child {border-right:0;}
.viewer-genre-segments > .viewer-genre-chip:hover {box-shadow:inset 0 0 0 1px var(--accent-color);}
.viewer-sidebar-layout .is-simple-search .search-header {gap:5px;}
.viewer-sidebar-layout .is-simple-search .search-header .search-word-input-wrap {flex:1;min-width:0;width:0;}
.viewer-sidebar-layout .is-simple-search .search-header .viewer-search-order {display:flex;margin:0;height:36px;}
.viewer-sidebar-layout .is-simple-search .search-filter-row,.viewer-sidebar-layout .is-simple-search .search-target-buttons {display:none!important;}
.viewer-ui-v19 .viewer-search-card {grid-template-rows:1fr;align-items:center;gap:0 6px;}
.viewer-ui-v19 .viewer-search-card .timeline-thumbnail {grid-row:1;grid-column:1;}
.viewer-search-card strong {grid-row:1;grid-column:2;line-height:16px;}
.viewer-search-card small {display:none;}
.viewer-search-like-count {grid-row:1;grid-column:3;align-self:end;padding-bottom:1px;font-size:11px;white-space:nowrap;pointer-events:none;color:var(--text-color);}
.viewer-ui-v19 .search-result-columns {min-height:36px;align-items:center;}
.viewer-ui-v19 .search-result-columns > span {text-decoration:none;border:0;box-shadow:none;}
.viewer-ui-v19 .search-result-columns > span::before,.viewer-ui-v19 .search-result-columns > span::after {content:none;}
.viewer-ui-v19 .settings-option-row[data-tooltip]::after {display:none!important;content:none;}
.viewer-ui-v19 .timeline-card-config-panel {display:grid;grid-template-columns:repeat(6,30px);grid-template-rows:auto auto auto;gap:6px;padding:8px;}
.viewer-ui-v19 .timeline-card-config-panel .timeline-color-palette {grid-column:1/5;grid-row:1;grid-template-columns:repeat(4,30px);grid-template-rows:repeat(2,28px);gap:3px;}
.viewer-ui-v19 .timeline-card-config-panel .timeline-palette-launch {grid-column:5/7;grid-row:1;place-self:center;}
.viewer-ui-v19 .timeline-card-config-panel .timeline-icon-choice-list {grid-column:1/7;grid-row:2;grid-template-columns:repeat(6,30px);grid-template-rows:28px;gap:6px;}
.viewer-ui-v19 .timeline-card-config-panel .event-image-setting-row {grid-column:1/7;grid-row:3;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.viewer-sidebar-layout .discovery-catalog-toolbar {gap:5px;}
.viewer-sidebar-layout .discovery-catalog-toolbar > input {flex:1;min-width:0;height:36px;}
.viewer-sidebar-layout .discovery-catalog-toolbar > .viewer-tabs {flex:none;height:36px;}
.viewer-sidebar-layout .discovery-catalog-card .discovery-card-title {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:18px;font-size:14px;color:var(--text-color);}
.viewer-sidebar-layout .discovery-catalog-card {background:var(--panel-background);border:1px solid var(--border-strong);border-radius:5px;cursor:pointer;}
.viewer-sidebar-layout .discovery-catalog-card .discovery-card-body {padding:5px 6px 5px 0;}
.viewer-sidebar-layout .discovery-catalog-card[aria-checked="true"] {outline:1px solid var(--accent-color);outline-offset:-1px;}
@media(max-width:600px){.viewer-genre-label{font-size:9px}.viewer-genre-segments > .viewer-genre-chip{font-size:9px;padding-inline:1px}.viewer-tabs>button{padding-inline:5px;}}

.viewer-tabs[hidden] {display:none!important;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tags {padding:0;margin:0;}

.viewer-tab-icon {display:inline-block;width:16px;height:16px;vertical-align:middle;margin-right:4px;background:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center;pointer-events:none;}

/* Genre frame and dividers remain visible for adjacent selections. */
.viewer-genre-segments {position:relative;isolation:isolate;box-sizing:border-box;padding:1px;--genre-selection:#2563eb;--genre-divider:#94a3b8;}
html[data-theme="dark"] .viewer-genre-segments {--genre-selection:#294f74;--genre-divider:#91a5ba;}
.viewer-genre-segments > .viewer-genre-chip {position:relative;flex:1 1 0;min-height:0;margin:0;border:0;height:auto;}
.viewer-genre-segments > .viewer-genre-chip:first-child {border-radius:999px 0 0 999px;}
.viewer-genre-segments > .viewer-genre-chip:last-child {border-radius:0 999px 999px 0;}
.viewer-genre-segments > .viewer-genre-chip[aria-pressed="true"] {background:var(--genre-selection)!important;color:#fff!important;}
.viewer-genre-segments > .viewer-genre-chip + .viewer-genre-chip::before {content:"";position:absolute;left:0;top:2px;bottom:2px;width:1px;z-index:2;background:var(--genre-divider);pointer-events:none;}

.viewer-ui-v19 .viewer-search-card {grid-template-columns:36px minmax(0,1fr);}
.viewer-search-card-text {grid-column:2;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:5px;min-width:0;}
.viewer-search-card-text strong {grid-column:1;grid-row:1;}
.viewer-search-card-text .viewer-search-like-count {grid-column:2;grid-row:1;line-height:16px;padding:0;}

/* VIEW-V V24: embedded recommendations share panel height; legacy overlays remain available. */
.viewer-sidebar-layout .viewer-side-panel {height:100%;padding:12px 8px;}
.viewer-sidebar-layout #timeline-list-content {flex:1 1 auto;min-height:0;padding:0 0 0 6px;}
.viewer-sidebar-layout[data-viewer-panel="search"] #timeline-list-content {display:flex;flex-direction:column;overflow:hidden;}
.viewer-sidebar-layout .viewer-embedded-suggestions {position:static;flex:0 0 auto;display:flex;flex-direction:column;min-width:0;min-height:32px;width:100%;margin-top:8px;padding:0 0 0 6px;box-sizing:border-box;}
.viewer-embedded-suggestions[hidden] {display:none!important;}
.viewer-embedded-suggestions .disc-p-suggestion-prototype {display:flex;flex-direction:column;flex:0 1 auto;min-height:0;height:auto;width:100%;max-height:100%;margin:0;padding:3px;border:1px solid var(--border-color);border-radius:6px;overflow:hidden;}
.viewer-embedded-suggestions .disc-p-suggestion-heading {order:0;min-height:30px;height:30px;padding:2px 4px;cursor:pointer;}
.viewer-embedded-suggestions .disc-p-suggestion-toggle {flex:1;align-self:stretch;min-width:0;margin:0;padding:2px 4px;text-align:left;}
.viewer-embedded-suggestions .disc-p-suggestion-body {order:1;flex:0 0 auto;min-height:0;}
.viewer-embedded-suggestions .disc-p-suggestion-body-inner {min-height:0;}
.viewer-embedded-suggestions .disc-p-suggestion-cards {max-height:min(226px,max(42px,calc(100dvh - 180px)));overflow-y:auto!important;scrollbar-gutter:auto;}
.viewer-embedded-suggestions .disc-p-suggestion-settings-button {flex:none;}
body:has(.viewer-sidebar-settings-menu,.help-panel) .viewer-embedded-suggestions {display:none!important;}
.viewer-sidebar-layout .timeline-list-items {width:100%;max-width:none;padding-right:0;box-sizing:border-box;}
.viewer-sidebar-layout .timeline-list-items .timeline-list-item {width:100%;max-width:none;box-sizing:border-box;}
body.viewer-ui-v19 .viewer-sidebar-layout .viewer-catalog-card {display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:1fr;align-items:center;gap:6px;width:100%;max-width:none;height:42px;min-height:42px;padding:2px 4px;margin:0 0 4px;border:1px solid var(--border-strong);border-radius:5px;background:var(--panel-background);color:var(--text-color);cursor:pointer;box-sizing:border-box;transition:background-color 120ms ease,border-color 120ms ease,box-shadow 120ms ease;}
body.viewer-ui-v19 .viewer-sidebar-layout .viewer-catalog-card:hover,body.viewer-ui-v19 .viewer-sidebar-layout .viewer-catalog-card:focus-visible {background:color-mix(in srgb,var(--accent-color) 13%,var(--panel-background));border-color:var(--accent-color);box-shadow:inset 0 0 0 1px var(--accent-color);outline:none;}
body.viewer-ui-v19 .viewer-sidebar-layout .viewer-catalog-card .viewer-catalog-card-text {display:grid;grid-template-columns:minmax(0,1fr) auto;grid-column:2;grid-row:1;align-items:center;gap:5px;min-width:0;}
body.viewer-ui-v19 .viewer-sidebar-layout .viewer-catalog-card .viewer-catalog-card-title {grid-column:1;grid-row:1;min-width:0;margin:0;padding:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;font-weight:600;line-height:16px;text-align:left;}
.viewer-catalog-card-likes {grid-column:2;grid-row:1;align-self:center;font-size:11px;line-height:16px;white-space:nowrap;pointer-events:none;}
body.viewer-ui-v19 .viewer-sidebar-layout .disc-p-suggestion-cards .viewer-catalog-card {margin:0;}
.viewer-catalog-card :is(.timeline-thumbnail,.disc-p-suggestion-thumbnail) {grid-column:1;grid-row:1;}
.viewer-sidebar {--v24-sidebar-selected:color-mix(in srgb,var(--accent-color) 17%,var(--panel-background));}
.viewer-ui-v19 .viewer-sidebar-button.v19-button:hover:not(:disabled) {background:color-mix(in srgb,var(--accent-color) 10%,var(--panel-background));border-color:var(--accent-color);}
.viewer-ui-v19 .viewer-sidebar-button.v19-button:active:not(:disabled) {background:color-mix(in srgb,var(--accent-color) 24%,var(--panel-background));}
.viewer-ui-v19 .viewer-sidebar-button.v19-button:is([aria-pressed="true"],[aria-expanded="true"]) {background:var(--v24-sidebar-selected);border-color:var(--accent-color);color:var(--text-color);}
.viewer-ui-v19 .viewer-sidebar-utilities [data-help-target="help"][aria-expanded="true"] {background:var(--v24-sidebar-selected);border-color:var(--accent-color);color:var(--text-color);}
.viewer-share-panel {display:flex;flex-direction:column;gap:10px;padding:4px;}
.viewer-share-panel input {width:100%;}
@media(prefers-reduced-motion:reduce){.viewer-catalog-card{transition:none!important;}}

.viewer-embedded-suggestions .disc-p-suggestion-body-inner {display:flex;flex-direction:column;}
.viewer-embedded-suggestions .disc-p-suggestion-cards {flex:0 0 auto;min-height:0;}

/* V25: the detailed search floats beside the management panel; no grid reservation. */
.viewer-search-overlay {position:fixed;z-index:var(--layer-panel-search);display:flex;flex-direction:column;box-sizing:border-box;max-width:calc(100vw - 16px);padding:12px;border:1px solid var(--border-strong);border-radius:6px;background:var(--panel-background);color:var(--text-color);box-shadow:0 8px 24px #0003;overflow:hidden;}
.viewer-search-overlay[hidden] {display:none!important;}
.viewer-search-overlay #search-panel {display:flex;flex-direction:column;margin:0;}
.viewer-search-overlay .search-header {flex-direction:row!important;align-items:center;}
.viewer-search-overlay .search-header .search-input-wrap {flex:1;min-width:0;width:0;}
.viewer-search-overlay .search-target-buttons {flex:none;}
.viewer-search-overlay .search-result-columns,.viewer-search-overlay .search-result-row {min-width:640px;}
.viewer-search-overlay .search-results {overflow:auto;}
.viewer-search-open {flex:none;display:inline-flex;align-items:center;gap:4px;width:auto;min-width:60px;}
.viewer-search-button-icon {display:block;flex:none;width:16px;height:16px;background:currentColor;mask:url('/icons/ui-a/lupe.png') center/contain no-repeat;}
.viewer-search-button-label {display:inline;white-space:nowrap;}
.viewer-sidebar-layout[data-viewer-panel="lanes"] #timeline-list-controls {gap:6px;flex-wrap:wrap;}
.viewer-sidebar-layout[data-viewer-panel="lanes"] #timeline-list-controls .viewer-tabs > button {padding-inline:5px;}
.viewer-sidebar-layout[data-viewer-panel="lanes"] .viewer-search-open {padding-inline:6px;min-width:58px;}
.viewer-sidebar-layout[data-viewer-panel="search"] #search-panel .search-header {display:flex;flex-direction:row;}
.viewer-sidebar-layout[data-viewer-panel="search"] #search-panel .viewer-search-order {align-self:flex-start;flex:none;}
.viewer-single-genre.viewer-suggestion-mode {grid-template-columns:repeat(5,minmax(0,1fr));box-sizing:border-box;min-height:52px;max-width:100%;border-radius:6px;padding:2px;flex:1;--segment-count:5;overflow:visible;}
.viewer-single-genre > .viewer-suggestion-mode-option {display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-height:44px;gap:3px;padding:3px 2px;font-size:12px;line-height:16px;}
.viewer-genre-count {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:16px;height:16px;padding:0 3px;border:1px solid var(--border-strong);border-radius:999px;background:var(--panel-background);font-size:10px;line-height:1;white-space:nowrap;}
.viewer-genre-count[hidden] {display:none;}
body.viewer-ui-v19 .timeline-summary-period {display:flex;flex-direction:row;align-items:baseline;gap:8px;min-width:0;}
body.viewer-ui-v19 .timeline-summary-period .timeline-summary-date {margin:0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.timeline-summary-period .timeline-summary-section-title {flex:none;}
.timeline-summary-section-title {font-size:11px;color:var(--muted-color);}
.timeline-summary-genre.timeline-card-tag {border-radius:2px;}
.timeline-summary-block {border-left:2px solid var(--border-strong);padding-left:10px;margin-top:8px;}
body.viewer-ui-v19 .timeline-summary-events .timeline-summary-event-row {display:flex;align-items:center;gap:6px;margin:3px 0;min-width:0;}
body.viewer-ui-v19 .timeline-summary-event-label {display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.timeline-summary-event-row .timeline-summary-more {float:none;flex:none;margin-left:auto;}
body.viewer-ui-v19 .timeline-summary-scroll-body .timeline-summary-memo {white-space:pre-wrap;}
body.viewer-ui-v19 .timeline-summary-scroll-body .is-simple-summary {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
body.viewer-ui-v19 .timeline-summary-sources p {margin:2px 0;line-height:1.35;}
body.viewer-ui-v19 .date-position-button[data-tooltip]::after {display:none;content:none;}

/* Current Viewer polish: canonical selected/hover fills and compact search rows. */
.viewer-suggestion-mode > .viewer-suggestion-mode-option:is(:hover,:focus-visible),.viewer-ui-v19 :is(.v19-mode,.graph-segmented,.theme-segmented-control) > :is(button,label,.v19-button):is(:hover,:focus-visible) {background:var(--v19-toggle-hover,color-mix(in srgb,var(--accent-color) 14%,var(--panel-background)));}
:is(.viewer-sidebar-layout,.viewer-search-overlay) #search-panel {border-radius:0;}
:is(.viewer-sidebar-layout,.viewer-search-overlay) .search-tag-input-wrap:hover {border-color:var(--accent-color);}
.viewer-search-field {display:flex;align-items:center;position:relative;min-width:0;}
.viewer-search-field > input {width:100%;min-width:0;padding-left:30px!important;}
.viewer-search-field > .viewer-search-input-icon {position:absolute;left:9px;width:14px;height:14px;background:currentColor;mask:url('/icons/ui-a/lupe.png') center/contain no-repeat;pointer-events:none;}
.discovery-catalog-toolbar > .viewer-search-field {flex:1;min-width:0;}
.discovery-catalog-toolbar > .viewer-search-field input {height:36px;}
.viewer-sidebar-layout .is-simple-search .search-header {align-items:center;}
.viewer-sidebar-layout .is-simple-search .search-header > .viewer-search-field {flex:1 1 0;width:0;min-width:0;}
.viewer-added-check {position:absolute;inset:0;display:grid;place-items:center;z-index:2;color:#1683ff;font-size:36px;font-weight:900;line-height:1;text-shadow:0 0 2px #fff,0 0 2px #fff;pointer-events:none;}
.viewer-local-heading {margin:0;font-size:14px;}
.viewer-share-setting {display:flex;align-items:center;justify-content:space-between;gap:8px;}
.viewer-share-setting .viewer-share-viewport {flex:0 0 100px;}
.viewer-share-generate {align-self:flex-start;}
.viewer-share-url-scroll {max-width:100%;overflow-x:auto;}
.viewer-share-url-scroll[hidden] {display:none;}
.viewer-ui-v19 .viewer-share-url {display:inline-flex;justify-content:flex-start;width:max-content;min-width:100%;max-width:none;white-space:nowrap;}
.viewer-share-status:empty {display:none;}

/* Viewer series/filter follow-up: keep selected outline above each option hover. */
.viewer-suggestion-mode > .viewer-suggestion-mode-option[aria-pressed="true"] {box-shadow:inset 0 0 0 1px var(--accent-color);}
.viewer-sidebar-layout .timeline-list-item:is(:hover,:focus-within) {border-color:var(--accent-color);box-shadow:0 0 0 1px var(--accent-color),0 0 5px color-mix(in srgb,var(--accent-color) 25%,transparent);}
.viewer-global-settings {position:fixed;inset:auto;right:auto;width:min(330px,calc(100vw - 56px));min-width:min(280px,calc(100vw - 56px));max-width:calc(100vw - 56px);max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;margin:0;padding:12px;border:1px solid var(--border-strong);border-radius:8px;box-shadow:0 8px 24px rgb(15 23 42 / .24);background:var(--panel-background);z-index:220;}
.viewer-global-settings .settings-option-row {gap:8px;flex-wrap:wrap;}
html[data-theme="dark"] .date-pointer-relative {color:#8db7ff;}
html[data-theme="dark"] .date-pointer-relative.is-future {color:#80dba3;}

/* T14: lane labels and existing shared Viewer control faces. */
.timeline-lane:not(.discovery-event-group-lane):not(.numeric-graph-group-lane) > .timeline-lane-label .timeline-lane-label-title { font-size: .875rem; }
.event-group-label-rail { position:absolute; z-index:5; top:5px; bottom:5px; left:5px; display:flex; flex-direction:column; gap:3px; max-width:2.4rem; pointer-events:none; }
.event-group-label-rail > .timeline-lane-label { position:relative; top:auto; left:auto; flex:1 1 0; min-height:0; max-height:none; box-sizing:border-box; }
.event-group-label-rail .timeline-lane-label-title { font-size:.72rem; writing-mode:vertical-rl; text-orientation:upright; white-space:nowrap; word-break:keep-all; overflow-wrap:normal; }
.event-group-settings-panel > header { align-items:center; }
.event-group-settings-panel > header > label { flex:0 0 auto; font-size:13px; }
.event-group-settings-panel > header > input.v19-input { box-sizing:border-box; height:36px; min-height:36px; padding:4px 10px; border-radius:999px; font-size:13px; }
.event-group-settings-panel > header > input.v19-input:hover,.event-group-settings-panel > header > input.v19-input:focus { border-color:var(--accent-color); }
html[data-theme="dark"] .event-group-settings-panel > header > input { background:#101214; }
.viewer-ui-v19 .v19-graph-toggle[data-mixed="true"]::before { display:none; }
.graph-setting-row-other { align-items:center; gap:5px; }
.viewer-ui-v19 .graph-setting-row-other > button { border-radius:4px; background:var(--v19-control-surface,var(--panel-background)); }
.viewer-ui-v19 .graph-setting-row-other > button[aria-pressed="true"] { box-shadow:inset 0 0 0 1px var(--accent-color); background:var(--v19-toggle-selected); color:var(--v19-toggle-selected-text,var(--accent-color)); font-weight:700; }

.timeline-summary-config {position:fixed;inset:0;z-index:180;pointer-events:none;}
.timeline-summary-config .timeline-card-config-panel {pointer-events:auto;max-height:calc(100dvh - 16px);overflow:auto;}

.timeline-summary-graph-settings {z-index:180;}

/* Shared summary primitives; detail-only product carousel. */
body.viewer-ui-v19 .timeline-summary-popup {width:min(400px,calc(100vw - 16px));padding:10px;gap:8px;}
.timeline-summary-overview {display:flex;flex-direction:column;gap:8px;min-height:0;overflow:hidden;flex:2 1 0;}
.is-detailed-popup .timeline-summary-overview {height:auto;max-height:min(390px,calc(100dvh - 44px));}
.timeline-summary-products {box-sizing:border-box;min-height:0;padding:12px;border:1px solid var(--border-strong);border-radius:24px;}
.timeline-summary-products[hidden] {display:none;}
.timeline-summary-products:not([hidden]) {display:flex;flex-direction:column;gap:12px;}
.timeline-product-header {display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;}
.timeline-product-header > strong {font-size:13px;line-height:1.4;}
.timeline-product-card {display:grid;grid-template-columns:minmax(72px,34%) minmax(0,1fr);gap:14px;min-height:144px;}
.timeline-product-image {position:relative;height:144px;min-height:144px;align-self:start;overflow:hidden;display:grid;place-items:center;border:1px solid var(--border-strong);border-radius:18px;background:var(--panel-background);}
.timeline-product-image-link {position:absolute;inset:0;display:block;}
.timeline-product-image img {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:var(--panel-background);}
.timeline-product-info {display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;overflow-wrap:anywhere;}
.timeline-product-title {flex:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:inherit;font-weight:700;text-decoration:none;}
.timeline-product-title:hover,.timeline-product-title:focus-visible {text-decoration:underline;}
.timeline-product-info p {overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.5;margin:6px 0 0;}
.timeline-product-navigation {display:flex;align-items:center;gap:5px;flex:none;font-size:13px;}
.timeline-product-navigation .ui-button {min-width:24px;min-height:24px;padding:0 3px;}
.timeline-product-disclosure {font-size:12px;line-height:1.6;}
.timeline-product-info > .timeline-product-disclosure {margin-top:auto;padding-top:8px;}
.timeline-product-disclosure > summary {list-style:none;cursor:pointer;overflow-wrap:anywhere;}
.timeline-product-disclosure > summary::-webkit-details-marker {display:none;}
.timeline-product-disclosure > summary::before {content:"▶";margin-right:3px;}
.timeline-product-disclosure[open] > summary::before {content:"▼";}
.timeline-product-disclosure > summary:focus-visible {outline:2px solid var(--accent-color,#168aff);outline-offset:3px;border-radius:3px;}
.timeline-product-disclosure p {margin:8px 0 0;}
body.viewer-ui-v19 .timeline-summary-title-row,body.viewer-ui-v19 .timeline-summary-actions {flex:none;}
body.viewer-ui-v19 .timeline-summary-scroll-body {flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;}
.timeline-summary-title {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
body.viewer-ui-v19 .timeline-summary-popup.is-simple-popup .timeline-summary-overview {flex:0 1 auto;height:auto;min-height:0;overflow:visible;}
body.viewer-ui-v19 .timeline-summary-popup.is-simple-popup .timeline-summary-scroll-body {flex:0 1 auto;min-height:0;max-height:none;}
body.viewer-ui-v19 .timeline-summary-tags {display:flex;gap:4px;min-width:0;flex-wrap:wrap;}
.timeline-summary-tags .timeline-card-tag {background:var(--chip-background,var(--panel-background));}
.timeline-summary-genre.timeline-card-tag {border-radius:2px;border:2px solid var(--border-strong);color:var(--text-color);}
.timeline-summary-tags .timeline-card-tag:not(.timeline-summary-genre) {border-radius:999px;}
body.viewer-ui-v19 .is-simple-popup .timeline-summary-tags {display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.is-simple-popup .timeline-summary-tags .timeline-card-tag {display:inline-block;vertical-align:middle;margin-right:4px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.is-simple-popup .timeline-summary-events {display:flex;flex-direction:column;gap:3px;min-width:0;}
.is-simple-popup .timeline-summary-event-row {display:block;min-width:0;margin:0;}
.is-simple-popup .timeline-summary-event-row .timeline-summary-more {align-self:flex-start;margin-left:0;}
body.viewer-ui-v19 .is-simple-popup .timeline-summary-event-label {display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
body.viewer-ui-v19 .is-simple-popup .timeline-summary-memo {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.timeline-summary-more {float:none;display:block;clear:both;margin:0;color:var(--muted-text-color);white-space:nowrap;}

.is-detailed-popup .timeline-summary-overview {flex:0 1 auto;}
.is-detailed-popup:has(.timeline-summary-products:not([hidden])) {height:auto;max-height:min(600px,calc(100dvh - 24px));}
.is-detailed-popup:has(.timeline-summary-products:not([hidden])) .timeline-summary-overview {height:auto;flex:0 1 auto;max-height:min(390px,calc(100dvh - 210px));}
.is-detailed-popup .timeline-summary-products:not([hidden]) {flex:0 0 auto;overflow:visible;}

body.viewer-ui-v19 .is-simple-popup .timeline-summary-title {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
