/* =====================================================================================================================
   Bench Discovery Review - design system (Local Preview).

   THE PALETTE IS THE DESKTOP PRODUCT'S. Every colour below is the exact token from
   Bench_Discovery\src\BenchDiscovery.App\Theme\Tokens.xaml, so the web application and the desktop application are
   recognisably one product: the same Fluent neutrals, the same blue reserved for the single primary action, and the
   same status colours. The layout, spacing, radii and motion stay web-native - this is not an imitation of a desktop
   window. System fonts only (no external fonts, CDNs or tracking).

   Status is always written in words; colour only supports it.
   ===================================================================================================================== */

:root {
    /* Surfaces and text: C.Background, C.Surface, C.SurfaceMuted, C.NeutralTint, C.Border, C.BorderStrong,
       C.TextPrimary, C.TextSecondary, C.TextTertiary. */
    --bg: #f3f3f3;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --surface-3: #f0f0f0;
    --border: #e6e6e6;
    --border-strong: #d1d1d1;
    --text: #1b1b1b;
    --text-2: #5d5d5d;
    --muted: #767676;

    /* The one accent, reserved for primary actions, focus, selection and progress: C.Primary / Hover / Tint. */
    --accent: #0f6cbd;
    --accent-hover: #115ea3;
    --accent-soft: #eff6fc;
    --accent-ring: rgba(15, 108, 189, 0.38);

    --info: #0f6cbd;
    --info-soft: #eff6fc;
    --needs: #9d5d00;       /* C.Warning: a row that needs a person */
    --needs-soft: #fff4ce;
    --other: #424242;       /* C.Neutral: read, nothing found */
    --other-soft: #f0f0f0;
    --error: #c42b1c;
    --error-soft: #fde7e9;
    --success: #107c10;
    --success-soft: #edf7ed;
    --warn: #9d5d00;
    --warn-soft: #fff4ce;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 2px 8px rgba(16, 24, 40, 0.07);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

    /* Segoe UI first, as the desktop product uses; system fonts throughout, nothing fetched. */
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

    --header-h: 58px;
    --sidebar-w: 244px;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5rem; color: var(--text); font-weight: 650; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1:focus { outline: none; }

:focus-visible {
    outline: 3px solid var(--accent-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--surface); color: var(--text);
    padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.skip-link:focus { top: 10px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.right { text-align: right; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

/* History filters: one row on a desktop, stacked on a narrow screen; every control keeps its label. */
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.filters .field { margin: 0; min-width: 0; }
.filters .field.grow { flex: 1 1 14rem; }
.filters input[type="date"], .filters input[type="search"], .filters select { min-width: 0; }
.run-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }

/* A group heading above a band of stat cards, so the two count dimensions cannot be read as one. */
.section-title { font-size: 0.95rem; margin: 0 0 8px; font-weight: 600; }

/* Per-file event timeline: only what was recorded, one line each. */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 4px 0 4px 12px; font-size: 0.9rem; flex-wrap: wrap; }
.timeline li + li { border-top: 1px solid var(--border-subtle, var(--border)); }

/* ----------------------------------------------------------------------------------------------------------- shell */
.app-header {
    position: sticky; top: 0; z-index: 20;
    height: var(--header-h);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex; align-items: center; gap: 0.6rem;
    color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap;
}
.brand:hover { color: var(--text); }
/* The product's own mark, as the desktop application uses it. Height-constrained so the header keeps its rhythm. */
.brand-mark { height: 30px; width: auto; display: block; }
.hero-logo { height: 84px; width: auto; display: block; margin: 0 auto 6px; }
.auth-brand { display: flex; align-items: center; gap: 0.8rem; }
.auth-brand img { height: 40px; width: auto; display: block; }
.brand-name { font-size: 1rem; }
.edition {
    font-size: 0.72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft);
    border: 1px solid #cbe6e2; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}

.header-context { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 1 1 auto; }
.org-switch { position: relative; }
.org-switch summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
    font-weight: 600; color: var(--text-2); max-width: 280px;
}
.org-switch summary::-webkit-details-marker { display: none; }
.org-switch summary .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; z-index: 30;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 6px; display: flex; flex-direction: column;
}
.menu.right-align { left: auto; right: 0; }
.menu a, .menu button.menu-item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer;
}
.menu a:hover, .menu button.menu-item:hover { background: var(--surface-3); }
.menu .menu-meta { padding: 8px 10px; color: var(--muted); font-size: 0.8rem; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu form { margin: 0; }

.user-menu { margin-left: auto; position: relative; }
.user-menu summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; padding: 4px 6px;
    border-radius: 999px; border: 1px solid transparent;
}
.user-menu summary:hover { border-color: var(--border); }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
    background: var(--info-soft); color: var(--info);
}

.app-body { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.app-body.no-sidebar { grid-template-columns: minmax(0, 1fr); }

.app-sidebar { align-self: stretch; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; }
.app-sidebar > nav { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
.nav-section { margin-bottom: 18px; }
.nav-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.nav-link {
    display: flex; align-items: center; gap: 0.6rem; padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--text-2); text-decoration: none; font-weight: 550;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link[aria-current="page"], .nav-link.active { background: var(--accent-soft); color: var(--accent-hover); }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.85; }

.app-main { padding: 28px 32px 56px; min-width: 0; }
.content-width { max-width: 1240px; margin: 0 auto; }

.mobile-nav { display: none; }

@media (max-width: 960px) {
    .app-body { grid-template-columns: minmax(0, 1fr); }
    .app-sidebar { display: none; }
    .mobile-nav { display: block; position: relative; }
    .mobile-nav summary {
        list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
        background: var(--surface-2); font-weight: 600;
    }
    .mobile-nav summary::-webkit-details-marker { display: none; }
    .mobile-nav .menu { min-width: 260px; }
    .app-main { padding: 20px 16px 48px; }
    .brand-name { display: none; }
    .org-switch summary { max-width: 160px; }
}

@media (max-width: 520px) {
    .edition { display: none; }
    h1 { font-size: 1.35rem; }
}

/* ----------------------------------------------------------------------------------------------------- page header */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .sep { color: var(--border-strong); }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 22px; }
.page-header .subtitle { color: var(--muted); margin: 0.25rem 0 0; max-width: 72ch; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 38px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { color: var(--error); border-color: #efc2bd; background: var(--surface); }
.btn-danger:hover { background: var(--error-soft); color: var(--error); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 0.85rem; }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: 1rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* ------------------------------------------------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-account { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .grid-account { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-sidebar { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.link-card { display: block; text-decoration: none; color: inherit; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.link-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); color: inherit; }

.stat { padding: 16px 18px; }
.stat-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.stat-note { font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 2px 9px; border-radius: 999px;
    font-size: 0.78rem; font-weight: 650; border: 1px solid transparent; white-space: nowrap; line-height: 1.5;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.badge-needs { color: var(--needs); background: var(--needs-soft); border-color: #f4d7b3; }
.badge-other { color: var(--other); background: var(--other-soft); border-color: #dbe1e8; }
.badge-error { color: var(--error); background: var(--error-soft); border-color: #f3c6c0; }
.badge-success { color: var(--success); background: var(--success-soft); border-color: #bfe2cc; }
.badge-info { color: var(--info); background: var(--info-soft); border-color: #c9d9f6; }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: #f1dea4; }
.badge-neutral { color: var(--text-2); background: var(--surface-3); border-color: var(--border); }

/* ---------------------------------------------------------------------------------------------------------- alerts */
.alert { display: flex; gap: 0.7rem; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; }
.alert p:last-child { margin-bottom: 0; }
.alert-info { background: var(--info-soft); border-color: #c9d9f6; color: #1b3f7a; }
.alert-warn { background: var(--warn-soft); border-color: #f1dea4; color: #5d3d00; }
.alert-error { background: var(--error-soft); border-color: #f3c6c0; color: #7f1a12; }
.alert-success { background: var(--success-soft); border-color: #bfe2cc; color: #0f4d29; }
.alert ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

/* ------------------------------------------------------------------------------------------------------------ forms */
.form-grid { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.help { color: var(--muted); font-size: 0.83rem; }
.field-error, .validation-message { color: var(--error); font-size: 0.83rem; }
.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
    width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.textarea, .field textarea { min-height: 180px; resize: vertical; font-family: var(--mono); font-size: 0.88rem; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.invalid { border-color: var(--error) !important; }
.checkbox { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.narrow { max-width: 460px; }
.medium { max-width: 720px; }
input[type=file] { font: inherit; }

/* ----------------------------------------------------------------------------------------------------------- tables */
/* position: relative keeps absolutely positioned screen-reader text inside the scroller (otherwise it widens the page). */
.table-wrap { position: relative; width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th {
    text-align: left; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700;
    padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfd; }
table.data tr.selected { background: var(--accent-soft); }
table.data .file-cell { min-width: 220px; max-width: 360px; }
table.data .findings { min-width: 180px; max-width: 320px; overflow-wrap: anywhere; }
.file-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.file-folder { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }

.toolbar { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .field { margin: 0; }
.toolbar .field input, .toolbar .field select { min-height: 36px; }
.pagination { display: flex; gap: 0.4rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }

/* -------------------------------------------------------------------------------------------------------- progress */
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #0f766e, #1f7fbf); border-radius: 999px; transition: width 0.3s ease; }
.progress.small { height: 6px; }

/* ------------------------------------------------------------------------------------------------------ empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h2, .empty-state h3 { color: var(--text); }
.empty-state .icon { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--accent); opacity: 0.85; }

/* ------------------------------------------------------------------------------------------------- key/value lists */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ----------------------------------------------------------------------------------------------------- setup steps */
.steps { counter-reset: step; display: grid; gap: 16px; }
.step { position: relative; }
.step-head { display: flex; gap: 0.75rem; align-items: center; }
.step-number {
    width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; font-size: 0.85rem;
}
.step-head h2 { margin: 0; }

.dropzone {
    border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2);
    padding: 28px 20px; text-align: center; transition: border-color 0.12s ease, background-color 0.12s ease;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 40px; height: 40px; color: var(--accent); margin: 0 auto 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem;
    background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2);
}
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 1rem; line-height: 1; }
.chip.accent { background: var(--accent-soft); border-color: #cbe6e2; color: var(--accent-hover); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestion { font: inherit; font-size: 0.8rem; padding: 3px 9px; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--surface); cursor: pointer; color: var(--text-2); }
.suggestion:hover { border-color: var(--accent); color: var(--accent); }

.summary-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.summary-bar strong { font-size: 1.05rem; }

/* What was chosen, answered at the point of choosing rather than at the bottom of the page. */
.picked { display: grid; gap: 12px; }
.picked-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.picked-stat {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
    border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2);
}
.picked-stat.ok { border-color: #bfe2cc; background: var(--success-soft); }
.picked-stat.ok.none { border-color: var(--border); background: var(--surface-2); }
.picked-n { font-size: 1.45rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.picked-stat.ok .picked-n { color: var(--success); }
.picked-stat.ok.none .picked-n { color: var(--muted); }
.picked-label { font-size: 0.82rem; color: var(--text-2); }
.picked-folders { display: grid; gap: 6px; }
.picked-folders-label { font-size: 0.82rem; color: var(--muted); }

/* The chosen-file table sits inside the Files step, so it needs its own top edge rather than a card's. */
.card-sub { border-top: 1px solid var(--border); }
.card-sub .card-header h3 { margin: 0; font-size: 1rem; }
.upload-list { max-height: 320px; overflow: auto; border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ------------------------------------------------------------------------------------------------- details panel */
.detail-panel { position: sticky; top: calc(var(--header-h) + 16px); }
.detail-panel .card-body { max-height: calc(100vh - var(--header-h) - 120px); overflow: auto; }
.text-preview {
    font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin: 0;
    max-height: 420px; overflow: auto;
}
.findings-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.findings-list li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.findings-list li .file-folder { display: block; }
table.data.compact .col-optional { display: none; }
.run-results { font-size: 0.85rem; color: var(--text-2); white-space: nowrap; }
.count { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ------------------------------------------------------------------------------------------------------ landing */
.landing { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 40px 16px; }
.landing-inner { max-width: 980px; width: 100%; }
.hero { text-align: center; padding: 24px 0 36px; }
.hero h1 { font-size: 2.4rem; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 60ch; margin: 0 auto 1.5rem; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.how .card-body { padding: 22px; }
.how-number { font-size: 0.8rem; font-weight: 700; color: var(--accent); letter-spacing: 0.05em; text-transform: uppercase; }
@media (max-width: 760px) { .how { grid-template-columns: minmax(0, 1fr); } .hero h1 { font-size: 1.8rem; } }
.fine-print { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 28px; }

.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: start center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 1.4rem; }

/* ------------------------------------------------------ ASP.NET Core Identity template classes (account pages) */
.col-md-4, .col-md-6, .col-xl-6, .col-lg-3, .col-lg-9 { flex: 1 1 100%; max-width: 520px; }
.form-floating { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-floating > label { order: -1; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-control::placeholder { color: transparent; }
.form-check { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 12px; }
.w-100 { width: 100%; }
.mb-3 { margin-bottom: 14px; }
.alert-danger { background: var(--error-soft); border-color: #f3c6c0; color: #7f1a12; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-list a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 550; }
.nav-list a:hover { background: var(--surface-3); }
.nav-list a.active { background: var(--accent-soft); color: var(--accent-hover); }

/* -------------------------------------------------------------------------------------------- framework leftovers */
#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 10px 16px;
    background: #fff4d6; border-top: 1px solid #f1dea4; color: #5d3d00;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
.blazor-error-boundary { background: var(--error-soft); color: var(--error); padding: 1rem; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "An error has occurred."; }
.text-danger { color: var(--error); }
ul.validation-errors { color: var(--error); padding-left: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
