/* Respondent Experience Styles - SurveyOps */
/* Version 2.1.0 - Unified layout with code review improvements */

/* Generic Hidden Class */
.hidden {
    display: none !important;
}

/* Survey Selector Row - inline layout */
.survey-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.survey-selector-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.survey-label {
    font-weight: 500;
    font-size: 0.9em;
    color: var(--text-primary);
    white-space: nowrap;
}

.survey-select {
    width: 300px;
    padding: 6px 10px;
    font-size: 0.875em;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.survey-select:hover {
    border-color: var(--primary-light);
    background: var(--bg-light);
}

.survey-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.12);
    background: var(--bg-white);
}

/* Date Filter Group */
.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter-label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.875em;
}

.date-input {
    padding: 6px 10px;
    font-size: 0.875em;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    width: 125px;
}

.date-input:hover {
    border-color: var(--primary-light);
    background: var(--bg-light);
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.12);
    background: var(--bg-white);
}

.date-separator {
    color: var(--text-secondary);
    font-size: 0.875em;
}

.date-reset-btn {
    padding: 6px 10px;
    font-size: 0.875em;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.date-reset-btn:hover {
    border-color: var(--error-red);
    color: var(--error-red);
    background: var(--bg-error-light);
}

/* Refresh Button */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.refresh-btn:hover {
    background: var(--primary-blue-dark, #005a9e);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.refresh-btn .btn-icon {
    font-size: 1.1em;
}

.refresh-btn .btn-icon.spinning {
    display: inline-block;
    animation: hourglass-flip 1s ease-in-out infinite;
}

@keyframes hourglass-flip {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

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

/* Refresh button group with status inline */
.refresh-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.last-updated {
    color: var(--text-secondary);
    font-size: 0.8em;
    font-style: italic;
}

.last-updated:empty {
    display: none;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-range-status {
    color: var(--text-secondary);
    font-size: 0.8em;
    white-space: nowrap;
    padding-left: 2px;
}

.date-range-status:empty {
    display: none;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 8px;
}

.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card.success {
    border-left: 4px solid var(--success-green);
}

.summary-card.info {
    border-left: 4px solid var(--primary-blue);
}

.summary-card.warning {
    border-left: 4px solid var(--warning-orange);
}

.summary-card.data-range {
    border-left: 4px solid #6366f1;
}

/* Outlier indicator warning */
.outlier-indicator {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem 0;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: var(--radius-sm);
    color: #9a3412;
    font-size: 0.875rem;
    cursor: help;
}

.outlier-indicator:hover {
    background: #ffedd5;
}

.summary-card.data-range .card-value {
    font-size: 1em;
    line-height: 1.3;
}

.summary-card.data-range .date-to {
    font-size: 0.75em;
    color: var(--text-tertiary);
    font-weight: 400;
}

.card-icon {
    font-size: 1.5em;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
}

.card-content {
    flex: 1;
}

.card-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-label {
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-top: 2px;
}

/* Tabs */
.tabs-container {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.tabs {
    display: flex;
    gap: 2px;
}

.tab {
    padding: 12px 20px;
    font-size: 0.9375em;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
    box-shadow: none;
}

.tab:hover {
    color: var(--primary-blue);
    background: transparent;
}

.tab:focus {
    outline: none;
    box-shadow: none;
}

.tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background: transparent;
    box-shadow: none;
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease-out;
}

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

/* Section Header */
.section-header {
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.2em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.section-header-spacing {
    margin-top: 32px;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-white);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.data-table th {
    background: var(--bg-gray);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.data-table th.sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.data-table th.sortable:hover {
    background: var(--border-light);
}

.data-table th.sortable::after {
    content: ' ↕';
    color: var(--text-muted);
    font-size: 0.8em;
}

.data-table th.sorted-asc::after {
    content: ' ↑';
    color: var(--primary-blue);
}

.data-table th.sorted-desc::after {
    content: ' ↓';
    color: var(--primary-blue);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-light);
}

/* Time indicators */
.time-fast {
    color: var(--success-green);
    font-weight: 600;
}

.time-medium {
    color: var(--warning-orange);
    font-weight: 600;
}

.time-slow {
    color: var(--error-red);
    font-weight: 600;
}

/* Drop-off indicators */
.dropoff-low {
    color: var(--success-green);
}

.dropoff-medium {
    color: var(--warning-orange);
}

.dropoff-high {
    color: var(--error-red);
    font-weight: 600;
}

/* Answer rate indicators */
.answer-high {
    color: var(--success-green);
}

.answer-medium {
    color: var(--warning-orange);
}

.answer-low {
    color: var(--error-red);
    font-weight: 600;
}

/* ============================================
   Question Table (Survey Structure Page)
   ============================================ */

.question-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.question-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.question-table th {
    background: var(--bg-gray);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.question-table th:hover {
    background: var(--border-light);
}

.question-table th.sorted-asc::after {
    content: ' ↑';
    color: var(--primary-blue);
}

.question-table th.sorted-desc::after {
    content: ' ↓';
    color: var(--primary-blue);
}

.question-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.question-table tr:hover td {
    background: var(--bg-light);
}

.question-table .col-order {
    width: 50px;
    text-align: center;
    color: var(--text-secondary);
}

.question-table .col-id {
    width: 100px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.question-table .col-text {
    min-width: 200px;
    max-width: 350px;
}

.question-table .col-type {
    width: 140px;
}

.question-table .col-reached,
.question-table .col-answer-rate,
.question-table .col-drop-rate {
    width: 90px;
    text-align: right;
}

/* Type Badge */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.type-badge .type-icon {
    font-size: 1rem;
}

/* Rate Badges */
.rate-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    font-weight: 500;
}

.rate-badge.good {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-green);
}

.rate-badge.warning {
    background: rgba(255, 193, 7, 0.15);
    color: var(--warning-orange);
}

.rate-badge.medium {
    background: rgba(255, 193, 7, 0.15);
    color: var(--warning-orange);
}

.rate-badge.high {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-red);
    font-weight: 600;
}

/* Block Header Row */
.block-header-row td {
    background: var(--bg-gray) !important;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.block-header {
    font-size: 0.9rem;
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9em;
    color: #1565c0;
}

.info-banner .info-icon {
    flex-shrink: 0;
}

.info-banner a {
    color: #0d47a1;
    text-decoration: underline;
}

.info-banner a:hover {
    color: #1976d2;
}

/* Funnel Visualization */
.funnel-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

/* Overview Stats */
.funnel-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.funnel-stat {
    text-align: center;
    padding: 12px 24px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    min-width: 120px;
}

.funnel-stat-number {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-blue);
}

.funnel-stat-drops .funnel-stat-number {
    color: var(--error-red);
}

.funnel-stat-complete .funnel-stat-number {
    color: var(--success-green);
}

.funnel-stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Response breakdown within drop-off stat */
.funnel-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    font-size: 0.75em;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.breakdown-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-xs, 3px);
    cursor: help;
}

.breakdown-item.abandoned {
    color: var(--warning-orange, #ed6c02);
    background: rgba(237, 108, 2, 0.1);
}

.breakdown-item.closed {
    color: var(--text-secondary);
    background: var(--bg-gray);
}

.funnel-stat-arrow {
    font-size: 1.5em;
    color: var(--text-muted);
}

/* Drop-off Table */
.dropoff-table {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.dropoff-header {
    display: grid;
    grid-template-columns: 1fr 70px 80px 90px 70px 120px;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-gray);
    font-weight: 600;
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropoff-row {
    display: grid;
    grid-template-columns: 1fr 70px 80px 90px 70px 120px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}

.dropoff-row:last-child {
    border-bottom: none;
}

.dropoff-row:hover {
    background: var(--bg-gray);
}

.dropoff-col-q {
    font-size: 0.9em;
    color: var(--text-primary);
    line-height: 1.4;
}

.dropoff-seq {
    color: var(--text-muted);
    margin-right: 4px;
    font-weight: 600;
}

.dropoff-qid {
    font-size: 0.75em;
    color: var(--text-muted);
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    margin-right: 8px;
    font-family: monospace;
}

.critical-qid {
    font-size: 0.7em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    margin-right: 8px;
    font-family: monospace;
}

.dropoff-col-reached,
.dropoff-col-answered,
.dropoff-col-dropped {
    text-align: center;
    font-weight: 500;
    font-size: 0.9em;
}

.dropoff-col-answer-rate {
    text-align: center;
}

.answer-rate-value {
    font-weight: 600;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.answer-rate-value.high {
    color: var(--success-green);
    background: rgba(16, 124, 16, 0.1);
}

.answer-rate-value.medium {
    color: var(--warning-orange);
    background: rgba(255, 140, 0, 0.1);
}

.answer-rate-value.low {
    color: var(--error-red);
    background: rgba(220, 53, 69, 0.1);
}

.dropoff-col-rate {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropped-count {
    font-weight: 600;
}

.dropped-count.low {
    color: #f57c00;
}

.dropped-count.medium {
    color: var(--warning-orange);
}

.dropped-count.high {
    color: var(--error-red);
}

.rate-bar-container {
    height: 6px;
    background: var(--bg-gray);
    border-radius: 3px;
    overflow: hidden;
}

.rate-bar {
    height: 100%;
    border-radius: 3px;
}

.rate-bar.low {
    background: #ffb74d;
}

.rate-bar.medium {
    background: var(--warning-orange);
}

.rate-bar.high {
    background: var(--error-red);
}

.rate-value {
    font-size: 0.85em;
    font-weight: 600;
}

.rate-value.low {
    color: #f57c00;
}

.rate-value.medium {
    color: var(--warning-orange);
}

.rate-value.high {
    color: var(--error-red);
}

.no-drops {
    color: var(--text-muted);
    text-align: center;
}

.dropoff-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Responsive: Stack columns on smaller screens */
@media (max-width: 900px) {

    .dropoff-header,
    .dropoff-row {
        grid-template-columns: 1fr 60px 70px 70px 60px 100px;
        font-size: 0.8em;
    }
}

/* Critical Points */
.critical-points {
    display: grid;
    gap: 16px;
}

.critical-point-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--error-red);
}

.critical-rank {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--error-red);
    min-width: 40px;
}

.critical-info {
    flex: 1;
    min-width: 0;
}

.critical-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.critical-stats {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.critical-rate {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--error-red);
}

/* ============================================
   SANKEY FLOW DIAGRAM
   ============================================ */

.sankey-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 24px;
    overflow-x: auto;
}

.sankey-svg {
    display: block;
    margin: 0 auto;
    min-width: 800px;
}

.sankey-node {
    cursor: default;
}

.sankey-node-rect {
    stroke: none;
}

.sankey-node-rect.start {
    fill: var(--primary-blue);
}

.sankey-node-rect.section {
    fill: #5c6bc0;
}

.sankey-node-rect.complete {
    fill: var(--success-green);
}

.sankey-node-rect.dropoff {
    fill: var(--error-red);
}

.sankey-node-label {
    font-size: 12px;
    font-weight: 600;
    fill: var(--text-primary);
    dominant-baseline: middle;
}

.sankey-node-value {
    font-size: 11px;
    fill: var(--text-secondary);
    dominant-baseline: middle;
}

.sankey-link {
    fill: none;
    stroke-opacity: 0.4;
    transition: stroke-opacity 0.2s ease;
}

.sankey-link:hover {
    stroke-opacity: 0.7;
}

.sankey-link.flow-continue {
    stroke: var(--primary-blue);
}

.sankey-link.flow-dropoff {
    stroke: var(--error-red);
}

.sankey-link.flow-complete {
    stroke: var(--success-green);
}

.sankey-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.sankey-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.sankey-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.sankey-legend-color.start {
    background: var(--primary-blue);
}

.sankey-legend-color.section {
    background: #5c6bc0;
}

.sankey-legend-color.complete {
    background: var(--success-green);
}

.sankey-legend-color.dropoff {
    background: var(--error-red);
}

.sankey-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.sankey-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* ============================================
   SURVEY STRUCTURE TAB - Enhanced Styles
   ============================================ */

/* Structure Stats Grid */
.structure-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .structure-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .structure-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.structure-stat {
    text-align: center;
    padding: 20px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.structure-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.structure-stat.required {
    border-left: 3px solid var(--error-red);
}

.stat-icon {
    display: block;
    font-size: 1.5em;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 1.75em;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* Structure Panels - Two Column Layout */
.structure-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .structure-panels {
        grid-template-columns: 1fr;
    }
}

.structure-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.structure-panel h3 {
    margin: 0 0 16px 0;
    font-size: 1.1em;
    color: var(--text-primary);
}

/* Question Type Chart */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    margin-bottom: 16px;
}

.donut-chart {
    position: relative;
    width: 160px;
    height: 160px;
}

.donut-chart svg {
    transform: rotate(-90deg);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center .total-count {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.donut-center .total-label {
    font-size: 0.75em;
    color: var(--text-secondary);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-count {
    font-weight: 600;
    color: var(--text-primary);
}

/* Complexity Breakdown */
.complexity-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.complexity-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.complexity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 1.1em;
}

.complexity-details {
    flex: 1;
}

.complexity-label {
    font-size: 0.9em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.complexity-bar {
    height: 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    overflow: hidden;
}

.complexity-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.complexity-fill.low {
    background: var(--success-green);
}

.complexity-fill.medium {
    background: var(--warning-orange);
}

.complexity-fill.high {
    background: var(--error-red);
}

.complexity-value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Structure Sections */
.structure-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.structure-section h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    color: var(--text-primary);
}

.section-subtitle {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Section Header with Toggle */
.section-header-with-toggle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header-with-toggle h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    color: var(--text-primary);
}

.section-header-with-toggle .section-subtitle {
    margin: 0;
}

.toggle-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.toggle-checkbox:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

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

.toggle-label {
    font-weight: 500;
}

/* Logic Flow */
.logic-flow-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logic-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logic-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.logic-stat-icon {
    font-size: 1.1em;
}

.logic-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-blue);
}

.logic-stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Logic Groups */
.logic-group {
    margin-bottom: 20px;
}

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

.logic-group h4 {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.logic-group-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.95em;
}

.logic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logic-list li {
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary-blue);
}

.logic-list li strong {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    font-size: 0.95em;
}

.logic-list .logic-more {
    color: var(--text-muted);
    font-style: italic;
    background: transparent;
    padding-left: 14px;
    border-left: none;
}

.logic-rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.logic-rule {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-blue);
}

.logic-rule.skip-logic {
    border-left-color: var(--warning-orange);
}

.logic-rule.display-logic {
    border-left-color: var(--accent-purple);
}

.logic-rule.branch-logic {
    border-left-color: var(--success-green);
}

.logic-rule-icon {
    font-size: 1.2em;
}

.logic-rule-content {
    flex: 1;
}

.logic-rule-type {
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.logic-rule-description {
    font-size: 0.9em;
    color: var(--text-primary);
}

.no-logic-message {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
}

/* Blocks Container */
.blocks-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.block-group {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-gray);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background var(--transition-fast);
}

.block-header:hover {
    background: var(--border-light);
}

.block-toggle {
    font-size: 0.9em;
    transition: transform var(--transition-fast);
}

.block-group.collapsed .block-toggle {
    transform: rotate(-90deg);
}

.block-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.block-count {
    padding: 4px 10px;
    background: var(--bg-white);
    border-radius: var(--radius-full);
    font-size: 0.85em;
    color: var(--text-secondary);
}

.block-questions {
    display: flex;
    flex-direction: column;
}

.block-group.collapsed .block-questions {
    display: none;
}

/* Flat Questions List (no block grouping) */
.questions-flat-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* Question Items (Enhanced) */
.question-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.question-item:hover {
    background: var(--bg-gray);
}

.question-item:last-child {
    border-bottom: none;
}

.question-item.expanded {
    background: var(--bg-gray);
}

.question-number {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--text-secondary);
}

.question-item:hover .question-number,
.question-item.expanded .question-number {
    background: var(--border-light);
}

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

.question-text {
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.question-type {
    padding: 2px 8px;
    background: var(--bg-gray);
    border-radius: var(--radius-xs);
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.question-item:hover .question-type,
.question-item.expanded .question-type {
    background: var(--border-light);
}

.question-badge {
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.75em;
    font-weight: 500;
}

.question-badge.required {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-red);
}

.question-badge.conditional {
    background: rgba(123, 104, 238, 0.1);
    color: var(--accent-purple);
}

.question-badge.answer-rate {
    background: rgba(0, 120, 212, 0.1);
    color: var(--primary-blue);
}

.question-badge.answer-rate.high {
    background: rgba(16, 124, 16, 0.1);
    color: var(--success-green);
}

.question-badge.answer-rate.medium {
    background: rgba(255, 140, 0, 0.1);
    color: var(--warning-orange);
}

.question-badge.answer-rate.low {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-red);
}

.question-expand {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.question-item.expanded .question-expand {
    transform: rotate(180deg);
}

/* Question Details Panel */
.question-details {
    padding: 16px 20px 16px 68px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    display: none;
}

.question-details.visible {
    display: block;
}

.question-full-text {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.question-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.question-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.question-info-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.question-info-value {
    font-size: 0.9em;
    color: var(--text-primary);
    font-weight: 500;
}

.question-info-value.high {
    color: var(--success-green);
}

.question-info-value.medium {
    color: var(--warning-orange);
}

.question-info-value.low {
    color: var(--error-red);
}

.question-conditions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.question-conditions-title {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.question-condition-item {
    padding: 8px 12px;
    background: rgba(123, 104, 238, 0.1);
    border-radius: var(--radius-xs);
    font-size: 0.85em;
    color: var(--accent-purple);
    margin-bottom: 4px;
}

/* Legacy structure-info for backwards compatibility */
.structure-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Question List - Legacy */
.question-list {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.question-conditional {
    color: var(--accent-purple);
    font-size: 0.85em;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-secondary);
}

.no-data.hidden {
    display: none;
}

.no-data-icon {
    font-size: 4em;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-data-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.no-data-message {
    color: var(--text-muted);
}

/* No data message box with actions */
.no-data-message-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.no-data-message-box .no-data-icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-data-message-box .no-data-text {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 400px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.no-data-message-box .no-data-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.no-data-message-box .action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.no-data-message-box .action-btn:hover {
    border-color: var(--primary-blue);
    background: var(--bg-light);
}

.no-data-message-box .action-btn.primary {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.no-data-message-box .action-btn.primary:hover {
    background: var(--primary-blue-dark);
}

/* Structure-only notice banner */
.structure-only-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.structure-only-notice .notice-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.structure-only-notice .notice-content {
    flex: 1;
}

.structure-only-notice .notice-content strong {
    display: block;
    color: #1565c0;
    margin-bottom: 4px;
}

.structure-only-notice .notice-content p {
    color: #1976d2;
    font-size: 0.9em;
    margin: 0;
    line-height: 1.4;
}

.structure-only-notice .notice-dismiss {
    background: none;
    border: none;
    color: #1565c0;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.structure-only-notice .notice-dismiss:hover {
    opacity: 1;
}

/* Disabled tabs */
.tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab.disabled:hover {
    color: var(--text-secondary);
    background: transparent;
}

/* Muted summary cards (no data) */
.summary-card.muted {
    opacity: 0.6;
}

.summary-card.muted .card-value {
    color: var(--text-secondary);
}

/* Main Content */
.main-content.hidden {
    display: none;
}

/* Privacy Notice */
.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9em;
}

.privacy-icon {
    font-size: 1.2em;
}

/* Insufficient Data */
.insufficient-data {
    color: var(--text-muted);
    font-style: italic;
}

/* Conditional Questions */
.conditional-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.7em;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 6px;
    cursor: help;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.3);
}

.not-triggered {
    opacity: 0.6;
}

.not-triggered td {
    color: var(--text-muted);
}

.not-triggered-text {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9em;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-secondary);
    -webkit-user-select: none;
    user-select: none;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

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

/* ============================================
   TIMING DETAILS SECTION
   ============================================ */

.timing-details-section {
    background: var(--bg-light, #f8f9fa);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.timing-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.timing-details-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-primary);
}

.timing-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.8em;
    font-weight: 500;
    border-radius: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.timing-source-badge.timing-questions {
    background: #e6f4ea;
    border-color: #34a853;
    color: #137333;
}

.timing-source-badge.qualtrics-duration {
    background: #fef7e0;
    border-color: #f9ab00;
    color: #b06000;
}

/* Device Breakdown */
.device-breakdown {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.device-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-white);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    min-width: 120px;
}

.device-icon {
    font-size: 1.4em;
}

.device-count {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
}

.device-label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Timing by Device */
.timing-by-device {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.timing-device-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    min-width: 150px;
    flex: 1;
}

.timing-device-card h5 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.timing-device-card .timing-value {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

.timing-device-card .timing-detail {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Page Timings */
.page-timings-container {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    margin-top: 16px;
}

.page-timings-container h4 {
    margin: 0 0 4px 0;
    font-size: 1em;
    color: var(--text-primary);
}

.page-timings-note {
    margin: 0 0 12px 0;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.page-timings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-timing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-white);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.page-timing-seq {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
}

.page-timing-info {
    flex: 1;
    min-width: 0;
}

.page-timing-label {
    font-size: 0.9em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-timing-questions {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-timing-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
}

.page-timing-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.page-timing-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.page-timing-stat-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Timing indicator in table */
.timing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.timing-indicator .timing-icon {
    font-size: 0.8em;
    opacity: 0.7;
}

.timing-indicator .timing-icon.has-timing {
    color: #34a853;
}

/* ============================================
   TIMING ANALYSIS TAB STYLES
   ============================================ */

/* Timing Overview Stats Grid */
.timing-overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.timing-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timing-stat-card .stat-icon {
    font-size: 1.5em;
    opacity: 0.8;
}

.timing-stat-card .stat-content {
    display: flex;
    flex-direction: column;
}

.timing-stat-card .stat-value {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--text-primary);
}

.timing-stat-card .stat-label {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Timing Sections */
.timing-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.timing-section h4 {
    margin: 0 0 16px 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
}

/* Timing Details Section - now always visible in its tab */
.timing-details-section {
    padding: 0;
    background: transparent;
    border: none;
}

.timing-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.timing-details-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
}

/* Data Quality Section */
.timing-data-quality {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-blue);
}

.timing-data-quality .quality-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.timing-data-quality .quality-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.timing-data-quality .quality-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.timing-data-quality .quality-stat .label {
    color: var(--text-muted);
}

.timing-data-quality .quality-stat .value {
    font-weight: 500;
    color: var(--text-primary);
}

.timing-data-quality .quality-note {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
}

/* No timing data state */
.no-timing-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-medium);
}

.no-timing-data .icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-timing-data .title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.no-timing-data .message {
    font-size: 0.9em;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.5;
}

.no-timing-data .message a {
    color: var(--primary-blue);
    text-decoration: none;
}

.no-timing-data .message a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE - Consolidated Media Queries (768px)
   ============================================ */
@media (max-width: 768px) {

    /* Survey selector */
    .survey-selector-container {
        flex-direction: column;
        align-items: stretch;
    }

    .survey-select {
        min-width: 100%;
    }

    /* Summary cards */
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
    }

    .tab {
        white-space: nowrap;
    }

    /* Funnel */
    .funnel-label {
        min-width: 120px;
        font-size: 0.8em;
    }

    .funnel-count {
        min-width: 80px;
    }

    /* Timing */
    .timing-overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .timing-stat-card {
        padding: 12px;
    }

    .timing-stat-card .stat-value {
        font-size: 1.1em;
    }

    /* Device breakdown */
    .device-breakdown {
        gap: 12px;
    }

    .device-stat {
        min-width: 100px;
        padding: 8px 12px;
    }

    .timing-by-device {
        flex-direction: column;
    }

    .page-timing-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-timing-stats {
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
    }
}

/* ============================================
   RESPONSIVE - Consolidated Media Queries (480px)
   ============================================ */
@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 1.5em;
    }

    .timing-overview-stats {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONDENT ATTRIBUTES TAB STYLES
   ============================================ */

.attributes-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.attributes-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 180px;
    flex: 1;
    max-width: 250px;
}

.attributes-stat .stat-icon {
    font-size: 1.5em;
}

.attributes-stat .stat-value {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--text-primary);
}

.attributes-stat .stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-left: auto;
}

.attributes-stat.recipient {
    border-left: 4px solid var(--primary-blue);
}

.attributes-stat.custom {
    border-left: 4px solid var(--success-green);
}

.attributes-info {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.attributes-info p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.attributes-info p:not(:last-child) {
    margin-bottom: 8px;
}

.attributes-info p strong {
    color: var(--text-primary);
}

.attributes-list-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.attributes-table {
    width: 100%;
    border-collapse: collapse;
}

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

.attributes-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.attributes-table td {
    font-size: 0.9em;
    color: var(--text-primary);
}

.attributes-table tbody tr:hover {
    background: var(--bg-light);
}

.attributes-table tbody tr:last-child td {
    border-bottom: none;
}

.attribute-field-name {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--primary-blue);
    font-weight: 500;
}

.attribute-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.attribute-source.recipient {
    background: rgba(0, 120, 212, 0.1);
    color: var(--primary-blue);
}

.attribute-source.custom {
    background: rgba(16, 124, 16, 0.1);
    color: var(--success-green);
}

.attribute-default-value {
    color: var(--text-muted);
    font-style: italic;
}

.attribute-default-value.has-value {
    color: var(--text-primary);
    font-style: normal;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Possible Values Tags */
.possible-values-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    max-height: 52px;
    /* Approximately 2 lines */
    overflow: hidden;
}

.possible-value-tag {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    font-size: 0.8em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.possible-value-more {
    display: inline-block;
    padding: 2px 6px;
    background: var(--primary-blue);
    color: white;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: help;
    line-height: 1.4;
}

.no-attributes {
    text-align: center;
    padding: 48px 24px;
}

.no-attributes-icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-attributes-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.no-attributes-message {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Responsive adjustments for attributes */
@media (max-width: 768px) {
    .attributes-summary {
        flex-direction: column;
    }

    .attributes-stat {
        max-width: none;
    }

    .attributes-table th,
    .attributes-table td {
        padding: 10px 12px;
    }

    .attributes-table th:nth-child(3),
    .attributes-table td:nth-child(3) {
        display: none;
        /* Hide possible values column on mobile */
    }
}

/* ============================================
   PATH ANALYSIS TAB STYLES
   ============================================ */

/* Path Summary Stats */
.path-summary-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.path-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    min-width: 140px;
    flex: 1;
    transition: all var(--transition-fast);
}

.path-stat:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.path-stat .stat-icon {
    font-size: 1.5em;
    margin-bottom: 8px;
}

.path-stat .stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.path-stat .stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* No Branching Notice */
.no-branching-notice {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid var(--primary-blue);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.no-branching-notice .notice-icon {
    font-size: 2.5em;
}

.no-branching-notice .notice-content strong {
    display: block;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.no-branching-notice .notice-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Path Section */
.path-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.path-section h3 {
    margin: 0 0 4px 0;
    font-size: 1.1em;
    color: var(--text-primary);
}

.path-section .section-subtitle {
    margin: 0 0 16px 0;
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Path Cards */
.path-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.path-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.path-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.path-card.selected {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
}

.path-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.path-card-title {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.3;
}

.path-card-badge {
    background: var(--primary-blue);
    color: white;
    font-size: 0.75em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.path-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.path-card-stat {
    text-align: center;
}

.path-card-stat-value {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary);
}

.path-card-stat-label {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.path-card-stat.good .path-card-stat-value {
    color: var(--success-green);
}

.path-card-stat.warning .path-card-stat-value {
    color: var(--warning-orange);
}

.path-card-stat.danger .path-card-stat-value {
    color: var(--danger-red);
}

.path-card-questions {
    font-size: 0.8em;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
    margin-top: 4px;
}

.path-card-questions-label {
    font-weight: 600;
    margin-bottom: 6px;
}

.distinctive-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.distinctive-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

.distinctive-tag.included {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.distinctive-tag.excluded {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Decision Points List */
.decision-points-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Survey Flow Diagram */
.diagram-controls {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.diagram-zoom-controls {
    display: flex;
    gap: 4px;
}

.diagram-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* @keyframes spin - defined in main.css */

.diagram-btn {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.diagram-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.diagram-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.diagram-btn.active:hover {
    background: var(--primary-blue-dark, #0056b3);
    border-color: var(--primary-blue-dark, #0056b3);
}

.mermaid-container {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    min-height: 300px;
    max-height: 800px;
    overflow: auto;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    cursor: grab;
}

/* Structure-only info banner */
.structure-only-banner {
    margin: 16px 16px 0 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f7ff 100%);
    border: 1px solid #b3d7ff;
    border-radius: var(--radius-sm);
    color: #0056b3;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.structure-only-banner i {
    font-size: 1.1em;
}

.structure-only-banner strong {
    margin-right: 4px;
}

.mermaid-container .mermaid {
    display: block;
    padding: 8px;
    min-width: 100%;
}

/* Ensure SVG doesn't get clipped and aligns to top */
.mermaid-container .mermaid svg {
    display: block;
    overflow: visible;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.mermaid-container.panning {
    cursor: grabbing;
}

.mermaid-container svg {
    max-width: none;
    height: auto;
    transition: transform 0.1s ease;
    overflow: visible;
    display: block;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Node labels - properly contained with padding */
.mermaid-container svg .nodeLabel {
    font-size: 11px !important;
    font-weight: 400 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Edge labels (numbers on arrows) */
.mermaid-container svg .edgeLabel {
    font-size: 11px !important;
    font-weight: 500 !important;
}

/* Node styling - larger boxes */
.mermaid-container svg .node .label {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

/* foreignObject needs height 100% to allow flex centering */
.mermaid-container svg .node foreignObject {
    overflow: visible !important;
}

.mermaid-container svg .node foreignObject>div {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
}

/* Span inside the div also needs centering */
.mermaid-container svg .node foreignObject>div>span {
    display: block !important;
    text-align: center !important;
}

/* Larger minimum node sizing */
.mermaid-container svg .node rect,
.mermaid-container svg .node polygon {
    min-width: 180px;
    min-height: 50px;
}

/* Clickable nodes */
.mermaid-container .node rect,
.mermaid-container .node circle,
.mermaid-container .node ellipse,
.mermaid-container .node polygon,
.mermaid-container .node path {
    cursor: pointer;
}

/* Structure-only nodes - dashed border style */
.mermaid-container svg .node.structureOnly rect,
.mermaid-container svg .node.structureOnly polygon {
    stroke-dasharray: 4, 3;
    stroke-width: 1.5px;
}

.no-diagram-data,
.diagram-error {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-style: italic;
}

.diagram-error {
    color: var(--danger-red);
}

/* Diagram Tooltip */
.diagram-tooltip {
    position: fixed;
    z-index: 10000;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    max-width: 400px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    font-size: 0.9em;
}

.diagram-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.tooltip-header {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-family: monospace;
}

.tooltip-question {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.tooltip-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.tooltip-stat {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.tooltip-badge {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.tooltip-badge.start {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}

.tooltip-badge.end {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
}

.tooltip-badge.decision {
    background: rgba(239, 108, 0, 0.1);
    color: #ef6c00;
}

.tooltip-paths {
    font-size: 0.9em;
}

.tooltip-paths-header {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.tooltip-path {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 4px;
    padding: 4px 0;
}

.tooltip-path-arrow {
    color: var(--primary-color);
    flex-shrink: 0;
}

.tooltip-path-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.3;
}

.tooltip-path-count {
    color: var(--text-secondary);
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Branch explanation box */
.tooltip-branch-explanation {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg-light);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--border-medium);
}

.tooltip-branch-explanation .branch-icon {
    font-size: 1.4em;
    flex-shrink: 0;
}

.tooltip-branch-explanation .branch-text {
    flex: 1;
    font-size: 0.9em;
    line-height: 1.4;
}

.tooltip-branch-explanation .branch-detail {
    color: var(--text-secondary);
    font-weight: normal;
}

/* Path type styling */
.tooltip-path.path-routing {
    border-left: 2px solid #9c27b0;
    padding-left: 8px;
    margin-left: -8px;
    background: rgba(156, 39, 176, 0.03);
}

.tooltip-path.path-routing .tooltip-path-arrow {
    color: #9c27b0;
}

.tooltip-path.path-conditional {
    border-left: 2px solid #ff9800;
    padding-left: 8px;
    margin-left: -8px;
    background: rgba(255, 152, 0, 0.03);
}

.tooltip-path.path-conditional .tooltip-path-arrow {
    color: #ff9800;
}

/* Path note badge */
.path-note {
    display: inline-block;
    font-size: 0.75em;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.path-note.routing {
    background: rgba(156, 39, 176, 0.12);
    color: #7b1fa2;
}

.path-note.conditional {
    background: rgba(255, 152, 0, 0.12);
    color: #e65100;
}

/* Structure-only mode styling (no response data) */
.tooltip-stat.structure-only {
    color: var(--text-secondary);
    font-style: italic;
}

.structure-note {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.4;
}

.decision-point-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.decision-point-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.decision-point-question {
    flex: 1;
}

.decision-point-seq {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.decision-point-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.decision-point-logic {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.8em;
    color: var(--text-secondary);
}

.branch-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.branch-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.branch-option:hover {
    border-color: var(--primary-blue);
}

.branch-arrow {
    font-size: 1.2em;
    color: var(--text-muted);
}

.branch-target {
    flex: 1;
}

.branch-target-text {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9em;
}

.branch-target-id {
    font-size: 0.75em;
    color: var(--text-muted);
    font-family: 'Consolas', 'Monaco', monospace;
}

.branch-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.branch-stat {
    text-align: center;
}

.branch-stat-value {
    font-weight: 700;
    font-size: 1em;
    color: var(--text-primary);
}

.branch-stat-label {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.branch-bar {
    width: 80px;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
}

.branch-bar-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Question Flow Table */
.question-flow-table-container {
    overflow-x: auto;
}

.question-flow-table {
    width: 100%;
}

.question-flow-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-medium);
}

.question-flow-table td {
    padding: 10px 12px;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-light);
}

.question-flow-table tr:hover {
    background: var(--bg-light);
}

.question-flow-table tr.conditional {
    background: rgba(251, 191, 36, 0.05);
}

.question-flow-table tr.conditional:hover {
    background: rgba(251, 191, 36, 0.1);
}

.flow-seq {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9em;
}

.flow-question-id {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8em;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.flow-question-id:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.flow-question {
    max-width: 400px;
}

.flow-question-text {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.flow-conditional-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--warning-orange);
    color: white;
    border-radius: 50%;
    font-size: 0.7em;
    font-weight: 700;
}

.flow-question-type {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 2px;
}

.coverage-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coverage-bar-bg {
    width: 60px;
    height: 8px;
    background: var(--bg-medium);
    border-radius: 4px;
    overflow: hidden;
}

.coverage-bar-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.coverage-bar-fill.full {
    background: var(--success-green);
}

.coverage-bar-fill.partial {
    background: var(--warning-orange);
}

.coverage-bar-fill.low {
    background: var(--danger-red);
}

.coverage-value {
    font-weight: 600;
    font-size: 0.9em;
    min-width: 45px;
}

.respondent-count {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 2px;
    text-align: center;
}

.flow-respondents {
    min-width: 100px;
}

.flow-dropoff {
    font-weight: 500;
}

.flow-dropoff.low {
    color: var(--success-green);
}

.flow-dropoff.medium {
    color: var(--warning-orange);
}

.flow-dropoff.high {
    color: var(--danger-red);
}

.flow-paths {
    font-weight: 500;
    color: var(--text-primary);
}

/* Empty State */
.path-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.path-empty-state .empty-icon {
    font-size: 3em;
    margin-bottom: 12px;
    opacity: 0.5;
}

.path-empty-state .empty-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.path-empty-state .empty-message {
    font-size: 0.9em;
}

/* ============================================
   PATH CARD HOVER TOOLTIP WITH MINI DIAGRAM
   ============================================ */

.path-card-tooltip {
    position: fixed;
    z-index: 10001;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 0;
    width: 400px;
    height: 650px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.path-card-tooltip.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.path-tooltip-header {
    background: linear-gradient(135deg, var(--primary-blue), #1565c0);
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.path-tooltip-diagram {
    padding: 12px;
    background: var(--bg-light);
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.path-tooltip-diagram svg {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

.path-tooltip-diagram svg {
    max-width: 100%;
    height: auto;
}

.mini-diagram-empty,
.mini-diagram-error {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85em;
    padding: 30px 20px;
    font-style: italic;
}

.mini-diagram-error {
    color: var(--danger-red);
}

/* Mini diagram node styling overrides */
.path-tooltip-diagram .node text {
    font-size: 9px !important;
}

.path-tooltip-diagram .edgeLabel {
    font-size: 8px !important;
}

/* ============================================
   PATH HIGHLIGHTING IN DIAGRAM
   ============================================ */

/* Selected path card state */
.path-card-selected {
    border-color: var(--primary-blue) !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2), var(--shadow-md) !important;
    transform: translateY(-2px) !important;
}

.path-card-selected .path-card-title {
    color: var(--primary-blue);
}

.path-card-selected .path-card-badge {
    background: #1565c0;
}

/* Diagram node highlighting */
.mermaid svg .node.path-highlighted rect,
.mermaid svg .node.path-highlighted polygon,
.mermaid svg .node.path-highlighted circle,
.mermaid svg .node.path-highlighted ellipse {
    stroke: var(--primary-blue) !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 6px rgba(0, 120, 212, 0.5));
}

.mermaid svg .node.path-highlighted .nodeLabel {
    font-weight: 700 !important;
}

.mermaid svg .node.path-dimmed {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.mermaid svg .node.path-dimmed rect,
.mermaid svg .node.path-dimmed polygon,
.mermaid svg .node.path-dimmed circle,
.mermaid svg .node.path-dimmed ellipse {
    fill: #e5e7eb !important;
    stroke: #d1d5db !important;
    stroke-width: 1px !important;
}

.mermaid svg .node.path-dimmed .nodeLabel {
    fill: #9ca3af !important;
    color: #9ca3af !important;
}

/* Diagram edge highlighting */
.mermaid svg .edgePath.edge-highlighted path {
    stroke: var(--primary-blue) !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 4px rgba(0, 120, 212, 0.5));
}

.mermaid svg .edgePath.edge-highlighted marker path {
    fill: var(--primary-blue) !important;
}

.mermaid svg .edgePath.edge-dimmed path,
.mermaid svg .edgePath.edge-dimmed path.path {
    stroke: #d1d5db !important;
    stroke-width: 1px !important;
    opacity: 1 !important;
}

.mermaid svg .edgePath.edge-dimmed marker,
.mermaid svg .edgePath.edge-dimmed marker path {
    fill: #d1d5db !important;
    stroke: #d1d5db !important;
}

/* Target arrow markers directly */
.mermaid svg .edge-dimmed defs marker path {
    fill: #d1d5db !important;
}

.mermaid svg .edgeLabel.edge-highlighted span {
    background: var(--primary-blue) !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.mermaid svg .edgeLabel.edge-dimmed span {
    background: #e5e7eb !important;
    color: #9ca3af !important;
}

/* Path card click hint */
.path-card-hint {
    font-size: 0.75em;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.path-card:hover .path-card-hint {
    opacity: 1;
}

.path-card.highlighted .path-card-hint {
    opacity: 1;
    color: var(--primary-blue);
}

.path-card.highlighted .path-card-hint::before {
    content: 'Click to clear highlight • ';
}

/* Path card highlighted state */
.path-card.highlighted {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2), var(--shadow-md) !important;
    transform: translateY(-2px) !important;
}

.path-card.highlighted .path-card-title {
    color: var(--primary-blue);
}

.path-card.highlighted .path-card-badge {
    background: #1565c0;
}

/* Add hint text when path card is clickable (backward compatibility) */
.path-card::after {
    content: 'Click to highlight path';
    display: block;
    font-size: 0.7em;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.path-card:hover::after {
    opacity: 1;
}

.path-card-selected::after {
    content: 'Click to clear highlight';
    opacity: 1;
    color: var(--primary-blue);
}

/* Drop-Off Analysis Card */
.dropoff-card {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.05) 0%, rgba(255, 152, 0, 0.05) 100%);
    border: 2px solid rgba(244, 67, 54, 0.3);
}

.dropoff-card:hover {
    border-color: var(--error-red);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(255, 152, 0, 0.08) 100%);
}

.dropoff-card.path-card-selected {
    border-color: var(--error-red);
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2), 0 4px 12px rgba(244, 67, 54, 0.3);
}

.dropoff-card::after {
    content: 'Click to highlight exit points';
}

.dropoff-card.path-card-selected::after {
    content: 'Click to clear highlights';
    color: var(--error-red);
}

.dropoff-card .path-letter {
    background: linear-gradient(135deg, var(--error-red), #ff7043);
    font-size: 1.2em;
}

.dropoff-card .path-badge {
    background: rgba(244, 67, 54, 0.15);
    color: var(--error-red);
}

/* Exit Points List in Drop-Off Card */
.dropoff-exit-points {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(244, 67, 54, 0.2);
}

.dropoff-exit-points h5 {
    font-size: 0.75em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exit-point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(244, 67, 54, 0.05);
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 0.8em;
}

.exit-point-item:last-child {
    margin-bottom: 0;
}

.exit-point-question {
    color: var(--text-secondary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exit-point-rate {
    font-weight: 600;
    color: var(--error-red);
}

.exit-point-rate.warning {
    color: var(--warning-orange);
}

.exit-point-rate.minor {
    color: var(--warning-yellow, #f59e0b);
}

/* Drop-Off Highlighting in Mermaid Diagram */
.mermaid svg .node.dropoff-critical rect,
.mermaid svg .node.dropoff-critical polygon,
.mermaid svg .node.dropoff-critical circle,
.mermaid svg .node.dropoff-critical ellipse {
    fill: rgba(244, 67, 54, 0.4) !important;
    stroke: #dc2626 !important;
    stroke-width: 4px !important;
}

.mermaid svg .node.dropoff-warning rect,
.mermaid svg .node.dropoff-warning polygon,
.mermaid svg .node.dropoff-warning circle,
.mermaid svg .node.dropoff-warning ellipse {
    fill: rgba(239, 68, 68, 0.3) !important;
    stroke: #ef4444 !important;
    stroke-width: 3px !important;
}

.mermaid svg .node.dropoff-minor rect,
.mermaid svg .node.dropoff-minor polygon,
.mermaid svg .node.dropoff-minor circle,
.mermaid svg .node.dropoff-minor ellipse {
    fill: rgba(248, 113, 113, 0.25) !important;
    stroke: #f87171 !important;
    stroke-width: 2.5px !important;
}

.mermaid svg .node.dropoff-ok rect,
.mermaid svg .node.dropoff-ok polygon,
.mermaid svg .node.dropoff-ok circle,
.mermaid svg .node.dropoff-ok ellipse {
    fill: #e5e7eb !important;
    stroke: #d1d5db !important;
    stroke-width: 1px !important;
    opacity: 1 !important;
}

.mermaid svg .node.dropoff-ok .nodeLabel {
    fill: #9ca3af !important;
    color: #9ca3af !important;
}

/* Drop-off node labels */
.mermaid svg .node.dropoff-critical .nodeLabel {
    font-weight: 700 !important;
    fill: #b91c1c !important;
}

.mermaid svg .node.dropoff-warning .nodeLabel {
    font-weight: 600 !important;
    fill: #dc2626 !important;
}

.mermaid svg .node.dropoff-minor .nodeLabel {
    font-weight: 500 !important;
    fill: #ef4444 !important;
}

/* Edges when drop-off highlighting is active */
.mermaid svg .edgePath.dropoff-dimmed path,
.mermaid svg .edgePath.dropoff-dimmed path.path {
    stroke: #d1d5db !important;
    stroke-width: 1px !important;
    opacity: 1 !important;
}

.mermaid svg .edgePath.dropoff-dimmed marker,
.mermaid svg .edgePath.dropoff-dimmed marker path {
    fill: #d1d5db !important;
    stroke: #d1d5db !important;
}

/* Drop-off percentage badges */
.mermaid svg .dropoff-badge .dropoff-badge-bg {
    opacity: 0.95;
}

.mermaid svg .dropoff-badge.dropoff-critical .dropoff-badge-bg {
    fill: #b91c1c;
}

.mermaid svg .dropoff-badge.dropoff-warning .dropoff-badge-bg {
    fill: #dc2626;
}

.mermaid svg .dropoff-badge.dropoff-minor .dropoff-badge-bg {
    fill: #ef4444;
}

.mermaid svg .dropoff-badge text {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    fill: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* =============================================================================
   Breadcrumb Navigation (Sub-pages)
============================================================================= */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-secondary);
}

/* =============================================================================
   Analysis Section Containers
============================================================================= */

.analysis-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.analysis-section .section-header {
    margin-bottom: 20px;
}

.analysis-section .section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.analysis-section .section-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* =============================================================================
   Critical Drop-Off Cards (Sub-page style)
============================================================================= */

.critical-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.critical-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--border-medium);
    transition: all var(--transition-fast);
}

.critical-card.high {
    border-left-color: var(--danger);
    background: rgba(220, 53, 69, 0.05);
}

.critical-card.medium {
    border-left-color: var(--warning);
    background: rgba(255, 193, 7, 0.05);
}

.critical-card.low {
    border-left-color: var(--success);
    background: rgba(40, 167, 69, 0.05);
}

.critical-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 36px;
}

.critical-content {
    flex: 1;
}

.critical-question {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.critical-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.critical-rate {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.critical-rate.high {
    color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.critical-rate.medium {
    color: var(--warning-dark);
    background: rgba(255, 193, 7, 0.1);
}

.critical-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* =============================================================================
   AI Insights Section
============================================================================= */

.insights-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

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

.insight-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-white);
}

.insight-card.warning {
    border-left: 4px solid var(--warning);
}

.insight-card.alert {
    border-left: 4px solid var(--danger);
}

.insight-card.info {
    border-left: 4px solid var(--primary-blue);
}

.insight-card.success {
    border-left: 4px solid var(--success);
}

.insight-icon {
    font-size: 1.5rem;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.insight-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.insight-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.insight-placeholder {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

.insight-placeholder span {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

/* =============================================================================
   Drop-Off Legend
============================================================================= */

.dropoff-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.high {
    background: var(--danger);
}

.legend-dot.medium {
    background: var(--warning);
}

.legend-dot.low {
    background: var(--success);
}

/* =============================================================================
   Loading & Empty States
============================================================================= */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 16px;
}

.loading-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 12px;
    text-align: center;
}

.error-icon {
    font-size: 2rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 8px;
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 400px;
}

/* =============================================================================
   Type Distribution Chart (Survey Structure)
============================================================================= */

.type-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.type-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.type-icon {
    font-size: 1.125rem;
}

.type-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.type-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.type-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-light));
    border-radius: var(--radius-sm);
    transition: width var(--transition-normal);
}

.type-value {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 80px;
    justify-content: flex-end;
}

.type-count {
    font-weight: 600;
    color: var(--text-primary);
}

.type-percent {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.type-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* =============================================================================
   Complexity Analysis Grid
============================================================================= */

.complexity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .complexity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.complexity-grid .complexity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.complexity-grid .complexity-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.complexity-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.complexity-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.2;
}

.complexity-percent {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =============================================================================
   Embedded Data Grid
============================================================================= */

.embedded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.embedded-card {
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.embedded-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-icon {
    font-size: 0.875rem;
}

.embedded-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.embedded-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* =============================================================================
   Diagram Error State
============================================================================= */

.diagram-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 12px;
    text-align: center;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.diagram-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

/* =============================================================================
   Decision Point Cards
============================================================================= */

.decision-point-card {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.decision-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.decision-icon {
    font-size: 1.25rem;
}

.decision-question {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.decision-branches {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 32px;
}

.decision-branch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    padding: 8px 12px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
}

.branch-condition {
    font-weight: 500;
    color: var(--primary-blue);
}

.branch-arrow {
    color: var(--text-muted);
}

.branch-target {
    color: var(--text-primary);
}

.branch-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.decision-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .mermaid-container svg .nodeLabel {
        font-size: 11px !important;
        max-width: 140px !important;
    }

    .path-cards {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .path-summary-stats {
        flex-direction: column;
    }

    .path-stat {
        min-width: auto;
    }

    .path-cards {
        grid-template-columns: 1fr;
    }

    .path-card-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .branch-stats {
        flex-direction: column;
        gap: 8px;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }

    .critical-card {
        flex-direction: column;
        gap: 8px;
    }

    .critical-rank {
        min-width: auto;
    }

    .type-row {
        flex-wrap: wrap;
    }

    .type-label {
        min-width: 100%;
    }

    .complexity-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mermaid responsive */
    .mermaid-container {
        min-height: 200px;
    }

    .mermaid-container svg .nodeLabel {
        font-size: 10px !important;
        max-width: 120px !important;
    }

    .structure-only-banner {
        margin: 12px;
        padding: 10px 12px;
        font-size: 0.85em;
        flex-wrap: wrap;
    }

    /* Decision points compact on mobile */
    .decision-point-card {
        padding: 12px;
    }

    .decision-point-header {
        flex-direction: column;
        gap: 8px;
    }

    .decision-point-logic {
        align-self: flex-start;
