

.console { max-width: 72rem; margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-8); }
.console-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-bottom: var(--s-6); }
.console h1 { font-size: var(--fs-3xl); line-height: 1.12; letter-spacing: var(--track-display); font-weight: 820; }
.console h2 { font-size: var(--fs-xl); font-weight: 780; margin: var(--s-7) 0 var(--s-4); padding-top: var(--s-4); border-top: 2px solid var(--rule-strong); }
.console h3 { font-size: var(--fs-md); font-weight: 740; margin: var(--s-6) 0 var(--s-3); }
.console p { margin: 0 0 var(--s-3); }
.lede { color: var(--ink-2); font-size: var(--fs-md); max-width: 46em; }
.muted { color: var(--ink-3); font-weight: 400; }
.hint { color: var(--ink-3); font-size: var(--fs-sm); margin: var(--s-1) 0 0; max-width: 60em; }
.console .callout p { margin: 0; }
.console .callout > * + * { margin-top: var(--s-2); }

.tabs {
  display: inline-flex; flex-wrap: wrap; margin: 0 0 -1.5px;
  border: 1.5px solid var(--ink); border-bottom: 0; border-radius: var(--r-2) var(--r-2) 0 0; overflow: hidden;
  background: var(--surface); position: relative; z-index: 1;
}
.tabs [role="tab"] {
  font: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); background: transparent; cursor: pointer;
  border: 0; min-height: 2.9rem; padding: 0.5rem 1.15rem; display: inline-flex; align-items: center; gap: 0.55rem;
}
.tabs [role="tab"] + [role="tab"] { border-left: 1.5px solid var(--ink); }
.tabs [role="tab"]::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: var(--r-lamp); background: var(--lamp-off); box-shadow: 0 0 0 2px var(--lamp-rim); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tabs [role="tab"][aria-selected="true"]::before { background: var(--green-lamp); }
.tabs [role="tab"]:hover:not([aria-selected="true"]) { background: var(--paper-2); color: var(--ink); }

.panel {
  background: var(--enamel); border: 1.5px solid var(--ink); border-radius: 0 var(--r-2) var(--r-2) var(--r-2);
  padding: var(--s-5) var(--s-5) var(--s-5);
}
.panel > p:first-child { color: var(--ink-2); max-width: 52em; margin-bottom: var(--s-5); }

fieldset {
  border: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  margin: 0; padding: var(--s-4) 0 var(--s-5); min-width: 0;
}
legend { font-weight: 760; font-size: var(--fs-sm); padding: 0 var(--s-3) 0 0; float: left; width: 100%; margin-bottom: var(--s-3); }
legend + * { clear: both; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--s-4) var(--s-5); align-items: end; }
.grid > .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field > label { font-weight: 650; font-size: var(--fs-sm); }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); border-radius: var(--r-1);
  padding: 0.55rem 0.7rem; width: 100%; min-width: 0; min-height: 2.6rem;
  transition: border-color var(--dur-1) var(--ease-out);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
textarea { font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"], [data-path][aria-invalid="true"] {
  border-color: var(--red); box-shadow: 0 0 0 1px var(--red);
}
.field-error { color: var(--red); font-size: var(--fs-xs); font-weight: 600; margin: 0.15rem 0 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.choice { display: inline-flex; align-items: flex-start; gap: 0.55rem; cursor: pointer; line-height: 1.5; font-size: var(--fs-sm); }
.choice input { margin: 0.18rem 0 0; width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--ink); }
.sub { margin: 0 0 var(--s-4); }
.sub-title { font-weight: 650; font-size: var(--fs-sm); margin: 0 0 var(--s-2); }
.advanced { border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); padding: var(--s-4) 0; margin: 0; }
.advanced > summary { cursor: pointer; font-weight: 700; font-size: var(--fs-sm); }
.advanced[open] > summary { margin-bottom: var(--s-4); }
.authorize {
  border: 1px solid var(--amber); background: var(--amber-wash); border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4); margin: var(--s-3) 0 var(--s-4);
}
.authorize .choice { font-weight: 700; }
.estimate { margin: var(--s-4) 0 var(--s-4); color: var(--ink-2); font-size: var(--fs-sm); font-family: var(--font-mono); font-size: 0.8rem; }
.estimate.bad { color: var(--red); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.btn-link {
  font: inherit; font-weight: 650; background: none; border: 0; padding: 0; min-height: 0; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--link-rule); text-underline-offset: 0.22em; cursor: pointer;
}
.btn-link:hover { text-decoration-color: currentColor; }
#demo-run { min-width: 9rem; }

.progress-box { border: 1.5px solid var(--ink); border-radius: var(--r-2); padding: var(--s-4); margin: var(--s-5) 0; background: var(--surface); }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin-bottom: var(--s-2); }
.progress-head label { font-weight: 700; display: inline-flex; align-items: center; gap: 0.55rem; }
.progress-head label::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: var(--r-lamp); background: var(--amber-lamp); box-shadow: 0 0 0 2px var(--lamp-rim); animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { background: var(--lamp-off); } }
progress { width: 100%; height: 0.55rem; accent-color: var(--ink); }
.progress-text { margin: var(--s-2) 0 0; font-size: 0.8rem; color: var(--ink-3); overflow-wrap: anywhere; font-family: var(--font-mono); }
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#results > h2 { margin-top: var(--s-7); }
.gate {
  --tone: var(--ink); --tone-wash: var(--paper-2); --tone-lamp: var(--lamp-off);
  border: 1.5px solid var(--tone); background: var(--tone-wash); border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5); margin: 0 0 var(--s-5); display: grid; gap: var(--s-2);
}
.gate-pass { --tone: var(--green); --tone-wash: var(--green-wash); --tone-lamp: var(--green-lamp); }
.gate-fail { --tone: var(--red); --tone-wash: var(--red-wash); --tone-lamp: var(--red-lamp); }
.gate-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: 0; font-size: var(--fs-md); font-weight: 650; }
.gate-badge { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 1.6rem; font-weight: 760; letter-spacing: 0.02em; color: var(--tone); }
.gate-badge::before { content: ""; width: 1.05rem; height: 1.05rem; border-radius: var(--r-lamp); flex: none; background: radial-gradient(circle at 34% 30%, rgb(255 255 255 / 0.5), transparent 46%), var(--tone-lamp); box-shadow: 0 0 0 2px var(--lamp-rim); }
.gate ul { margin: 0; padding-left: 1.3em; }
.gate p { margin: 0; }
.gate .gate-warning { margin: var(--s-2) 0 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0; margin: 0 0 var(--s-5); padding: 0; list-style: none; border-top: 2px solid var(--rule-strong); }
.stat { padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.3rem; }
.stat .k { display: block; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.stat .v { display: block; font-family: var(--font-mono); font-size: 1.75rem; font-weight: 680; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat.is-bad .v { color: var(--red); }
.stat.is-ok .v { color: var(--green); }
.stat.is-warn .v { color: var(--amber); }

.meta { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 var(--s-5); }
.meta dt { font-weight: 700; color: var(--ink); }
.meta dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem var(--s-4); margin: 0; }
.meta dd { margin: 0; overflow-wrap: anywhere; word-break: break-all; font-family: var(--font-mono); font-size: 0.8rem; padding-top: 0.15em; }

.console .table-wrap { margin: 0 0 var(--s-5); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--font-mono); font-size: 0.8rem; }
td.nowrap { white-space: nowrap; }
td.nowrap .btn-link { font-family: var(--font-mono); font-size: 0.8rem; }
td.evidence { min-width: 14rem; max-width: 28rem; font-family: var(--font-mono); font-size: 0.78rem; word-break: break-all; color: var(--ink-2); }
td.reason { min-width: 12rem; }

.verdict {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  font-weight: 700; font-size: var(--fs-xs); line-height: 1.4;
  padding: 0.1rem 0.5rem 0.1rem 0.4rem; border-radius: var(--r-1);
  color: var(--tone, var(--ink)); background: var(--tone-wash, var(--paper-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--ink)) 45%, transparent);
}
.verdict::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: var(--r-lamp); background: var(--tone-lamp, var(--lamp-off)); box-shadow: 0 0 0 1.5px var(--lamp-rim); flex: none; }
.v-VULNERABLE { --tone: var(--red); --tone-wash: var(--red-wash); --tone-lamp: var(--red-lamp); }
.v-BLOCKED { --tone: var(--green); --tone-wash: var(--green-wash); --tone-lamp: var(--green-lamp); }
.v-INCONCLUSIVE { --tone: var(--amber); --tone-wash: var(--amber-wash); --tone-lamp: var(--amber-lamp); }
.v-ERROR { --tone: var(--red); --tone-wash: var(--paper-2); --tone-lamp: var(--lamp-off); }
.v-ERROR::before { box-shadow: 0 0 0 1.5px var(--red-lamp); }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: end; margin: 0 0 var(--s-3); }
.toolbar .field { flex: 0 1 14rem; }
.downloads { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: 0 0 var(--s-5); }

.segmented { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: var(--r-1); overflow: hidden; margin: 0 0 var(--s-5); background: var(--surface); }
.segmented button { font: inherit; font-size: var(--fs-sm); font-weight: 680; border: 0; background: transparent; color: var(--ink-2); min-height: 2.6rem; padding: 0.4rem 1rem; cursor: pointer; }
.segmented button + button { border-left: 1.5px solid var(--ink); }
.segmented button:hover { background: var(--paper-2); color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.compare { background: var(--enamel); border: 1.5px solid var(--ink); border-radius: var(--r-2); padding: var(--s-5); margin: 0 0 var(--s-6); }
.compare h3 { margin-top: 0; }
.compare .big { font-family: var(--font-mono); font-size: 2rem; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.compare .table-wrap { background: var(--surface); padding: 0 var(--s-3); }
.idlist { font-family: var(--font-mono); font-size: 0.8rem; word-break: break-all; }
ul.plain { margin: 0 0 var(--s-4); padding-left: 1.3em; }
.trust-badge { margin-left: var(--s-3); vertical-align: middle; }
.aborted-banner strong { font-size: var(--fs-md); }

dialog {
  width: min(58rem, calc(100vw - 1rem)); max-height: calc(100vh - 2rem); padding: 0;
  border: 1.5px solid var(--ink); border-radius: var(--r-2); background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.45);
}
dialog::backdrop { background: rgb(8 11 13 / 0.55); }
.dialog-head {
  position: sticky; top: 0; z-index: 1; display: flex; gap: var(--s-4); justify-content: space-between; align-items: center;
  padding: var(--s-3) var(--s-5); background: var(--enamel); border-bottom: 1.5px solid var(--ink);
}
.dialog-head h2 { margin: 0; font-size: var(--fs-md); border: 0; padding: 0; overflow-wrap: anywhere; font-family: var(--font-mono); font-weight: 700; }
#case-dialog-body { padding: var(--s-4) var(--s-5) var(--s-5); }
.trial { border-top: 2px solid var(--rule-strong); padding: var(--s-3) 0 var(--s-4); margin: 0 0 var(--s-3); }
.trial h3 { margin: 0 0 var(--s-2); font-size: var(--fs-base); }
.turn { border-top: 1px dashed var(--rule); padding-top: var(--s-3); margin-top: var(--s-3); }
.turn h4 { margin: 0 0 var(--s-2); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; }
.excerpt-label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); margin: var(--s-2) 0 0.2rem; }
pre.excerpt {
  margin: 0; background: var(--term-bg); color: var(--term-ink); border-radius: var(--r-1);
  padding: var(--s-3) var(--s-4); font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all; max-height: 16rem; overflow: auto;
  --focus: var(--term-ink); --focus-gap: var(--term-bg);
}

@media (max-width: 640px) {
  .console { padding-top: var(--s-5); }
  .panel { padding: var(--s-4) var(--s-3); border-radius: 0 0 var(--r-2) var(--r-2); }
  .tabs { display: flex; width: 100%; }
  .tabs [role="tab"] { flex: 1 1 0; justify-content: center; padding: 0.5rem 0.6rem; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .meta dl { grid-template-columns: minmax(0, 1fr); }
  .meta dd { margin-bottom: var(--s-2); }
  dialog { width: calc(100vw - 0.5rem); max-height: calc(100vh - 1rem); }
  .dialog-head, #case-dialog-body { padding-left: var(--s-4); padding-right: var(--s-4); }
}
