:root {
    /* Light theme tokens */
    --bg-primary: #f4f6f8;
    --bg-secondary: #ffffff;
    --bg-inset: #eef2f7;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent-blue: #0891b2;
    --accent-blue-hover: #0e7490;
    --input-bg: #ffffff;
    --input-text: #0f172a;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --case-bg: #f8fafc;
    --tag-bg: #cffafe;
    --tag-text: #155e75;
    --tooltip-bg: #0f172a;
    --tooltip-text: #ffffff;

    /* Legacy aliases (kept so existing rules keep working) */
    --bg: var(--bg-primary);
    --card-bg: var(--bg-secondary);
    --text: var(--text-primary);
    --border: var(--border-color);
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --positive: #059669;
    --negative: #dc2626;
    --edge: #d97706;
    --assertion: #7c3aed;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.03);
}

.dark {
    --bg-primary: #0a0f1e;
    --bg-secondary: #111a2e;
    --bg-inset: #0b1424;
    --text-primary: #e5e9f2;
    --text-secondary: #8695b0;
    --border-color: #1e2a44;
    --accent-blue: #22d3ee;
    --accent-blue-hover: #38bdf8;
    --input-bg: #0b1424;
    --input-text: #eaf2ff;
    --sidebar-bg: #0b1120;
    --sidebar-border: #1a2740;
    --case-bg: #0d1730;
    --tag-bg: #0e3a4a;
    --tag-text: #a5f0fb;
    --tooltip-bg: #e5e9f2;
    --tooltip-text: #0a0f1e;
    --primary: #22d3ee;
    --primary-hover: #38dced;
    --error-bg: #3b0d0d;
    --error-text: #fca5a5;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 20px -3px rgba(0,0,0,0.6), 0 4px 6px -2px rgba(0,0,0,0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 200ms ease, color 200ms ease;
}

.footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.required {
    color: var(--negative);
}

.hint {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.hint-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9375rem;
}

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

.results-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9375rem;
    background: var(--input-bg);
    color: var(--input-text);
    transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
    font-family: inherit;
}

input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

textarea {
    resize: vertical;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875rem;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: var(--bg-inset);
}

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

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sample-btn {
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--accent-blue);
    background: transparent;
    color: var(--accent-blue);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.sample-btn:hover {
    background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.error-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.result-group {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.group-title.positive { border-color: var(--positive); }
.group-title.negative { border-color: var(--negative); }
.group-title.edge { border-color: var(--edge); }
.group-title.assertions { border-color: var(--assertion); }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    background: var(--border);
    flex-shrink: 0;
}

/* Case Cards */
.case-item {
    background: var(--case-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.15s;
}

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

.case-item:hover {
    box-shadow: var(--shadow-lg);
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.case-id {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #e5e7eb;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.case-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.case-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
}

.tag.status {
    background: #dbeafe;
    color: #1e40af;
}

.tag.severity-critical {
    background: #fee2e2;
    color: #991b1b;
}

.tag.severity-high {
    background: #ffedd5;
    color: #9a3412;
}

.tag.severity-medium {
    background: #fef9c3;
    color: #854d0e;
}

.tag.severity-low {
    background: #dcfce7;
    color: #166534;
}

/* Assertion specific */
.assertion-rule {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* CI/CD export */
.cicd-export {
    margin-top: 1.5rem;
}

.cicd-export h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.export-format-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.export-format-card {
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    background: var(--card-bg);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.export-format-card:hover {
    box-shadow: var(--shadow-lg);
}

.export-format-card.selected {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.export-format-card strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.export-format-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.cicd-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cicd-filename {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.cicd-preview-actions {
    display: flex;
    gap: 0.5rem;
}

.code-preview {
    background: #1e293b;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    max-height: 480px;
    overflow-y: auto;
}

.provider-badge {
    display: inline-block;
    vertical-align: middle;
    background: var(--accent-blue);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Test execution */
.case-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-run {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-run:hover:not(:disabled) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

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

.case-details {
    margin-top: 0.75rem;
}

.detail-row {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.assertion-list {
    list-style: none;
    margin: 0.375rem 0;
}

.assertion-list li {
    padding: 0.15rem 0;
}

.test-pass {
    border-left: 4px solid #22c55e !important;
    background: rgba(34, 197, 94, 0.05);
}

.test-fail {
    border-left: 4px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.status-badge.passed {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.execution-progress {
    margin-bottom: 1rem;
}

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

.execution-progress-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
    width: 0;
    transition: width 0.3s ease;
}

@keyframes progress-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

.execution-progress-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.execution-summary {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 12px 24px;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.assertion-pass {
    color: #22c55e;
    font-size: 12px;
}

.assertion-fail {
    color: #ef4444;
    font-weight: 500;
    font-size: 12px;
}

.response-preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-inset);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Security scanning mode */
.security-mode-active {
    background: var(--bg);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s ease;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

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

.security-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.dark .security-warning {
    background: #451a03;
    border-color: #f59e0b;
    color: #fde68a;
}

.warning-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: #92400e;
    line-height: 1;
}

.dark .warning-dismiss {
    color: #fcd34d;
}

.owasp-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.5rem;
}

.owasp-category-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.owasp-category-item input {
    margin-top: 0.15rem;
    accent-color: var(--accent-blue);
}

.owasp-category-item .cat-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.risk-score-gauge {
    margin-bottom: 1rem;
}

.risk-score-bar {
    height: 16px;
    background: var(--bg-inset);
    border-radius: 8px;
    overflow: hidden;
}

.risk-score-fill {
    height: 100%;
    width: 0;
    background: #22c55e;
    transition: width 1s ease-out, background 0.3s ease;
}

.risk-score-fill.risk-green { background: linear-gradient(to right, #22c55e, #16a34a); }
.risk-score-fill.risk-yellow { background: linear-gradient(to right, #eab308, #ca8a04); }
.risk-score-fill.risk-orange { background: linear-gradient(to right, #f97316, #ea580c); }
.risk-score-fill.risk-red { background: linear-gradient(to right, #dc2626, #b91c1c); }

.risk-score-label {
    margin-top: 0.375rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.scan-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.scan-summary .chip {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

.sec-export-actions {
    margin-bottom: 1rem;
}

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

.findings-table th,
.findings-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.findings-table th {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.severity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.severity-critical {
    background: #7f1d1d;
    color: #fecaca;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.severity-high { background: #dc2626; color: #fff; }
.severity-medium { background: #ea580c; color: #fff; }
.severity-low { background: #ca8a04; color: #fff; }

.findings-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    background: var(--bg-inset);
    padding: 1px 5px;
    border-radius: 4px;
}

.status-vulnerable { color: #dc2626; font-weight: 600; }
.status-secure { color: #22c55e; font-weight: 600; }
.status-error { color: #ca8a04; font-weight: 600; }
.status-review { color: #d97706; font-weight: 600; }

.finding-vulnerable { border-left: 4px solid #dc2626; }
.finding-secure { border-left: 4px solid #22c55e; }
.finding-review { border-left: 4px solid #d97706; }

.ground-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.ground-verified {
    color: #0f6e56;
    background: rgba(29, 158, 117, 0.14);
}

.ground-unverified {
    color: #854f0b;
    background: rgba(217, 119, 6, 0.16);
}

.ground-legend {
    font-size: 12px;
    color: var(--text-secondary, #666);
    margin: 8px 2px 0;
}

.ground-legend .ground-verified,
.ground-legend .ground-unverified {
    padding: 0;
    background: none;
    font-weight: 500;
}

.degraded-banner {
    background: color-mix(in srgb, #d97706 12%, transparent);
    color: #92400e;
    border: 1px solid color-mix(in srgb, #d97706 35%, transparent);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.degraded-banner strong {
    font-weight: 600;
}

.finding-detail-row td {
    background: var(--bg-inset);
    font-size: 0.8125rem;
}

.payload-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    overflow-x: auto;
    margin: 0.375rem 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.expand-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* OpenAPI import & contract testing */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header-row h2 {
    margin-bottom: 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.openapi-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.openapi-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-top: 0.75rem;
    white-space: pre-wrap;
}

.openapi-info {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.endpoint-list {
    margin-top: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

.endpoint-item .endpoint-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

.endpoint-item .endpoint-summary {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
}

.method-badge {
    display: inline-block;
    min-width: 52px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.method-badge-get { background: #2563eb; }
.method-badge-post { background: #16a34a; }
.method-badge-put { background: #ca8a04; }
.method-badge-delete { background: #dc2626; }
.method-badge-patch { background: #7c3aed; }

.contract-panel {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.contract-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.contract-valid {
    border: 1px solid #22c55e;
    background: rgba(34, 197, 94, 0.05);
    color: #166534;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.875rem;
}

.schema-violation {
    color: #dc2626;
    font-size: 0.8125rem;
    padding: 0.25rem 0;
}

.schema-violation .violation-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
}

/* Phase 10: history items, dark toggle, toasts, skeletons */
.history-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.625rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.history-item:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow);
}

.history-item .history-endpoint {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.history-item .history-meta {
    color: var(--text-secondary);
    font-size: 0.7rem;
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.history-item .history-actions {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.history-item .history-actions button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.history-item .history-actions button:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
}

.toast {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-blue);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    animation: toast-slide-in 0.25s ease;
}

.toast.toast-success { border-left-color: #22c55e; }
.toast.toast-error { border-left-color: #ef4444; }

.toast.toast-leaving {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 200ms ease, transform 200ms ease;
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Loading skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    min-height: 1rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 90px;
    margin-bottom: 0.75rem;
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .export-format-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
.menu-toggle {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0.5rem 0.75rem;
    font-size: 1.125rem;
    cursor: pointer;
    z-index: 110;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: fixed;
        top: 16px;
        left: 16px;
    }

    .sidebar-backdrop.open {
        display: block;
    }

    input[type="url"],
    select {
        min-height: 44px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .results-actions {
        flex-wrap: wrap;
    }

    .export-format-cards,
    .owasp-categories {
        grid-template-columns: 1fr;
    }

    .findings-table {
        display: block;
        overflow-x: auto;
        font-size: 0.75rem;
    }

    .openapi-modal {
        max-height: 90vh;
        padding: 1rem;
    }

    .execution-summary {
        flex-direction: column;
        gap: 8px;
        font-size: 0.8125rem;
    }
}

/* Phase A fixes: active-looking action buttons */
#importOpenapiBtn {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease;
}

#importOpenapiBtn:hover {
    background: var(--accent-blue-hover);
}

#runAllBtn {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    font-weight: 600;
    opacity: 1;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 200ms ease;
}

#runAllBtn:hover:not(:disabled) {
    background: var(--accent-blue-hover);
}

#runAllBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.summary-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

/* Phase B: UX clarity */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    max-width: 480px;
    margin: 0 auto 1rem;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 60;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Inline field validation */
.input-invalid {
    border-color: var(--negative) !important;
}

.field-error {
    display: block;
    color: var(--negative);
    font-size: 12px;
    margin-top: 4px;
}

/* Error banner dismiss */
.error-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--error-text);
    line-height: 1;
}

/* Mode subtitle */
/* History empty state */
.history-empty {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.history-empty-hint {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Card hierarchy */
.case-title {
    font-weight: 600;
    font-size: 1rem;
}

.case-id {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.case-desc {
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-meta .tag {
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
    opacity: 0.85;
}

.status-badge.pending {
    background: var(--bg-inset);
    color: var(--text-secondary);
}

/* Phase C: visual polish */
html {
    scroll-behavior: smooth;
}

/* Smooth color switching (dark mode) */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Page load fade-in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered card entrance */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.case-item {
    animation: slideUp 0.3s ease-out;
    animation-fill-mode: both;
}

.case-item:nth-child(1) { animation-delay: 0.05s; }
.case-item:nth-child(2) { animation-delay: 0.1s; }
.case-item:nth-child(3) { animation-delay: 0.15s; }
.case-item:nth-child(4) { animation-delay: 0.2s; }
.case-item:nth-child(5) { animation-delay: 0.25s; }
.case-item:nth-child(6) { animation-delay: 0.3s; }
.case-item:nth-child(7) { animation-delay: 0.35s; }
.case-item:nth-child(8) { animation-delay: 0.4s; }
.case-item:nth-child(9) { animation-delay: 0.45s; }
.case-item:nth-child(10) { animation-delay: 0.5s; }
.case-item:nth-child(11) { animation-delay: 0.55s; }
.case-item:nth-child(12) { animation-delay: 0.6s; }

/* Button micro-interactions */
button {
    transition: transform 0.15s ease, box-shadow 0.15s ease,
        background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

button:hover:not(:disabled) {
    transform: scale(1.02);
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:hover:not(:disabled),
#runAllBtn:hover:not(:disabled),
#importOpenapiBtn:hover:not(:disabled),
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Generate button loading pulse */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.btn-loading {
    animation: pulse 1.5s infinite;
    pointer-events: none;
}

/* Card hover lift */
.case-item:hover,
.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease,
        background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dark .case-item:hover,
.dark .history-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Copy/download success flash */
.btn-flash {
    background: #22c55e !important;
    color: #fff !important;
    border-color: #22c55e !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Accessible focus rings */
*:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Active state indicators */
.history-item.selected {
    border-left: 3px solid var(--accent-blue);
}

/* Finding row expand chevron */
.expand-btn .chevron {
    display: inline-block;
    transition: transform 0.3s ease;
}

.expand-btn.expanded .chevron {
    transform: rotate(180deg);
}

/* Toast icons */
.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast .toast-icon {
    flex-shrink: 0;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* =========================================================
   Dashboard shell redesign (API Sentinel)
   ========================================================= */
.app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.875rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.5rem 1.25rem;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22d3ee, #0891b2);
    color: #04222b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.brand-text span {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nav-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0 0.75rem 0.35rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.nav-item:hover:not(.active) {
    background: var(--bg-inset);
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--accent-blue);
    border-color: color-mix(in srgb, var(--accent-blue) 45%, transparent);
    background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
    font-weight: 600;
}

.nav-item:hover:not(:disabled),
.nav-item:active:not(:disabled),
.theme-toggle:hover:not(:disabled) {
    transform: none;
}

.sidebar-footer {
    padding-top: 1rem;
}

.theme-toggle {
    width: 100%;
    background: var(--bg-inset);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--accent-blue);
}

/* Main content area */
.main {
    flex: 1;
    min-width: 0;
    padding: 1.75rem 2rem 2.5rem;
    max-width: 1240px;
    animation: fadeIn 0.4s ease-out;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.main-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.main-header .subtitle {
    margin-top: 0.2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.view {
    animation: fadeIn 0.3s ease-out;
}

/* Two-column workspace */
.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 1.5rem;
    align-items: start;
}

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

.col-left .card,
.col-right .card {
    margin-bottom: 1.25rem;
}

.card {
    border: 1px solid var(--border-color);
}

.results-panel {
    min-height: 360px;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Stack generated-case groups vertically inside the results panel */
.col-right .results-grid {
    grid-template-columns: 1fr;
}

/* Condensed form */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 1rem;
}

.form-row .autofetch {
    margin-bottom: 1.1rem;
    white-space: nowrap;
}

.advanced {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--bg-inset);
}

.advanced > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.advanced .plus {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.advanced[open] .plus {
    transform: rotate(45deg);
}

.advanced-body {
    padding: 0 0.9rem 0.5rem;
}

.advanced-body .form-group:first-child {
    margin-top: 0.25rem;
}

/* Empty / placeholder states inside panels */
.empty-state,
.placeholder-panel {
    background: none;
    box-shadow: none;
    padding: 3rem 1.5rem;
    text-align: center;
    margin-bottom: 0;
}

.empty-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    margin: 0 auto 1rem;
}

.empty-state h3,
.placeholder-panel h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.empty-state p,
.placeholder-panel p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 380px;
    margin: 0 auto;
}

/* Documentation panel */
.docs-panel {
    line-height: 1.65;
}

.docs-panel h2 {
    font-size: 1.15rem;
    margin: 1.25rem 0 0.5rem;
}

.docs-panel h2:first-child {
    margin-top: 0;
}

.docs-panel p,
.docs-panel li {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.docs-panel ul {
    margin: 0.25rem 0 0.75rem 1.25rem;
}

.docs-panel code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--bg-inset);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Cyan primary button needs dark text in dark mode */
.dark .btn-primary {
    color: #04222b;
    font-weight: 700;
}

/* Import button: subtle pill (overrides the earlier accent-fill rule) */
#importOpenapiBtn {
    background: var(--bg-inset);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

#importOpenapiBtn:hover {
    background: var(--card-bg);
    border-color: var(--accent-blue);
}

/* Mobile: collapsible sidebar */
@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        height: 100%;
        width: 240px;
        z-index: 99;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-backdrop.open {
        display: block;
    }

    .menu-toggle {
        display: block;
        position: fixed;
        top: 12px;
        left: 12px;
    }

    .main {
        padding: 4rem 1rem 2rem;
        max-width: none;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* History tabs (Functional / Security) */
.history-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.history-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.history-tab:hover:not(.active):not(:disabled) {
    color: var(--text-primary);
    transform: none;
}

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

.history-tab-count {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-inset);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    min-width: 1.2rem;
    text-align: center;
}

.history-tab.active .history-tab-count {
    background: color-mix(in srgb, var(--accent-blue) 18%, transparent);
    color: var(--accent-blue);
}

/* =========================================================
   Results UX: toolbar dropdown, category/severity tabs,
   compact case rows, collapsible CI/CD export
   ========================================================= */

/* Export dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 0.25rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
}
.dropdown-menu button {
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}
.dropdown-menu button:hover:not(:disabled) { background: var(--bg-inset); transform: none; }

/* Category / severity tabs */
.result-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--border-color);
}
.result-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.result-tab:hover:not(.active):not(:disabled) { color: var(--text-primary); transform: none; }
.result-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.rt-count {
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--bg-inset);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.02rem 0.38rem;
    min-width: 1.1rem;
    text-align: center;
}
.result-tab.active .rt-count {
    background: color-mix(in srgb, var(--accent-blue) 18%, transparent);
    color: var(--accent-blue);
}

/* Result groups */
.results-groups .result-group {
    background: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 1.25rem;
}
.results-groups .result-group:last-child { margin-bottom: 0; }
.results-groups.single-cat .group-title { display: none; }

/* Compact, expandable case rows */
.case-item {
    padding: 0;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.case-item:hover { transform: none; box-shadow: none; }
.case-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
}
.case-row:hover { background: var(--bg-inset); }
.case-row .case-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.case-row .case-title {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.case-row-tags { display: inline-flex; gap: 0.25rem; flex-shrink: 0; }
.case-row .btn-run { flex-shrink: 0; padding: 0.2rem 0.6rem; font-size: 0.75rem; }
.case-row .chevron { flex-shrink: 0; color: var(--text-secondary); transition: transform 0.2s ease; }
.case-item.open .chevron { transform: rotate(180deg); }
.case-body {
    padding: 0.25rem 0.7rem 0.7rem;
    border-top: 1px solid var(--border-color);
}
.case-body .case-desc {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin: 0.5rem 0;
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.case-rules {
    margin: 0.4rem 0 0 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.empty-group { padding: 0.5rem 0.2rem; font-size: 0.82rem; }

/* Collapsible CI/CD export */
details.cicd-export {
    margin-top: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-inset);
}
details.cicd-export > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
details.cicd-export > summary::-webkit-details-marker { display: none; }
details.cicd-export > summary::before { content: '\25B8'; margin-right: 0.5rem; color: var(--text-secondary); }
details.cicd-export[open] > summary::before { content: '\25BE'; }
details.cicd-export[open] > summary { border-bottom: 1px solid var(--border-color); }
details.cicd-export .export-format-cards { margin: 0.9rem; }
details.cicd-export #cicdPreview { margin: 0 0.9rem 0.9rem; }
