/* Button Styles */
.btn {
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-cohorts {
    align-items: center;
    background-color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
    margin-left: 10px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-cohorts:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-delete {
    background-color: #fff0f0;
    border-color: #f5d0d0;
    color: #d12c2c;
}

.btn-delete:hover {
    background-color: #f5d0d0;
}

.btn-edit {
    background-color: #e9f0ff;
    border-color: #d0ddf5;
    color: #2c5fd1;
}

.btn-edit:hover {
    background-color: #d0ddf5;
}

.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.btn-triage {
    align-items: center;
    background-color: #7c3aed;
    border: 1px solid #7c3aed;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
    margin-top: 20px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-triage:hover {
    background-color: #6d28d9;
}

/* Chart Styles */
.chart-canvas {
    height: 300px !important;
    max-height: 300px;
    width: 100% !important;
}

.chart-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

/* Cohort Modal Styles */
.cohort-summary {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 16px;
}

.cohort-summary h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.cohort-summary p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* Dropdown Styles */
.dropdown-category {
    background: #f9fafb;
    border-bottom: 1px solid #eee;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px 4px 12px;
}

.dropdown-item {
    background: #fff;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    padding: 6px 12px;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

/* Empty State */
.empty-state {
    color: #666;
    padding: 60px 20px;
    text-align: center;
}

/* Explain Styles */
.explain-content {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #000000;
    font-size: 14px;
    margin-top: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

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

.explain-icon {
    transition: transform 0.3s ease;
}

.explain-icon.rotated {
    transform: rotate(180deg);
}

.explain-toggle {
    align-items: center;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 8px;
    margin-top: 10px;
    transition: color 0.2s ease;
}

.explain-toggle:hover {
    color: #374151;
}

.explain-text {
    font-weight: 500;
}

/* Feedback Styles */
.feedback-button {
    align-items: center;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    gap: 6px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.feedback-button:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.feedback-button.active {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.feedback-button.thumbs-down:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.feedback-button.thumbs-down.active {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}

.feedback-button.thumbs-up:hover {
    background-color: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.feedback-button.thumbs-up.active {
    background-color: #dcfce7;
    border-color: #4ade80;
    color: #15803d;
}

.feedback-container {
    align-items: center;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
}

/* Follow-up Styles */
.follow-up-button {
    align-items: center;
    background-color: #7c3aed;
    border: 1px solid #7c3aed;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 500;
    height: 48px;
    justify-content: center;
    min-width: 48px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.follow-up-button:active {
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
    transform: translateY(0);
}

.follow-up-button:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.2);
    transform: translateY(-1px);
}

.follow-up-button i {
    font-size: 16px;
}

.follow-up-container {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.follow-up-input {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #374151;
    font-size: 14px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    width: 100%;
}

.follow-up-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    outline: none;
}

.follow-up-input::placeholder {
    color: #9ca3af;
}

.follow-up-input-container {
    flex: 1;
}

/* Form Styles */
.edit-signal-form {
    padding: 0;
}

.form-actions {
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-input,
.form-select,
.form-textarea {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-label {
    color: #374151;
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    min-height: 120px;
    resize: vertical;
}

/* General Layout */
.hidden {
    display: none;
}

.page-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-title {
    color: #333;
    font-size: 28px;
    margin: 0;
}

/* Impact and Conclusion Styles */
.conclusion {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-top: 12px;
    padding: 12px;
}

.conclusion p {
    color: #155724;
    font-size: 14px;
    margin: 0;
}

.conclusion strong {
    color: #155724;
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.final-conclusion {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    margin-top: 16px;
    padding: 16px;
}

.final-conclusion h5 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.final-conclusion p {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0;
}

.final-impact {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    margin-top: 20px;
    padding: 16px;
}

.final-impact h5 {
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.final-impact li,
.final-impact ul {
    color: #1e40af;
    font-size: 14px;
    line-height: 1.5;
}

.hypothesis {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.hypothesis:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.hypothesis h4,
.hypothesis h5 {
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.hypothesis p {
    color: #000000;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.impact-description {
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 16px;
}

.impact-step {
    margin-bottom: 16px;
}

.impact-step h5 {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.impact-subset {
    margin-bottom: 16px;
}

.impact-subset h5 {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.impact-subset li,
.impact-subset ul {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* Keyframes */
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Modal Styles */
.modal-close {
    background: none;
    border: none;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 80vh;
    max-width: 900px;
    overflow-y: auto;
    padding: 24px;
    width: 90%;
}

.modal-header {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
}

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

.modal-title {
    color: #111827;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* New Signal Button */
.new-signal-btn {
    align-items: center;
    background-color: #0066cc;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    gap: 8px;
    padding: 10px 20px;
    text-decoration: none;
}

.new-signal-btn:hover {
    background-color: #0052a3;
}

.no-definition {
    color: #94a3b8;
    font-style: italic;
}

/* Pill Styles */
.pill {
    align-items: center;
    background: transparent;
    border: 1px solid #93c5fd;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    font-size: 13px;
    line-height: 1.3;
    margin: 2px 0;
    padding: 2px 10px;
    transition: all 0.2s ease;
}

.pill:hover {
    background: #f0f9ff;
    border-color: #60a5fa;
}

.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 6px;
}

.pill-key {
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
}

.pill-separator {
    color: #94a3b8;
    margin: 0 4px;
}

.pill-value {
    color: #334155;
    line-height: 1.4;
    max-width: none;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

/* Property Styles */
.property-label {
    color: #666;
    font-size: 13.5px;
    font-weight: 500;
    padding-top: 2px;
}

.property-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14.5px;
    line-height: 1.45;
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Result Styles */
.result-block {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 8px 0;
    padding: 12px;
}

.result-block strong {
    color: #333;
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.result-table {
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
    width: 100%;
}

.result-table td {
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 12px;
    text-align: left;
}

.result-table th {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    padding: 8px 12px;
    text-align: left;
}

/* Signal Card Styles */
.impact-pill {
    background-color: var(--pill-color, #e8f5e8);
    border: 2px solid var(--pill-border, #2d6f2d);
    border-radius: 12px;
    color: var(--pill-text-color, #1a4d1a);
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    min-width: 60px;
    padding: 4px 12px;
    text-align: right;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.metric-sql-row {
    grid-column: 1 / -1;
    margin-bottom: 0;
    width: 100%;
}

.metric-sql-row .sql-container,
.metric-sql-row .sql-content code,
.metric-sql-row .sql-content pre {
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
}

.signal-actions {
    display: flex;
    gap: 8px;
}

.signal-actions-bottom {
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
    padding: 8px 0 0;
}

.signal-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    overflow: hidden;
}

.signal-card:has(.signal-details.active) {
    grid-column: 1 / -1;
}

.signal-card.expanded {
    flex: 1 1 100%;
    max-width: 100%;
}

.signal-card[data-impact="0"] {
    background: white;
}

.signal-card-header {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    transition: background-color 0.2s ease;
}

.signal-card-header:hover {
    background-color: #f9f9f9;
}

.signal-chart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    padding: 20px;
}

.signal-details {
    border-top: 1px solid transparent;
    display: none;
    overflow: visible;
    padding: 0 16px;
    transition: all 0.3s ease;
}

.signal-details.active {
    border-top: 1px solid #f0f0f0;
    display: block;
    padding: 12px 16px 8px;
}

.signal-properties {
    display: grid;
    gap: 8px;
    grid-template-columns: 140px 1fr;
    margin-bottom: 8px;
}

.signal-title {
    align-items: center;
    color: #222;
    display: flex;
    font-size: 15px;
    font-weight: 700;
    gap: 10px;
    justify-content: space-between;
    margin: 0;
}

.signal-title-text {
    flex: 1;
}

.signal-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.3s ease;
}

.signal-toggle.rotated {
    transform: rotate(180deg);
}

.signals-container {
    margin: 0;
    padding: 20px 24px;
}

.signals-list {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    margin-top: 0;
}

.signals-run-context {
    color: #075985;
    font-size: 14px;
    font-weight: 500;
    margin: 4px 0 0 0;
}

.signals-run-header {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.signals-run-insight {
    color: #075985;
    font-size: 14px;
    margin: 0;
}

.signals-run-section {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 16px;
}

.signals-run-section.opportunity {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10B981;
}

.signals-run-section.risk {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #EF4444;
}

.signals-run-title {
    color: #0369a1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* SQL Styles */
.sql-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    margin: 8px 0;
    overflow-x: auto;
    padding: 0;
}

.sql-container code {
    background: none;
    border: none;
    color: #333;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    padding: 0;
    white-space: pre;
}

.sql-container pre {
    background: none;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    padding: 12px;
}

.sql-content {
    margin-top: 12px;
    transition: all 0.3s ease;
}

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

.sql-step {
    margin-bottom: 16px;
}

.sql-step strong {
    color: #374151;
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sql-toggle {
    align-items: center;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 8px;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.sql-toggle:hover {
    color: #374151;
}

.sql-toggle-icon {
    transition: transform 0.3s ease;
}

.sql-toggle-icon.rotated {
    transform: rotate(180deg);
}

.sql-toggle-text {
    font-weight: 500;
}

/* Thinking Indicator */
.thinking-indicator {
    align-items: center;
    color: #666;
    display: flex;
    font-style: italic;
    gap: 10px;
    margin: 20px 0;
}

.thinking-indicator svg {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Tree Styles */
.tree-alert {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.tree-alert:hover {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

.tree-branch {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    position: relative;
    transition: all 0.2s ease;
}

.tree-branch:hover {
    background-color: #f9fafb;
    transform: translateX(2px);
}

.tree-children {
    border-left: 2px solid #e5e7eb;
    margin-left: 16px;
    margin-top: 4px;
    padding-left: 8px;
    transition: all 0.3s ease;
}

.tree-children.hidden {
    display: none;
}

.tree-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.tree-icon {
    flex-shrink: 0;
    height: 16px;
    width: 16px;
}

.tree-leaf {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    padding: 6px 12px;
    position: relative;
    transition: all 0.2s ease;
}

.tree-leaf:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    transform: translateX(2px);
}

.tree-level-0 {
    color: #1f2937;
    font-weight: 600;
    margin-left: 0;
}

.tree-level-1 {
    color: #374151;
    font-weight: 500;
    margin-left: 20px;
}

.tree-level-2 {
    color: #4b5563;
    margin-left: 40px;
}

.tree-level-3 {
    color: #6b7280;
    margin-left: 60px;
}

.tree-level-4 {
    color: #6b7280;
    margin-left: 80px;
}

.tree-level-5 {
    color: #9ca3af;
    font-size: 13px;
    margin-left: 100px;
}

.tree-node {
    margin: 4px 0;
}

.tree-opportunity {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.tree-opportunity:hover {
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}

.tree-stats {
    background-color: #f3f4f6;
    border-radius: 10px;
    color: #6b7280;
    font-size: 12px;
    margin-left: auto;
    padding: 2px 6px;
}

.tree-text {
    flex: 1;
}

/* Triage Styles */
.triage-divider {
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    height: 1px;
    margin: 24px auto;
    width: 60%;
}

.triage-results {
    color: #333;
    padding: 24px;
}

.triage-results-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    padding: 0;
}

.triage-results-title {
    border-bottom: 2px solid #f3f4f6;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
}

.triage-section {
    margin-bottom: 24px;
}

.triage-section:last-child {
    margin-bottom: 0;
}

.triage-section-content {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.triage-section-list {
    color: #4b5563;
    font-size: 14px;
    margin: 0;
    padding-left: 20px;
}

.triage-section-list li {
    line-height: 1.6;
    margin-bottom: 8px;
}

.triage-section-list li:last-child {
    margin-bottom: 0;
}

.triage-section-list strong {
    color: #111827;
    font-weight: 600;
}

.triage-section-title {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-transform: none;
}


.signal-properties {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.property-label {
    font-weight: 500;
    color: #666;
    font-size: 13.5px;
    padding-top: 2px;
}

.property-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 2px 0;
    font-size: 14.5px;
    line-height: 1.45;
}

.signal-actions-bottom {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 0 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-edit {
    background-color: #e9f0ff;
    color: #2c5fd1;
    border-color: #d0ddf5;
}

.btn-edit:hover {
    background-color: #d0ddf5;
}

.btn-delete {
    background-color: #fff0f0;
    color: #d12c2c;
    border-color: #f5d0d0;
}

.btn-delete:hover {
    background-color: #f5d0d0;
}


.btn-triage {
    background-color: #7c3aed;
    border: 1px solid #7c3aed;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
    margin-top: 20px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-triage:hover {
    background-color: #6d28d9;
}

.signal-chart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    padding: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.chart-canvas {
    height: 300px !important;
    max-height: 300px;
    width: 100% !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 6px;
}

.pill {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid #93c5fd;
    border-radius: 14px;
    padding: 2px 10px;
    font-size: 13px;
    line-height: 1.3;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 2px 0;
}

.pill:hover {
    background: #f0f9ff;
    border-color: #60a5fa;
}

.pill-key {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.pill-separator {
    margin: 0 4px;
    color: #94a3b8;
}


.pill-value {
    color: #334155;
    white-space: normal;
    overflow: visible;
    max-width: none;
    word-break: break-word;
    line-height: 1.4;
}

.no-definition {
    color: #94a3b8;
    font-style: italic;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    color: #666;
    font-style: italic;
}

.thinking-indicator svg {
    animation: pulse 1.5s ease-in-out infinite;
}

.triage-results {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #7c3aed;
}

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

.triage-section:last-child {
    margin-bottom: 0;
}

.triage-section h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.triage-section p {
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.btn-cohorts {
    background-color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
    margin-left: 10px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-cohorts:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.tree-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.tree-node {
    margin: 4px 0;
}

.tree-level-0 {
    margin-left: 0;
    font-weight: 600;
    color: #1f2937;
}

.tree-level-1 {
    margin-left: 20px;
    font-weight: 500;
    color: #374151;
}

.tree-level-2 {
    margin-left: 40px;
    color: #4b5563;
}

.tree-level-3 {
    margin-left: 60px;
    color: #6b7280;
}

.tree-level-4 {
    margin-left: 80px;
    color: #6b7280;
}

.tree-level-5 {
    margin-left: 100px;
    color: #9ca3af;
    font-size: 13px;
}

.tree-branch {
    position: relative;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-branch:hover {
    background-color: #f9fafb;
    transform: translateX(2px);
}

.tree-leaf {
    position: relative;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.tree-leaf:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.tree-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tree-text {
    flex: 1;
}

.tree-stats {
    font-size: 12px;
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.cohort-summary {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.cohort-summary h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.cohort-summary p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.hidden {
    display: none;
}

.tree-children {
    margin-left: 16px;
    border-left: 2px solid #e5e7eb;
    padding-left: 8px;
    margin-top: 4px;
    transition: all 0.3s ease;
}

.tree-children.hidden {
    display: none;
}

.tree-alert {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.tree-alert:hover {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

.tree-opportunity {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.tree-opportunity:hover {
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}

/* Professional Triage Results Styling */
.triage-results-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    padding: 0;
}

.triage-results {
    padding: 24px;
    color: #333;
}

.triage-results-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.triage-section {
    margin-bottom: 24px;
}

.triage-section:last-child {
    margin-bottom: 0;
}

.triage-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
    text-transform: none;
}

.triage-section-content {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.triage-section-list {
    margin: 0;
    padding-left: 20px;
    color: #4b5563;
    font-size: 14px;
}

.triage-section-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.triage-section-list li:last-child {
    margin-bottom: 0;
}

.triage-section-list strong {
    color: #111827;
    font-weight: 600;
}

.explain-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    margin-top: 10px;
    transition: color 0.2s ease;
}

.explain-toggle:hover {
    color: #374151;
}

.explain-text {
    font-weight: 500;
}

.explain-icon {
    transition: transform 0.3s ease;
}

.explain-icon.rotated {
    transform: rotate(180deg);
}

.explain-content {
    margin-top: 12px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    color: #000000;
    font-size: 14px;
}

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

.hypothesis {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.hypothesis:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.hypothesis h4,
.hypothesis h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #000000;
}

.hypothesis p {
    font-size: 14px;
    color: #000000;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.sql-step {
    margin-bottom: 16px;
}

.sql-step strong {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 8px;
}

.sql-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
}

.sql-container code {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #333;
    white-space: pre;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.result-block {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0;
}

.result-block strong {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

.result-table th,
.result-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.result-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.result-table td {
    color: #6b7280;
}

.conclusion {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
}

.conclusion strong {
    font-size: 14px;
    font-weight: 600;
    color: #155724;
    display: block;
    margin-bottom: 4px;
}

.conclusion p {
    font-size: 14px;
    color: #155724;
    margin: 0;
    font-weight: 500;
}

.final-conclusion {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 16px;
    margin-top: 16px;
}

.final-conclusion h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.final-conclusion p {
    font-size: 14px;
    color: #333;
    margin: 8px 0;
    line-height: 1.5;
}

.impact-subset,
.impact-step {
    margin-bottom: 16px;
}

.impact-subset h5,
.impact-step h5 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.impact-subset ul,
.impact-subset li {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.final-impact {
    margin-top: 20px;
    padding: 16px;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}

.final-impact h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin: 0 0 8px 0;
}

.final-impact ul,
.final-impact li {
    font-size: 14px;
    color: #1e40af;
    line-height: 1.5;
}

/* Signals Run Section */
.signals-run-section {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.signals-run-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.signals-run-title {
    font-weight: 600;
    color: #0369a1;
    font-size: 16px;
    margin: 0;
}

.signals-run-insight {
    margin: 0;
    color: #075985;
    font-size: 14px;
}

.signals-run-context {
    margin: 4px 0 0 0;
    color: #075985;
    font-size: 14px;
    font-weight: 500;
}

/* Impact description consistent font size */
.impact-description {
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* SQL containers with syntax highlighting */
.sql-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0;
    margin: 8px 0;
    overflow-x: auto;
}

.sql-container pre {
    margin: 0;
    padding: 12px;
    background: none;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.sql-container code {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #333;
    white-space: pre;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Add these CSS classes at the top of the file */
.signals-run-section.opportunity {
    background-color: rgba(16, 185, 129, 0.1);
    /* Light green background */
    border-left: 4px solid #10B981;
    /* Green left border */
}

.signals-run-section.risk {
    background-color: rgba(239, 68, 68, 0.1);
    /* Light red background */
    border-left: 4px solid #EF4444;
    /* Red left border */
}

.triage-section-list strong {
    color: #111827;
    font-weight: 600;
}

.follow-up-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.follow-up-input-container {
    flex: 1;
}

.follow-up-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background-color: white;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.follow-up-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.follow-up-input::placeholder {
    color: #9ca3af;
}

.follow-up-button {
    background-color: #7c3aed;
    border: 1px solid #7c3aed;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    transition: all 0.2s ease;
    min-width: 48px;
    height: 48px;
}

.follow-up-button:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.2);
}

.follow-up-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

.follow-up-button i {
    font-size: 16px;
}

.triage-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 24px 0;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.explain-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.sql-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.sql-toggle:hover {
    color: #374151;
}

.sql-toggle-text {
    font-weight: 500;
}

.sql-toggle-icon {
    transition: transform 0.3s ease;
}

.sql-toggle-icon.rotated {
    transform: rotate(180deg);
}

.sql-content {
    margin-top: 12px;
    transition: all 0.3s ease;
}

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

.triage-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 24px 0;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.metric-sql-row {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 0;
}

.metric-sql-row .sql-container,
.metric-sql-row .sql-content pre,
.metric-sql-row .sql-content code {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
}

/* Edit Signal Modal Form Styles */
.edit-signal-form {
    padding: 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.form-group {
    margin-bottom: 20px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.dropdown-item {
    padding: 6px 12px;
    cursor: pointer;
    background: #fff;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-category {
    font-weight: 600;
    color: #64748b;
    background: #f9fafb;
    padding: 6px 12px 4px 12px;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

/* Feedback buttons styling */
.feedback-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.feedback-button {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.feedback-button:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.feedback-button.thumbs-up:hover {
    background-color: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.feedback-button.thumbs-down:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.feedback-button.active {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.feedback-button.thumbs-up.active {
    background-color: #dcfce7;
    border-color: #4ade80;
    color: #15803d;
}

.feedback-button.thumbs-down.active {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}