:root {
  color-scheme: light;
  --bg: #edf1ef;
  --paper: #fcfdfb;
  --ink: #17211d;
  --muted: #63706a;
  --line: #cbd5d1;
  --green: #176b4d;
  --green-soft: #dceee5;
  --red: #9a342c;
  --red-soft: #f4dfdc;
  --blue: #235f82;
  --blue-soft: #ddeaf0;
  --gold: #8a671f;
  --shadow: 0 18px 45px rgba(20, 31, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 33, 29, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(23, 33, 29, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 38px 38px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(520px, 0.95fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow,
.mono {
  margin: 0;
  color: var(--blue);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 4.5rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.status-grid div,
.policy-panel,
.result-panel,
.chain-panel,
.trace-grid > section {
  background: rgba(252, 253, 251, 0.95);
}

.status-grid div {
  padding: 14px 16px;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 750;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.25fr) minmax(360px, 1.25fr);
  gap: 16px;
  align-items: stretch;
}

.policy-panel,
.result-panel,
.chain-panel,
.trace-grid > section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.policy-panel,
.result-panel,
.chain-panel {
  min-height: 440px;
  padding: 18px;
}

.section-title {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title strong {
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.policy-expression {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.policy-expression span,
.policy-expression b {
  display: block;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf8;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.9rem;
}

.policy-expression b {
  min-height: 32px;
  padding: 6px 14px;
  border-color: #cbb677;
  background: #f3e6bd;
  color: var(--gold);
  font-family: inherit;
  font-size: 0.78rem;
  text-align: center;
}

.actor-stack {
  display: grid;
  gap: 10px;
}

.actor {
  display: grid;
  width: 100%;
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.actor:hover,
.actor:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  outline: none;
  transform: translateY(-1px);
}

.actor.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.actor.danger.active {
  border-color: var(--red);
  background: var(--red-soft);
}

.actor-name {
  font-weight: 850;
}

.actor-attrs {
  color: var(--muted);
  font-size: 0.86rem;
}

.result {
  display: grid;
  min-height: 138px;
  align-content: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid;
  border-radius: 8px;
}

.result.accept {
  border-color: rgba(23, 107, 77, 0.34);
  background: var(--green-soft);
}

.result.reject {
  border-color: rgba(154, 52, 44, 0.36);
  background: var(--red-soft);
}

.result-label {
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0;
}

.result.accept .result-label {
  color: var(--green);
}

.result.reject .result-label {
  color: var(--red);
}

.request-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.request-grid div {
  min-height: 70px;
  padding: 13px 14px;
  background: var(--paper);
}

.hash {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.architecture {
  display: block;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 28 / 9;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.architecture rect {
  fill: #fcfdfb;
  stroke: #bfb4a6;
  stroke-width: 1.4;
}

.architecture text {
  fill: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 750;
}

.architecture .authority rect {
  fill: var(--blue-soft);
  stroke: #80a7bc;
}

.architecture .gateway rect {
  fill: var(--green-soft);
  stroke: #82aa98;
}

.architecture .chain rect {
  fill: #f3e6bd;
  stroke: #cbb677;
}

.architecture .edge {
  fill: none;
  stroke: #6e7a73;
  stroke-width: 2;
}

.architecture marker path {
  fill: #6e7a73;
}

.event-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.84rem;
}

.chain-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.chain-links a {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-soft);
  color: #174561;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.trace-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 1fr) minmax(300px, 0.78fr);
  gap: 16px;
  margin-top: 16px;
}

.trace-grid > section {
  padding: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.9rem;
}

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

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.boundary-copy {
  display: grid;
  gap: 12px;
}

.storage-copy dl {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.storage-copy div {
  min-height: 62px;
  padding: 12px 14px;
  background: #f8faf8;
}

.storage-copy a {
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.boundary-copy p {
  min-height: 54px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf8;
}

@media (max-width: 1180px) {
  .topbar,
  .hero-grid,
  .trace-grid {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chain-links {
    grid-template-columns: 1fr;
  }

  .policy-panel,
  .result-panel,
  .chain-panel {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
    gap: 6px;
  }

  .section-title strong {
    text-align: left;
  }

  h1 {
    font-size: 2.8rem;
  }

  .result-label {
    font-size: 2.6rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
