/* ============================================================================
   REDESIGN APP — single-question + tree + output viewer.
   Used only by redesign.html. Do not mix with style.css.
   ============================================================================ */

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

:root {
    /* Typeform-style: white, ample whitespace, restrained blue accent */
    --redesign-bg: #ffffff;
    --redesign-bg-subtle: #f7f8fa;
    --redesign-bg-option: #f0f4f8;
    --redesign-text: #1a1d21;
    --redesign-text-muted: #6b7280;
    --redesign-text-option: #374151;
    --redesign-border: #e5e7eb;
    --redesign-border-light: #eef0f3;
    --redesign-accent: #3b82f6;
    --redesign-accent-hover: #2563eb;
    --redesign-accent-dark: #1d4ed8;
    --redesign-accent-neutral: #6b7280;
    --redesign-radius: 8px;
    --redesign-radius-sm: 6px;
    --redesign-space: 16px;
    --redesign-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --redesign-font-serif: Georgia, "Times New Roman", serif;
    --redesign-font-size-question: 23px;
    --redesign-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --redesign-shadow-md: 0 3px 8px rgba(0,0,0,0.12);
    --redesign-transition: 150ms ease;
    /* Easing tokens for consistent deceleration */
    --redesign-ease-out-smooth: cubic-bezier(0.33, 1, 0.68, 1);
    --redesign-ease-out-snappy: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Thin scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.redesign-body {
    font-family: var(--redesign-font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--redesign-text);
    background: var(--redesign-bg);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================================================
   Mode banners — thin contextual strip below toolbar
   ============================================================================ */
.redesign-banner {
    flex-shrink: 0;
    padding: 7px 24px;
    font-size: 13px;
    line-height: 1.6;
    z-index: 10;
    background: #1d4ed8;
    color: #e0eaff;
}
.redesign-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}
.redesign-banner-inner > div {
    flex: 1;
    min-width: 0;
}
.redesign-banner-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #e0eaff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.redesign-banner-close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}
.redesign-banner-close:focus {
    outline: none;
}
.redesign-banner-close:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.redesign-banner-annotate-line {
    margin-top: 2px;
}

/* Pills — inline clickable terms */
.redesign-banner-pill {
    display: inline;
    padding: 1px 7px;
    margin: 0 1px;
    border-radius: 999px;
    font-weight: 600;
    cursor: default;
    transition: background var(--redesign-transition), border-color var(--redesign-transition);
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
}
.redesign-banner-pill:hover,
.redesign-banner-pill:focus-visible {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.75);
}

/* Rating chips — inline colored symbols in the annotate line */
.redesign-banner-rating-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
    margin: 0 1px;
    position: relative;
    top: -1px;
}
.redesign-banner-rating-chip--approve {
    background: #22c55e;
    color: #fff;
}
.redesign-banner-rating-chip--reject {
    background: #ef4444;
    color: #fff;
}
.redesign-banner-rating-chip--neutral {
    background: #f59e0b;
    color: #fff;
}

/* ---- Highlight effects triggered by banner pill hover ---- */
/* Shared transition so highlights animate in smoothly */
.redesign-question-row,
.redesign-option,
.redesign-output-card,
.redesign-right-top,
.redesign-path-rating-row {
    transition: outline 0.18s var(--redesign-ease-out-smooth), box-shadow 0.18s var(--redesign-ease-out-smooth);
}

/* Left-panel HTML element highlights — outline + strong glow when banner pill hovered */
body.banner-hl-questions .redesign-question-row {
    outline: 2px solid rgba(59, 130, 246, 0.65);
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18), 0 0 24px rgba(59, 130, 246, 0.45), 0 0 48px rgba(59, 130, 246, 0.25);
}
body.banner-hl-answers .redesign-option {
    outline: 2px solid rgba(59, 130, 246, 0.65);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18), 0 0 24px rgba(59, 130, 246, 0.45), 0 0 48px rgba(59, 130, 246, 0.25);
}
body.banner-hl-outputs .redesign-output-card {
    outline: 2px solid rgba(59, 130, 246, 0.65);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18), 0 0 24px rgba(59, 130, 246, 0.45), 0 0 48px rgba(59, 130, 246, 0.25);
}
body.banner-hl-tree .redesign-right-top {
    outline: 2px solid rgba(59, 130, 246, 0.65);
    outline-offset: -2px;
    box-shadow: inset 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 24px rgba(59, 130, 246, 0.4), 0 0 48px rgba(59, 130, 246, 0.22);
}
body.banner-hl-mark .redesign-path-rating-row {
    outline: 2px solid rgba(59, 130, 246, 0.65);
    outline-offset: 6px;
    border-radius: 8px;
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.18), 0 0 24px rgba(59, 130, 246, 0.45), 0 0 48px rgba(59, 130, 246, 0.25);
}

/* SVG tree element highlights — stronger stroke + filter glow where supported */
body.banner-hl-questions .redesign-tree-bar {
    stroke: #2563eb !important;
    stroke-width: 2.5 !important;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
}
body.banner-hl-answers .redesign-tree-dot {
    fill: #2563eb !important;
    stroke: #ffffff !important;
    stroke-width: 1.5 !important;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.55));
}
body.banner-hl-outputs g[data-output-id] circle:not(.redesign-output-glow) {
    stroke: #2563eb !important;
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.55));
}

/* Toolbar — minimal, Typeform-style */
.redesign-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--redesign-bg);
    border-bottom: 1px solid var(--redesign-border-light);
}
.redesign-toolbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.redesign-toolbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}
.redesign-toolbar-right { display: flex; align-items: center; gap: 8px; }
.redesign-toolbar-group { display: flex; align-items: center; gap: 8px; }

/* Annotate toggle — switch style */
.redesign-annotate-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--redesign-text);
    user-select: none;
}
.redesign-annotate-toggle input { display: none; }
.redesign-annotate-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--redesign-border);
    border-radius: 10px;
    transition: background var(--redesign-transition);
}
.redesign-annotate-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--redesign-shadow-sm);
    transition: transform var(--redesign-transition);
}
.redesign-annotate-toggle input:checked + .redesign-annotate-toggle-slider {
    background: var(--redesign-accent);
}
.redesign-annotate-toggle input:checked + .redesign-annotate-toggle-slider::after {
    transform: translateX(16px);
}
.redesign-annotate-toggle-label { font-weight: 500; }
.redesign-btn-icon {
    padding: 8px 10px;
    min-width: 36px;
}

/* Annotation help "?" — prominent like old app (alignment mode) */
.redesign-annotation-help-btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: var(--redesign-accent);
    border: 2px solid var(--redesign-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.redesign-annotation-help-btn:hover {
    background: #3367d6;
    border-color: #3367d6;
    color: #fff;
    transform: scale(1.05);
}
.redesign-annotation-help-icon {
    display: inline-block;
    font-weight: 700;
    line-height: 1;
}

.redesign-annotation-count-badge {
    margin-left: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--redesign-accent);
    color: #fff;
    border-radius: 10px;
}

/* Condition rating bar (annotate mode): compact summary + hover unfurl ✕ / − / ✓ */
.redesign-annotation-rating-bar {
    display: inline-flex;
    align-items: center;
}
.redesign-annotation-rating-bar--compact {
    position: relative;
}
.redesign-annotation-rating-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.15s ease;
}
.redesign-annotation-rating-summary.redesign-annotation-rating--unset {
    background: var(--redesign-bg-subtle);
    color: var(--redesign-text-muted);
    border-color: var(--redesign-border);
}
.redesign-annotation-rating-summary.redesign-annotation-rating--reject {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.redesign-annotation-rating-summary.redesign-annotation-rating--neutral {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.redesign-annotation-rating-summary.redesign-annotation-rating--approve {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.redesign-annotation-rating-bar--compact:hover .redesign-annotation-rating-summary,
.redesign-annotation-rating-bar--compact:focus-within .redesign-annotation-rating-summary {
    opacity: 0;
    pointer-events: none;
}
.redesign-annotation-rating-expanded {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 2px;
    background: var(--redesign-bg-subtle);
    border: 1px solid var(--redesign-border);
    border-radius: 8px;
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    transition: transform 0.24s var(--redesign-ease-out-smooth), opacity 0.24s var(--redesign-ease-out-smooth);
    pointer-events: none;
}
.redesign-annotation-rating-bar--compact:hover .redesign-annotation-rating-expanded,
.redesign-annotation-rating-bar--compact:focus-within .redesign-annotation-rating-expanded {
    pointer-events: auto;
}
.redesign-annotation-rating-expanded--portaled {
    position: fixed;
    z-index: 10000;
    transform-origin: right center;
    pointer-events: auto;
    transition: transform 0.24s var(--redesign-ease-out-smooth), opacity 0.24s var(--redesign-ease-out-smooth);
}
.redesign-annotation-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--redesign-bg);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.redesign-annotation-btn:hover {
    opacity: 0.9;
}
.redesign-annotation-btn.active {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}
.redesign-annotation-btn--reject {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.redesign-annotation-btn--reject.active {
    background: #fecaca;
    border-color: #ef4444;
}
.redesign-annotation-btn--neutral {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.redesign-annotation-btn--neutral.active {
    background: #fde68a;
    border-color: #f59e0b;
}
.redesign-annotation-btn--approve {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.redesign-annotation-btn--approve.active {
    background: #bbf7d0;
    border-color: #22c55e;
}
.redesign-option .redesign-annotation-rating-bar {
    margin-left: auto;
    flex-shrink: 0;
}
/* Solid outline on selected option */
.redesign-option.selected {
    outline: 2px solid var(--redesign-accent);
    outline-offset: 0;
}

.redesign-program-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--redesign-text);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.redesign-program-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--redesign-text-muted);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.redesign-btn {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid var(--redesign-border);
    border-radius: var(--redesign-radius-sm);
    background: var(--redesign-bg);
    color: var(--redesign-text);
    cursor: pointer;
    font-weight: 500;
    transition: background var(--redesign-transition), border-color var(--redesign-transition);
}
.redesign-btn:hover {
    background: var(--redesign-bg-subtle);
    border-color: var(--redesign-border);
}
.redesign-btn-icon {
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.redesign-btn-icon svg {
    width: 16px;
    height: 16px;
}
.redesign-btn-primary {
    background: var(--redesign-accent);
    border-color: var(--redesign-accent);
    color: #fff;
}
.redesign-btn-primary:hover {
    background: var(--redesign-accent-hover);
    border-color: var(--redesign-accent-hover);
    color: #fff;
}
.redesign-btn-secondary {
    background: var(--redesign-bg-subtle);
}
.redesign-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--redesign-text-muted);
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.redesign-btn-ghost svg { opacity: 0.75; }
.redesign-btn-ghost:hover {
    background: var(--redesign-bg-subtle);
    border-color: var(--redesign-border-light);
    color: var(--redesign-text);
}
.redesign-btn-ghost:hover svg { opacity: 1; }

/* ============================================================================
   Opening screen — multiverse library (no program loaded)
   ============================================================================ */
.redesign-opening-screen {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
    display: flex;
    justify-content: center;
    padding: 72px 32px 96px;
}
.redesign-opening-inner {
    width: 100%;
    max-width: 920px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}
.redesign-opening-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.redesign-opening-title {
    font-family: var(--redesign-font-serif);
    font-size: 40px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--redesign-text);
    line-height: 1.1;
}
.redesign-opening-subtitle {
    font-size: 15px;
    color: var(--redesign-text-muted);
    font-weight: 400;
}
.redesign-opening-note {
    font-size: 13px;
    color: #7a7a7a;
    font-weight: 400;
    letter-spacing: 0;
    margin-top: 6px;
}
.redesign-opening-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
}
.redesign-opening-placeholder {
    color: var(--redesign-text-muted);
    font-size: 14px;
    text-align: center;
    padding: 32px 0;
}
.redesign-opening-category {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.redesign-opening-category-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--redesign-border-light);
}
.redesign-opening-category-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--redesign-text);
}
.redesign-opening-category-title--alignment { color: #dc2626; }
.redesign-opening-category-title--poetry { color: #7c3aed; }
.redesign-opening-category-title--philosophical { color: #16a34a; }
.redesign-opening-category-count {
    font-size: 11px;
    color: var(--redesign-text-muted);
    font-weight: 500;
}
.redesign-opening-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.redesign-opening-card {
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    background: var(--redesign-bg);
    border: 1px solid var(--redesign-border-light);
    border-radius: var(--redesign-radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color var(--redesign-transition),
                box-shadow var(--redesign-transition),
                transform var(--redesign-transition);
}
.redesign-opening-card:hover {
    border-color: var(--redesign-border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
/* Featured (pinned) multiverse in each domain — subtle lift, no label chip */
.redesign-opening-card--featured {
    background: rgba(79, 70, 229, 0.035);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.18);
}
.redesign-opening-card--featured:hover {
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.28),
                0 6px 20px rgba(0, 0, 0, 0.06);
}
.redesign-opening-card:focus-visible {
    outline: none;
    border-color: var(--redesign-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.redesign-opening-card-title {
    font-family: var(--redesign-font-serif);
    font-size: 15px;
    line-height: 1.4;
    color: var(--redesign-text);
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.redesign-opening-card-meta {
    margin-top: auto;
    font-size: 11px;
    color: var(--redesign-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile block: demo is desktop-only */
.redesign-mobile-block {
    display: none;
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
}
.redesign-mobile-block-inner {
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.redesign-mobile-block-title {
    font-family: var(--redesign-font-serif);
    font-size: 26px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--redesign-text);
}
.redesign-mobile-block-message {
    font-size: 14px;
    color: var(--redesign-text-muted);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}
.redesign-mobile-block-link {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 18px;
    font-size: 13px;
    color: var(--redesign-text);
    text-decoration: none;
    border: 1px solid var(--redesign-border);
    border-radius: 8px;
    transition: background .2s, border-color .2s;
}
.redesign-mobile-block-link:hover {
    background: var(--redesign-surface-hover, rgba(0,0,0,.04));
    border-color: var(--redesign-text-muted);
}
@media (max-width: 860px) {
    .redesign-mobile-block { display: flex; }
    .redesign-body > header,
    .redesign-body > main,
    .redesign-body > #redesign-banner,
    .redesign-body > #redesign-opening-screen { display: none !important; }
}

/* Hide main split + toolbar-right elements while opening screen is showing */
body.redesign-mode-opening #redesign-main-split { display: none; }
body.redesign-mode-opening #redesign-banner { display: none !important; }
body.redesign-mode-opening #redesign-view-another-btn { display: none; }
body.redesign-mode-opening .redesign-nav-history-btn { display: none; }
body.redesign-mode-opening .redesign-toolbar-center { display: none; }
body.redesign-mode-opening .redesign-annotate-toolbar-btn { display: none !important; }
body.redesign-mode-opening #redesign-restore-banner-btn { display: none !important; }
body.redesign-mode-opening #redesign-toolbar {
    border-bottom: none;
    background: transparent;
}

/* Hide opening screen when a program is loaded */
body:not(.redesign-mode-opening) #redesign-opening-screen { display: none; }

/* Split layout — fit viewport, no bleed */
.redesign-split-container {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
.redesign-left-pane {
    width: 50%;
    min-width: 200px;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}
.redesign-resizer {
    width: 4px;
    background: var(--redesign-border);
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
}
/* Invisible wider hit area for dragging */
.redesign-resizer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -6px;
    right: -6px;
}

.redesign-right-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--redesign-bg-subtle);
    overflow: hidden;
}
.redesign-right-top {
    flex: 0 0 28%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--redesign-bg);
    overflow: hidden;
    position: relative;
}
/* Progressive blur zone at bottom of tree — disabled to avoid hard edge at divider
.redesign-right-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black);
    mask-image: linear-gradient(to bottom, transparent, black);
    pointer-events: none;
    z-index: 2;
} */
.redesign-tree-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--redesign-text-muted);
    padding: 10px 18px;
    border-bottom: 1px solid var(--redesign-border-light);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.redesign-tree-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
.redesign-right-divider {
    height: 0;
    cursor: ns-resize;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
/* Two child segments render the actual line, with a gap between them */
.redesign-divider-seg {
    position: absolute;
    top: -2px;
    height: 2px;
    background: var(--redesign-border);
    z-index: 1;
}
/* Fade the inner edge of each segment into the gap */
.redesign-divider-seg-l {
    background: linear-gradient(to right,
        var(--redesign-border) calc(100% - 20px),
        transparent 100%);
}
.redesign-divider-seg-r {
    background: linear-gradient(to left,
        var(--redesign-border) calc(100% - 20px),
        transparent 100%);
}
/* Blurred extension below the line — fades "into" the outputs space */
.redesign-divider-seg::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--redesign-border);
    filter: blur(4px);
    opacity: 0.3;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent);
    mask-image: linear-gradient(to bottom, black, transparent);
    pointer-events: none;
}
/* Wider invisible hit area for dragging */
.redesign-right-divider::before {
    content: '';
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: 0;
    right: 0;
}
.redesign-right-bottom {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--redesign-bg);
    overflow: hidden;
}
.redesign-output-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 18px 14px;
    display: flex;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 8px);
    mask-image: linear-gradient(to bottom, transparent, black 8px);
    flex-direction: column;
    gap: 12px;
}
/* More top padding when no taxonomy filter is present */
.redesign-output-list:first-child {
    padding-top: 16px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 18px);
    mask-image: linear-gradient(to bottom, transparent, black 18px);
}
/* Empty state */
.redesign-empty-state {
    text-align: center;
    color: var(--redesign-text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.redesign-empty-state-icon {
    margin-bottom: 16px;
    opacity: 0.35;
}
.redesign-empty-state-icon svg {
    width: 48px;
    height: 48px;
}
.redesign-empty-text { font-size: 16px; margin-bottom: 6px; }
.redesign-empty-hint { font-size: 14px; }

/* Question container — Typeform vibe: one question, clean options, clear CTA */
.redesign-question-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}
/* Question row: number badge (soft pill) + question text */
.redesign-question-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 36px;
}
.redesign-decision-badge {
    flex-shrink: 0;
    min-width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--redesign-accent);
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
}
.redesign-question-text {
    flex: 1;
    font-family: var(--redesign-font-serif);
    font-size: var(--redesign-font-size-question);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--redesign-text);
}
.redesign-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}
.redesign-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--redesign-border-light);
    border-radius: var(--redesign-radius-sm);
    cursor: pointer;
    background: var(--redesign-bg-option);
    font-size: 15px;
    text-align: left;
    transition: border-color var(--redesign-transition), background var(--redesign-transition), box-shadow var(--redesign-transition);
}
.redesign-option:hover {
    border-color: var(--redesign-border);
    background: #e8ecf2;
}
.redesign-option.selected {
    border-color: var(--redesign-accent);
    background: #f0f6ff;
}

.redesign-option.selected:hover {
    background: #e8f0ff;
}
.redesign-option-num-box {
    flex-shrink: 0;
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--redesign-border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--redesign-accent-dark);
    background: linear-gradient(180deg, #fff 0%, #f8f9fb 100%);
}
.redesign-option.selected .redesign-option-num-box {
    border-color: var(--redesign-accent);
    color: var(--redesign-accent);
    background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
}
.redesign-option-label {
    flex: 1;
    line-height: 1.45;
    color: var(--redesign-text-option);
    font-weight: 500;
    user-select: text;
    -webkit-user-select: text;
}
.redesign-nav-row {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.redesign-nav-btn {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 20px;
    border: 1px solid var(--redesign-border);
    border-radius: var(--redesign-radius-sm);
    background: var(--redesign-bg);
    color: var(--redesign-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: background var(--redesign-transition), border-color var(--redesign-transition);
}
.redesign-nav-btn:hover:not(:disabled) {
    background: var(--redesign-bg-subtle);
    border-color: var(--redesign-border);
}
.redesign-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.redesign-nav-btn-primary {
    background: var(--redesign-accent);
    border-color: var(--redesign-accent);
    color: #fff;
}
.redesign-nav-btn-primary:hover:not(:disabled) {
    background: var(--redesign-accent-hover);
    border-color: var(--redesign-accent-hover);
    color: #fff;
}

/* Path rating row (annotate mode, shown at end of path instead of grayed-out Next) */
.redesign-path-rating-row {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.redesign-path-rating-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--redesign-text-muted);
}
.redesign-path-rating-btns {
    display: flex;
    gap: 12px;
}
.redesign-path-rating-btn {
    font-family: inherit;
    font-size: 26px;
    line-height: 1;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
    opacity: 0.75;
}
.redesign-path-rating-btn:hover {
    transform: translateY(-2px);
    opacity: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.redesign-path-rating-btn:active {
    transform: translateY(0);
    box-shadow: none;
}
.redesign-path-rating-btn--reject {
    background: #fde8e8;
    color: #c0392b;
    border-color: #f5b7b1;
}
.redesign-path-rating-btn--neutral {
    background: #fef9e7;
    color: #7d6608;
    border-color: #f9e79f;
}
.redesign-path-rating-btn--approve {
    background: #e9f7ef;
    color: #1e8449;
    border-color: #a9dfbf;
}
.redesign-path-rating-btn--active {
    opacity: 1;
    box-shadow: 0 0 0 3px currentColor;
    transform: scale(1.08);
}
.redesign-path-rating-btn--active.redesign-path-rating-btn--reject {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px #e74c3c;
}
.redesign-path-rating-btn--active.redesign-path-rating-btn--neutral {
    background: #f1c40f;
    color: #fff;
    border-color: #d4ac0d;
    box-shadow: 0 0 0 3px #f1c40f;
}
.redesign-path-rating-btn--active.redesign-path-rating-btn--approve {
    background: #27ae60;
    color: #fff;
    border-color: #1e8449;
    box-shadow: 0 0 0 3px #27ae60;
}

/* Keyboard key hint */
.redesign-key-hint {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--redesign-text-muted);
    background: linear-gradient(180deg, #fff 0%, #f3f4f6 100%);
    border: 1px solid var(--redesign-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 5px;
    line-height: 1.4;
    vertical-align: middle;
}

/* Progress indicator */
.redesign-progress-indicator {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--redesign-text-muted);
    letter-spacing: 0.02em;
}

/* Whoosh animation — same duration and smooth ease for even feel */
.redesign-question-container.redesign-slide-out-up {
    animation: redesignSlideOutUp 0.25s var(--redesign-ease-out-smooth) forwards;
}
.redesign-question-container.redesign-slide-out-down {
    animation: redesignSlideOutDown 0.25s var(--redesign-ease-out-smooth) forwards;
}
.redesign-question-container.redesign-slide-in-from-below {
    animation: redesignSlideInFromBelow 0.25s var(--redesign-ease-out-smooth) forwards;
}
.redesign-question-container.redesign-slide-in-from-above {
    animation: redesignSlideInFromAbove 0.25s var(--redesign-ease-out-smooth) forwards;
}
@keyframes redesignSlideOutUp {
    to { transform: translateY(-24px); opacity: 0; }
}
@keyframes redesignSlideOutDown {
    to { transform: translateY(24px); opacity: 0; }
}
@keyframes redesignSlideInFromBelow {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes redesignSlideInFromAbove {
    from { transform: translateY(-24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Output cards — rich but clean */
.redesign-output-card {
    background: var(--redesign-bg);
    border: 1px solid var(--redesign-border-light);
    border-radius: var(--redesign-radius);
    overflow: hidden;
    transition: box-shadow var(--redesign-transition);
    box-shadow: var(--redesign-shadow-sm);
    flex-shrink: 0;
}
.redesign-output-card:hover {
    box-shadow: var(--redesign-shadow-md);
}
.redesign-output-card--rated-approve {
    border-color: #22c55e;
}
.redesign-output-card--rated-approve .redesign-output-card-header {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}
.redesign-output-card--rated-neutral {
    border-color: #eab308;
}
.redesign-output-card--rated-neutral .redesign-output-card-header {
    background: #fefce8;
    border-bottom-color: #fef08a;
}
.redesign-output-card--rated-reject {
    border-color: #ef4444;
}
.redesign-output-card--rated-reject .redesign-output-card-header {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}
.redesign-path-rating-badge {
    font-size: 13px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.redesign-path-rating-badge--approve { background: #22c55e; color: #fff; }
.redesign-path-rating-badge--neutral { background: #eab308; color: #fff; }
.redesign-path-rating-badge--reject  { background: #ef4444; color: #fff; }
.redesign-output-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--redesign-bg-subtle);
    border-bottom: 1px solid var(--redesign-border-light);
}
.redesign-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.4;
}
.redesign-badge-output {
    background: #f3f4f6;
    color: var(--redesign-accent-neutral);
}
.redesign-badge-current {
    background: rgba(59, 130, 246, 0.12);
    color: var(--redesign-accent);
}
.redesign-output-card-content {
    padding: 12px 14px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: none;
    overflow-y: visible;
    font-size: 13px;
    line-height: 1.55;
    color: var(--redesign-text-option);
}
.redesign-taxonomy-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 20px), transparent);
    padding-right: 8px;
}
.redesign-taxonomy-pills::-webkit-scrollbar { display: none; }
.redesign-taxonomy-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    color: var(--redesign-accent-neutral);
    background: #f0f1f3;
    border-radius: 10px;
    padding: 2px 8px;
    line-height: 1.5;
    white-space: nowrap;
    flex-shrink: 0;
}
.redesign-output-empty {
    font-size: 14px;
    color: var(--redesign-text-muted);
    padding: 16px 0;
    margin: 0;
}

/* Output list fade-in */
@keyframes redesignFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.redesign-output-list.redesign-fade-in .redesign-output-card {
    animation: redesignFadeIn 0.25s var(--redesign-ease-out-smooth) both;
}
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(2) { animation-delay: 0.04s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(3) { animation-delay: 0.08s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(4) { animation-delay: 0.12s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(5) { animation-delay: 0.16s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(6) { animation-delay: 0.20s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(7) { animation-delay: 0.24s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(8) { animation-delay: 0.28s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(9) { animation-delay: 0.32s; }
.redesign-output-list.redesign-fade-in .redesign-output-card:nth-child(10) { animation-delay: 0.36s; }

/* Tree bar clickable */
.redesign-tree-bar {
    cursor: pointer;
}

/* Tree tooltip — appended to document.body with position:fixed to escape
   the tree container's overflow:hidden and appear above the toolbar */
.redesign-tree-tooltip {
    position: fixed;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 12px;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    max-width: 240px;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    word-break: break-word;
}

/* Tree pulse animation for current node */
@keyframes redesignNodePulse {
    0%, 100% { stroke-opacity: 0.3; }
    50% { stroke-opacity: 0; }
}

/* Modal — clean, light; open/close transitions */
.redesign-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.redesign-modal[hidden] { display: none; }
.redesign-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.15s var(--redesign-ease-out-smooth);
}
.redesign-modal.redesign-modal--open .redesign-modal-backdrop {
    opacity: 1;
}
.redesign-modal-content {
    position: relative;
    background: var(--redesign-bg);
    border-radius: var(--redesign-radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.98);
    opacity: 0;
    transition: transform 0.2s var(--redesign-ease-out-smooth), opacity 0.2s var(--redesign-ease-out-smooth);
}
.redesign-modal.redesign-modal--open .redesign-modal-content {
    transform: scale(1);
    opacity: 1;
}
.redesign-modal-title {
    font-size: 18px;
    font-weight: 600;
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--redesign-border-light);
    color: var(--redesign-text);
}
.redesign-domain-filter-wrap {
    padding: 10px 20px;
    border-bottom: 1px solid var(--redesign-border-light);
}
.redesign-domain-filter {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--redesign-border);
    border-radius: var(--redesign-radius-sm);
    background: var(--redesign-bg);
    color: var(--redesign-text);
    width: 100%;
    outline: none;
}
.redesign-domain-filter:focus {
    border-color: var(--redesign-accent);
}
.redesign-load-list-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 20px;
}
.redesign-load-list { display: flex; flex-direction: column; gap: 8px; }
.redesign-load-placeholder {
    color: var(--redesign-text-muted);
    font-size: 14px;
}
.redesign-load-item {
    padding: 12px 14px;
    border: 1px solid var(--redesign-border-light);
    border-radius: var(--redesign-radius-sm);
    cursor: pointer;
    text-align: left;
    background: var(--redesign-bg);
    transition: border-color var(--redesign-transition), box-shadow var(--redesign-transition);
}
.redesign-load-item:hover {
    border-color: var(--redesign-border);
    box-shadow: var(--redesign-shadow-sm);
}
.redesign-item-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 10px;
    margin-bottom: 4px;
    line-height: 1.4;
}
.redesign-item-tag-alignment { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.redesign-item-tag-poetry { background: rgba(168, 85, 247, 0.1); color: #7c3aed; }
.redesign-item-tag-philosophical { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.redesign-item-tag-default { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.redesign-item-title {
    font-family: var(--redesign-font-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--redesign-text);
    margin-bottom: 2px;
}
.redesign-item-meta {
    font-size: 11px;
    color: var(--redesign-text-muted);
    margin-top: 4px;
}
.redesign-modal-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--redesign-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.redesign-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tree node opacity transitions — position is animated via JS */
.redesign-tree-container g[data-node-id],
.redesign-tree-container g[data-ellipsis-id] {
    transition: opacity 300ms cubic-bezier(0.33, 1, 0.68, 1);
}

/* ============================================================================
   Fisheye decision context cards
   ============================================================================ */

/* Summary card: most compressed, single-line ribbon — flat, no shadow */
.fisheye-summary-card {
    padding: 8px 20px;
    margin: 0;
    background: var(--redesign-bg-subtle);
    border: none;
    border-bottom: 1px solid var(--redesign-border-light);
    border-radius: 0;
    font-size: 12px;
    color: var(--redesign-text-muted);
    line-height: 1.4;
    max-height: 36px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-shadow: none;
    flex-shrink: 0;
}
.fisheye-summary-count {
    font-weight: 600;
}
.fisheye-summary-breadcrumb {
    font-weight: 400;
}

/* Previous card: anchored above current, full-width band — mirrors peek card style */
.fisheye-previous-card {
    padding: 10px 20px;
    margin: 0;
    background: var(--redesign-bg-subtle);
    border: none;
    border-bottom: 1px solid var(--redesign-border-light);
    border-radius: 0;
    cursor: pointer;
    transition: background var(--redesign-transition);
    box-shadow: none;
    flex-shrink: 0;
    opacity: 0.85;
}
.fisheye-previous-card:hover {
    background: var(--redesign-bg-subtle);
}
.fisheye-prev-question {
    font-size: 13px;
    color: var(--redesign-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.fisheye-prev-text {
    /* inline text after badge */
}
.fisheye-prev-selected {
    font-size: 12px;
    color: var(--redesign-accent);
    margin-left: 0;
    font-weight: 500;
}
.fisheye-prev-dot {
    font-size: 8px;
    vertical-align: middle;
}
.fisheye-prev-check {
    color: var(--redesign-accent);
    font-size: 12px;
    margin-left: 4px;
}

/* User input card — shown expanded on first decision only */
.fisheye-user-input-card {
    flex-shrink: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--redesign-border-light);
    background: var(--redesign-bg-subtle);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
}
.fisheye-user-input-label-inline {
    color: #2563eb;
    font-weight: 600;
}
.fisheye-user-input-text {
    color: var(--redesign-text);
}
.fisheye-user-input-inline {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    color: var(--redesign-text);
}

/* Previous decisions accordion */
.fisheye-prev-accordion {
    flex-shrink: 0;
    border-bottom: 1px solid var(--redesign-border-light);
    background: var(--redesign-bg-subtle);
}
.fisheye-prev-accordion-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    cursor: default;
    user-select: none;
    position: relative;
}
.fisheye-prev-accordion-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--redesign-text-muted);
    letter-spacing: 0.02em;
}
.fisheye-prev-accordion-arrow {
    font-size: 16px;
    color: var(--redesign-text-muted);
    transition: transform 0.2s ease;
}
/* Pin (stick) button */
.fisheye-prev-pin-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    opacity: 0.4;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.fisheye-prev-pin-btn:hover {
    opacity: 0.85;
    background: var(--redesign-bg-hover, rgba(0,0,0,0.06));
    border-color: var(--redesign-border-light);
}
.fisheye-prev-pin-btn--active {
    opacity: 1;
    background: #fff1f2;
    border-color: #fecdd3;
}
.fisheye-prev-pin-btn--active:hover {
    background: #ffe4e6;
}

/* Body: collapsed by default, unfurls on hover */
.fisheye-prev-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    opacity: 0;
}
.fisheye-prev-accordion:hover .fisheye-prev-accordion-body {
    max-height: 800px;
    opacity: 1;
}
.fisheye-prev-accordion:hover .fisheye-prev-accordion-arrow {
    transform: rotate(180deg);
}
/* Stuck (pinned) state: always expanded */
.fisheye-prev-accordion--stuck .fisheye-prev-accordion-body {
    max-height: 800px;
    opacity: 1;
}
.fisheye-prev-accordion--stuck .fisheye-prev-accordion-arrow {
    transform: rotate(180deg);
}
/* Individual previous decision items */
.fisheye-prev-accordion-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 20px;
    border-top: 1px solid var(--redesign-border-light);
}
.fisheye-prev-accordion-num {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--redesign-accent);
    min-width: 14px;
}
.fisheye-prev-accordion-question {
    font-size: 12px;
    color: var(--redesign-text);
    line-height: 1.4;
}
.fisheye-prev-accordion-answer {
    font-size: 11px;
    font-weight: 500;
    color: var(--redesign-accent);
    line-height: 1.4;
    margin-top: 2px;
}

/* Current card wrapper — fills middle, horizontal shadow breaks above & below */
.fisheye-current-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* DO NOT use justify-content: center here.
       With overflow-y: auto, centered flex content overflows equally above and
       below the container, but only the downward overflow is scrollable —
       the top gets permanently clipped.  Instead, centering is handled by
       margin: auto 0 on the inner wrapper (.fisheye-current-card-inner). */
    padding: 0;
    background: var(--redesign-bg);
    position: relative;
    z-index: 1;
    box-shadow: 0 -6px 12px rgba(0,0,0,0.06), 0 6px 12px rgba(0,0,0,0.06);
    overflow-y: auto;
    min-height: 0;
}

/* Inner wrapper: margin:auto centers vertically when content fits;
   collapses to 0 when content overflows, so scroll starts at the top. */
.fisheye-current-card-inner {
    margin: auto 0;
    padding: 24px 20px 16px;
}

/* Peek card: anchored at bottom, full-width band */
.fisheye-peek-card {
    padding: 10px 20px;
    margin: 0;
    border: none;
    border-top: 1px solid var(--redesign-border-light);
    border-radius: 0;
    opacity: 0.85;
    background: var(--redesign-bg-subtle);
    box-shadow: none;
    flex-shrink: 0;
}
.fisheye-peek-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--redesign-text-muted);
    margin-bottom: 4px;
}
.fisheye-peek-question {
    font-size: 13px;
    color: var(--redesign-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fisheye-peek-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    color: var(--redesign-text-muted);
    background: var(--redesign-bg-subtle);
    border-radius: 10px;
    padding: 0 5px;
    vertical-align: middle;
    margin-right: 4px;
}

/* Peek card: terminal/output variant */
.fisheye-peek-terminal .fisheye-peek-header {
    color: var(--redesign-accent-neutral);
}
.fisheye-peek-body {
    font-size: 13px;
    color: var(--redesign-text-muted);
    line-height: 1.4;
}
.fisheye-peek-link {
    font-size: 12px;
    color: var(--redesign-accent);
    margin-top: 4px;
    cursor: default;
}

/* Peek card crossfade animation */
.fisheye-peek-card.fisheye-peek-fade-out {
    animation: fisheyePeekFadeOut 150ms var(--redesign-ease-out-smooth) forwards;
}
.fisheye-peek-card.fisheye-peek-fade-in {
    animation: fisheyePeekFadeIn 150ms var(--redesign-ease-out-smooth) forwards;
}
@keyframes fisheyePeekFadeOut {
    from { opacity: 0.85; transform: translateY(0); }
    to   { opacity: 0;    transform: translateY(4px); }
}
@keyframes fisheyePeekFadeIn {
    from { opacity: 0;    transform: translateY(-4px); }
    to   { opacity: 0.85; transform: translateY(0); }
}

/* ============================================================================
   Info callout — option detail panel protruding into right pane
   ============================================================================ */

/* ⓘ button inside option card */
.redesign-info-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--redesign-border);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    font-style: italic;
    color: var(--redesign-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--redesign-transition), border-color var(--redesign-transition), color var(--redesign-transition);
    margin-left: auto;
}
.redesign-info-btn:hover {
    background: var(--redesign-bg-subtle);
    border-color: var(--redesign-accent);
    color: var(--redesign-accent);
}
.redesign-info-btn.redesign-info-active {
    background: var(--redesign-accent);
    border-color: var(--redesign-accent);
    color: #fff;
    font-style: italic;
}

/* Right-pane overlay (dim) */
.redesign-info-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 90;
    transition: opacity 0.2s;
}
.redesign-info-overlay[hidden] { display: none; }

/* Right pane needs position:relative for overlay */
.redesign-right-pane { position: relative; }

/* Callout panel */
.redesign-info-callout {
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid var(--redesign-border-light);
    border-radius: 0 var(--redesign-radius) var(--redesign-radius) 0;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.12);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.redesign-info-callout[hidden] { display: none; }
.redesign-info-callout.redesign-info-visible { opacity: 1; }

/* Dashed tether line */
.redesign-info-tether {
    position: absolute;
    left: -1px;
    width: 0;
    border-left: 2px dashed var(--redesign-border);
}

/* Callout content headings and text */
.redesign-info-heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--redesign-text-muted);
    margin-bottom: 6px;
}
.redesign-info-text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--redesign-text);
    margin-bottom: 16px;
}
.redesign-info-text:last-child {
    margin-bottom: 0;
}

/* Decision-level ⓘ button inside question row */
.redesign-decision-info-btn {
    flex-shrink: 0;
    margin-left: 8px;
    align-self: center;
}

/* ============================================================================
   Navigation history buttons (back/forward) — toolbar
   ============================================================================ */
.redesign-nav-history-btn {
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    width: 30px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--redesign-border);
    border-radius: var(--redesign-radius-sm);
    background: var(--redesign-bg);
    color: var(--redesign-text);
    cursor: pointer;
    padding: 0;
    transition: background var(--redesign-transition), border-color var(--redesign-transition), color var(--redesign-transition);
}
.redesign-nav-history-btn:hover:not(:disabled) {
    background: var(--redesign-bg-subtle);
    border-color: var(--redesign-border);
}
.redesign-nav-history-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================================================
   Output card "Go to" switch button
   ============================================================================ */
.redesign-output-switch-btn {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    margin-left: auto;
    border: 1px solid var(--redesign-border);
    border-radius: 10px;
    background: var(--redesign-bg);
    color: var(--redesign-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1.4;
    transition: background var(--redesign-transition), border-color var(--redesign-transition), color var(--redesign-transition);
    flex-shrink: 0;
}
.redesign-output-switch-btn:hover {
    background: var(--redesign-bg-subtle);
    border-color: var(--redesign-accent);
    color: var(--redesign-accent);
}
.redesign-output-switch-arrow {
    font-size: 13px;
    line-height: 1;
}

/* ============================================================================
   Tree drag-to-pan & re-center button
   ============================================================================ */

/* Grab cursor on the tree SVG for drag-to-pan */
.redesign-tree-container svg {
    cursor: grab;
}
.redesign-tree-container.tree-dragging svg {
    cursor: grabbing;
}
/* Keep pointer cursor on interactive tree elements */
.redesign-tree-container .redesign-tree-bar,
.redesign-tree-container .redesign-tree-dot {
    cursor: pointer;
}

/* Re-center button — small pill in top-left corner of tree; shown when panned */
.redesign-tree-recenter-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20;
    width: 30px;
    height: 30px;
    border: 1px solid var(--redesign-border);
    border-radius: var(--redesign-radius-sm);
    background: #fff;
    color: var(--redesign-text-muted);
    font-size: 16px;
    font-family: inherit;
    line-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
    padding: 0;
    box-shadow: var(--redesign-shadow-sm);
}
.redesign-tree-recenter-btn::before {
    content: '\2316';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 0;
    font-size: inherit;
}
.redesign-tree-recenter-btn.visible {
    opacity: 1;
    animation: redesign-recenter-pulse 1.8s ease-in-out infinite;
    transform-origin: center center;
}
.redesign-tree-recenter-btn.visible:hover {
    animation: none;
}
.redesign-tree-recenter-btn:hover {
    background: var(--redesign-bg-subtle);
    color: var(--redesign-accent);
    border-color: var(--redesign-accent);
}

@keyframes redesign-recenter-pulse {
    0%, 100% {
        box-shadow: var(--redesign-shadow-sm);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
        transform: scale(1.08);
    }
}

/* Small note in top-right of tree */
.redesign-tree-double-click-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 15;
    font-size: 11px;
    color: var(--redesign-text-muted);
    pointer-events: none;
    white-space: nowrap;
}

/* Prevent text selection while dragging the tree */
.redesign-tree-container.tree-dragging {
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================================================
   Taxonomy filter header — filterable pills above output list
   ============================================================================ */
.redesign-taxonomy-filter {
    padding: 16px 18px 6px;
    flex-shrink: 0;
}
.redesign-taxonomy-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    min-width: 0;
}
.redesign-taxonomy-filter-row:last-child {
    margin-bottom: 0;
}
.redesign-taxonomy-filter-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.redesign-taxonomy-filter-scroll {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
}
.redesign-taxonomy-filter-scroll::-webkit-scrollbar { display: none; }
/* No overflow or scrolled to end: no fade */
.redesign-taxonomy-filter-scroll.at-end {
    -webkit-mask-image: none;
    mask-image: none;
}
.redesign-taxonomy-filter-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: center;
}
/* Single slot on the right: ‹ and › overlay so only one is visible at a time */
.redesign-taxonomy-filter-scroll-buttons {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 1.2em;
}
.redesign-taxonomy-filter-less,
.redesign-taxonomy-filter-more {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--redesign-text-muted);
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.redesign-taxonomy-filter-less:hover,
.redesign-taxonomy-filter-more:hover {
    opacity: 1;
}
.redesign-taxonomy-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 2px 9px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, color 0.3s, opacity 0.3s;
    user-select: none;
}
.redesign-taxonomy-filter-pill:hover {
    filter: brightness(0.92);
}
.redesign-taxonomy-filter-pill.taxonomy-filter-insignificant {
    opacity: 0.35;
}
.redesign-taxonomy-filter-count {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.6;
}

/* Custom tooltip (JS-positioned, appended to body) */
.redesign-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--redesign-text, #1a1d21);
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: normal;
    max-width: 260px;
    width: max-content;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.redesign-tooltip.visible {
    opacity: 1;
}
.redesign-taxonomy-filter-clear {
    font-size: 11px;
    color: var(--redesign-text-muted);
    cursor: pointer;
    margin-top: 6px;
    display: inline-block;
}
.redesign-taxonomy-filter-clear:hover {
    color: var(--redesign-accent);
}
