:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --bg-grid: rgba(71, 84, 69, 0.08);
  --ink: #171a16;
  --muted: #626a5c;
  --soft: #858d7c;
  --line: #d8d5c9;
  --panel: rgba(255, 255, 250, 0.88);
  --panel-solid: #fffdfa;
  --green: #156f5c;
  --yellow: #9d6d16;
  --orange: #bd682d;
  --red: #b43d38;
  --accent: #2f5d50;
  --shadow: 0 18px 45px rgba(40, 44, 35, 0.08);
  font-family:
    Aptos, "IBM Plex Sans", "Source Sans 3", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(180deg, #f8f6ee 0%, var(--bg) 46%, #eeeadf 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
}

button {
  min-height: 2.6rem;
  border: 1px solid #20251f;
  border-radius: 0.5rem;
  padding: 0 1rem;
  background: #20251f;
  color: #fffdfa;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 26, 22, 0.16);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.shell {
  width: calc(100% - 32px);
  max-width: 1220px;
  margin: 0 auto;
  padding: 34px 0 52px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  min-width: 0;
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  border: 1px solid rgba(47, 93, 80, 0.24);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 250, 0.7);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: 4rem;
  line-height: 1;
  font-weight: 860;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 820;
}

.topbar p,
.verdict p,
.panel p,
.status {
  color: var(--muted);
  line-height: 1.58;
}

.topbar p {
  max-width: 820px;
  margin-top: 13px;
  overflow-wrap: anywhere;
}

.status {
  position: relative;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 11px 14px 11px 38px;
  background: rgba(255, 255, 250, 0.75);
  box-shadow: 0 8px 22px rgba(40, 44, 35, 0.04);
}

.status::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--yellow);
  transform: translateY(-50%);
}

.status.ok {
  border-color: rgba(21, 111, 92, 0.32);
  color: var(--green);
}

.status.ok::before {
  background: var(--green);
}

.status.error {
  border-color: rgba(180, 61, 56, 0.4);
  color: var(--red);
}

.status.error::before {
  background: var(--red);
}

.hero {
  --risk-score: 0;
  --risk-color: var(--soft);
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 285px;
  gap: 18px;
  align-items: stretch;
  min-width: 0;
  margin-bottom: 16px;
  border: 1px solid rgba(38, 48, 38, 0.16);
  border-radius: 0.5rem;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 250, 0.96), rgba(247, 245, 236, 0.88)),
    var(--panel-solid);
  box-shadow: var(--shadow);
}

.hero.green {
  --risk-color: var(--green);
}

.hero.yellow {
  --risk-color: var(--yellow);
}

.hero.orange {
  --risk-color: var(--orange);
}

.hero.red {
  --risk-color: var(--red);
}

.score-card {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  min-height: 230px;
  padding: 18px;
  background: #faf8ef;
}

.score-card > span {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fffdfa 0 58%, transparent 59%),
    conic-gradient(var(--risk-color) calc(var(--risk-score) * 1%), #e4e1d4 0);
  box-shadow:
    inset 0 0 0 1px rgba(38, 48, 38, 0.08),
    0 14px 28px rgba(40, 44, 35, 0.08);
}

.score-ring strong {
  font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 3.15rem;
  line-height: 1;
  font-weight: 850;
}

.score-ring small {
  margin-top: -34px;
  color: var(--soft);
  font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.verdict {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
  padding: 18px 8px 18px 22px;
}

#verdict {
  margin-bottom: 8px;
  color: var(--risk-color);
  font-size: 2rem;
  line-height: 1.18;
  font-weight: 860;
}

.risk-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 18px;
  min-width: 0;
}

.band {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 0.45rem;
  padding: 8px 7px;
  color: #fffdfa;
  font-size: 0.76rem;
  font-weight: 780;
  line-height: 1.2;
  text-align: center;
}

.band-green {
  background: var(--green);
}

.band-yellow {
  background: var(--yellow);
}

.band-orange {
  background: var(--orange);
}

.band-red {
  background: var(--red);
}

.meta {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.meta span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 12px;
  background: rgba(255, 255, 250, 0.72);
}

.meta em {
  color: var(--soft);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 760;
}

.meta strong {
  font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.explain-card,
.panel,
.module-card {
  border: 1px solid rgba(38, 48, 38, 0.16);
  border-radius: 0.5rem;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(40, 44, 35, 0.055);
  backdrop-filter: blur(8px);
}

.explain-card {
  padding: 15px;
  min-width: 0;
}

.explain-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.94rem;
}

.explain-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fbfaf4;
}

.trigger-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  line-height: 1.5;
  list-style: none;
}

.trigger-list li {
  min-width: 0;
  border-left: 3px solid var(--yellow);
  border-radius: 0.45rem;
  padding: 10px 11px;
  background: #fbfaf4;
  overflow-wrap: anywhere;
}

.trigger-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.module-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 16px;
}

.module-card::before {
  content: attr(data-index);
  position: absolute;
  right: 13px;
  top: 10px;
  color: rgba(98, 106, 92, 0.25);
  font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 800;
}

.module-card h3 {
  margin: 0 42px 12px 0;
  font-size: 1rem;
}

.module-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.module-score strong {
  font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2rem;
}

.module-score span,
.module-verdict {
  color: var(--muted);
  font-size: 0.9rem;
}

.bar {
  height: 10px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e4d7;
}

.bar span {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--c);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric-pill {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 12px;
  background: #fbfaf4;
}

.metric-pill span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}

.metric-pill strong {
  font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 780;
}

td {
  font-size: 0.92rem;
  line-height: 1.48;
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

.thresholds {
  margin-top: 10px;
}

@media (max-width: 980px) {
  h1 {
    font-size: 2.7rem;
  }

  .topbar,
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .verdict {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
  }

  .module-grid,
  .metric-grid,
  .explain-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: calc(100% - 22px);
    padding-top: 22px;
  }

  h1 {
    font-size: 2rem;
  }

  .risk-scale {
    grid-template-columns: 1fr;
  }
}
  min-width: 0;
