:root {
  color-scheme: dark;
  --bg: #090c0f;
  --surface: #0f1418;
  --surface-raised: #141b20;
  --surface-soft: #11171b;
  --line: #273138;
  --line-strong: #3b474e;
  --text: #eef3f1;
  --muted: #94a09e;
  --quiet: #66716f;
  --cyan: #73ddd0;
  --cyan-soft: rgba(115, 221, 208, 0.12);
  --green: #8ce7b0;
  --green-soft: rgba(85, 198, 130, 0.14);
  --amber: #e9c46a;
  --amber-soft: rgba(233, 196, 106, 0.13);
  --red: #ff938f;
  --red-soft: rgba(255, 112, 106, 0.13);
  --blue: #8fb8ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 87% -10%, rgba(75, 193, 181, 0.10), transparent 31rem),
    var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button { color: inherit; }

.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(9, 12, 15, .78), rgba(9, 12, 15, .94)),
    radial-gradient(circle at 50% 12%, rgba(115, 221, 208, .14), transparent 34rem);
}
.auth-card {
  width: min(470px, 100%);
  padding: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(20, 27, 32, .98), rgba(13, 18, 22, .98));
  box-shadow: 0 38px 120px rgba(0, 0, 0, .52);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 54px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 17px; letter-spacing: .02em; }
.auth-brand small { margin-top: 3px; color: var(--quiet); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.auth-card h1 { max-width: 380px; margin: 0 0 13px; font-size: clamp(29px, 5vw, 39px); }
.auth-intro { margin-bottom: 27px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.login-form { display: grid; }
.auth-submit { width: 100%; min-height: 44px; margin-top: 21px; }
.auth-footnote { margin: 23px 0 0; color: var(--quiet); font-size: 10px; letter-spacing: .05em; text-align: center; }
.bootstrap-notice { margin-bottom: 20px; padding: 14px; border-left: 2px solid var(--amber); background: var(--amber-soft); }
.bootstrap-notice strong, .bootstrap-notice span { display: block; }
.bootstrap-notice strong { margin-bottom: 5px; color: var(--amber); font-size: 12px; }
.bootstrap-notice span { color: var(--muted); font-size: 12px; line-height: 1.5; }

.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background: rgba(10, 14, 17, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 8px 44px;
  color: var(--text);
  text-decoration: none;
}
.brand strong { display: block; letter-spacing: 0.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(115, 221, 208, .55);
  transform: rotate(45deg);
}
.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  background: var(--cyan);
}
.brand-mark::before { width: 17px; height: 1px; }
.brand-mark::after { width: 1px; height: 17px; }
.brand-mark span { width: 5px; height: 5px; box-shadow: 0 0 16px var(--cyan); }

nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.nav-item:hover, .nav-item:focus-visible { background: var(--surface-raised); color: var(--text); }
.nav-item.active { background: var(--cyan-soft); color: var(--text); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); }
.nav-item.active .nav-dot { background: var(--cyan); box-shadow: 0 0 11px var(--cyan); }

.sidebar-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); }
.sidebar-foot p { margin: 9px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.55; }
.trust-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.trust-line span { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }

main { width: min(1320px, 100%); padding: 0 42px 70px; margin: 0 auto; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  border-bottom: 1px solid var(--line);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 3vw, 37px); font-weight: 500; letter-spacing: -.035em; }
h2 { font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 500; }
.eyebrow { margin-bottom: 8px; color: var(--cyan); font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.configuration-state { color: var(--muted); font-size: 12px; }

.button {
  min-height: 39px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.button:hover, .button:focus-visible { border-color: var(--cyan); }
.button.primary { border-color: var(--cyan); background: var(--cyan); color: #08100f; font-weight: 650; }
.button.quiet { min-height: 32px; padding-inline: 11px; color: var(--muted); font-size: 11px; }
.button:disabled { cursor: wait; opacity: .6; }
.session-identity { max-width: 150px; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.cockpit { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); gap: 20px; padding: 30px 0 16px; }
.verdict-panel, .attention-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 27, 32, .96), rgba(14, 19, 23, .96));
  box-shadow: var(--shadow);
}
.verdict-panel { padding: 28px; }
.attention-panel { padding: 24px; }
.verdict-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.verdict-heading .eyebrow { margin: 0; }
.verdict {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.verdict::before { content: ""; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; }
.verdict.ready { color: var(--green); background: var(--green-soft); border-color: rgba(140, 231, 176, .35); }
.verdict.conditional, .verdict.unproven { color: var(--amber); background: var(--amber-soft); border-color: rgba(233, 196, 106, .35); }
.verdict.blocked { color: var(--red); background: var(--red-soft); border-color: rgba(255, 147, 143, .35); }
.verdict-panel h2 { max-width: 740px; margin: 34px 0 9px; font-size: clamp(24px, 3vw, 34px); }
#verdictSummary { max-width: 720px; margin-bottom: 28px; color: var(--muted); line-height: 1.6; }
.release-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.release-meta div { min-width: 0; padding: 15px; background: var(--surface); }
.release-meta dt { color: var(--quiet); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.release-meta dd { margin: 7px 0 0; overflow: hidden; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.attention-list { display: grid; gap: 0; padding: 0; margin: 18px 0 0; list-style: none; }
.attention-list li { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.attention-list li > span { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 11px; }
.attention-list strong, .attention-list small { display: block; }
.attention-list strong { margin-bottom: 5px; font-size: 13px; font-weight: 500; }
.attention-list small { color: var(--muted); line-height: 1.4; }

.section-block { padding: 56px 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.section-heading h2 { margin: 0; }
.section-heading > p { max-width: 460px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }

.evidence-graph { min-height: 230px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.graph-placeholder, .empty-state { display: grid; place-items: center; min-height: 170px; color: var(--quiet); text-align: center; }
.graph-row { display: grid; grid-template-columns: minmax(170px, .8fr) 34px minmax(200px, 1fr) 34px minmax(140px, .7fr); align-items: stretch; gap: 0; }
.graph-row + .graph-row { margin-top: 13px; }
.graph-node { padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.graph-node:first-child { border-radius: 9px 0 0 9px; }
.graph-node:last-child { border-radius: 0 9px 9px 0; }
.graph-node small { display: block; margin-bottom: 6px; color: var(--quiet); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.graph-node strong { display: block; font-size: 12px; font-weight: 500; }
.graph-edge { position: relative; }
.graph-edge::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line-strong); }
.graph-edge::after { content: ""; position: absolute; top: calc(50% - 3px); right: 0; width: 6px; height: 6px; border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); transform: rotate(45deg); }
.graph-node[data-outcome="Passed"] { border-left: 2px solid var(--green); }
.graph-node[data-outcome="Failed"] { border-left: 2px solid var(--red); }
.graph-node[data-outcome="Unproven"] { border-left: 2px solid var(--amber); }

.claims-list { display: grid; gap: 10px; }
.claim { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.claim summary { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 13px; min-height: 68px; padding: 14px 18px; cursor: pointer; list-style: none; }
.claim summary::-webkit-details-marker { display: none; }
.claim summary::before { content: "+"; color: var(--muted); }
.claim[open] summary::before { content: "−"; }
.claim-title strong, .claim-title small { display: block; }
.claim-title strong { font-size: 14px; font-weight: 500; }
.claim-title small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.claim-mode { color: var(--quiet); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.outcome { min-width: 78px; font-size: 11px; font-weight: 600; text-align: right; text-transform: uppercase; }
.outcome.Passed { color: var(--green); }
.outcome.Failed { color: var(--red); }
.outcome.Unproven { color: var(--amber); }
.evidence-list { padding: 0 18px 18px 47px; border-top: 1px solid var(--line); }
.evidence-item { padding: 18px 0; }
.evidence-item + .evidence-item { border-top: 1px solid var(--line); }
.evidence-item header { display: flex; justify-content: space-between; gap: 16px; }
.evidence-item h3 { margin: 0 0 7px; }
.evidence-item p { margin-bottom: 13px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.observations { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.observation { min-width: 0; padding: 10px; background: var(--surface-raised); }
.observation small { display: block; margin-bottom: 4px; color: var(--quiet); font-size: 9px; text-transform: uppercase; }
.observation code { display: block; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.evidence-hash { margin-top: 12px; color: var(--quiet); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }

dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-raised); color: var(--text); box-shadow: 0 35px 110px rgba(0,0,0,.58); }
dialog::backdrop { background: rgba(2, 5, 7, .76); backdrop-filter: blur(4px); }
dialog form { padding: 26px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin-bottom: 0; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; font-size: 22px; }
.form-intro { margin: 21px 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
label { display: grid; gap: 8px; margin-top: 16px; color: var(--text); font-size: 12px; }
label span small { color: var(--quiet); }
input, select { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: #0b1013; color: var(--text); }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.intake-status { margin: 18px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-left: 2px solid var(--quiet); border-radius: 0 8px 8px 0; color: var(--muted); background: var(--surface); font-size: 12px; line-height: 1.5; }
.intake-status.working { border-left-color: var(--amber); }
.intake-status.ready { border-left-color: var(--cyan); color: var(--text); }
.intake-status.failed { border-left-color: var(--red); color: var(--red); background: var(--red-soft); }
input[type="file"] { min-height: 48px; padding: 7px 9px; color: var(--muted); }
input[type="file"]::file-selector-button { min-height: 32px; margin-right: 12px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-raised); color: var(--text); cursor: pointer; }
.form-error { margin-top: 17px; padding: 12px; border-left: 2px solid var(--red); background: var(--red-soft); color: var(--red); font-size: 12px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }

.data-panel { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.data-panel table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-panel th, .data-panel td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-panel th { color: var(--quiet); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.data-panel td small { display: block; margin-top: 5px; color: var(--quiet); }
.data-panel a, .text-button { color: var(--cyan); }
.text-button { padding: 0; border: 0; background: none; cursor: pointer; }
.inline-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.4fr) auto auto; align-items: center; gap: 10px; margin-bottom: 14px; }
.check-label { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.check-label input { width: auto; min-height: auto; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-grid article { min-height: 150px; padding: 24px; }
.status-grid article + article { border-left: 1px solid var(--line); }
.status-grid small, .status-grid strong, .status-grid span { display: block; }
.status-grid small { color: var(--quiet); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.status-grid strong { margin: 20px 0 8px; font-size: 18px; font-weight: 500; }
.status-grid span { color: var(--muted); font-size: 12px; }
.good { color: var(--green); }
.bad { color: var(--red); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 18px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 17px; }
  nav { display: flex; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
  main { padding: 0 24px 60px; }
  .cockpit { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .auth-shell { padding: 16px; }
  .auth-card { padding: 27px 23px; }
  .auth-brand { margin-bottom: 38px; }
  main { padding-inline: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 27px 0; }
  .top-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .configuration-state { max-width: 50%; }
  .verdict-panel, .attention-panel { padding: 20px; }
  .release-meta { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .evidence-graph { padding: 16px; }
  .graph-row { grid-template-columns: 1fr; }
  .graph-edge { height: 24px; }
  .graph-edge::before { top: 0; bottom: 0; left: 18px; width: 1px; height: auto; }
  .graph-edge::after { top: auto; right: auto; bottom: 0; left: 15px; transform: rotate(135deg); }
  .graph-node:first-child, .graph-node:last-child { border-radius: 8px; }
  .claim summary { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .claim-mode { display: none; }
  .evidence-list { padding-left: 18px; }
  .observations { grid-template-columns: 1fr; }
  .inline-form, .status-grid { grid-template-columns: 1fr; }
  .status-grid article + article { border-top: 1px solid var(--line); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
