/* FaradAI Dashboard — bridges legacy variable names to the
   semantic tokens in `colors_and_type.css`. theme-faraday.css
   restyles the main UI primitives; this layer keeps the long
   tail of style.css rules picking up the new Faraday palette
   without each rule needing an edit. */
:root {
    --bg:        var(--bg-page);
    --bg-card:   var(--bg-app);
    --bg-hover:  var(--fd-paper-mute);
    --text:      var(--fg-1);
    --text-dim:  var(--fg-3);
    --green:     var(--sev-low);
    --red:       var(--sev-critical);
    --orange:    var(--sev-medium);
    --purple:    #8250df;
    --strix:     var(--fd-blue-700);
    --hexstrike: #a14400;
    --pentestgpt:#4f1e9d;
    --aipentest: var(--fd-coral-700);
    --triage:    var(--fd-blue-700);
    --navbar-bg: var(--bg-page);
    /* --accent, --accent-hover, --border are already defined in
       colors_and_type.css with Faraday Blue / ink-line values, so we
       intentionally don't shadow them here. */
}


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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--navbar-bg);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
}
.nav-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}
.nav-brand-name { color: var(--text); }
.nav-brand-name span { color: var(--accent); }
.nav-info { color: var(--text-dim); font-size: 0.82rem; }

.container { max-width: 100%; margin: 0 auto; padding: 24px; }

h1 { font-size: 1.5rem; margin-bottom: 4px; }
.subtitle { color: var(--text-dim); margin-bottom: 20px; }

/* Filters */
.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.filter-btn:hover { border-color: var(--text-dim); color: var(--text); }
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(232,62,62,0.1); }

/* Tag search input — lives in the same .filters bar as the agent buttons. */
.tag-search {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}
.tag-search:focus { outline: none; border-color: var(--accent); }

/* Inline tag chips inside each scan-table row's instruction cell. */
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-chip {
    display: inline-block;
    background: rgba(120,120,120,0.12);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Scan table */
.scan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    /* `fixed` so explicit th widths set by the resize JS are authoritative
       — with `auto` the browser ignores them and the column snaps back to
       its content-driven width as soon as the drag ends. */
    table-layout: fixed;
}
.scan-table th {
    text-align: left;
    padding: 8px 8px;
    border-bottom: 2px solid var(--border);
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.scan-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    /* Truncation now comes from the column width (table-layout: fixed) rather
       than from per-class max-width caps that fought the user's resize. */
    overflow: hidden;
    text-overflow: ellipsis;
}
.scan-table tr:hover { background: var(--bg-hover); }

.run-id { font-family: monospace; font-size: 0.78rem; color: var(--text-dim); }
.targets { color: var(--text); }
.instruction { color: var(--text-dim); }
.timestamp { font-family: monospace; font-size: 0.8rem; }
.vuln-count { font-weight: 600; text-align: center; }
.vuln-count.has-vulns { color: var(--orange); }
.cost { font-family: monospace; font-size: 0.8rem; color: var(--green); font-weight: 600; }
.tokens { font-family: monospace; font-size: 0.8rem; color: var(--text-dim); }
.duration { font-family: monospace; font-size: 0.8rem; text-align: center; }

/* Resizable column grip. Sits just inside the right edge so it never overlaps
 * the header label (which previously made "ACTIONS" look clipped under the
 * col-resize cursor). A thin centered rule appears on hover/drag as the
 * affordance instead of tinting the whole 5px strip. */
.col-resize-grip {
    position: absolute;
    right: -3px;
    top: 20%;
    bottom: 20%;
    width: 7px;
    cursor: col-resize;
    background: transparent;
    z-index: 2;
}
.col-resize-grip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: transparent;
    border-radius: 2px;
    transition: background 0.12s ease;
}
.col-resize-grip:hover::after,
.col-resize-grip:active::after { background: var(--accent); }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-strix { background: rgba(66,153,225,0.15); color: var(--strix); }
.badge-hexstrike { background: rgba(237,137,54,0.15); color: var(--hexstrike); }
.badge-pentestgpt { background: rgba(159,122,234,0.15); color: var(--pentestgpt); }
.badge-aipentest { background: rgba(232,62,62,0.15); color: var(--aipentest); }
.badge-triage { background: rgba(66,153,225,0.15); color: var(--triage); }
.badge-dryrun { background: rgba(245,166,35,0.15); color: var(--orange); font-style: italic; }

/* Status */
.status { font-size: 0.8rem; font-weight: 500; }
.status-completed { color: var(--green); }
.status-running { color: var(--orange); }
.status-stopping { color: var(--orange); font-style: italic; }
.status-stuck { color: var(--red); font-weight: 700; }
.status-starting { color: var(--text-dim); font-style: italic; }
.status-unknown { color: var(--text-dim); }
.status-aborted { color: #e53e3e; }
.abort-banner {
    background: rgba(229,62,62,0.08);
    border: 1px solid rgba(229,62,62,0.35);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9em;
    line-height: 1.5;
}
.abort-banner strong { color: #e53e3e; display: block; margin-bottom: 4px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn:hover { border-color: var(--accent); background: rgba(232,62,62,0.1); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(207,34,46,0.08); }

/* Actions column: a single kebab (⋯) trigger per row opening a floating menu
 * (View / Share / Preview / Delete). Fixed narrow width so it never balloons
 * and the header label is never crowded by the resize affordance. */
td.actions { white-space: nowrap; text-align: center; }
.scan-table th[data-col="actions"],
.scan-table td.actions {
    width: 56px;
    min-width: 56px;
    padding-left: 4px;
    padding-right: 4px;
}

/* Sticky action column: last column of the scan table stays pinned to
 * the right edge so the per-row actions are always reachable. Reads as
 * an inline always-visible column (no drop shadow) — the left-border
 * separator gives just enough definition without making the cell look
 * like an overlay. */
.scan-table th:last-child,
.scan-table td.actions {
    position: sticky;
    right: 0;
    background: var(--bg);
    z-index: 1;
    border-left: 1px solid var(--border);
}
.scan-table tr:hover td.actions { background: var(--bg-hover); }

/* Kebab trigger button */
.row-kebab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
}
.row-kebab-btn:hover,
.row-kebab-btn[aria-expanded="true"] {
    border-color: var(--border);
    background: var(--bg-hover);
    color: var(--accent);
}

/* Floating per-row actions menu — reuses .column-menu chrome for a consistent
 * surface, with item rows styled below. */
.row-actions-menu {
    min-width: 180px;
    padding: 6px;
}
.row-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.row-menu-item:hover { background: var(--bg-hover); color: var(--accent); }
.row-menu-item-danger { color: var(--red); }
.row-menu-item-danger:hover { background: rgba(207,34,46,0.08); color: var(--red); }
.row-menu-item-flash { color: var(--green) !important; }
.row-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* Per-row icon buttons in the Actions column. Three of them inline —
 * View (👁), Share (⇪), Delete (🗑) — each carries title + aria-label
 * so the action stays describable for screen readers and on hover. */
.row-action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    text-decoration: none;
}
.row-action-icon-btn:hover {
    border-color: var(--border);
    background: var(--bg-hover);
    color: var(--accent);
}
.row-action-icon-btn.row-action-delete:hover {
    border-color: var(--red);
    color: var(--red);
}
.row-action-icon-btn.row-action-flash {
    color: var(--green);
    border-color: var(--green);
}

/* Floating scroll-to-top arrow installed from base.html by
 * table-tools.js. Hidden until the page has scrolled. */
#scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--accent);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}
#scroll-to-top:hover { transform: translateY(-2px); border-color: var(--accent); }
#scroll-to-top[hidden] { display: none; }

/* Column-visibility dropdown rendered by table-tools.js. Position is set
 * inline (top/right) relative to the trigger button. */
.column-menu {
    position: absolute;
    min-width: 180px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    padding: 6px 0;
}
.column-menu[hidden] { display: none; }
.column-menu-list {
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
}
.column-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
}
.column-menu-item:hover { background: var(--bg-hover); }
.column-menu-item input[type="checkbox"] { accent-color: var(--accent); }
.column-menu-footer {
    display: flex;
    gap: 6px;
    padding: 6px 8px 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

/* Findings tab header — hosts the per-tab Columns button. Right-aligns
 * the button without disturbing the dynamically rendered bucket list
 * below. */
.findings-tab-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* Run detail page */
.run-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.run-header h1 { font-size: 1.3rem; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.meta-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}
.meta-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.meta-value { font-size: 0.95rem; word-break: break-all; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-dim);
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

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

/* Log viewer */
.log-viewer {
    background: #0a0d14;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    max-height: 600px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #c9d1d9;
}

/* Report viewer */
.report-viewer {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 28px;
    line-height: 1.7;
    max-width: 100%;
    overflow-x: auto;
}
.report-viewer h1 { font-size: 1.4rem; margin: 24px 0 12px; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.report-viewer h2 { font-size: 1.15rem; margin: 20px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 4px; color: var(--accent); }
.report-viewer h3 { font-size: 1rem; margin: 16px 0 8px; }
.report-viewer code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; font-family: 'SF Mono', 'Fira Code', monospace; }
.report-viewer pre {
    background: #0a0d14;
    color: #c9d1d9;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 0.82rem;
}
.report-viewer pre code { background: none; padding: 0; }
.report-viewer a { color: var(--accent); text-decoration: none; }
.report-viewer a:hover { text-decoration: underline; }
/* Tables */
.report-viewer table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.88rem; }
.report-viewer th {
    text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border);
    color: var(--text-dim); font-weight: 600; font-size: 0.82rem;
    text-transform: uppercase; letter-spacing: 0.3px;
    background: var(--bg-card);
}
.report-viewer td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.report-viewer tr:hover { background: var(--bg-hover); }
/* Blockquotes — used for enrichment badges */
.report-viewer blockquote {
    margin: 4px 0 8px; padding: 6px 12px;
    border-left: 4px solid var(--orange);
    background: rgba(245,158,11,0.08);
    border-radius: 0 6px 6px 0;
    font-size: 0.88rem; font-weight: 500;
}
/* Lists */
.report-viewer ul, .report-viewer ol { padding-left: 24px; margin: 8px 0; }
.report-viewer li { margin: 4px 0; }
/* Horizontal rules */
.report-viewer hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
/* Strong in tables for severity */
.report-viewer td strong { font-weight: 600; }

/* Terminal (removed — kept as placeholder for dimensions) */

/* Findings table */
.findings-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.findings-table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); color: var(--text-dim); }
.findings-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.sev-critical { color: var(--red); font-weight: 600; }
.sev-high { color: #bc4c00; font-weight: 600; }
.sev-medium { color: var(--orange); }
.sev-low { color: var(--green); }
.sev-informational { color: var(--text-dim); }

/* FaradAI sequential finding ID (F-1, F-2, ...). Per-scan counter assigned
 * at render time in severity-sorted order, spanning every bucket and
 * invocation group of the scan so a finding can be referenced by a stable
 * short token within the run. */
.finding-id {
    display: inline-block;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(232, 62, 62, 0.08);
    border: 1px solid rgba(232, 62, 62, 0.2);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* Findings — expandable details row */
.finding-details-toggle {
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
    border-radius: 4px; padding: 2px 8px; font-size: 0.78rem; cursor: pointer;
}
.finding-details-toggle:hover { background: var(--bg-hover); }
.finding-details-row td { background: var(--bg-card); padding: 12px 16px; }
.finding-section { margin: 8px 0; }
.finding-section-label {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-dim); font-weight: 600; margin-bottom: 4px;
}
.finding-section-body { font-size: 0.85rem; line-height: 1.5; white-space: pre-wrap; }
.finding-link-list { padding-left: 20px; margin: 4px 0; font-size: 0.85rem; }
.finding-link-list li { margin: 2px 0; }
.finding-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.finding-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    background: var(--bg-hover); color: var(--text); border: 1px solid var(--border);
    font-size: 0.75rem; font-family: 'SF Mono', 'Fira Code', monospace;
}
.finding-badge-cve { border-color: var(--red); color: var(--red); }
.finding-badge-cwe { border-color: var(--orange); color: var(--orange); }
.finding-badge-cvss { border-color: var(--accent); color: var(--accent); }

/* Findings — inline field editing (name, severity, description, resolution).
 * Shared by both the row-level cells (name, severity) and the details-panel
 * sections (description, resolution) via buildEditableField() in
 * run_detail.html. .ff-field-view/.ff-edit-btn is the resting "view" state;
 * clicking the pencil swaps this wrapper's contents for a control + Save/Cancel. */
.findings-hint {
    color: var(--text-dim); font-size: 0.82rem; margin: 4px 0 10px;
}
.ff-field-wrap { display: inline-flex; align-items: center; gap: 6px; }
.finding-section .ff-field-wrap { display: flex; align-items: flex-start; }
.ff-field-view { white-space: pre-wrap; }
.ff-field-empty { color: var(--text-dim); font-style: italic; }
.ff-edit-btn {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: 0.85rem; padding: 0 2px; line-height: 1; opacity: 0.6;
}
.ff-edit-btn:hover { opacity: 1; color: var(--accent); }
.ff-field-input { font-size: 0.85rem; }
.finding-section .ff-field-input { width: 100%; }
.ff-field-actions { margin-top: 4px; display: block; }
.ff-field-status { margin-left: 8px; font-size: 0.85rem; }

/* Instruction & Goal box on the run-overview tab. Long briefs would
   otherwise overflow a meta-grid tile and skew the whole header. */
.instruction-goal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    max-height: 320px;
    overflow-y: auto;
}
.ig-block + .ig-block { margin-top: 12px; }
.ig-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.ig-value {
    margin: 0;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Section groups */
.section-group { margin-bottom: 20px; }
.section-title {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Log file selector */
.file-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.file-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: monospace;
}
.file-btn:hover { border-color: var(--text-dim); color: var(--text); }
.file-btn.active { border-color: var(--accent); color: var(--accent); }

/* Log groups (AI Pentest round grouping) */
.log-groups { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.log-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.log-group-header {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}
.log-group-files { display: flex; gap: 6px; padding: 10px 14px; flex-wrap: wrap; }
.file-icon {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-right: 4px;
}
.file-icon.stdout { background: rgba(26,127,55,0.12); color: var(--green); }
.file-icon.stderr { background: rgba(207,34,46,0.12); color: var(--red); }

/* File tree browser */
.file-tree {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.file-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: monospace;
}
.file-tree-item:last-child { border-bottom: none; }
.file-tree-item:hover { background: var(--bg-hover); }
.file-tree-item.active { background: rgba(232,62,62,0.1); border-left: 3px solid var(--accent); }
.file-tree-icon { font-size: 0.9rem; flex-shrink: 0; }
.file-tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree-ext {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    background: var(--bg-hover);
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.modal-content h2 { font-size: 1.2rem; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Forms */
.form-group { margin-bottom: 12px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ---- AI Pentest Console ---- */
.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}
.console-status { font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.console-status-label { color: var(--text-dim); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.5px; }
.console-live-dot {
    width: 8px; height: 8px;
    background: var(--orange);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}
.console-controls { display: flex; align-items: center; gap: 12px; }
.console-autoscroll { font-size: 0.8rem; color: var(--text-dim); display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* Cost bar (token & $ tracking) */
.console-cost-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text);
}
.console-cost-bar-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.console-cost-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.85rem;
    line-height: 1;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.console-cost-toggle:hover { color: var(--text); border-color: var(--text-dim); }
html.hide-console-cost-bar .console-cost-bar-content { display: none; }
.cost-label {
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}
.cost-sep { color: var(--border); }
.cost-breakdown { color: var(--text-dim); font-size: 0.78rem; }
#cost-total { font-weight: 600; color: var(--green); }
#cost-tokens { font-weight: 600; }

/* Per-turn cost badge next to turn_end markers */
.evt-cost-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text);
    white-space: nowrap;
}
.evt-marker { display: flex; align-items: center; gap: 8px; }

.console-stream {
    height: calc(100vh - 460px);
    min-height: 400px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 14px;
    font-size: 0.88rem;
}
.console-empty { color: var(--text-dim); text-align: center; padding: 40px; font-style: italic; }

.console-summary-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    position: sticky; bottom: 0; z-index: 5;
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin: 8px -14px -12px; padding: 10px 14px 12px;
}
.console-events { /* events container inside the scrollable console-stream */ }

/* Per-list minimize trigger sitting on the FIRST event of each list. */
.evt-min-trigger {
    float: right;
    background: var(--bg-elev, var(--bg)); border: 1px solid var(--border);
    border-radius: 4px; cursor: pointer;
    width: 22px; height: 22px; line-height: 18px; padding: 0;
    font-size: 1rem; color: var(--text); font-family: monospace;
    margin-left: 8px;
}
.evt-min-trigger:hover { border-color: var(--orange); color: var(--orange); }

/* Console fullscreen takeover — keeps directive input visible. */
.tab-content.console-fullscreen {
    position: fixed; inset: 0;
    background: var(--bg);
    z-index: 1000;
    padding: 16px;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.tab-content.console-fullscreen .console-header { flex: 0 0 auto; }
.tab-content.console-fullscreen .console-stream {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
}
.tab-content.console-fullscreen .console-input { flex: 0 0 auto; margin-top: 10px; }
body.console-fullscreen-on { overflow: hidden; }
.console-summary-pill {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--bg-elev, var(--bg)); border: 1px solid var(--border);
    border-radius: 16px; padding: 4px 12px;
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem;
    color: var(--text); cursor: pointer; max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.console-summary-pill:hover { border-color: var(--orange); }
.console-summary-pill[data-collapsed="true"] { background: var(--bg); opacity: 0.85; }
.console-summary-caret { font-size: 0.85rem; opacity: 0.6; }

.console-stream.hide-directives .evt-directive,
.console-stream.hide-directives .evt-directive-inline { display: none; }
.console-stream.hide-vulns .evt-finding { display: none; }

/* Out-of-scope findings section — collapsible below the in-scope table.
   Legacy classes retained for older cached pages; new code uses .findings-bucket. */
.findings-oos-section { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 18px; }
.findings-oos-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.findings-oos-title { margin: 0; font-size: 1rem; color: var(--text-dim); font-weight: 600; }
.findings-oos-subtitle { margin: 0 0 12px; font-size: 0.82rem; color: var(--text-dim); font-style: italic; }

/* Multi-bucket findings view — one section per source file (findings.json,
   findings_validated.json, findings_out_of_scope.json, …). Each bucket has a
   colour-coded tag chip so it's obvious which findings came from where. */
.findings-bucket { margin-top: 24px; }
.findings-bucket:first-of-type { margin-top: 0; }
.findings-bucket-oos { border-top: 1px solid var(--border); padding-top: 18px; }
.findings-bucket-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.findings-bucket-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; }
.findings-bucket-count { color: var(--text-dim); font-weight: 500; font-size: 0.9rem; }
.findings-bucket-subtitle { margin: 0 0 12px; font-size: 0.82rem; color: var(--text-dim); }
.findings-bucket-subtitle code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--bg-card); padding: 1px 5px; border-radius: 3px; }
.findings-bucket-tag {
    display: inline-block; padding: 2px 9px; border-radius: 10px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.4px;
    text-transform: uppercase; line-height: 1.4;
    border: 1px solid transparent;
}
/* Validated / confirmed → green, treated as the highest-trust bucket. */
.findings-bucket-tag-validated { background: rgba(34, 197, 94, 0.14); color: #16a34a; border-color: rgba(34, 197, 94, 0.35); }
/* Raw / pre-triage → neutral grey. */
.findings-bucket-tag-raw { background: var(--bg-card); color: var(--text-dim); border-color: var(--border); }
/* Out-of-scope → amber/dim, signals "not pushed". */
.findings-bucket-tag-out_of_scope { background: rgba(234, 179, 8, 0.12); color: #b45309; border-color: rgba(234, 179, 8, 0.35); }

/* Invocation sub-headers inside a findings bucket: divide findings by which
   run (initial vs resume N) discovered them. Soft chip + dim subtitle so
   it sits below the bucket header without competing visually. */
.findings-invocation-group { margin-top: 16px; }
.findings-invocation-group:first-of-type { margin-top: 6px; }
.findings-invocation-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--border); }
.findings-invocation-chip {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.3px;
    text-transform: uppercase; line-height: 1.4;
    background: rgba(99, 102, 241, 0.12); color: #4f46e5; border: 1px solid rgba(99, 102, 241, 0.3);
}
.findings-invocation-chip.is-initial { background: rgba(34, 197, 94, 0.12); color: #16a34a; border-color: rgba(34, 197, 94, 0.3); }
.findings-invocation-meta { font-size: 0.8rem; color: var(--text-dim); }

/* Resume marker in console: a centred banner divider so the boundary
   between invocations is immediately visible when scrolling the event
   stream. Uses the indigo of the invocation chip for consistency. */
.evt-resume-marker {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 18px 0; padding: 8px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    font-size: 0.82rem;
}
.evt-resume-badge {
    font-weight: 700; letter-spacing: 0.4px; color: #4f46e5;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
}
.evt-resume-text { color: var(--text); }

/* Expired share-link page — clean, centered, no scan chrome. */
.share-expired {
    max-width: 560px; margin: 80px auto 0; padding: 0 24px;
    text-align: center;
}
.share-expired-icon {
    font-size: 4rem; line-height: 1; color: var(--orange); opacity: 0.7;
    margin-bottom: 18px;
}
.share-expired h1 { margin: 0 0 12px; font-size: 1.6rem; }
.share-expired .subtitle { font-size: 1rem; color: var(--text-dim); margin: 0 0 28px; }
.share-expired-contact { font-size: 0.9rem; color: var(--text-dim); }

/* Preview share-link teaser banner (4.0.35) — sits above the capped findings
   table on a /share/<preview_token> view. Shows the full count + severity
   breakdown to hook a lead while only ~20% of findings are listed below. */
.preview-teaser {
    border: 1px solid var(--orange, #d97706);
    border-left-width: 4px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--orange, #d97706) 8%, var(--bg));
    padding: 14px 18px;
    margin: 0 0 16px;
}
.preview-teaser-headline { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.preview-teaser-breakdown { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 8px; }
.preview-breakdown-label { margin-right: 4px; }
.preview-sev { white-space: nowrap; }
.preview-sev-critical { color: var(--red, #dc2626); font-weight: 600; }
.preview-sev-high { color: var(--orange, #d97706); font-weight: 600; }
.preview-teaser-cta { font-size: 0.92rem; }

/* Topbar language dropdown. Sits in the topbar next to the FaradAI brand
   text. Click the chip to open a 6-row menu of flag + native name; click
   any row to switch. */
.lang-picker { position: relative; display: inline-block; margin-left: 12px; }
.lang-picker-current {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-elev, var(--bg));
    border: 1px solid var(--border); border-radius: 14px;
    padding: 3px 10px; cursor: pointer;
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem;
    color: var(--text); line-height: 1.2;
}
.lang-picker-current:hover { border-color: var(--orange); }
.lang-picker-flag-current { font-size: 1rem; line-height: 1; }
.lang-picker-code { letter-spacing: 0.5px; }
.lang-picker-caret { font-size: 0.7rem; opacity: 0.7; }

.lang-picker-menu {
    position: absolute; top: calc(100% + 6px); left: 0;
    margin: 0; padding: 4px; list-style: none;
    background: var(--bg-elev, var(--bg)); border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    min-width: 160px; z-index: 1000;
}
.lang-picker-menu li { margin: 0; padding: 0; }
.lang-picker-option {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 6px 10px; background: transparent; border: 0;
    border-radius: 6px; cursor: pointer; color: var(--text);
    font: inherit; font-size: 0.85rem; text-align: left;
}
.lang-picker-option:hover { background: var(--bg); }
.lang-picker-option.active { color: var(--orange); font-weight: 600; }
.lang-picker-flag { font-size: 1.05rem; line-height: 1; }
.lang-picker-native { flex: 1; }

/* Event cards */
.evt { margin-bottom: 10px; }
.evt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.75rem;
}
.evt-agent-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}
.evt-ts { color: var(--text-dim); font-family: monospace; font-size: 0.75rem; }
.evt-tool-label {
    font-family: monospace;
    color: var(--text-dim);
    background: var(--bg-hover);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
}

/* Claude vs Codex color coding */
.evt-claude .evt-agent-chip { background: rgba(207,34,46,0.12); color: var(--aipentest); }
.evt-codex .evt-agent-chip { background: rgba(26,127,55,0.12); color: var(--green); }

/* Scan start banner */
.evt-scan-start {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.evt-scan-start .evt-title { font-weight: 600; margin-bottom: 4px; }
.evt-scan-start .evt-meta { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 4px; }
.evt-scan-start code { background: var(--bg-hover); padding: 1px 6px; border-radius: 3px; font-size: 0.85rem; }
.evt-scan-start .evt-goal { font-size: 0.85rem; color: var(--text); margin-top: 4px; }

/* Turn header */
.evt-turn-start {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 20px 0 10px;
    border-top: 2px solid var(--border);
    font-size: 0.85rem;
}
.evt-turn-start:first-child { margin-top: 0; border-top: none; }
.evt-turn-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.evt-claude.evt-turn-start .evt-turn-badge { background: rgba(207,34,46,0.12); color: var(--aipentest); border-color: rgba(207,34,46,0.3); }
.evt-codex.evt-turn-start .evt-turn-badge { background: rgba(26,127,55,0.12); color: var(--green); border-color: rgba(26,127,55,0.3); }
.evt-turn-agent { font-weight: 600; }
.evt-turn-round { color: var(--text-dim); font-size: 0.8rem; }

/* Marker (start/end of turn) */
.evt-marker { font-size: 0.75rem; color: var(--text-dim); padding: 2px 12px; }
.evt-marker-text { font-style: italic; }

/* Message bubble */
.evt-message {
    background: var(--bg-card);
    border-left: 3px solid var(--border);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
}
.evt-claude.evt-message { border-left-color: var(--aipentest); }
.evt-codex.evt-message { border-left-color: var(--green); }
.evt-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.87rem;
    line-height: 1.55;
}

/* Tool call block */
.evt-tool {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
}
.evt-claude.evt-tool { border-left: 3px solid var(--aipentest); }
.evt-codex.evt-tool { border-left: 3px solid var(--green); }
.evt-cmd {
    background: #0a0d14;
    color: #7ee787;
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    margin: 2px 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.evt-output {
    background: #0a0d14;
    color: #c9d1d9;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #c9d1d9;
}

/* Finding badge */
.evt-finding {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 10px;
    background: rgba(245,158,11,0.08);
    border-left: 3px solid var(--orange);
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
}
.evt-finding-sev {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--bg-card);
}
.evt-finding-name { flex: 1; }
.evt-finding-host { color: var(--text-dim); font-family: monospace; font-size: 0.8rem; }
.evt-repro { margin-top: 6px; font-size: 0.82rem; }
.evt-repro summary { cursor: pointer; color: var(--accent); font-size: 0.8rem; }
.evt-repro .evt-cmd { cursor: pointer; position: relative; }
.evt-repro .evt-cmd:hover::after { content: "click to copy"; position: absolute; right: 8px; top: 4px; font-size: 0.7rem; color: var(--text-dim); }
.evt-finding { flex-wrap: wrap; }

/* Operator directive */
.evt-directive, .evt-directive-inline {
    background: rgba(232,62,62,0.08);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    margin: 8px 0;
}
.evt-directive-inline {
    background: rgba(245,158,11,0.12);
    border-left-color: var(--orange);
}
.evt-directive-label {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.evt-directive-inline .evt-directive-label { color: var(--orange); }

/* Control-command echo (PAUSE / RESUME / STOP / ADD ROUNDS) — thin
 * high-contrast strip so an operator can spot exactly when + from where
 * their command hit the runner. Styled distinct from OPERATOR DIRECTIVE
 * so a scan-history skim can distinguish "user injected guidance" from
 * "user changed the runner's state". */
.evt-control {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    margin: 4px 0;
    background: rgba(88,166,255,0.08);
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
}
.evt-control .evt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.evt-control-icon { font-size: 1rem; }
.evt-control-label {
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.evt-control-source {
    color: var(--text-dim);
    font-size: 0.78rem;
}
.evt-control .evt-ts { margin-left: auto; color: var(--text-dim); font-size: 0.75rem; }

/* Thinking block */
.evt-thinking {
    background: var(--bg-card);
    border-left: 3px dashed var(--text-dim);
    border-radius: 0 6px 6px 0;
    padding: 6px 10px;
    opacity: 0.85;
}
.evt-thinking-body {
    font-style: italic;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* Tool error flag */
.evt-tool-error {
    font-family: monospace;
    background: rgba(207,34,46,0.15);
    color: var(--red);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Console input */
.console-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 10px 14px;
}
.console-input textarea {
    resize: vertical;
    min-height: 50px;
}
.console-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 10px;
}
.console-input-actions span { font-size: 0.8rem; color: var(--text-dim); }
.console-control-buttons {
    display: inline-flex;
    gap: 6px;
    margin-left: auto;
}
.console-control-buttons .btn { padding: 3px 10px; font-size: 0.82rem; }

/* Console Grid view */
.grid-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.grid-header-actions { display: flex; gap: 8px; }

.console-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.grid-pagination {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 24px 0 8px;
}
.grid-pagination .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.grid-page-indicator { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85rem; color: var(--text-dim); }

.console-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}
.console-card:hover { border-color: var(--text-dim); }
.console-card[data-status="running"] {
    border-color: rgba(26,127,55,0.45);
    box-shadow: 0 0 0 1px rgba(26,127,55,0.18);
}
.console-card[data-status="stopping"] {
    border-color: rgba(230,126,34,0.5);
    box-shadow: 0 0 0 1px rgba(230,126,34,0.2);
}
.console-card[data-status="stuck"] {
    border-color: rgba(220,53,69,0.6);
    box-shadow: 0 0 0 1px rgba(220,53,69,0.25);
}
.console-card.console-card-revealed-hidden {
    opacity: 0.55;
    border-style: dashed;
}

.console-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.console-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.console-card-link {
    color: var(--accent);
    text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.console-card-link:hover { text-decoration: underline; }

.console-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 12px;
    font-size: 0.78rem;
    color: var(--text-dim);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.meta-target {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
    color: var(--text);
}
.meta-sep { opacity: 0.45; }
.meta-vulns { color: var(--red); font-weight: 600; }

.mini-terminal {
    background: #0d1117;
    color: #c9d1d9;
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.72rem;
    line-height: 1.45;
    flex: 1;
    min-height: 200px;
    max-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mini-terminal-cmd {
    color: #7ee787;
    white-space: pre-wrap;
    word-break: break-all;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 6px;
    flex-shrink: 0;
    max-height: 72px;
    overflow-y: auto;
    text-overflow: ellipsis;
}
.mini-terminal-output {
    margin: 0;
    color: #c9d1d9;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: inherit;
    font-size: inherit;
    background: transparent;
    border: none;
    padding: 0;
}
/* Dark scrollbar for mini terminal */
.mini-terminal-output::-webkit-scrollbar,
.mini-terminal-cmd::-webkit-scrollbar { width: 8px; }
.mini-terminal-output::-webkit-scrollbar-track,
.mini-terminal-cmd::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.mini-terminal-output::-webkit-scrollbar-thumb,
.mini-terminal-cmd::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
.mini-terminal-output::-webkit-scrollbar-thumb:hover,
.mini-terminal-cmd::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }

/* Hide button on console card */
.console-card-hide {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.console-card:hover .console-card-hide { opacity: 1; }
.console-card-hide:hover { color: var(--red); background: rgba(207,34,46,0.08); }

/* Hidden indicator next to filters */
.grid-hidden-info {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.grid-hidden-info.visible { display: inline-flex; }
.grid-hidden-info .link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    text-decoration: underline;
}
.grid-hidden-info .link-btn:hover { color: var(--accent-hover); }

/* When .filters has the hidden info pulled in, allow it to wrap nicely */
.filters { flex-wrap: wrap; align-items: center; }

/* Re-run panel form layout (run-detail page) */
.rerun-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.rerun-grid label, .rerun-row label {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: var(--text-dim);
    gap: 3px;
}
.rerun-row { display: flex; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.rerun-row label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
