/* 5 Whys Analysis Specific Styles */

/* Modal Styles */
.five-whys-modal.analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}



.five-whys-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.five-whys-modal-content::-webkit-scrollbar {
    display: none;
}


.five-whys-modal.analysis-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* Description Input Area Styles */
.description-input-area {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.description-input-area .input-group {
    margin-bottom: 0;
}

.description-input-area .input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.description-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.description-textarea:focus {
    border-color: #0A66C3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 102, 195, 0.1);
}

.description-input-area .input-help {
    margin-top: 0.5rem;
}

.description-input-area .input-help small {
    color: #64748b;
    font-size: 0.8rem;
    font-style: italic;
}

.five-whys-modal.analysis-modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
}

.five-whys-modal.analysis-modal .close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.five-whys-modal.analysis-modal .close-modal:hover {
    background: #718096;
}

.five-whys-modal.analysis-modal .modal-body {
    padding: 1.5rem;
}

.five-whys-modal.analysis-modal .input-group {
    margin-bottom: 1.5rem;
}

.five-whys-modal.analysis-modal .input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.five-whys-modal.analysis-modal .url-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.five-whys-modal.analysis-modal .url-input:focus {
    border-color: #0A66C3;
    outline: none;
}

.five-whys-modal.analysis-modal .input-help {
    margin-top: 0.5rem;
}

.five-whys-modal.analysis-modal .input-help small {
    color: #64748b;
    font-size: 0.8rem;
}

.five-whys-modal.analysis-modal .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.five-whys-modal.analysis-modal .cancel-btn,
.five-whys-modal.analysis-modal .analyze-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.five-whys-modal.analysis-modal .cancel-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #dee2e6;
}

.five-whys-modal.analysis-modal .cancel-btn:hover {
    background: #e9ecef;
}

.five-whys-modal.analysis-modal .analyze-btn {
    background: linear-gradient(135deg, #0A66C3, #1976D2);
    color: white;
}

.five-whys-modal.analysis-modal .analyze-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 102, 195, 0.3);
}

.five-whys-modal.analysis-modal .analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results Overlay */
.five-whys-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.five-whys-results-container {
    width: 100%;
    max-width: 99vw;
    max-height: 98vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.five-whys-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.five-whys-header.compact {
    padding: 0.75rem 1.5rem;
    display: none;
}

.five-whys-header.ultra-compact {
    padding: 0.5rem 1.5rem;
}

.five-whys-header .header-left h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
    color: white;
}

.five-whys-header.compact .header-left h2 {
    font-size: 0;
    height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
}

.five-whys-header .document-meta {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.five-whys-header.compact .document-meta {
    margin-top: 0;
}

.five-whys-header.ultra-compact .document-meta {
    font-size: 0;
    height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
}

.five-whys-header .document-title {
    font-size: 1rem;
    opacity: 0.9;
}

.five-whys-header.compact .document-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.five-whys-header .confidence-badge {
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.five-whys-header .header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.five-whys-header .export-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.five-whys-header .export-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.five-whys-header .export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.five-whys-header .close-results {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.five-whys-header .close-results:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Content Area */
.five-whys-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.five-whys-content .analysis-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.five-whys-content .analysis-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.five-whys-content .analysis-tab:hover {
    color: #0A66C3;
    background: rgba(10, 102, 195, 0.05);
}

.five-whys-content .analysis-tab.active {
    color: #0A66C3;
    border-bottom-color: #0A66C3;
    background: rgba(10, 102, 195, 0.05);
}

.five-whys-content .analysis-tab-content {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
}

.five-whys-content .tab-panel {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.five-whys-content .tab-panel.active {
    display: block;
}

/* Overview Panel */
.overview-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.overview-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.overview-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.overview-card h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.problem-card { border-left: 4px solid #ef4444; }
.solution-card { border-left: 4px solid #10b981; }
.completeness-card { border-left: 4px solid #0A66C3; }
.gap-card { border-left: 4px solid #f59e0b; }

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.type-badge.root-issue {
    background: #fee2e2;
    color: #dc2626;
}

.focus-level {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.level-number {
    background: #0A66C3;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.level-name {
    font-weight: 600;
    color: #374151;
}

.completeness-meter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meter-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 6px;
    transition: width 1s ease;
}

.meter-label {
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.gap-summary {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.gap-item {
    text-align: center;
}

.gap-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.gap-item.unaddressed .gap-count { color: #ef4444; }
.gap-item.addressed .gap-count { color: #10b981; }

.gap-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.overview-summary {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.overview-summary h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

/* 5 Whys Panel */
.five-whys-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.problem-statement-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0A66C3;
}

.problem-statement-card h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.problem-statement {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #374151;
}

.five-whys-table-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.five-whys-table-container h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.five-whys-table {
    display: flex;
    flex-direction: column;
}

.table-header {
    display: grid;
    grid-template-columns: 150px 1fr 2fr 150px;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #374151;
}

.table-row {
    display: grid !important;
    grid-template-columns: 150px 1fr 2fr 150px;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.table-row:hover {
    background: #f8fafc;
}

.level-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.level-indicator .level-number {
    background: #0A66C3;
    color: white;
    padding: 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.level-1 .level-number { background: #ef4444; }
.level-2 .level-number { background: #f59e0b; }
.level-3 .level-number { background: #0A66C3; }
.level-4 .level-number { background: #8b5cf6; }
.level-5 .level-number { background: #10b981; }

.level-depth {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.question-text {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.answer-content {
    margin-bottom: 1rem;
}

.characteristics {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid #0A66C3;
    font-size: 0.9rem;
}

.category-badge {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.category-badge.operational { background: #fee2e2; color: #dc2626; }
.category-badge.process { background: #fef3c7; color: #d97706; }
.category-badge.organizational { background: #dbeafe; color: #2563eb; }
.category-badge.strategic { background: #ede9fe; color: #7c3aed; }
.category-badge.fundamental { background: #d1fae5; color: #059669; }

.root-cause-card {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.25);
}

.root-cause-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.root-cause-content {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Visual Panel */
.visuals-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.diagram-grid {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    flex-direction: column;
}

.diagram-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.diagram-card h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.diagram-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 20px;
}

.loading-placeholder {
    color: #6b7280;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-placeholder::before {
    content: "⏳";
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mermaid-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: #dc2626;
    max-width: 400px;
    margin: 0 auto;
}

.mermaid-error .error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.mermaid-error .error-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.mermaid-error .error-message {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.mermaid-error .error-details {
    text-align: left;
    margin-top: 12px;
}

.mermaid-error .error-details summary {
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 8px;
}

.mermaid-error .error-details pre {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
}

.mermaid-diagram {
    width: 100%;
    height: auto;
}

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

/* Ensure diagram containers fill their space properly */
.diagram-card .diagram-container {
    background: white;
}

.diagram-card .diagram-container:has(.mermaid-diagram) {
    padding: 10px;
    border: none;
    background: transparent;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .diagram-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header, .table-row {
        grid-template-columns: 120px 1fr 1.5fr 120px !important;
    }
    
    .solutions-grid {
        grid-template-columns: 1fr;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .five-whys-results-overlay {
        padding: 0;
        align-items: stretch;
    }
    
    .five-whys-results-container {
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .five-whys-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .five-whys-header.compact {
        padding: 0.5rem 1rem;
        flex-direction: row;
        text-align: left;
    }
    
    .five-whys-header.ultra-compact {
        padding: 0.375rem 1rem;
        flex-direction: row;
        text-align: left;
    }
    
    .five-whys-header .header-left h2 {
        font-size: 1.25rem;
    }
    
    .five-whys-header.compact .header-left h2 {
        font-size: 0;
    }
    
    .five-whys-header .header-actions {
        order: -1;
        justify-content: flex-end;
        width: 100%;
    }
    
    .five-whys-header.compact .header-actions {
        order: 0;
        width: auto;
    }
    
    .five-whys-header.ultra-compact .header-actions {
        order: 0;
        width: auto;
    }
    
    .five-whys-header .document-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .five-whys-header.compact .document-meta {
        flex-direction: row;
        align-items: center;
    }
    
    .five-whys-content .analysis-tabs {
        flex-wrap: wrap;
        padding: 0 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .five-whys-content .analysis-tab {
        font-size: 0.8rem;
        padding: 0.75rem 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .five-whys-content .tab-panel {
        padding: 1rem;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .table-header, .table-row {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
        text-align: left;
    }
    
    .table-row {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .table-row .col-level,
    .table-row .col-question,
    .table-row .col-answer,
    .table-row .col-category {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-row .col-level::before { content: "Level: "; font-weight: 600; }
    .table-row .col-question::before { content: "Question: "; font-weight: 600; }
    .table-row .col-answer::before { content: "Answer: "; font-weight: 600; }
    .table-row .col-category::before { content: "Category: "; font-weight: 600; }
    
    .diagram-card {
        padding: 1rem;
    }
    
    .diagram-container {
        min-height: 200px;
    }
    
    .five-whys-modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .five-whys-modal.analysis-modal .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .five-whys-modal.analysis-modal .cancel-btn,
    .five-whys-modal.analysis-modal .analyze-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .solution-focus-card {
        padding: 1.5rem;
    }
    
    .focus-level-large {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .level-number-large {
        align-self: center;
    }
    
    .action-header {
        display: none;
    }
    
    .action-row {
        grid-template-columns: 1fr;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .action-row .col-priority::before { content: "Priority: "; font-weight: 600; }
    .action-row .col-timeframe::before { content: "Timeframe: "; font-weight: 600; }
    .action-row .col-action::before { content: "Action: "; font-weight: 600; }
    .action-row .col-owner::before { content: "Owner: "; font-weight: 600; }
    .action-row .col-target::before { content: "Target Level: "; font-weight: 600; }
    
    .diagram-preview-modal {
        padding: 1rem;
    }
    
    .diagram-preview-container {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .diagram-preview-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .diagram-preview-header .close-preview {
        order: -1;
        align-self: flex-end;
    }
    
    .diagram-preview-content {
        padding: 1rem;
    }
    
    .recommendations-tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .rec-tab {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Solutions Panel */
.solutions-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.solution-focus-card {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
    position: relative;
    overflow: hidden;
}

.solution-focus-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.solution-focus-card > * {
    position: relative;
    z-index: 1;
}

.solution-focus-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    color: #ffffff;
}

.focus-level-large {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-number-large {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.level-name-large {
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    color: #ffffff;
}

.focus-description {
    font-size: 1.1rem;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    color: #ffffff;
    font-weight: 500;
}

.identified-solutions h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.solution-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.solution-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.solution-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.effectiveness-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.effectiveness-badge.high { background: #d1fae5; color: #059669; }
.effectiveness-badge.medium { background: #fef3c7; color: #d97706; }
.effectiveness-badge.low { background: #fee2e2; color: #dc2626; }

.solution-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.solution-mapping {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.addresses-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.why-level-badge {
    background: #0A66C3;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.gap-analysis-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.gap-analysis-section h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.gap-analysis-content {
    margin-bottom: 1.5rem;
}

.levels-status {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.level-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    min-width: 80px;
    flex: 1;
}

.level-status.addressed {
    background: #d1fae5;
    border: 2px solid #10b981;
}

.level-status.unaddressed {
    background: #fee2e2;
    border: 2px solid #ef4444;
}

.level-status.partial {
    background: #fef3c7;
    border: 2px solid #f59e0b;
}

.level-indicator-small {
    background: currentColor;
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.level-status.addressed .level-indicator-small { background: #10b981; }
.level-status.unaddressed .level-indicator-small { background: #ef4444; }
.level-status.partial .level-indicator-small { background: #f59e0b; }

.status-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.level-status.addressed .status-label { color: #047857; }
.level-status.unaddressed .status-label { color: #dc2626; }
.level-status.partial .status-label { color: #d97706; }

/* Insights Panel */
.insights-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.assessment-card,
.completeness-card,
.risk-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.assessment-card { border-left: 4px solid #0A66C3; }
.risk-card { border-left: 4px solid #ef4444; }

.assessment-card h3,
.completeness-card h3,
.risk-card h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.assessment-content,
.risk-content {
    color: #374151;
    line-height: 1.6;
}

.recommendations-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.recommendations-section h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.recommendations-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.rec-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.rec-tab:hover {
    color: #0A66C3;
    background: rgba(10, 102, 195, 0.05);
}

.rec-tab.active {
    color: #0A66C3;
    border-bottom-color: #0A66C3;
}

.recommendations-content {
    position: relative;
}

.rec-panel {
    display: none;
}

.rec-panel.active {
    display: block;
}

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

.recommendation-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    border-left: 4px solid;
    position: relative;
}

.recommendation-item.immediate {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.recommendation-item.long-term {
    background: #f0f9ff;
    border-left-color: #0A66C3;
}

.recommendation-item.prevention {
    background: #f0fdf4;
    border-left-color: #10b981;
}

.action-items-section {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.action-items-section h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.action-items-table {
    display: flex;
    flex-direction: column;
}

.action-header {
    display: grid;
    grid-template-columns: 100px 120px 2fr 150px 100px;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.action-row {
    display: grid;
    grid-template-columns: 100px 120px 2fr 150px 100px;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.action-row:hover {
    background: #f8fafc;
}

.priority-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
}

.priority-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

.priority-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.priority-badge.low {
    background: #f3f4f6;
    color: #6b7280;
}

.timeframe-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Diagram Actions */
.diagram-actions {
    margin-top: 1rem;
    text-align: center;
}

.diagram-expand-btn {
    background: #0A66C3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.diagram-expand-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

/* Diagram Preview Modal */
.diagram-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 2rem;
}

.diagram-preview-container {
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.diagram-preview-header {
    background: linear-gradient(135deg, #0A66C3, #1976D2);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diagram-preview-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-preview {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-preview:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.diagram-preview-content {
    flex: 1;
    padding: 2rem;
    overflow: auto;
    background: #f8fafc;
}

.diagram-preview-area {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Diagram container improvements */
.diagram-container {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.diagram-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

.rendering-placeholder {
    color: #3b82f6;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rendering-placeholder::before {
    content: "⚙️";
    animation: spin 1s linear infinite;
}

.diagram-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: #dc2626;
}

.diagram-error button {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.diagram-error button:hover {
    background: #b91c1c;
}

.converting-placeholder {
    color: #3b82f6;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 2rem;
    min-height: 200px;
}

.converting-placeholder::before {
    content: "🔄";
    animation: spin 1s linear infinite;
}

.mermaid-diagram-image {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.mermaid-diagram-image:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

.diagram-error button:hover {
    background: #b91c1c;
}

/* Progress Message (Perplexity AI style) */
.analysis-progress-container {
    display: none;
    margin-top: 2rem;
    text-align: center;
}

.analysis-progress-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: column;
    text-align: center;
}

.progress-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #0A66C3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

.progress-text {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.progress-subtext {
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
    opacity: 0.9;
}

/* Image Preview Modal Styles */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.image-preview-panel {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    color: white;
    overflow: hidden;
}

.image-preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.image-preview-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.image-preview-action-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.image-preview-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    min-width: 40px;
    min-height: 40px;
}

.image-preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.image-preview-btn:active {
    transform: scale(0.95);
}

.image-preview-zoom-level {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 50px;
    text-align: center;
}

.image-preview-close-btn {
    background: rgba(220, 38, 38, 0.8);
    color: white;
    border: 1px solid rgba(220, 38, 38, 0.5);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-preview-close-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.image-preview-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: grab;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
}

.image-preview-wrapper.panning {
    cursor: grabbing;
}

.image-preview-wrapper:active {
    cursor: grabbing;
}

.image-preview-image {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-preview-instructions {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

/* Mobile Responsiveness for Image Preview */
@media (max-width: 768px) {
    .image-preview-controls {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .image-preview-zoom-controls {
        order: 1;
        flex: 1;
        justify-content: flex-start;
    }
    
    .image-preview-action-controls {
        order: 2;
        justify-content: flex-end;
    }
    
    .image-preview-close-btn {
        order: 3;
        margin-left: auto;
    }
    
    .image-preview-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 0.375rem;
    }
    
    .image-preview-instructions {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .image-preview-controls {
        padding: 0.5rem;
    }
    
    .image-preview-zoom-controls {
        gap: 0.5rem;
    }
    
    .image-preview-action-controls {
        gap: 0.5rem;
    }
    
    .image-preview-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 0.25rem;
    }
    
    .image-preview-close-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .image-preview-zoom-level {
        font-size: 0.75rem;
        min-width: 40px;
    }
    
    .image-preview-instructions {
        display: none;
    }
}

/* Coverage Badge Styles for Solution Coverage Column */
.coverage-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coverage-badge.addressed {
    background: #10b981;
    color: white;
}

.coverage-badge.partial {
    background: #f59e0b;
    color: white;
}

.coverage-badge.unaddressed {
    background: #ef4444;
    color: white;
}

/* Subtle Risk Assessment Styles */
.risk-info-subtle {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 3px solid #6b7280;
    border-radius: 4px;
}

.risk-info-subtle h4 {
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.risk-info-subtle summary::-webkit-details-marker {
    display: none;
}



.risk-content-subtle {
    margin-top: 0.5rem;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

.risk-considerations-inline {
    margin-top: 0;
    padding-top: 0;
}

.risk-considerations-inline h4 {
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.risk-content-inline {
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Action Type Badge Styles */
.action-type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-type-badge.immediate {
    background: #dc2626;
    color: white;
}

.action-type-badge.strategic {
    background: #7c3aed;
    color: white;
}

.action-type-badge.operational {
    background: #059669;
    color: white;
}

/* Solution Rationale Styles */
.solution-rationale {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #e2e8f0;
}

.effectiveness-rationale,
.mapping-rationale {
    margin-bottom: 0.75rem;
}

.effectiveness-rationale:last-child,
.mapping-rationale:last-child {
    margin-bottom: 0;
}

.solution-rationale strong {
    color: #374151;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.solution-rationale span {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Prevention Section Styles */
.prevention-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
}

.prevention-section h3 {
    color: #92400e;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

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

.prevention-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #fbbf24;
    color: #78350f;
}

@media (max-width: 1024px) {
    .five-whys-modal-content {
        max-width: 100vw;
        width: 100vw;
        min-width: 0;
        border-radius: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    .five-whys-modal.analysis-modal {
        padding: 0;
        border-radius: 0;
        align-items: stretch;
    }
    .five-whys-modal.analysis-modal .modal-header {
        padding: 1rem 1rem 0.5rem;
    }
    .description-input-area {
        padding: 1rem;
    }
    .description-textarea {
        font-size: 1rem;
        padding: 1rem;
        border-radius: 10px;
        min-height: 100px;
    }
    .five-whys-modal.analysis-modal .modal-body {
        padding: 1rem;
    }
    .five-whys-modal.analysis-modal .input-group label {
        font-size: 1rem;
    }
    .five-whys-modal.analysis-modal .url-input {
        font-size: 1rem;
        padding: 1rem;
        border-radius: 10px;
    }
    .five-whys-modal.analysis-modal .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    .five-whys-modal.analysis-modal .cancel-btn,
    .five-whys-modal.analysis-modal .analyze-btn {
        width: 100%;
        font-size: 1.1rem;
        padding: 1rem;
        border-radius: 10px;
    }
    .five-whys-results-overlay {
        padding: 0;
        align-items: stretch;
        border-radius: 0;
    }
    .five-whys-results-container {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        box-shadow: none;
    }
    .five-whys-header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0.5rem;
        border-radius: 0;
    }
    .five-whys-header .header-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    .five-whys-header .export-btn,
    .five-whys-header .close-results {
        font-size: 1.1rem;
        min-width: 44px;
        min-height: 44px;
        border-radius: 12px;
        padding: 0.75rem 1.25rem;
    }
    .five-whys-content .analysis-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.5rem;
        gap: 0.25rem;
        background: #f8fafc;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .five-whys-content .analysis-tab {
        font-size: 1.1rem;
        padding: 1rem 1.25rem;
        min-width: 120px;
        border-radius: 10px 10px 0 0;
        margin-right: 0.25rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .five-whys-content .analysis-tab.active {
        background: #e0e7ef;
        color: #0A66C3;
        border-bottom: 3px solid #0A66C3;
    }
    .five-whys-content .tab-panel {
        padding: 1rem 0.5rem;
        min-width: 0;
        overflow-x: hidden;
    }
    .overview-grid,
    .solutions-grid,
    .diagram-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .five-whys-table-container,
    .solutions-panel,
    .visuals-panel {
        padding: 1rem 0.5rem;
    }
    /* Keep table as grid layout for tablet screens - only change to flex on mobile */
    .table-header, .table-row {
        grid-template-columns: 120px 1fr 1.5fr 120px !important;
        gap: 0.75rem;
    }
    .five-whys-modal.analysis-modal .url-input,
    .five-whys-modal.analysis-modal .cancel-btn,
    .five-whys-modal.analysis-modal .analyze-btn {
        font-size: 1.1rem;
        padding: 1rem;
        border-radius: 10px;
    }
    .diagram-card {
        padding: 1rem !important;
    }
    .diagram-container {
        min-height: 160px !important;
        padding: 10px !important;
    }
    .image-preview-panel {
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    .image-preview-controls,
    .image-preview-instructions {
        padding: 0.5rem 0.5rem !important;
        font-size: 0.95rem !important;
    }
    .image-preview-btn {
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
    }
    .image-preview-zoom-level {
        min-width: 36px !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 600px) {
    .five-whys-modal-content,
    .five-whys-results-container,
    .image-preview-panel {
        border-radius: 0 !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .description-input-area {
        padding: 0.75rem !important;
    }
    .description-textarea {
        font-size: 1rem !important;
        padding: 0.75rem !important;
        border-radius: 8px !important;
        min-height: 80px !important;
    }
    .five-whys-header {
        padding: 0.5rem 0.25rem !important;
        font-size: 1rem !important;
    }
    .five-whys-header .header-left h2 {
        font-size: 1.1rem !important;
    }
    .five-whys-header .document-title {
        font-size: 0.95rem !important;
    }
    .five-whys-header .export-btn,
    .five-whys-header .close-results {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 1rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    .five-whys-content .analysis-tab {
        font-size: 1rem !important;
        padding: 0.75rem 0.75rem !important;
        min-width: 100px !important;
    }
    .five-whys-content .tab-panel {
        padding: 0.5rem 0.25rem !important;
    }
    .overview-card,
    .solution-card,
    .diagram-card {
        padding: 1rem !important;
        border-radius: 10px !important;
    }
    .action-row {
        padding: 0.75rem !important;
        border-radius: 10px !important;
    }
    .image-preview-controls,
    .image-preview-instructions {
        font-size: 0.85rem !important;
        padding: 0.25rem 0.25rem !important;
    }
    .image-preview-btn {
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
    }
    .image-preview-zoom-level {
        min-width: 32px !important;
        font-size: 0.95rem !important;
    }
} 

/* Key Assumptions Section - Matching Five Whys Theme */
.key-assumptions-section {
    margin-bottom: 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.key-assumptions-section:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.assumptions-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: none;
}

.assumptions-header h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
}

.assumptions-intro {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 400;
    opacity: 0.95;
}

.assumptions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin: 0;
}

.assumption-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0A66C3;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.assumption-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    border-left-color: #1976D2;
}

.assumption-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #0A66C3;
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(10, 102, 195, 0.25);
}

.assumption-content {
    flex: 1;
    min-width: 0;
}

.assumption-text {
    color: #1e293b;
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 0.625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.validation-importance {
    background: rgba(10, 102, 195, 0.05);
    border: 1px solid rgba(10, 102, 195, 0.2);
    border-left: 3px solid #0A66C3;
    color: #0A66C3;
    font-size: 0.8125rem;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 400;
}

.validation-importance strong {
    color: #1976D2;
    font-weight: 600;
    font-size: 0.8125rem;
}

.assumption-note {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.note-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    color: #f59e0b;
    opacity: 0.9;
}

.note-text {
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.note-text strong {
    color: #1e293b;
    font-weight: 600;
}

/* Professional Executive Styling - Matching Five Whys Theme */
.key-assumptions-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #667eea 50%, transparent 100%);
    opacity: 0.6;
}

/* Responsive adjustments - Matching Five Whys Theme */
@media (max-width: 1024px) {
    .assumptions-list {
        grid-template-columns: 1fr;
        gap: 0.875rem;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .key-assumptions-section {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .assumptions-header {
        padding: 0.875rem 1.25rem;
    }
    
    .assumptions-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.875rem 1.25rem;
    }
    
    .assumption-item {
        padding: 0.875rem;
        gap: 0.75rem;
        border-radius: 8px;
    }
    
    .assumption-number {
        width: 26px;
        height: 26px;
        font-size: 0.8125rem;
        border-radius: 8px;
    }
    
    .assumption-note {
        padding: 0.875rem 1.25rem;
        gap: 0.625rem;
    }
    
    .assumptions-header h3 {
        font-size: 1rem;
    }
    
    .assumptions-intro {
        font-size: 0.8125rem;
    }

    .assumption-text {
        font-size: 0.875rem;
    }
    
    .validation-importance {
        font-size: 0.75rem;
        padding: 0.4375rem 0.625rem;
    }
    
    .note-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .assumptions-header {
        padding: 0.75rem 1rem;
    }
    
    .assumptions-list {
        padding: 0.75rem 1rem;
        gap: 0.625rem;
    }
    
    .assumption-note {
        padding: 0.75rem 1rem;
    }
    
    .assumption-text {
        font-size: 0.8125rem;
    }
}