/*
 * Admin area (Phases 4.1 and 4.2). Plain CSS served from public/: the area
 * renders without a Vite build and without a frontend framework.
 */

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

:root {
    color-scheme: dark;
    --bg: #0d0e14;
    --surface: #121319;
    --surface-2: #1a1b21;
    --surface-3: #21232b;
    --border: #292a30;
    --border-strong: #3f414a;
    --text: #e3e1ea;
    --muted: #aab6ae;
    --subtle: #7d8981;
    --primary: #4edea3;
    --primary-strong: #10b981;
    --primary-ink: #03281b;
    --danger: #ffb4ab;
    --success: #6ee7b7;
    --warning: #fcd34d;
    --info: #c0c1ff;
    --scrollbar: #4a4c55;
    --focus: #4edea3;
    --radius-sm: .25rem;
    --radius: .375rem;
    --radius-lg: .5rem;
    --header-h: 4rem;
    font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

html, body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
body {
    background-image: radial-gradient(circle at 75% -20%, rgb(78 222 163 / 7%), transparent 34rem);
    font-variant-numeric: tabular-nums;
}

/* Thin scrollbars, for the page and for inner scroll areas. The -webkit-
   rules only serve browsers without the standard properties. */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }

@supports not (scrollbar-width: thin) {
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

a { color: var(--text); text-decoration-color: var(--border-strong); text-underline-offset: .2em; }
a:hover { color: var(--primary); text-decoration-color: currentColor; }

h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
h2 { margin: 0 0 1rem; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }

.muted { color: var(--muted); font-size: .875rem; }
.eyebrow {
    margin: 0 0 .4rem;
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .6875rem;
    font-weight: 650;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.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: 1rem; top: -3rem; z-index: 20; }
.skip-link:focus { top: .75rem; }

/* Header ---------------------------------------------------------------- */

.admin-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--header-h);
    padding: 0 1.25rem;
    background: rgb(13 14 20 / 94%);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(12px);
}
.admin-header.has-border { border-bottom: 1px solid var(--border); }

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { display: block; width: 1.75rem; height: 1.75rem; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: .9375rem; letter-spacing: .04em; }
.brand-copy small {
    margin-top: .24rem;
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .6rem;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.header-end { display: flex; align-items: center; gap: 1rem; margin-left: auto; min-width: 0; }
.header-end .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adapter-status,
.guest-header-status {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--success);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.status-dot { width: .42rem; height: .42rem; background: var(--primary); border-radius: 999px; box-shadow: 0 0 0 3px rgb(78 222 163 / 10%); }
.actor { display: grid; min-width: 0; text-align: right; line-height: 1.2; }
.actor-label { color: var(--subtle); font-size: .625rem; letter-spacing: .07em; text-transform: uppercase; }
.actor-email { overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }

.admin-main { min-height: 100vh; }

/* Shell: sidebar + content ---------------------------------------------- */

.admin-shell { display: flex; min-height: 100vh; padding-top: var(--header-h); }

.admin-sidebar { position: relative; flex: 0 0 15rem; padding: 1.25rem .875rem; background: rgb(13 14 20 / 64%); border-right: 1px solid var(--border); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 .5rem .75rem; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .625rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.admin-sidebar ul { margin: 0; padding: 0; list-style: none; }
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .875rem;
    text-decoration: none;
}
.admin-sidebar a:hover { color: var(--text); background: var(--surface-2); }
.admin-sidebar a[aria-current="page"] { color: var(--text); background: var(--surface-3); box-shadow: inset 2px 0 var(--primary); }
.nav-index { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .625rem; }
.admin-sidebar a[aria-current="page"] .nav-index { color: var(--primary); }
.sidebar-foot {
    position: absolute;
    right: .875rem;
    bottom: 1rem;
    left: .875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .75rem;
    color: var(--subtle);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .68rem;
}
.sidebar-foot .mono { color: var(--primary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.admin-shell .admin-main { flex: 1; min-width: 0; min-height: auto; padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.content { max-width: 64rem; }
.content-wide { max-width: 96rem; }

@media (max-width: 48rem) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { flex-basis: auto; padding: .65rem 1rem; border-right: 0; border-bottom: 1px solid var(--border); }
    .sidebar-heading, .sidebar-foot { display: none; }
    .admin-sidebar ul { display: flex; gap: .25rem; overflow-x: auto; }
    .admin-sidebar a { min-width: max-content; }
    .admin-shell .admin-main { padding: 1.25rem 1rem 2.5rem; }
    .actor-label { display: none; }
    .actor-email { max-width: 9rem; }
    .adapter-status { display: none; }
}

/* Buttons ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .4rem 1rem;
    font: inherit;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
}
.btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 650; }
.btn-primary:hover { background: #6ffbbe; color: var(--primary-ink); border-color: #6ffbbe; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }
.btn.is-disabled { color: var(--muted); opacity: .5; cursor: default; }

/* Page structure --------------------------------------------------------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-actions form { margin: 0; }
.back { display: inline-block; margin-bottom: .375rem; color: var(--muted); font-size: .875rem; text-decoration: none; }
.back:hover { color: var(--text); }

.panel { margin-top: 2rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* Flash messages --------------------------------------------------------- */

.flash { margin: 0 0 1.25rem; padding: .75rem .875rem; background: var(--surface); border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius); font-size: .875rem; }
.flash-success { border-left-color: var(--success); }
.flash-error { border-left-color: var(--danger); }

/* Forms ------------------------------------------------------------------ */

.form { max-width: 28rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .375rem; font-size: .8125rem; color: var(--muted); }
.field input, .field select, .field textarea, .search input {
    width: 100%;
    padding: .5rem .625rem;
    font: inherit;
    font-size: .875rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .search input:focus-visible { outline-offset: 0; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field textarea { resize: vertical; }
.field .check input { width: auto; }
.field-label { display: block; margin-bottom: .375rem; font-size: .8125rem; color: var(--muted); }
.field-static { margin: 0; }
.field-error { margin: .375rem 0 0; font-size: .8125rem; color: var(--danger); }
.field-hint { margin: .375rem 0 0; font-size: .8125rem; color: var(--muted); }

.form-actions { display: flex; gap: .5rem; margin-top: 1.5rem; }

.checks { margin: 0 0 1rem; padding: 0; border: 0; }
.check { display: flex; align-items: baseline; gap: .625rem; padding: .375rem 0; font-size: .9375rem; cursor: pointer; }
.check input { accent-color: var(--text); }

.search { display: flex; gap: .5rem; max-width: 32rem; margin-bottom: 1.25rem; }

/* Table ------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .625rem .875rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table thead th { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 650; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; background: var(--bg); }
.table tbody th { font-weight: 500; white-space: nowrap; }
.table tbody tr { transition: background-color 120ms ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }

.action-icons { display: inline-flex; align-items: center; justify-content: flex-end; gap: .25rem; }
.action-icons form { margin: 0; }
.icon-action {
    position: relative;
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    padding: 0;
    place-items: center;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.icon-action svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-action:hover { color: var(--primary); background: rgb(78 222 163 / 8%); border-color: rgb(78 222 163 / 24%); }
.icon-action-danger:hover { color: var(--danger); background: rgb(255 180 171 / 8%); border-color: rgb(255 180 171 / 28%); }
.icon-action::after {
    position: absolute;
    bottom: calc(100% + .4rem);
    left: 50%;
    z-index: 20;
    padding: .25rem .45rem;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    content: attr(data-tooltip);
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 .4rem 1rem rgb(0 0 0 / 30%);
    opacity: 0;
    transform: translate(-50%, .2rem);
    transition: opacity 100ms ease, transform 100ms ease;
}
.icon-action:hover::after,
.icon-action:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.action-icons > .icon-action:last-child::after,
.action-icons > form:last-child .icon-action::after { right: 0; left: auto; transform: translateY(.2rem); }
.action-icons > .icon-action:last-child:hover::after,
.action-icons > .icon-action:last-child:focus-visible::after,
.action-icons > form:last-child .icon-action:hover::after,
.action-icons > form:last-child .icon-action:focus-visible::after { transform: translateY(0); }

.empty { padding: 2rem 0; color: var(--muted); }

.badge { display: inline-block; padding: .08rem .45rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .6875rem; border: 1px solid var(--border); border-radius: var(--radius-sm); white-space: nowrap; }
.badge-active { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.badge-inactive { color: var(--muted); }
.badge-system { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }

/* Profiles and menus (Phases 4.3 and 4.4) ------------------------------- */

.notice { max-width: 46rem; margin: 1.25rem 0 0; padding: .625rem .875rem; font-size: .875rem; color: var(--muted); border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius); }
.tree-label { display: inline-block; padding-left: calc(var(--depth, 0) * 1.25rem); }

.matrix .matrix-cell { width: 5rem; text-align: center; }
.matrix tbody th { white-space: normal; }
.matrix-key { display: table; margin-top: .25rem; font-weight: 400; }

@media (max-width: 40rem) {
    .matrix th, .matrix td { padding: .5rem .375rem; }
    .matrix .matrix-cell { width: 2.75rem; font-size: .75rem; }
}
.matrix input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--text); }
.matrix input:disabled { opacity: .35; cursor: not-allowed; }

/* Description list ------------------------------------------------------- */

.details { display: grid; grid-template-columns: max-content 1fr; gap: .625rem 1.5rem; margin: 0; font-size: .9375rem; }
.details dt { color: var(--muted); font-size: .875rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 30rem) {
    .details { grid-template-columns: 1fr; gap: .125rem; }
    .details dd { margin-bottom: .625rem; }
}

/* Pagination ------------------------------------------------------------- */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }

/* Login panel (guest landing) -------------------------------------------- */

.login { position: relative; }
.login > summary::-webkit-details-marker { display: none; }
.login > summary { width: 100%; margin-top: 1rem; }

.login-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    width: min(18rem, calc(100vw - 2.5rem));
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .5rem;
}
.guest-main { display: grid; align-items: center; padding: calc(var(--header-h) + 2rem) clamp(1rem, 5vw, 5rem) 3rem; }
.guest-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 28rem); gap: clamp(2rem, 7vw, 7rem); width: min(100%, 72rem); margin: 0 auto; }
.guest-intro { align-self: center; }
.guest-intro h1 { max-width: 43rem; font-size: clamp(2rem, 5vw, 3.75rem); }
.guest-intro .lead { max-width: 42rem; margin-top: 1.25rem; font-size: 1rem; }
.trust-list { display: grid; gap: .5rem; max-width: 37rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.trust-list li { display: flex; align-items: center; gap: .75rem; padding: .75rem .875rem; color: var(--muted); background: rgb(18 19 25 / 70%); border: 1px solid var(--border); border-radius: var(--radius); font-size: .85rem; }
.trust-list li span { color: var(--primary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .65rem; }
.guest-login { align-self: center; padding: clamp(1.25rem, 4vw, 2rem); background: var(--surface); border: 1px solid var(--border); border-top-color: rgb(78 222 163 / 55%); border-radius: var(--radius-lg); box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%); }
.guest-login h2 { margin-bottom: .25rem; font-size: 1.25rem; }
.guest-login .login-panel { position: static; width: auto; margin-top: .75rem; padding: 1rem 0 0; background: transparent; border: 0; }
.guest-login .login[open] > summary { display: none; }

@media (max-width: 52rem) {
    .guest-page { grid-template-columns: 1fr; gap: 2rem; }
    .guest-intro h1 { font-size: clamp(2rem, 10vw, 3rem); }
    .guest-login { width: min(100%, 30rem); }
}

@media (max-width: 36rem) {
    .admin-header { padding: 0 1rem; }
    .brand-copy small { display: none; }
    .guest-header-status { font-size: .6rem; }
    .header-end { gap: .5rem; }
    .actor { display: none; }
}

/* Admin home ------------------------------------------------------------- */

.dashboard-heading { align-items: center; }
.dashboard-heading .lead { margin: .45rem 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 .875rem; }
.section-heading h2 { margin: 0; font-size: 1.125rem; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
.area-card { display: flex; align-items: center; gap: .85rem; min-height: 5rem; padding: 1rem; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease; }
.area-card:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.area-card:focus-visible { outline-offset: 3px; }
.area-card-index { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; color: var(--primary); background: rgb(78 222 163 / 9%); border: 1px solid rgb(78 222 163 / 20%); border-radius: var(--radius-sm); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .6875rem; }
.area-card-copy { display: grid; min-width: 0; }
.area-card-copy strong { font-size: .9rem; }
.area-card-copy span { margin-top: .2rem; color: var(--subtle); font-size: .75rem; }
.area-card-arrow { margin-left: auto; color: var(--primary); }
.access-model { display: grid; grid-template-columns: minmax(15rem, .8fr) minmax(0, 1.2fr); gap: 2rem; margin-top: 1.5rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.access-model h2 { margin-bottom: .4rem; font-size: 1.125rem; }
.access-layers { display: grid; grid-template-columns: repeat(5, minmax(7rem, 1fr)); gap: .35rem; margin: 0; padding: 0; list-style: none; }
.access-layers li { display: grid; align-content: space-between; min-height: 5.5rem; padding: .7rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .72rem; }
.access-layers span { color: var(--primary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .65rem; }

@media (max-width: 70rem) {
    .access-model { grid-template-columns: 1fr; }
    .access-layers { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
}

@media (max-width: 36rem) {
    .section-heading { align-items: start; flex-direction: column; }
    .area-grid { grid-template-columns: 1fr; }
    .access-layers { grid-template-columns: 1fr 1fr; }
}
.table .actions form { display: inline-block; }

/* Security Lab ----------------------------------------------------------- */

.lead { max-width: 46rem; margin: 0 0 1.5rem; color: var(--muted); font-size: .9375rem; }

code { padding: .05rem .3rem; font-size: .8125rem; background: var(--surface-2); border-radius: .25rem; }

.lab-tests { margin: 0; padding: 0; list-style: none; }
.lab-tests li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; padding: .875rem 0; border-top: 1px solid var(--border); }
.lab-tests li:last-child { border-bottom: 1px solid var(--border); }
.lab-tests a { font-weight: 500; }

/* Configuration, result, history. With less room the result drops under the
   form; on a single column it goes above it, since it is what was just asked
   for, and an empty result is not shown at all. */
.lab { display: grid; grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr) minmax(18rem, 24rem); grid-template-areas: "config result history"; gap: 2rem 2.5rem; align-items: start; }
.lab-config { grid-area: config; min-width: 0; }
.lab-result { grid-area: result; min-width: 0; }
.lab-history { grid-area: history; min-width: 0; }

.lab-placeholder { margin: 0; padding: 1.5rem 1.125rem; color: var(--muted); font-size: .875rem; text-align: center; border: 1px dashed var(--border); border-radius: .5rem; }

@media (max-width: 85rem) {
    .lab { grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); grid-template-areas: "config history" "result history"; }
}

@media (max-width: 56rem) {
    .lab { grid-template-columns: minmax(0, 1fr); grid-template-areas: "result" "config" "history"; }
    .lab-result.is-empty { display: none; }
}

.choices { min-width: 0; margin: 0 0 1.25rem; padding: 0; border: 0; }
.choices legend { margin-bottom: .375rem; padding: 0; font-size: .8125rem; color: var(--muted); }
.choice-list { display: grid; gap: .375rem; }
.choice { display: flex; align-items: baseline; gap: .625rem; padding: .5rem .75rem; font-size: .875rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { background: var(--surface-2); border-color: var(--muted); }
.choice input { flex: none; margin: 0; accent-color: var(--text); }
.choice-note { margin-left: .375rem; color: var(--muted); font-size: .8125rem; }

.segmented { margin: 0 0 1.25rem; padding: 0; border: 0; }
.segmented legend { margin-bottom: .375rem; padding: 0; font-size: .8125rem; color: var(--muted); }
.segmented-options { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented label { flex: 1; padding: .45rem .75rem; font-size: .875rem; text-align: center; color: var(--muted); cursor: pointer; }
.segmented label + label { border-left: 1px solid var(--border); }
.segmented label:has(input:checked) { color: var(--text); background: var(--surface-2); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }

.verdict { display: inline-block; padding: .1rem .5rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; border: 1px solid currentColor; border-radius: .25rem; white-space: nowrap; }
.verdict-exposed { color: var(--danger); }
.verdict-protected { color: var(--success); }
.verdict-inconclusive { color: var(--warning); }

/* The link of a run jumps to the result; keep its title clear of the fixed header. */
#result-title { scroll-margin-top: calc(var(--header-h) + 1rem); }
.result-meta { margin: -.5rem 0 .75rem; }
.result { padding: 1rem 1.125rem; font-size: .9375rem; background: var(--surface); border: 1px solid var(--border); border-left-width: 3px; border-radius: .5rem; }
.result p { margin: 0 0 .625rem; }
.result p:last-child { margin-bottom: 0; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem; }
.result-exposed { border-left-color: var(--danger); }
.result-protected { border-left-color: var(--success); }
.result-inconclusive { border-left-color: var(--warning); }

.disclosed { margin-top: .875rem; padding: .75rem .875rem; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); overflow-wrap: anywhere; }

/* Mass Assignment: the payload sent and the state it left behind. */
.choices .field label { display: flex; align-items: center; gap: .5rem; }
.badge-protected { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.state { margin: .875rem 0; background: var(--bg); }
/* Four columns have to fit a phone: tighter cells, and the tag may drop
   under the property name. */
.state .table { font-size: .8125rem; }
.state .table th, .state .table td { padding: .5rem; }
.state .table tbody th { white-space: normal; }
.state td { overflow-wrap: break-word; }
.state .is-violation { color: var(--danger); font-weight: 600; }

/* Fixed height: the history scrolls inside its box and the page stays put. */
.runs-scroll { height: clamp(18rem, calc(100vh - 17rem), 38rem); overflow-y: auto; border: 1px solid var(--border); border-radius: .5rem; }
.runs-scroll:focus-visible { outline-offset: 0; }
.runs { margin: 0; padding: 0; list-style: none; }

@media (max-width: 56rem) {
    .runs-scroll { height: auto; max-height: 26rem; }
}
.run { font-size: .875rem; border-bottom: 1px solid var(--border); }
.run:last-child { border-bottom: 0; }
/* Each run is a link that opens it in the result panel. */
.run-link { display: block; padding: .75rem .875rem; color: inherit; text-decoration: none; border-left: 2px solid transparent; }
.run-link:hover { color: inherit; background: var(--surface); }
.run-link[aria-current="true"] { background: var(--surface-2); border-left-color: var(--text); }
.run-link:focus-visible { outline-offset: -2px; }
.run p { margin: .25rem 0 0; overflow-wrap: anywhere; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.run-head time { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
