:root {
    --bg-dark: #0f172a;
    --sidebar-bg: #1e293b;
    --accent-blue: #38bdf8;
    --accent-purple: #818cf8;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --highlight-color: rgba(56, 189, 248, 0.3);
    --input-bg: rgba(15, 23, 42, 0.8);
    --bg-secondary: #1e293b;
    --bg-surface: #0f172a;
    --primary-color: #38bdf8;
}

/* Light Mode - Apply to html element */
html[data-theme="light"],
html[data-theme="light"] body {
    --bg-dark: #f1f5f9;
    --sidebar-bg: #ffffff;
    --accent-blue: #0369a1;
    --accent-purple: #4f46e5;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
    --highlight-color: rgba(3, 105, 161, 0.2);
    --input-bg: #ffffff;
    --bg-secondary: #ffffff;
    --bg-surface: #f8fafc;
    --primary-color: #0369a1;
}

/* Light mode content area overrides */
html[data-theme="light"] .transcript-wrapper {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: #e2e8f0;
}

html[data-theme="light"] .guidance-box {
    background: #f8fafc;
    border-color: #e2e8f0;
}

html[data-theme="light"] .node-item {
    background: #f8fafc;
}

html[data-theme="light"] .checklist-container {
    background: #f8fafc;
}

html[data-theme="light"] .form-input-text {
    background: #f8fafc;
}

html[data-theme="light"] .table-container {
    background: #ffffff;
}

html[data-theme="light"] .coding-table th {
    background: #f1f5f9;
}

html[data-theme="light"] .modal-content {
    background: #ffffff;
}

/* System preference detection */
@media (prefers-color-scheme: light) {

    html[data-theme="system"],
    html[data-theme="system"] body {
        --bg-dark: #f1f5f9;
        --sidebar-bg: #ffffff;
        --accent-blue: #0369a1;
        --accent-purple: #4f46e5;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --border-color: #334155;
        --highlight-color: rgba(3, 105, 161, 0.2);
        --input-bg: #ffffff;
        --bg-secondary: #ffffff;
        --bg-surface: #f8fafc;
    }
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    max-height: 100vh;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 30px;
}

.logo span {
    color: var(--accent-blue);
}

#case-list {
    list-style: none;
    margin-top: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 300px);
}

#case-list li {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    font-size: 14px;
}

#case-list li[data-case-id] {
    cursor: grab;
}

#case-list li[data-case-id]:active {
    cursor: grabbing;
}

#case-list .folder-item {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: default;
    margin-bottom: 6px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(148, 163, 184, 0.04);
}

#case-list .folder-item.drop-target {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    background: rgba(59, 130, 246, 0.08);
}

#case-list .folder-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#case-list .folder-toggle {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    user-select: none;
    font-size: 11px;
}

#case-list .folder-name {
    font-weight: 800;
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

#case-list .folder-name.editing {
    overflow: visible;
    text-overflow: clip;
}

#case-list .folder-icon {
    flex: 0 0 auto;
}

#case-list .folder-name-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
}

#case-list .folder-name-input {
    width: min(260px, 100%);
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
    font-weight: 800;
    margin-left: 0;
}

#case-list .folder-name-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

#case-list .folder-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    opacity: 0.75;
}

#case-list .folder-actions button:hover {
    opacity: 1;
}

#case-list .folder-actions .help-icon-btn {
    font-size: 13px;
    opacity: 0.65;
}

#case-list .folder-actions .help-icon-btn:hover {
    opacity: 1;
}

#case-list .case-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

#case-list .case-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    flex: 0 0 auto;
    margin-right: 6px;
}

#case-list li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#case-list li.active {
    background-color: var(--accent-blue);
    color: var(--bg-dark);
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.top-bar {
    min-height: 70px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 120;
    overflow: visible;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 280px;
    overflow: hidden;
}

.user-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.active-breadcrumb {
    border-bottom: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 8px 24px;
}

/* Global Filter Bar Container - Below Navbar */
.global-filter-bar-container {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px;
}

.global-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-btn-sm {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.filter-btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.filter-select-sm {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 150px;
}

.filter-indicator {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.filter-indicator.case-mode {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

#active-case-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Ident child items nicely */
.nodes-tree .node-item {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
    font-size: 14px;
    margin-top: 4px;
}

.nodes-tree .node-children {
    margin-top: 4px;
}

/* --- Collapsible UI --- */
.sidebar,
.analysis-panel {
    transition: width 0.3s ease, padding 0.3s ease, margin 0.3s ease, transform 0.3s ease;
    overflow-x: hidden;
    position: relative;
}

.sidebar.collapsed {
    width: 60px;
    padding: 20px 10px;
}

.sidebar.collapsed.force-wide {
    width: 360px;
    padding: 20px;
}

.sidebar:not(.collapsed):hover,
.sidebar.force-wide:not(.collapsed) {
    width: 360px;
}

/* Hover-expand even when collapsed (desktop UX) */
@media (hover: hover) and (pointer: fine) {

    /* Left sidebar hover-expand (desktop UX) - expand toward center (overlay) */
    .sidebar:not(.collapsed):hover,
    .sidebar.force-wide:not(.collapsed) {
        margin-right: -100px;
        /* 360 - 260 = 100 */
        z-index: 60;
        box-shadow: 10px 0 24px rgba(0, 0, 0, 0.18);
    }

    .sidebar.collapsed:hover,
    .sidebar.collapsed.force-wide {
        width: 360px;
        padding: 20px;
        margin-right: -300px;
        /* 360 - 60 = 300 */
        z-index: 60;
        box-shadow: 10px 0 24px rgba(0, 0, 0, 0.18);
    }

    .sidebar.collapsed:hover .logo h1,
    .sidebar.collapsed.force-wide .logo h1,
    .sidebar.collapsed:hover #case-list,
    .sidebar.collapsed.force-wide #case-list,
    .sidebar.collapsed:hover .guidance-box,
    .sidebar.collapsed.force-wide .guidance-box,
    .sidebar.collapsed:hover #import-btn,
    .sidebar.collapsed.force-wide #import-btn {
        display: block;
    }

    .sidebar.collapsed:hover .collapse-btn,
    .sidebar.collapsed.force-wide .collapse-btn {
        right: 10px;
        transform: none;
    }

    /* Right sidebar hover-expand (desktop UX) - overlay mode, center layout remains fixed */
    .analysis-panel:not(.collapsed):hover {
        width: var(--panel-expanded-width);
        margin-left: 0;
        transform: translateX(var(--panel-hover-shift));
        flex: 0 0 var(--panel-base-width);
        z-index: 50;
        box-shadow: -10px 0 24px rgba(0, 0, 0, 0.18);
    }
}

.analysis-panel.collapsed {
    width: 0;
    flex-basis: 0;
    padding: 0;
    border: none;
    transform: none;
}

/* Hide content when collapsed */
.sidebar.collapsed .logo h1,
.sidebar.collapsed #case-list,
.sidebar.collapsed .guidance-box,
.sidebar.collapsed #import-btn {
    display: none;
}

/* Allow content while forced-wide even if collapsed */
.sidebar.collapsed.force-wide .logo h1,
.sidebar.collapsed.force-wide #case-list,
.sidebar.collapsed.force-wide .guidance-box,
.sidebar.collapsed.force-wide #import-btn {
    display: block;
}

/* Collapse Toggles */
.collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    position: absolute;
    top: 20px;
    z-index: 100;
}

.sidebar .collapse-btn {
    right: 10px;
}

.analysis-panel .collapse-btn {
    left: 10px;
}

.sidebar.collapsed .collapse-btn {
    right: 50%;
    transform: translateX(50%) rotate(180deg);
}

/* Show icon/initial when collapsed? Optional polish */

.editor-section {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    overflow-x: auto;
    min-width: 0;
    /* Allow center content to shrink so side panels don't get clipped */
}

.transcript-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.5);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.transcript-area {
    line-height: 1.8;
    font-size: 16px;
    white-space: pre-wrap;
    color: var(--text-primary);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 12px 0;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.transcript-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 8px 0 12px 0;
    position: relative;
    z-index: 5;
}

.transcript-editor {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

.transcript-editor.hidden {
    display: none;
}

.transcript-editor-warning {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.transcript-editor-warning.hidden {
    display: none;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    font-size: 12px;
}

.find-replace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.fr-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fr-tab-btn {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
}

.fr-tab-btn.active {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
}

.fr-panel.hidden {
    display: none;
}

.find-replace-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.find-replace-label {
    min-width: 64px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
}

.find-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.transcript-editor-surface {
    position: relative;
    width: 100%;
    min-height: 260px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.transcript-editor-highlight,
.transcript-editor-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    tab-size: 4;
    border: none;
    background: transparent;
    overflow: auto;
    border-radius: 12px;
}

.transcript-editor-highlight {
    pointer-events: none;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.transcript-editor-highlight mark.fr-hit {
    background: rgba(250, 204, 21, 0.65);
    /* yellow */
    border-radius: 3px;
    padding: 0 1px;
}

.transcript-editor-highlight mark.fr-hit-active {
    background: rgba(251, 146, 60, 0.78);
    /* orange */
}

.transcript-editor-text {
    color: var(--text-primary);
    outline: none;
    resize: none;
    background: transparent;
}

.transcript-original-details {
    margin-top: 10px;
}

.transcript-original-preview {
    white-space: pre-wrap;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 10px;
    background: rgba(148, 163, 184, 0.06);
    font-size: 12px;
    line-height: 1.4;
    max-height: 240px;
    overflow: auto;
}

.node-search {
    display: flex;
    gap: 8px;
    margin: 8px 0 10px 0;
}

.node-search .search-input {
    flex: 1;
}

.node-search-empty {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 6px 4px 0 4px;
}

.search-mode-toggle {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

.search-mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.search-mode-btn.active {
    color: var(--text-primary);
    background: var(--highlight-color);
    border: 1px solid var(--accent-blue);
}

.search-bar-compact {
    max-width: 1000px;
    margin: 0 auto 12px auto;
    flex-wrap: wrap;
}

.analysis-toolbar {
    max-width: 100%;
    margin: 0 0 12px 0;
    padding: 14px 16px;
    gap: 12px;
}

.analysis-toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.analysis-toolbar-row-primary {
    align-items: stretch;
}

.analysis-search-input {
    min-width: 280px;
    flex: 1 1 360px;
}

.analysis-filter-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.analysis-filter-field .filter-label {
    white-space: nowrap;
    font-weight: 700;
}

.analysis-toolbar-row-secondary {
    justify-content: space-between;
}

.analysis-nav-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-pagination-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 0 2px;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.analysis-pagination-wrap {
    border-left: none;
    border-right: none;
    padding: 0;
    margin-left: auto;
    gap: 10px;
}

.table-page-size {
    min-width: 86px;
    padding: 6px 10px;
}

.table-page-info {
    min-width: 180px;
    text-align: left;
}

.analysis-toolbar-row-actions .ghost-btn {
    width: auto;
}

.analysis-scoring-status {
    margin-left: auto;
    min-width: 260px;
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 1100px) {
    .analysis-toolbar-row-secondary {
        justify-content: flex-start;
    }

    .analysis-pagination-wrap {
        margin-left: 0;
    }

    .analysis-scoring-status {
        margin-left: 0;
        text-align: left;
        min-width: 0;
    }
}

@media (max-width: 760px) {
    .analysis-toolbar {
        padding: 12px;
    }

    .analysis-search-input {
        min-width: 0;
        flex: 1 1 100%;
    }

    .analysis-filter-field {
        width: 100%;
        justify-content: space-between;
    }

    .analysis-filter-field .filter-select-sm {
        flex: 1 1 auto;
    }

    .analysis-nav-group {
        width: 100%;
    }

    .analysis-pagination-wrap {
        width: 100%;
    }
}

.search-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 13px;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-count {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 44px;
    text-align: center;
}

.search-hit {
    background: rgba(250, 204, 21, 0.45);
    color: inherit;
    padding: 1px 2px;
    border-radius: 4px;
}

.search-hit-active {
    background: rgba(250, 204, 21, 0.75);
}

.search-jump-flash {
    outline: 2px solid rgba(250, 204, 21, 0.6);
    outline-offset: 4px;
    border-radius: 8px;
}

.theme-assign-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 10px 0;
}

.findings-select {
    min-width: 180px;
    width: 100%;
    max-width: 300px;
}

.info-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent-blue);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.info-icon-btn:hover {
    background: rgba(56, 189, 248, 0.18);
}

.info-icon-btn-sm {
    width: 22px;
    height: 22px;
    font-size: 12px;
}

.findings-delete-btn {
    padding: 8px 12px;
    font-weight: 700;
}

.findings-empty-card {
    border: 1px dashed rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.08);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.findings-empty-card.hidden {
    display: none;
}

.findings-empty-title {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.findings-empty-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.help-popover {
    position: fixed;
    right: 24px;
    top: 120px;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    z-index: 2600;
    overflow: hidden;
}

.help-popover.hidden {
    display: none;
}

.help-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.10));
}

.help-popover-title {
    font-weight: 900;
    color: var(--text-primary);
    font-size: 14px;
}

.help-close-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.help-close-btn:hover {
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.45);
}

.help-popover-body {
    padding: 12px 14px 14px 14px;
}

.help-steps {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

.help-steps li {
    margin-bottom: 8px;
}

.help-steps strong {
    color: var(--text-primary);
}

.help-tip {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.95;
}

.ghost-btn.danger {
    border-color: rgba(239, 68, 68, 0.6);
    color: #ef4444;
}

.ghost-btn:disabled,
.ghost-btn.danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.findings-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 14px;
    max-width: 1200px;
    margin: 0 auto;
}

.findings-feature-guide {
    max-width: 1200px;
    margin: 0 auto 12px auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    padding: 12px;
}

.findings-feature-guide-title {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.findings-feature-guide-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 10px;
}

.findings-feature-tip-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.findings-feature-tip-btn {
    border: 1px dashed rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.findings-feature-tip-btn:hover,
.findings-feature-tip-btn.active {
    border-style: solid;
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.18);
}

.findings-feature-tip-box {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.findings-feature-tip-box strong {
    color: var(--text-primary);
}

.matrix-tools-bar {
    max-width: 1200px;
    margin: 0 auto 10px auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.findings-layout .form-group label {
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
}

.findings-panel {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    overflow: hidden;
}

.findings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.findings-toolbar .ghost-btn {
    padding: 8px 12px;
    width: auto;
    font-weight: 700;
}

.findings-toolbar .ghost-btn:hover {
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--text-primary);
}

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

.findings-toolbar-left {
    flex: 1 1 320px;
    min-width: 240px;
}

.findings-toolbar-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.finding-builder-modal-content {
    width: min(1080px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.finding-builder-subtitle {
    color: var(--text-secondary);
    margin-top: -6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.finding-builder-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.finding-builder-toolbar-left,
.finding-builder-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.finding-builder-toolbar-left .form-label {
    margin: 0;
    font-size: 12px;
}

.finding-builder-limit {
    width: 90px;
}

.finding-builder-stats {
    border: 1px solid var(--border-color);
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

.finding-builder-draft {
    min-height: 190px;
    resize: vertical;
    margin-bottom: 10px;
    line-height: 1.45;
}

.finding-builder-quotes-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface);
}

.finding-builder-quotes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 12px;
    font-size: 13px;
}

.finding-builder-quotes {
    overflow: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finding-builder-quote {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.finding-builder-quote-meta {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 6px;
}

.finding-builder-quote-text {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.finding-builder-quote-actions {
    display: inline-flex;
    gap: 6px;
    flex-shrink: 0;
}

.findings-list {
    flex: 1;
    overflow: auto;
    padding: 6px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.findings-list::-webkit-scrollbar {
    width: 10px;
}

.findings-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
}

.findings-empty {
    padding: 18px 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.findings-theme-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    border: 1px solid transparent;
}

.findings-theme-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
}

.findings-theme-item.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.45);
}

.findings-theme-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.2;
}

.findings-theme-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Manage Elements Modal */
.manage-elements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.manage-elements-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.manage-elements-list {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 8px;
    max-height: 360px;
    overflow: auto;
}

.manage-element-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.manage-element-row:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.06);
}

.manage-element-main {
    min-width: 0;
    flex: 1;
}

.manage-element-name {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.2;
}

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.manage-element-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.35;
    white-space: pre-wrap;
}

.manage-element-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.manage-mini-btn {
    width: auto;
    padding: 6px 9px;
    border-radius: 8px;
    font-weight: 800;
    line-height: 1;
}

@media (max-width: 880px) {
    .manage-elements-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .findings-layout {
        grid-template-columns: 1fr;
    }

    .help-popover {
        right: 14px;
        top: 92px;
    }
}

.findings-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.findings-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (min-width: 1280px) {
    .findings-toolbar-right {
        flex: 0 1 auto;
        justify-content: flex-end;
    }
}

.findings-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.findings-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.findings-detail-body {
    flex: 1;
    overflow: auto;
    padding-right: 4px;
}

.findings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.findings-textarea-definition {
    min-height: 120px;
}

.findings-textarea-memo {
    min-height: 180px;
}

.findings-save-row {
    display: flex;
    justify-content: flex-end;
    padding: 6px 0 0 0;
    margin-bottom: 10px;
}

.findings-title-sm {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.findings-quotes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.findings-quotes-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.findings-quote {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.findings-quote:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.findings-quote-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.findings-quote-text {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.findings-quote-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.qa-check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
}

.qa-check-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface);
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.qa-check-item strong {
    color: var(--text-primary);
}

.qa-check-item-action {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
    color: var(--text-primary);
    font-size: 12px;
}

.qa-check-item.pass {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
}

.qa-check-item.warn {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.10);
}

.qa-check-item.info {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.08);
}

.qa-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: auto;
    max-height: 320px;
}

.qa-consistency-table {
    margin: 0;
    font-size: 12px;
}

.qa-consistency-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(460px, 1.3fr);
    gap: 12px;
    margin-top: 10px;
    min-height: 0;
}

.qa-consistency-left,
.qa-consistency-right {
    min-width: 0;
}

.qa-help-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface);
    padding: 10px 12px;
}

.qa-help-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.qa-help-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.qa-tip-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.qa-tip-btn {
    border: 1px dashed rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.qa-tip-btn:hover,
.qa-tip-btn.active {
    border-style: solid;
    border-color: rgba(56, 189, 248, 0.75);
    background: rgba(56, 189, 248, 0.16);
}

.qa-tip-content {
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.qa-tip-content strong {
    color: var(--text-primary);
}

@media (max-width: 1120px) {
    .qa-consistency-layout {
        grid-template-columns: 1fr;
    }
}

.findings-link-btn {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.findings-link-btn:hover {
    background: rgba(56, 189, 248, 0.18);
}

.findings-trash-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
}

.findings-trash-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

.table-search-active {
    background: rgba(250, 204, 21, 0.12) !important;
}

.table-search-hit {
    background: var(--highlight-color);
    border-radius: 4px;
    padding: 0 2px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
}

.search-results-empty {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px;
}

.search-result-item {
    text-align: left;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 12px;
}

.search-result-item:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.search-result-title {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-result-snippet {
    line-height: 1.4;
}

.search-result-highlight {
    background: rgba(250, 204, 21, 0.3);
    border-radius: 4px;
    padding: 0 2px;
}

.results-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.analysis-panel {
    --panel-base-width: 320px;
    --panel-expanded-width: 440px;
    --panel-hover-shift: -70px;
    width: var(--panel-base-width);
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--panel-base-width);
    margin-left: 0;
    overflow: visible;
}

.analysis-panel.force-wide:not(.collapsed) {
    width: var(--panel-expanded-width);
    margin-left: 0;
    transform: translateX(var(--panel-hover-shift));
    flex: 0 0 var(--panel-base-width);
    z-index: 50;
    box-shadow: -10px 0 24px rgba(0, 0, 0, 0.18);
}

.analysis-panel:not(.collapsed):focus-within {
    width: var(--panel-expanded-width);
    margin-left: 0;
    transform: translateX(var(--panel-hover-shift));
    flex: 0 0 var(--panel-base-width);
    z-index: 50;
    box-shadow: -10px 0 24px rgba(0, 0, 0, 0.18);
}

.analysis-panel.collapsed {
    width: 0;
    flex-basis: 0;
    padding: 0;
    border: none;
    transform: none;
}

.nodes-tree {
    flex: 1;
    overflow-y: auto;
    margin-top: 20px;
}

.empty-state-box {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 14px;
    background: var(--bg-surface);
}

.empty-state-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.empty-state-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.empty-state-actions .primary-btn,
.empty-state-actions .secondary-btn {
    width: auto;
    margin-top: 0;
    padding: 10px 14px;
    font-size: 13px;
}

.node-item {
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.node-item:hover {
    border-color: var(--accent-purple);
}

.node-item.selected {
    background: var(--accent-purple);
    color: white;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    margin-top: 20px;
}

.secondary-btn {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

.scoring-dict-modal-content {
    max-width: 980px;
    width: min(96vw, 980px);
    height: min(940px, calc(100vh - 28px));
    max-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

#scoring-dictionary-modal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 14px 8px;
}

.scoring-dict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scoring-dict-header .modal-title {
    margin: 0;
}

.scoring-dict-header .close-modal {
    font-size: 24px;
    cursor: pointer;
}

.scoring-dict-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.scoring-dict-howto {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.scoring-dict-howto strong {
    color: var(--text-primary);
}

.scoring-dict-toolbar {
    display: grid;
    grid-template-columns: auto minmax(220px, 380px) repeat(3, auto) 1fr;
    gap: 8px;
    align-items: center;
}

.scoring-dict-toolbar label,
#scoring-dict-version-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.scoring-dict-tabs {
    display: inline-flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.scoring-dict-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.scoring-dict-tab.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
}

.scoring-dict-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.scoring-dict-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.scoring-dict-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scoring-dict-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.scoring-dict-inline-help {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.scoring-dict-tip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px dashed var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    background: var(--bg-surface);
    font-family: inherit;
    line-height: 1.2;
}

.scoring-dict-help-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 40;
    width: min(520px, 90vw);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.22);
}

.scoring-dict-help-popover strong {
    color: var(--text-primary);
}

.scoring-dict-help-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.scoring-dict-help-line {
    margin: 4px 0 8px 0;
}

.scoring-dict-help-list {
    margin: 0 0 8px 18px;
    padding: 0;
}

.scoring-dict-help-list li {
    margin-bottom: 6px;
}

.scoring-dict-help-sample {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 8px;
    margin: 8px 0;
    background: rgba(148, 163, 184, 0.08);
}

.scoring-dict-help-sample code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 4px;
}

.scoring-dict-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.scoring-dict-field {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    line-height: 1.3;
    margin: 0;
}

select.scoring-dict-field {
    padding-right: 36px;
}

.scoring-dict-checkbox-row {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.scoring-dict-actions {
    display: flex;
    justify-content: flex-end;
}

.scoring-dict-btn,
.scoring-dict-btn-primary {
    width: auto;
    margin: 0;
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
}

.scoring-dict-btn-primary {
    min-width: 140px;
}

.scoring-dict-template-note {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.scoring-dict-list-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: var(--bg-secondary);
}

#scoring-dict-pane-setup {
    overflow-y: auto;
    padding-right: 2px;
}

.scoring-dict-entry-filter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.scoring-dict-entry-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 8px;
    align-items: center;
}

#scoring-dict-entry-filters-wrap {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-surface);
}

#scoring-dict-filter-keyword {
    grid-column: span 2;
}

#scoring-dict-pane-entries {
    min-height: 0;
    overflow: hidden;
}

.scoring-dict-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
}

.scoring-dict-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    text-align: left;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    box-shadow: 0 1px 0 var(--border-color);
}

.scoring-dict-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    word-break: break-word;
}

.scoring-dict-table th:nth-child(1),
.scoring-dict-table td:nth-child(1) {
    width: 52px;
}

.scoring-dict-table th:nth-child(2),
.scoring-dict-table td:nth-child(2),
.scoring-dict-table th:nth-child(6),
.scoring-dict-table td:nth-child(6),
.scoring-dict-table th:nth-child(7),
.scoring-dict-table td:nth-child(7),
.scoring-dict-table th:nth-child(9),
.scoring-dict-table td:nth-child(9),
.scoring-dict-table th:nth-child(10),
.scoring-dict-table td:nth-child(10) {
    width: 78px;
}

.scoring-dict-table th:nth-child(8),
.scoring-dict-table td:nth-child(8) {
    width: 70px;
}

.scoring-dict-table tbody tr {
    background: var(--bg-secondary);
}

.scoring-dict-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 980px) {
    .scoring-dict-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .scoring-dict-tabs {
        width: 100%;
    }

    .scoring-dict-tab {
        flex: 1;
        text-align: center;
    }

    .scoring-dict-grid {
        grid-template-columns: 1fr;
    }

    .scoring-dict-entry-filter-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .scoring-dict-entry-filters {
        grid-template-columns: 1fr 1fr;
    }

    #scoring-dict-filter-keyword {
        grid-column: span 2;
    }

    .scoring-dict-form-grid {
        grid-template-columns: 1fr;
    }

    .scoring-dict-btn,
    .scoring-dict-btn-primary {
        width: 100%;
    }

    .scoring-dict-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

.ghost-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.ghost-btn.danger {
    border-color: rgba(239, 68, 68, 0.55);
    color: #ef4444;
}

.ghost-btn.danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ghost-btn.danger:not(:disabled):hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.8);
}

/* Burger Menu */
.burger-menu {
    position: relative;
}

.burger-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.burger-btn:hover {
    background: var(--accent-blue);
    color: white;
}

.burger-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-width: 220px;
    z-index: 9999;
    /* Ensure it stays above EVERYTHING */
    padding: 8px 0;
    margin-top: 8px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.burger-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.burger-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.burger-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.filter-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.hidden {
    display: none;
}

/* --- View Controls (Tabs) --- */
.view-controls {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
    overflow: visible;
    overflow-y: visible;
    position: relative;
    z-index: 220;
    scrollbar-width: thin;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    flex: 0 0 auto;
}

.view-btn.active {
    background: var(--accent-blue);
    color: var(--bg-dark);
}

.view-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.view-btn-utility {
    border: 1px dashed var(--border-color);
}

.top-nav-dropdown {
    position: relative;
    flex: 0 0 auto;
    z-index: 230;
}

.top-nav-dropdown-toggle {
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.top-nav-dropdown.open .top-nav-dropdown-toggle {
    background: rgba(56, 189, 248, 0.15);
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.55);
}

.top-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 210px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    z-index: 2000;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.28);
    pointer-events: auto;
}

@media (max-width: 1280px) {
    .view-controls {
        overflow-x: auto;
        overflow-y: visible;
    }
}

.view-dropdown-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 8px;
    padding: 9px 10px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.view-dropdown-item:hover {
    background: rgba(56, 189, 248, 0.14);
}

.view-dropdown-item.active {
    background: var(--accent-blue);
    color: var(--bg-dark);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .top-bar {
        padding: 8px 14px;
    }

    .header-left {
        max-width: 210px;
    }

    .active-breadcrumb {
        padding: 7px 14px;
    }
}

/* --- View toggling --- */
.active-view {
    display: block;
}

.hidden-view {
    display: none;
}

/* --- Table Styles --- */
.table-container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--sidebar-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 20px;
}

.coding-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

.coding-table th,
.coding-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.coding-table td {
    vertical-align: top;
}

.coding-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-blue);
    font-weight: 600;
}

.coding-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.coding-table .select-cell {
    width: 44px;
    text-align: center;
}

.coding-table .rank-cell,
.coding-table .score-cell {
    width: 86px;
    white-space: nowrap;
}

.rank-badge {
    display: inline-block;
    min-width: 46px;
    text-align: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.20);
}

.score-badge {
    display: inline-block;
    min-width: 58px;
    text-align: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.20);
}

.score-badge.score-positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.score-badge.score-negative {
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
}

.score-badge.score-neutral,
.score-badge.score-empty,
.rank-badge.rank-empty {
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.14);
}

.coding-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.coding-table input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.node-badge {
    background: rgba(129, 140, 248, 0.2);
    color: var(--accent-purple);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* --- Dynamic Node Highlight --- */
.node-item.has-coding {
    border-left: 3px solid var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
}

.node-count {
    background: var(--accent-blue);
    color: var(--bg-dark);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
    display: inline-block;
}

/* Matrix View Styles */
.coding-table th,
.coding-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.coding-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
}

/* Highlight Overlay for coded segments */
.highlight-overlay {
    background-color: rgba(148, 163, 184, 0.20);
    border-radius: 3px;
    padding: 1px 2px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.highlight-overlay.interviewee {
    background-color: rgba(129, 140, 248, 0.35);
}

.highlight-overlay.interviewer {
    background-color: rgba(56, 189, 248, 0.30);
}

.highlight-overlay.mixed {
    background-color: rgba(245, 158, 11, 0.30);
}

.highlight-overlay:hover {
    background-color: rgba(148, 163, 184, 0.32);
}

.highlight-overlay.interviewee:hover {
    background-color: rgba(129, 140, 248, 0.55);
}

.highlight-overlay.interviewer:hover {
    background-color: rgba(56, 189, 248, 0.48);
}

.highlight-overlay.mixed:hover {
    background-color: rgba(245, 158, 11, 0.45);
}

.highlight-overlay.jump-target {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
    animation: jumpPulse 1.2s ease-in-out 1;
}

.highlight-overlay.editing-target {
    background-color: rgba(251, 191, 36, 0.55) !important;
    outline: 2px solid rgba(245, 158, 11, 0.95);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}

.highlight-overlay.editing-target:hover {
    background-color: rgba(245, 158, 11, 0.65) !important;
}

@keyframes jumpPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.32);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.22);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.0);
    }
}

.edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-size: 12px;
    color: var(--text-secondary);
}

#form-edit-banner #form-edit-text {
    flex: 1;
    min-width: 120px;
}

#form-edit-banner>div:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

#form-edit-banner button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
}

.form-input-text[readonly] {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.85;
}

.selected-nodes-wrapper {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.selected-nodes-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.selected-nodes-count {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
}

.selected-nodes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-node-chip {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.12);
}

.selected-node-empty {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.9;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 200px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    font-size: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Dynamic Tooltip Container */
.highlight-tooltip {
    position: absolute;
    z-index: 10000;
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-width: 320px;
    overflow: hidden;
    animation: tooltipFadeIn 0.15s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip-header {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 12px;
}

.tooltip-body {
    padding: 10px 12px;
}

.tooltip-item {
    padding: 6px 0;
}

.tooltip-item.has-border {
    border-top: 1px solid #f1f5f9;
    margin-top: 6px;
    padding-top: 10px;
}

.tooltip-code {
    margin-bottom: 4px;
}

.tooltip-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tooltip-badge {
    display: inline-block;
    background: #ede9fe;
    color: #7c3aed;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tooltip-memos {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.tooltip-memo {
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 6px;
    margin-top: 4px;
}

.tooltip-memo strong {
    color: #7c3aed;
}


/* Transcript Highlighting */
.highlight-primary {
    background-color: rgba(255, 215, 0, 0.3) !important;
    /* Gold */
    border-bottom: 2px solid var(--accent-primary);
    cursor: pointer;
}

.highlight-child {
    background-color: rgba(34, 197, 94, 0.2) !important;
    /* Green */
    border-bottom: 2px dashed var(--accent-secondary);
    cursor: pointer;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* --- Right Panel Tabs --- */
.panel-tabs {
    display: flex;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.panel-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.panel-tab {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.panel-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.panel-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.panel-tab.hidden {
    display: none;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* Input Form layout: scroll + fixed footer */
#tab-form {
    overflow: hidden;
}

#tab-form .form-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    padding-bottom: 12px;
}

#tab-form .form-footer {
    flex: 0 0 auto;
    padding-top: 10px;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
}

/* --- Assign Themes (Analysis Table) --- */
.assign-themes-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.assign-themes-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.assign-themes-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
}

.assign-themes-context {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.assign-themes-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.45;
    white-space: pre-wrap;
}

.theme-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 10px;
}

.theme-checklist-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.theme-checklist-label {
    min-width: 0;
    cursor: pointer;
}

.theme-checklist-meta {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* --- Findings Tabs --- */
.findings-detail-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.findings-tab-btn {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

.findings-tab-btn.active {
    color: var(--accent-blue);
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.12);
}

.findings-tab-content {
    display: none;
}

.findings-tab-content.active {
    display: block;
}

.findings-form-mode-banner {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 12px;
    line-height: 1.35;
}

.findings-form-mode-banner.hidden {
    display: none;
}

/* --- Analysis Table Layout Fixes --- */
.coding-table td.case-cell {
    white-space: nowrap;
    font-weight: 900;
    color: var(--text-primary);
}

.coding-table td.code-cell {
    min-width: 220px;
}

.coding-table td.actions-cell {
    white-space: nowrap;
}

.coding-table td.record-no-cell {
    width: 72px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.record-no-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.10);
    font-size: 12px;
    line-height: 1.1;
}

.table-node-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.3;
}

.node-badge {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.analysis-node-badge {
    gap: 6px;
    align-items: center;
}

.analysis-node-remove-btn {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    color: #ffffff;
    background: rgba(239, 68, 68, 0.92);
    padding: 0;
}

.analysis-node-remove-btn:hover {
    background: rgba(220, 38, 38, 0.96);
}

.analysis-node-remove-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.coding-table tr.analysis-row-top td {
    border-bottom: none;
    padding-bottom: 8px;
}

.coding-table tr.analysis-row-codes td {
    padding-top: 0;
    padding-bottom: 8px;
    border-bottom: none;
}

.coding-table tr.analysis-row-detail td {
    padding-top: 0;
    border-bottom: 1px solid var(--border-color);
}

.analysis-codes-cell {
    background: rgba(148, 163, 184, 0.06);
    border-top: 1px dashed rgba(148, 163, 184, 0.30);
}

.analysis-codes-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analysis-detail-cell {
    background: rgba(148, 163, 184, 0.08);
    border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.analysis-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: 14px;
}

.analysis-detail-block {
    min-width: 0;
}

.analysis-detail-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.analysis-segment-content {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-primary);
}

.analysis-segment-id-top {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.analysis-info-note {
    font-size: 11px;
    color: var(--text-secondary);
}

.analysis-segment-content .speaker-badge {
    margin-right: 6px;
}

.analysis-memo-content {
    font-size: 12px;
    line-height: 1.45;
}

.analysis-memo-text {
    color: var(--text-secondary);
    font-style: italic;
}

.analysis-memo-empty,
.analysis-segment-empty {
    color: var(--text-secondary);
    font-style: italic;
}

.analysis-action-wrap {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.analysis-copy-btn {
    padding: 4px 10px;
    font-size: 11px;
}

.analysis-copy-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-evidence-section {
    margin-top: 10px;
}

.analysis-evidence-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-evidence-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.analysis-evidence-tag input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.analysis-evidence-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.analysis-evidence-tag-text {
    color: var(--text-primary);
}

.analysis-evidence-empty {
    color: var(--text-secondary);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.analysis-evidence-manage-btn {
    padding: 2px 8px;
    font-size: 11px;
}

@media (max-width: 980px) {
    .analysis-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Accordion sections */
.accordion {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.10), rgba(129, 140, 248, 0.06));
    border-bottom: 1px solid var(--border-color);
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion summary::after {
    content: "▾";
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 900;
    transform: rotate(-90deg);
    transition: transform 0.15s ease;
}

.accordion[open] summary::after {
    transform: rotate(0deg);
}

.accordion-hint {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.accordion-body {
    padding: 12px;
}

/* Reduce vertical density inside accordions */
#tab-form .form-group {
    margin-bottom: 14px;
}

#tab-form .form-group label {
    margin-bottom: 6px;
}

/* Keep big lists usable on smaller screens */
@media (max-height: 820px) {
    #tab-form .checklist-container {
        max-height: 240px;
    }
}

@media (max-height: 740px) {
    #tab-form .checklist-container {
        max-height: 200px;
    }
}

/* --- Coding Form --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.form-input-text {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.form-input-text:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.evidence-tags {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.evidence-tags-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.evidence-tags-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.evidence-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    user-select: none;
}

.evidence-tag input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.evidence-tag span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.evidence-tag-help {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.evidence-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.evidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.checklist-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checklist-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.checklist-item label {
    cursor: pointer;
    margin-bottom: 0;
    text-transform: none;
    color: var(--text-primary);
    font-size: 14px;
    flex: 1;
}

/* Sidebar Drawer */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transform: translateX(-100%);
    /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.sidebar-drawer.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.drawer-content {
    padding: 20px;
}

.drawer-section {
    margin-bottom: 20px;
}

.drawer-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 0.9em;
    text-transform: uppercase;
}

.drawer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-menu li {
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.drawer-menu li:hover {
    background-color: var(--bg-hover);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal-content {
    background: var(--sidebar-bg);
    /* Use sidebar-bg as panel bg */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    position: relative;
    color: var(--text-primary);
}

.project-modal-content {
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-radius: 28px;
    padding: 32px;
}

.project-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.project-modal-header h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1.1;
    font-weight: 800;
}

.project-modal-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.24);
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.project-modal-subtitle {
    margin: 14px 0 0;
    max-width: 720px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.project-modal-user {
    min-width: 220px;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(56, 189, 248, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.project-user-label {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.project-user-name {
    color: var(--accent-blue);
    font-size: 18px;
    font-weight: 800;
}

.project-modal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 20px;
    min-height: 0;
    flex: 1;
}

.project-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.project-panel-solo {
    grid-column: 1 / -1;
}

.project-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-panel-header h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.project-panel-header p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.project-count-badge,
.project-id-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.project-list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 6px;
}

.project-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 22px;
    align-items: start;
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.project-list-item:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
    transform: translateY(-1px);
}

.project-list-item.active {
    border-color: rgba(56, 189, 248, 0.55);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.07));
    box-shadow: 0 12px 28px rgba(3, 105, 161, 0.12);
    position: relative;
}

.project-list-item.active::before {
    content: "";
    position: absolute;
    inset: 14px auto 14px 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.95), rgba(59, 130, 246, 0.75));
}

.project-list-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-list-item-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.project-list-item-title {
    min-width: 0;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.project-list-item-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.project-list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
}

.project-list-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.project-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
}

.project-origin-chip {
    max-width: 100%;
    white-space: normal;
}

.project-inline-editor {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.06);
}

.project-rename-input,
.project-rename-textarea {
    width: 100%;
}

.project-inline-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-load-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
    font-size: 15px;
    white-space: nowrap;
}

.project-load-btn.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.6);
    color: var(--text-primary);
}

.project-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.14);
    border: 1px solid rgba(74, 222, 128, 0.34);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.project-duplicate-btn {
    min-width: 0;
    justify-content: center;
}

.project-rename-btn,
.project-delete-btn {
    min-width: 0;
    justify-content: center;
}

.project-delete-btn {
    grid-column: 1 / -1;
}

.project-delete-btn {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}

.project-delete-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
}

.project-panel-create .form-group {
    margin-bottom: 0;
}

.project-field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-create-btn {
    margin-top: auto;
}

.project-create-msg {
    min-height: 20px;
    margin-top: 10px;
    color: var(--accent-blue);
    font-size: 14px;
}

.project-list-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 20px;
    border: 1px dashed var(--border-color);
    border-radius: 18px;
    color: var(--text-secondary);
    text-align: center;
}

.project-modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 4px;
}

@media (max-width: 960px) {
    .project-modal-layout {
        grid-template-columns: 1fr;
    }

    .project-modal-user {
        min-width: 0;
    }
}

.confirm-suppress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: -8px 0 16px 0;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.confirm-suppress input[type="checkbox"] {
    cursor: pointer;
}

/* Create Node Modal - Full screen overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal.hidden {
    display: none;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2002;
    /* Higher than drawer */
    pointer-events: auto;
}

/* Enhanced Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.optional-tag {
    font-size: 12px;
    opacity: 0.6;
    font-weight: 400;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.input-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-action .form-input {
    flex: 1;
}

.btn-icon {
    background: var(--accent-blue);
    color: var(--bg-dark);
    border: none;
    border-radius: 8px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-icon:hover {
    background: #0ea5e9;
    transform: scale(1.05);
}

/* Modal Enhancements */
.node-modal-content {
    max-width: 480px;
    width: 90%;
}

.modal-title {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-dark);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.theme-option {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.theme-option:hover {
    color: var(--text-primary);
}

.theme-option.active {
    background: var(--accent-blue);
    color: var(--bg-dark);
    font-weight: 600;
}

/* Node Action Buttons */
.node-actions {
    display: flex;
    gap: 2px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.node-group:hover .node-actions,
.node-item:hover .node-actions,
.node-header:hover .node-actions {
    opacity: 1;
}

.node-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.1s;
}

.node-action-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Form Hint */
.form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.hint-link-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--accent-blue);
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
    font-size: inherit;
}

.hint-link-btn:hover {
    color: var(--text-primary);
}

/* Speaker toggle */
.speaker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.speaker-label {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.speaker-toggle {
    display: inline-flex;
    gap: 10px;
    padding: 0;
    border: none;
    background: transparent;
}

.speaker-btn {
    border: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.10);
    color: var(--text-secondary);
    padding: 9px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    transition: all 0.15s ease;
}

.speaker-btn:hover {
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(148, 163, 184, 0.14);
}

.speaker-btn.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.65);
    color: var(--text-primary);
}

.speaker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.10);
    margin-left: 8px;
    white-space: nowrap;
}

.speaker-badge.interviewer {
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.10);
}

.speaker-badge.interviewee {
    border-color: rgba(129, 140, 248, 0.45);
    color: var(--accent-purple);
    background: rgba(129, 140, 248, 0.10);
}

/* Dual-speaker segment boxes */
.segment-speaker-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.archival-case #segment-box-interviewer {
    display: none;
}

.segment-speaker-box {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 10px 12px;
    background: rgba(148, 163, 184, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.segment-speaker-box.active-target {
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
    background: rgba(56, 189, 248, 0.06);
}

.segment-speaker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.segment-speaker-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.segment-speaker-box textarea.form-input-text {
    margin-top: 0;
}

/* Case details / attributes */
.case-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.case-attributes-list {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-surface);
    max-height: 240px;
    overflow: auto;
}

.case-attributes-empty {
    padding: 14px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 13px;
}

.case-attr-group {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.case-attr-group:last-child {
    margin-bottom: 0;
}

.case-attr-key {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.case-attr-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.case-attr-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 13px;
}

.case-attr-chip button {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.case-attr-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-top: 12px;
}

.case-attr-master-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

@media (max-width: 720px) {
    .case-attr-form {
        grid-template-columns: 1fr;
    }

    .case-attr-form .primary-btn {
        width: 100% !important;
    }

    .case-attr-master-form {
        grid-template-columns: 1fr;
    }

    .case-attr-master-form .btn-secondary {
        width: 100% !important;
    }
}

/* Transcript legend for speaker highlights */
.speaker-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin: 10px 0 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.06);
}

.explore-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    align-items: start;
}

.explore-filters {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    background: rgba(148, 163, 184, 0.04);
    max-height: calc(100vh - 260px);
    overflow: auto;
}

.explore-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.explore-block {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 12px;
}

.explore-block:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.explore-block-title {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.explore-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.explore-checklist {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
    max-height: 220px;
    overflow: auto;
}

.explore-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 10px;
}

.explore-item:hover {
    background: rgba(148, 163, 184, 0.08);
}

.explore-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

.explore-item .explore-meta {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.9;
}

.explore-selected {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.explore-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(99, 102, 241, 0.08);
    font-size: 12px;
}

.explore-chip button {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.explore-attr-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
}

.explore-attr-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explore-attr-group {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
}

.explore-attr-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.explore-attr-group-title {
    font-weight: 900;
    font-size: 13px;
}

.explore-attr-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.explore-results {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    background: rgba(148, 163, 184, 0.02);
    min-height: 300px;
}

.explore-results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.explore-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.explore-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explore-result {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.explore-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.explore-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.explore-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(59, 130, 246, 0.10);
}

.explore-result-text {
    white-space: pre-wrap;
    line-height: 1.55;
    color: var(--text-primary);
}

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

@media (max-width: 980px) {
    .explore-layout {
        grid-template-columns: 1fr;
    }

    .explore-filters {
        max-height: none;
    }
}

.cross-links-toolbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr)) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.cross-links-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cross-links-control label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.cross-links-control-wide {
    grid-column: span 2;
}

.cross-links-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.cross-links-view-tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 10px;
}

.cross-links-view-tab {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
}

.cross-links-view-tab.active {
    color: var(--accent-blue);
    border-color: rgba(56, 189, 248, 0.75);
    background: rgba(56, 189, 248, 0.12);
}

.cross-links-harvey-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    justify-content: flex-start;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 7px 10px;
    margin-bottom: 12px;
    text-align: left;
}

.cross-links-harvey-note {
    opacity: 0.9;
}

.cross-links-howto {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.07);
    padding: 12px;
    margin-bottom: 12px;
}

.cross-links-howto-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.cross-links-howto-steps {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.cross-links-howto-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed var(--border-color);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 12px;
    text-align: left;
}

.cross-links-hover-help {
    position: relative;
}

.ahp-panel-shell .cross-links-hover-help::after,
.ahp-panel-shell .cross-links-hover-help::before {
    left: 0;
    transform: translateX(0) translateY(4px);
}

.ahp-panel-shell .cross-links-hover-help::after {
    top: calc(100% + 10px);
    min-width: 240px;
    max-width: min(360px, 72vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: #4b5d77;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-line;
    text-transform: none;
    letter-spacing: normal;
}

.ahp-panel-shell .cross-links-hover-help::before {
    top: calc(100% + 4px);
    left: 6px;
    transform: translateX(0) translateY(4px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(148, 163, 184, 0.22) transparent;
}

.cross-links-hover-help::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 320px;
    max-width: min(520px, 88vw);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.4;
    font-size: 12px;
    white-space: pre-line;
    text-align: left;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
    z-index: 2400;
}

.cross-links-hover-help::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent var(--border-color) transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
    z-index: 2401;
}

.cross-links-hover-help:hover::after,
.cross-links-hover-help:hover::before,
.cross-links-hover-help:focus-visible::after,
.cross-links-hover-help:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.ahp-panel-shell .cross-links-hover-help:hover::after,
.ahp-panel-shell .cross-links-hover-help:hover::before,
.ahp-panel-shell .cross-links-hover-help:focus-visible::after,
.ahp-panel-shell .cross-links-hover-help:focus-visible::before {
    transform: translateX(0) translateY(0);
}

.cross-links-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 14px;
    align-items: start;
    min-height: 0;
}

.cross-links-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.cross-links-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.05);
    padding: 12px;
}

.cross-links-card-title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.cross-links-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cross-links-card-title-row .cross-links-card-title {
    margin-bottom: 0;
}

.cross-links-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.cross-links-kpi {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
}

.cross-links-kpi-value {
    font-size: 19px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--text-primary);
}

.cross-links-kpi-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.cross-links-top-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
}

.cross-links-link-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.cross-links-link-item:hover {
    border-color: rgba(56, 189, 248, 0.75);
    background: rgba(56, 189, 248, 0.08);
}

.cross-links-link-item.selected {
    border-color: rgba(56, 189, 248, 0.95);
    background: rgba(56, 189, 248, 0.16);
}

.cross-links-link-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.cross-links-link-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cross-links-lift-badge {
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 800;
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.12);
}

.cross-links-main {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    background: rgba(148, 163, 184, 0.03);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cross-links-matrix-wrap {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: auto;
    max-height: 420px;
    background: rgba(255, 255, 255, 0.02);
}

.cross-links-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    min-width: 720px;
}

.cross-links-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
    vertical-align: bottom;
}

.cross-links-matrix-table tbody td {
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    padding: 6px 8px;
    text-align: center;
    color: var(--text-primary);
}

.cross-links-matrix-table tbody tr:last-child td {
    border-bottom: none;
}

.cross-links-sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    text-align: left !important;
    background: var(--sidebar-bg);
    min-width: 220px;
    max-width: 320px;
}

.cross-links-value-cell {
    font-weight: 700;
}

.cross-links-th-cases {
    min-width: 68px;
    width: 68px;
}

.cross-links-th-entity {
    min-width: 120px;
}

.cross-links-col-total {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.cross-links-case-count {
    font-weight: 700;
    color: var(--text-secondary);
}

.cross-links-cell-empty {
    color: var(--text-secondary);
    opacity: 0.65;
}

.cross-links-cell {
    padding: 4px !important;
}

.cross-links-cell-btn {
    width: 100%;
    border: 1px solid transparent;
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 6px;
    font-weight: 800;
    cursor: pointer;
}

.cross-links-cell.selected .cross-links-cell-btn,
.cross-links-cell-btn:hover {
    border-color: rgba(56, 189, 248, 0.85);
}

.cross-links-harvey-cell {
    padding: 2px !important;
}

.cross-links-harvey-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.35);
}

.cross-links-harvey-symbol {
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
}

.cross-links-harvey-meta {
    font-size: 10px;
    line-height: 1.1;
    color: var(--text-secondary);
    font-weight: 700;
}

.cross-links-harvey-strength {
    font-size: 10px;
    line-height: 1.1;
    color: var(--text-secondary);
}

.cross-links-harvey-btn.lift-strong {
    color: #0ea5e9;
    border-color: rgba(14, 165, 233, 0.55);
    background: rgba(14, 165, 233, 0.13);
}

.cross-links-harvey-btn.lift-neutral {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.5);
    background: rgba(148, 163, 184, 0.10);
}

.cross-links-harvey-btn.lift-weak {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.12);
}

.cross-links-evidence {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
}

.cross-links-evidence-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cross-links-evidence-head h4 {
    margin: 0;
    font-size: 14px;
}

.cross-links-evidence-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 330px;
    overflow: auto;
}

.cross-links-evidence-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.cross-links-evidence-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.cross-links-badge {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.12);
}

.cross-links-evidence-text {
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.cross-links-evidence-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.cross-links-empty {
    color: var(--text-secondary);
    font-size: 12px;
}

.sectione-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sectione-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sectione-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 12px;
}

.sectione-chip {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 900;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.08);
}

.sectione-chip.done {
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.20);
}

.sectione-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.sectione-tab-btn {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    padding: 8px 12px;
    font-weight: 800;
    cursor: pointer;
}

.sectione-tab-btn.active {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.16);
}

.sectione-tab-content {
    display: none;
}

.sectione-tab-content.active {
    display: block;
}

.sectione-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.sectione-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    background: rgba(56, 189, 248, 0.08);
}

.sectione-card-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.1;
}

.sectione-card-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.sectione-notes {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.08);
    padding: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.sectione-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.sectione-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sectione-list-chip {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.10);
}

.sectione-e3-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sectione-e3-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.sectione-e3-title {
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sectione-e3-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sectione-e3-block {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: rgba(148, 163, 184, 0.06);
    min-height: 88px;
}

.sectione-e3-label {
    font-size: 11px;
    font-weight: 900;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

@media (max-width: 1024px) {
    .sectione-split {
        grid-template-columns: 1fr;
    }

    .sectione-e3-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1280px) {
    .cross-links-toolbar {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .cross-links-control-wide {
        grid-column: span 2;
    }
}

@media (max-width: 1024px) {
    .cross-links-layout {
        grid-template-columns: 1fr;
    }

    .cross-links-sidebar {
        order: 2;
    }

    .cross-links-main {
        order: 1;
    }
}

@media (max-width: 760px) {
    .cross-links-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .cross-links-control-wide {
        grid-column: span 2;
    }
}

.speaker-legend-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.speaker-legend-items {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.speaker-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block;
    margin-right: 6px;
}

.speaker-swatch.interviewee {
    background: rgba(129, 140, 248, 0.35);
    border-color: rgba(129, 140, 248, 0.55);
}

.speaker-swatch.interviewer {
    background: rgba(56, 189, 248, 0.30);
    border-color: rgba(56, 189, 248, 0.55);
}

.speaker-legend-items span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

/* Info & Guide Boxes */
.info-box,
.guide-box,
.guidance-box {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(129, 140, 248, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-left: 4px solid var(--accent-blue);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0;
    position: relative;
}

.info-box::before,
.guide-box::before,
.guidance-box::before {
    content: "💡";
    position: absolute;
    top: -10px;
    left: 12px;
    background: var(--sidebar-bg);
    padding: 0 6px;
    font-size: 14px;
}

.info-box h4,
.guide-box h4,
.guidance-box h4 {
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.info-box p,
.guide-box p,
.guidance-box p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.info-box ul,
.guide-box ul,
.guidance-box ul {
    margin: 8px 0 0 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 13px;
}

.info-box li,
.guide-box li,
.guidance-box li {
    margin-bottom: 4px;
}

/* Tip Box Variation */
.tip-box {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(129, 140, 248, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-left: 4px solid var(--accent-blue);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    transition: transform 0.2s;
}

.tip-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-blue);
    margin-bottom: 8px;
    font-size: 14px;
}

.tip-box h4::before {
    content: "✨";
}

/* Warning Box Variation */
.warning-box {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(225, 29, 72, 0.08));
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-left: 4px solid #f43f5e;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    transition: transform 0.2s;
}

.warning-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f43f5e;
    margin-bottom: 8px;
    font-size: 14px;
}

.warning-box h4::before {
    content: "⚠️";
}

/* Step Indicator */
.step-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.1);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.step-indicator .step-number {
    background: var(--accent-blue);
    color: var(--bg-dark);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Word Cloud Styles */
.word-tools-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px 0;
    flex-wrap: wrap;
}

.word-tools-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gauge-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
}

.heatmap-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
}

.heatmap-summary {
    flex: 1 1 320px;
    min-height: 42px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.gauge-toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.gauge-group-help {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.gauge-group-help strong {
    color: var(--text-primary);
}

.gauge-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.gauge-kpi-card {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gauge-kpi-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.08);
}

.gauge-kpi-card.active {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.14);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25) inset;
}

.gauge-kpi-title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.gauge-kpi-hint {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.9;
    line-height: 1.25;
}

.gauge-kpi-value {
    font-size: 24px;
    line-height: 1.1;
    color: var(--text-primary);
    font-weight: 800;
}

.gauge-metric-explain {
    margin-top: 4px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    line-height: 1.45;
    font-size: 13px;
}

.gauge-metric-explain strong {
    color: var(--text-primary);
}

.gauge-metric-explain span {
    color: var(--text-secondary);
}

.gauge-interpret-list {
    margin-top: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

.gauge-interpret-item {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 4px;
}

.word-cloud-container {
    min-height: 300px;
    height: 420px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    display: block;
    position: relative;
    overflow: hidden;
    max-height: none;
}

.word-cloud-word {
    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-block;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: default;
    transition: transform 0.2s, opacity 0.2s;
    will-change: transform, opacity;
}

.word-cloud-word:hover {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0.8;
}

/* Word Count Styles */
.word-count-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.word-count-stat {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}

.word-count-stat .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
}

.word-count-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.word-count-table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.word-count-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.word-count-table th,
.word-count-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.word-count-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.word-count-table tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

.frequency-bar {
    height: 6px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    min-width: 4px;
}

@media (max-width: 760px) {
    .word-tools-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .heatmap-toolbar,
    .gauge-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .heatmap-summary,
    .gauge-toolbar-field {
        min-width: 0;
        width: 100%;
    }

    .gauge-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Coding Summary (bulk delete) --- */
.summary-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.summary-tree-pane {
    flex: 1 1 55%;
    min-width: 320px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.summary-segments-pane {
    flex: 1 1 45%;
    min-width: 320px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.summary-segments-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.summary-segments-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-primary);
}

.summary-segments-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.summary-segments-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.summary-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    user-select: none;
}

.summary-segments-list {
    padding: 12px 14px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.summary-segment-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-segment-top {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    gap: 10px;
    align-items: start;
}

.summary-segment-select {
    display: inline-flex;
    align-items: start;
}

.summary-segment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.summary-chip-id {
    font-weight: 800;
}

.summary-chip-location {
    font-variant-numeric: tabular-nums;
}

.summary-segment-bottom {
    padding-top: 8px;
    border-top: 1px dashed rgba(148, 163, 184, 0.2);
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.summary-segment-text {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-primary);
}

.summary-segment-memo {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
}

.summary-segment-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .summary-segment-top {
        grid-template-columns: 26px 1fr;
    }

    .summary-segment-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 26px;
    }
}

.summary-row {
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.summary-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.summary-row.active {
    background: rgba(56, 189, 248, 0.10);
    border-left-color: rgba(56, 189, 248, 0.45);
}

.ahp-view-root {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ahp-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--card-bg);
}

.ahp-toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ahp-toolbar-grow {
    flex: 1;
    min-width: 280px;
}

.ahp-model-select {
    min-width: 260px;
}

.ahp-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.ahp-summary-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 0;
    transition: all 0.2s ease;
}

.ahp-summary-card:hover {
    background: var(--sidebar-bg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.ahp-summary-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
}

.ahp-summary-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ahp-summary-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: left;
    word-break: break-word;
}

.ahp-helper-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-top: auto;
}

.ahp-panel-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ahp-panel-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: var(--bg-surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.ahp-panel-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--sidebar-bg);
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.ahp-panel-tab:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.ahp-panel-tab.active {
    border-color: var(--accent-blue);
    background: var(--highlight-color);
    color: var(--text-primary);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.15);
}

.ahp-panel-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ahp-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ahp-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ahp-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-surface);
    min-height: 0;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.ahp-card.ahp-span-2 {
    grid-column: span 2;
}

.ahp-card-head,
.ahp-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.ahp-card-head h3,
.ahp-result-head strong {
    margin: 0;
    color: var(--text-primary);
    font-size: 21px;
    line-height: 1.2;
}

.ahp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ahp-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.ahp-span-2 {
    grid-column: span 2;
}

.ahp-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ahp-field-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ahp-builder-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ahp-builder-layout {
    display: grid;
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.ahp-layout-flipped {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

.ahp-builder-shell {
    border: 1px solid var(--border-color);
    border-radius: 26px;
    background: var(--bg-surface);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.ahp-side-reference .ahp-builder-shell {
    background: rgba(15, 23, 42, 0.3);
    border-style: dashed;
}

.ahp-side-reference .ahp-hierarchy-branch-card,
.ahp-side-reference .ahp-hierarchy-leaf-main {
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ahp-side-reference .ahp-hierarchy-branch-card:hover,
.ahp-side-reference .ahp-hierarchy-leaf-main:hover {
    border-color: var(--accent-blue);
    transform: scale(1.02);
}

.ahp-builder-shell-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid var(--border-color);
}

.ahp-builder-shell-head h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.ahp-builder-shell-head p {
    margin: 6px 0 0;
    max-width: 420px;
    color: #5f6f86;
    font-size: 14px;
    line-height: 1.45;
}

.ahp-builder-shell-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.ahp-builder-shell-editor .ahp-builder-shell-head {
    justify-content: flex-start;
}

.ahp-builder-shell-body {
    padding: 28px;
}

.ahp-builder-shell-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 28px 28px;
}

.ahp-builder-form-grid {
    gap: 18px 14px;
}

.ahp-builder-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.ahp-builder-field .filter-select-sm,
.ahp-builder-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
}

.ahp-rich-editor-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.ahp-rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 12px;
    z-index: 8;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    background: rgba(248, 252, 255, 0.94);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.ahp-rich-toolbar-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
}

.ahp-rich-editor {
    min-height: 260px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    outline: none;
    cursor: text;
    text-transform: none;
    letter-spacing: normal;
    font-size: 15px;
    font-weight: 500;
    padding: 16px 18px;
}

.ahp-rich-editor ul,
.ahp-rich-editor ol {
    margin: 0.25em 0 0.5em 1.1em;
    padding-left: 0.95em;
    list-style-position: outside;
}

.ahp-rich-editor li {
    margin: 0.2em 0;
}

.ahp-rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #7b8ba4;
}

.ahp-builder-field textarea.ahp-builder-input {
    min-height: 72px;
    resize: vertical;
}

.ahp-builder-field .filter-select-sm:focus,
.ahp-builder-input:focus {
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.ahp-builder-label {
    display: block;
}

.ahp-builder-level-display {
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
}

.ahp-builder-submit {
    min-width: 220px;
}

.ahp-builder-tree-body {
    max-height: 980px;
    overflow-y: auto;
}

.ahp-tree {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ahp-hierarchy-kicker {
    margin-bottom: 10px;
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ahp-hierarchy-goal {
    padding: 10px 4px 2px;
}

.ahp-hierarchy-goal-head strong {
    font-size: 28px;
    line-height: 1.15;
    color: var(--text-primary);
}

.ahp-hierarchy-goal-children {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}

.ahp-hierarchy-branch {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.ahp-hierarchy-branch-rail {
    width: 4px;
    min-height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb, #60a5fa);
    margin-top: 4px;
}

.ahp-hierarchy-branch-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ahp-hierarchy-branch-card {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.ahp-hierarchy-branch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ahp-hierarchy-branch-head strong {
    font-size: 18px;
    color: var(--text-primary);
}

.ahp-hierarchy-branch-children {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 16px;
}

.ahp-hierarchy-leaf {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.ahp-hierarchy-leaf-line {
    width: 2px;
    min-height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.7), rgba(96, 165, 250, 0.25));
    margin: 2px auto 0;
}

.ahp-hierarchy-leaf-main {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.ahp-hierarchy-leaf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ahp-hierarchy-leaf-head strong {
    font-size: 16px;
    color: var(--text-primary);
}

.ahp-survey-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.ahp-survey-link .form-input {
    min-width: 0;
}

.ahp-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.12);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

.public-survey-body {
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 48%, #fffaf1 100%);
    min-height: 100vh;
    height: auto;
    padding: 32px 16px 48px;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.public-survey {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.public-survey-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 10px 2px 4px;
}

.public-survey-brand {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b6f92;
}

.public-survey-title {
    margin: 6px 0 4px;
    font-size: 52px;
    line-height: 0.95;
    color: #153258;
    text-shadow: 0 10px 32px rgba(56, 189, 248, 0.12);
}

.public-survey-subtitle {
    margin: 0;
    max-width: 760px;
    color: #607594;
    font-size: 17px;
}

.public-survey-badge {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.24);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(186, 230, 253, 0.8));
    font-size: 12px;
    font-weight: 600;
    color: #22446e;
    box-shadow: 0 12px 24px rgba(56, 189, 248, 0.12);
}

.public-survey-card {
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(91, 111, 146, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.93));
    box-shadow:
        0 24px 60px rgba(21, 50, 88, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    display: none;
    flex-direction: column;
    gap: 18px;
}

.public-survey-card.active {
    display: flex;
}

.public-survey-card h2 {
    margin: 0;
    color: #153258;
    font-size: 36px;
    line-height: 1;
}

.public-survey-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.public-survey-overview-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.public-survey-meta-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #5f718e;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.10);
    background: rgba(255, 255, 255, 0.72);
}

.public-survey-meta-row--toggleable {
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.public-survey-meta-row--toggleable:hover,
.public-survey-meta-row--toggleable:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.public-survey-meta-row--survey {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(255, 255, 255, 0.84));
}

.public-survey-meta-title {
    color: #153258;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.public-survey-meta-body {
    color: #4f6484;
    font-size: 15px;
    line-height: 1.72;
    word-break: break-word;
}

.public-survey-meta-body ul,
.public-survey-meta-body ol {
    margin: 0.35em 0 0.6em 1.15em;
    padding-left: 0.95em;
    list-style-position: outside;
}

.public-survey-meta-body li {
    margin: 0.2em 0;
}

.public-survey-meta-body.is-collapsed {
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.public-survey-overview-toggle {
    align-self: flex-start;
    margin-top: 2px;
    padding: 0;
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.public-survey-overview-toggle:hover {
    color: #1d4ed8;
}

.public-survey-guidelines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 6px 0 4px;
}

.public-survey-guidelines-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(219, 234, 254, 0.68);
    color: #1f3b63;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
    position: relative;
    z-index: 2;
    pointer-events: auto;
    list-style: none;
    cursor: pointer;
}

.public-survey-guidelines-toggle::-webkit-details-marker {
    display: none;
}

.public-survey-guidelines[open] > .public-survey-guidelines-toggle {
    background: rgba(191, 219, 254, 0.88);
    border-color: rgba(59, 130, 246, 0.28);
}

.public-survey-guidelines-toggle-label {
    display: inline-flex;
    align-items: center;
}

.public-survey-guidelines-toggle-icon {
    font-size: 12px;
    transition: transform 0.18s ease;
}

.public-survey-guidelines[open] > .public-survey-guidelines-toggle .public-survey-guidelines-toggle-icon {
    transform: rotate(180deg);
}

.public-survey-guidelines-toggle:hover {
    background: rgba(191, 219, 254, 0.82);
}

.public-survey-guidelines-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.92));
}

.public-survey-guidelines-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.public-survey-keyfacts {
    display: grid;
    gap: 10px;
}

.public-survey-keyfact {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.72), rgba(255, 251, 235, 0.78));
    box-shadow: 0 14px 32px rgba(56, 189, 248, 0.10);
}

.public-survey-keyfact-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5f718e;
}

.public-survey-keyfact strong {
    color: #153258;
    font-size: 18px;
}

.public-survey-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.public-survey .btn-primary,
.public-survey .ghost-btn {
    min-height: 48px;
    border-radius: 16px;
    padding: 0 22px;
    font-weight: 700;
    font-size: 15px;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.public-survey .btn-primary {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #2563eb 55%, #7c3aed);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.24);
}

.public-survey .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(37, 99, 235, 0.28);
}

.public-survey .ghost-btn {
    border: 1px solid rgba(91, 111, 146, 0.22);
    color: #365074;
    background: rgba(255, 255, 255, 0.88);
}

.public-survey-note {
    color: #64748b;
    font-size: 13px;
}

.public-survey-error {
    display: none;
    color: #ef4444;
    font-size: 13px;
}

.public-survey-empty {
    color: #64748b;
    font-size: 14px;
}

.public-survey-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.public-survey-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #3b5477;
    font-size: 13px;
    font-weight: 600;
}

.public-survey-form .form-input {
    width: 100%;
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(91, 111, 146, 0.18);
    background: rgba(255, 255, 255, 0.94);
    color: #173257;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.public-survey-form .form-input:focus {
    border-color: rgba(37, 99, 235, 0.46);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.public-survey-form .form-input::placeholder {
    color: #7b8ba4;
    opacity: 1;
}

.public-survey-respondent-summary {
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.85), rgba(255, 255, 255, 0.96));
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.public-survey-respondent-name {
    font-size: 18px;
    font-weight: 700;
    color: #153258;
}

.public-survey-respondent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.public-survey-respondent-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(91, 111, 146, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

.public-survey-respondent-item span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #607594;
}

.public-survey-respondent-item strong {
    font-size: 14px;
    line-height: 1.45;
    color: #173257;
    word-break: break-word;
}

.public-survey-thanks-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.42);
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.98), rgba(236, 253, 245, 0.98));
    color: #14532d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.public-survey-thanks-greeting {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 4px;
}

.public-survey-thanks-message {
    font-size: 16px;
    line-height: 1.7;
    color: #0f2747;
    margin: 0 0 6px;
}

.public-survey-thanks-summary {
    margin-top: 4px;
}

.public-survey-thanks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.public-survey-thanks-item {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(91, 111, 146, 0.18);
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.public-survey-thanks-item span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #35516f;
}

.public-survey-thanks-item strong {
    font-size: 14px;
    line-height: 1.45;
    color: #0f2747;
}

.public-survey-thanks-note {
    margin-top: 8px;
    color: #1f3d61;
    font-size: 13px;
    line-height: 1.6;
}

.public-survey-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.public-survey-helper {
    color: #607594;
    font-size: 13px;
}

.public-survey-progress {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.32);
    background: linear-gradient(135deg, rgba(255, 249, 219, 0.9), rgba(255, 237, 213, 0.8));
    font-size: 12px;
    font-weight: 600;
    color: #7c5a00;
}

.public-survey-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.public-survey-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    border-radius: 14px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(255, 255, 255, 0.8));
    color: #1f3656;
    cursor: pointer;
    text-align: left;
    font: inherit;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.public-survey-group-toggle:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.public-survey-group-title {
    font-weight: 700;
    color: inherit;
    font-size: 16px;
}

.public-survey-group-toggle-icon {
    flex: 0 0 auto;
    color: #5b6f92;
    transition: transform 0.16s ease;
}

.public-survey-group.is-open .public-survey-group-toggle-icon {
    transform: rotate(180deg);
}

.public-survey-group-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.public-survey-question {
    border: 1px solid rgba(91, 111, 146, 0.12);
    border-radius: 20px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.public-survey-mobile-flow {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 6px;
}

.public-survey-mobile-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    background: rgba(239, 246, 255, 0.9);
}

.public-survey-mobile-progress-count {
    font-size: 12px;
    font-weight: 800;
    color: #1f3656;
}

.public-survey-mobile-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: #5b6f92;
    text-align: right;
}

.public-survey-mobile-frame {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(91, 111, 146, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.public-survey-mobile-question-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #5b6f92;
}

.public-survey-mobile-layer {
    font-weight: 700;
    color: #1f3656;
}

.public-survey-mobile-step {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(219, 234, 254, 0.74);
    border: 1px solid rgba(59, 130, 246, 0.12);
    font-weight: 700;
}

.public-survey-question-mobile {
    margin-bottom: 0;
    border-radius: 18px;
}

.public-survey-question-mobile .public-survey-question-head {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.public-survey-question-mobile .public-survey-question-vs {
    justify-self: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.public-survey-question-mobile .public-survey-question-label {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    justify-self: center;
    max-width: 100%;
}

.public-survey-question-mobile .public-survey-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.public-survey-mobile-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.public-survey-mobile-review {
    gap: 16px;
}

.public-survey-mobile-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.public-survey-mobile-review-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.public-survey-mobile-review-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #1f3656;
    letter-spacing: 0.01em;
}

.public-survey-mobile-review-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.public-survey-mobile-review-item {
    padding: 12px 12px 10px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    background: rgba(255, 255, 255, 0.9);
}

.public-survey-mobile-review-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.public-survey-mobile-review-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(219, 234, 254, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.12);
    color: #1f3656;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.public-survey-mobile-review-question {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: #1f3656;
    font-size: 14px;
    line-height: 1.5;
}

.public-survey-mobile-review-question strong {
    font-weight: 800;
}

.public-survey-mobile-review-vs {
    color: #5b6f92;
    font-weight: 700;
}

.public-survey-mobile-review-stat {
    padding: 12px 10px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    background: rgba(239, 246, 255, 0.88);
    text-align: center;
}

.public-survey-mobile-review-stat span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #5b6f92;
    margin-bottom: 4px;
}

.public-survey-mobile-review-stat strong {
    font-size: 22px;
    color: #1f3656;
}

.public-survey-mobile-review-note {
    color: #5f718e;
    font-size: 14px;
    line-height: 1.6;
}

.public-survey-question.missing {
    border-color: rgba(239, 68, 68, 0.42);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.94));
}

.public-survey-question-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.public-survey-question-label {
    font-weight: 600;
    color: #173257;
    font-size: 15px;
}

.public-survey-question-label.align-right {
    text-align: right;
}

.public-survey-question-label.has-definition {
    cursor: help;
    text-decoration: underline dotted #94a3b8;
    text-underline-offset: 4px;
    position: relative;
    display: inline-block;
    outline: none;
    z-index: 1;
}

.public-survey-question-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 260px;
    max-width: min(420px, 52vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.98);
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
}

.public-survey-question-tooltip::before {
    content: '';
    position: absolute;
    top: calc(100% - 2px);
    left: 16px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.98) transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 51;
}

.public-survey-question-label.align-right .public-survey-question-tooltip {
    left: auto;
    right: 0;
}

.public-survey-question-label.align-right .public-survey-question-tooltip::before {
    left: auto;
    right: 16px;
}

.public-survey-question-label.has-definition:hover .public-survey-question-tooltip,
.public-survey-question-label.has-definition:hover .public-survey-question-tooltip::before,
.public-survey-question-label.has-definition:focus-visible .public-survey-question-tooltip,
.public-survey-question-label.has-definition:focus-visible .public-survey-question-tooltip::before {
    opacity: 1;
    visibility: visible;
}

.public-survey-question-label.has-definition:hover,
.public-survey-question-label.has-definition:focus-visible {
    z-index: 6;
}

.public-survey-floating-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: min(420px, calc(100vw - 24px));
    min-width: 260px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.98);
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
    text-align: left;
    pointer-events: none;
}

.public-survey-floating-tooltip::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 16px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.98) transparent;
}

.public-survey-floating-tooltip[data-side="right"]::before {
    left: auto;
    right: 16px;
}

.public-survey-question-vs {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.08);
    color: #4f6b8f;
    font-size: 12px;
    font-weight: 700;
}

.public-survey-options {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(186, 230, 253, 0.18), rgba(255, 255, 255, 0.72) 50%, rgba(254, 240, 138, 0.18));
    border: 1px solid rgba(91, 111, 146, 0.10);
}

.public-survey-option {
    border: 1px solid rgba(91, 111, 146, 0.16);
    border-radius: 10px;
    min-height: 54px;
    padding: 5px 3px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: #607594;
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.public-survey-option:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 8px 18px rgba(56, 189, 248, 0.10);
}

.public-survey-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.public-survey-option-dot {
    width: 15px;
    height: 15px;
    border-radius: 999px;
    border: 2px solid rgba(91, 111, 146, 0.38);
    background: #fff;
    box-shadow: inset 0 0 0 3px transparent;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.public-survey-option-value {
    font-size: 10px;
    font-weight: 700;
    color: #4f6b8f;
}

.public-survey-option.left {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.96));
}

.public-survey-option.equal {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}

.public-survey-option.right {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.96));
}

.public-survey-option input[type="radio"]:checked+.public-survey-option-dot {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: inset 0 0 0 4px #2563eb;
}

.public-survey-option input[type="radio"]:checked~.public-survey-option-value {
    color: #153258;
}

.public-survey-scale-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.88));
}

.public-survey-scale-title {
    font-size: 15px;
    font-weight: 700;
    color: #153258;
}

.public-survey-scale-subtitle {
    color: #607594;
    font-size: 13px;
}

.public-survey-scale-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 8px;
}

.public-survey-scale-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    padding: 8px 6px;
    border-radius: 14px;
    border: 1px solid rgba(91, 111, 146, 0.12);
}

.public-survey-scale-item.left {
    background: rgba(219, 234, 254, 0.52);
}

.public-survey-scale-item.equal {
    background: rgba(241, 245, 249, 0.88);
}

.public-survey-scale-item.right {
    background: rgba(254, 249, 195, 0.58);
}

.public-survey-scale-value {
    font-size: 12px;
    font-weight: 700;
    color: #153258;
}

.public-survey-scale-text {
    font-size: 10px;
    line-height: 1.25;
    color: #607594;
}

@media (max-width: 900px) {
    .public-survey-header {
        flex-direction: column;
    }

    .public-survey-form {
        grid-template-columns: 1fr;
    }

    .public-survey-title {
        font-size: 40px;
    }

    .public-survey-overview {
        grid-template-columns: 1fr;
    }

    .public-survey-meta-title {
        font-size: 17px;
    }

    .public-survey-meta-body {
        font-size: 14px;
    }

    .public-survey-question-head {
        grid-template-columns: 1fr;
    }

    .public-survey-question-label.align-right {
        text-align: left;
    }

    .public-survey-question-vs {
        justify-self: start;
    }

    .public-survey-scale-grid,
    .public-survey-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-survey-group-toggle {
        position: sticky;
        top: 8px;
        z-index: 4;
        backdrop-filter: blur(10px);
    }

    .public-survey-group-panel {
        display: none;
    }

    .public-survey-group.is-open .public-survey-group-panel {
        display: flex;
    }

    .public-survey-group {
        gap: 8px;
    }

    .public-survey-group-toggle .public-survey-group-title {
        font-size: 22px;
        line-height: 1.15;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .public-survey-question-head {
        gap: 8px;
    }
}

.ahp-inline-check {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

.danger-soft {
    color: #f87171;
}

.ahp-helper-text,
.ahp-node-definition {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.ahp-status-badge,
.ahp-counter,
.ahp-node-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.10);
    color: var(--text-primary);
}

.ahp-status-badge.ok,
.ahp-consistency-chip.ok {
    border-color: rgba(74, 222, 128, 0.30);
    background: rgba(74, 222, 128, 0.10);
}

.ahp-status-badge.warn,
.ahp-consistency-chip.warn {
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.10);
}

.ahp-node-badge.goal {
    border-color: rgba(244, 114, 182, 0.30);
    background: rgba(244, 114, 182, 0.10);
}

.ahp-node-badge.criterion {
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.10);
}

.ahp-node-badge.subcriterion {
    border-color: rgba(167, 139, 250, 0.28);
    background: rgba(167, 139, 250, 0.10);
}

.ahp-list,
.ahp-questionnaire {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ahp-prep-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.ahp-candidate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ahp-candidate-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 280px;
}

.ahp-candidate-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.ahp-candidate-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.ahp-candidate-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ahp-candidate-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.ahp-source-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ahp-source-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--sidebar-bg);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.ahp-list-item,
.ahp-question-group,
.ahp-result-card {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ahp-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ahp-list-item.active {
    border-color: rgba(37, 99, 235, 0.22);
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.88), rgba(255, 255, 255, 0.98));
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.ahp-meta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.ahp-question-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ahp-question-group-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.ahp-question-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 12px;
    align-items: center;
}

.ahp-question-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-primary);
}

.ahp-consistency-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ahp-consistency-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.10);
}

.ahp-results-table td,
.ahp-results-table th {
    white-space: nowrap;
}

.ahp-group-results {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.ahp-divider {
    height: 1px;
    background: var(--border-color);
    opacity: 0.9;
}

.ahp-version-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.ahp-version-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
}

.ahp-alternative-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
}

.ahp-subcard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    min-width: 0;
}

.ahp-matrix-table-wrap {
    overflow-x: auto;
}

.ahp-matrix-table th,
.ahp-matrix-table td {
    white-space: normal;
    min-width: 140px;
}

.ahp-score-input {
    min-width: 110px;
}

.ahp-sensitivity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.ahp-sensitivity-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 1100px) {

    .ahp-summary-grid,
    .ahp-section-grid,
    .ahp-layout {
        grid-template-columns: 1fr;
    }

    .ahp-card.ahp-span-2 {
        grid-column: span 1;
    }

    .ahp-question-row {
        grid-template-columns: 1fr;
    }

    .ahp-prep-toolbar,
    .ahp-candidate-grid,
    .ahp-builder-layout {
        grid-template-columns: 1fr;
    }

    .ahp-builder-tree-body {
        max-height: none;
    }

    .ahp-alternative-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .project-modal-content {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 20px;
        gap: 18px;
    }

    .project-modal-header,
    .project-panel-header,
    .project-list-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .project-list-item-actions {
        width: 100%;
    }

    .project-modal-layout {
        grid-template-columns: 1fr;
    }

    .project-modal-user,
    .project-load-btn,
    .project-duplicate-btn,
    .project-rename-btn,
    .project-delete-btn {
        width: 100%;
    }

    .project-list-item-actions {
        grid-template-columns: 1fr;
    }

    .project-load-btn,
    .project-delete-btn {
        grid-column: auto;
    }

    .project-modal-footer {
        justify-content: stretch;
    }

    .project-modal-footer .ghost-btn {
        width: 100%;
    }

    .ahp-summary-grid {
        grid-template-columns: 1fr;
    }

    .ahp-panel-nav {
        padding: 12px;
    }

    .ahp-panel-tab {
        width: 100%;
        justify-content: space-between;
    }

    .ahp-form-grid {
        grid-template-columns: 1fr;
    }

    .ahp-span-2 {
        grid-column: span 1;
    }

    .ahp-builder-shell-head,
    .ahp-builder-shell-footer,
    .ahp-list-item,
    .ahp-card-head,
    .ahp-result-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ahp-builder-shell-body,
    .ahp-builder-shell-head,
    .ahp-builder-shell-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .ahp-hierarchy-branch,
    .ahp-hierarchy-leaf {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ahp-hierarchy-branch-rail,
    .ahp-hierarchy-leaf-line {
        width: 100%;
        height: 3px;
        min-height: 3px;
        margin: 0;
    }
}

/* AHP Bulk Tooltip Editor */
.ahp-bulk-tooltip-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
}

.ahp-bulk-table {
    width: 100%;
    border-collapse: collapse;
}

.ahp-bulk-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    z-index: 1;
}

.ahp-bulk-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #1e293b;
}

.ahp-bulk-node-info {
    background: #f8fafc;
    min-width: 200px;
}

.ahp-bulk-node-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.ahp-bulk-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    font-size: 13px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    transition: border-color 0.15s ease;
}

.ahp-bulk-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* AHP Results Dashboard Extensions */
.ahp-results-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 30px;
}

.ahp-results-dashboard .ahp-summary-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-dark) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.ahp-summary-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.ahp-summary-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-blue);
}

.ahp-summary-big {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ahp-top-factors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.ahp-factor-badge {
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.2);
    color: var(--accent-purple);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ahp-charts-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    min-height: 400px;
}

.ahp-chart-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.ahp-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ahp-chart-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ahp-chart-filter label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

.ahp-chart-target {
    width: 100%;
    height: 350px;
}
