/* LOMAinsights — Data Platform, page-scoped layer.

   Everything shared (shell, topbar, buttons, dl-hero, dl-arch, dl-why, tabs,
   footer) lives in /styles.css. This file styles only the components that
   data-layer/app.js injects at runtime.

   It must never redefine a :root token — doing so previously overrode the
   global palette and broke the shared topbar on this page. */

[hidden] { display: none !important; }

/* app.js toggles `.active` rather than the hidden attribute */
.dl-tab-panel { display: none; }
.dl-tab-panel.active { display: block; }

code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    padding: 1px 5px;
}

/* ── Section heads inside tabs ────────────────────────────────────── */
.data-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-2);
    margin-bottom: var(--s-3);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line-strong);
}
.data-section-head-mt { margin-top: var(--s-7); }
.data-section-head h3 { font-size: 1.0625rem; }
.data-section-meta {
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Tables ───────────────────────────────────────────────────────── */
.src-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.src-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-xs);
    min-width: 720px;
}
.src-table th,
.src-table td {
    text-align: left;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.src-table thead th {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.src-table tbody tr { transition: background-color var(--dur) var(--ease); }
.src-table tbody tr:hover { background: var(--surface-alt); }
.src-table tbody tr:last-child td { border-bottom: 0; }

/* Status uses a leading square, not a coloured pill — the direction has no
   filled shapes and one accent. Colour is doubled by the label text. */
.src-status {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.src-status::before { content: ""; width: 6px; height: 6px; flex: none; background: currentColor; }
.src-status-ok { color: var(--ok); }
.src-status-warn { color: var(--warn); }
.src-status-fail { color: var(--accent); }

.data-foot-note {
    margin-top: var(--s-3);
    font-size: var(--text-xs);
    color: var(--muted);
    max-width: var(--measure);
}

/* ── Semantic controls ────────────────────────────────────────────── */
.sem-controls { display: flex; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.sem-search, .sem-filter {
    padding: var(--s-3) var(--s-4);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: border-color var(--dur) var(--ease);
}
.sem-search:hover, .sem-filter:hover { border-color: var(--accent); }
.sem-search { flex: 1 1 240px; }
.sem-filter { min-width: 200px; }
.sem-formula {
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    color: var(--muted);
    white-space: normal;
}

/* ── Pipeline ─────────────────────────────────────────────────────── */
.pipeline-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line-strong); }
.pipe-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 110px 90px minmax(0, 2fr);
    gap: var(--s-4);
    align-items: center;
    background: var(--surface);
    padding: var(--s-3) var(--s-4);
    font-size: var(--text-xs);
    border-left: 3px solid var(--ok);
    transition: background-color var(--dur) var(--ease);
}
.pipe-row:hover { background: var(--surface-alt); }
.pipe-warn { border-left-color: var(--warn); }
.pipe-fail { border-left-color: var(--accent); }
.pipe-ts { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--muted); }
.pipe-rows { color: var(--muted); font-variant-numeric: tabular-nums; }
.pipe-note { color: var(--muted); }

/* ── Security cards ───────────────────────────────────────────────── */
.sec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line-strong);
}
.sec-card {
    background: var(--surface);
    padding: var(--s-5);
    display: grid;
    gap: var(--s-2);
    align-content: start;
    transition: background-color var(--dur) var(--ease);
}
.sec-card:hover { background: var(--surface-alt); }
.sec-card h4 { font-size: 0.9375rem; font-weight: 700; letter-spacing: var(--track-tight); }
.sec-card p { font-size: var(--text-sm); color: var(--muted); }
.sec-card .sec-tag {
    justify-self: start;
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

@media (max-width: 980px) {
    .pipe-row { grid-template-columns: 1fr 1fr; }
    .pipe-note { grid-column: 1 / -1; }
}
