@import url("https://fonts.googleapis.com/css2?family=Forum&family=Manrope:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --ink: #ecf0eb;
  --muted: #a8b2ad;
  --faint: #6c7570;
  --line: #232c30;
  --line-strong: #364148;
  --paper: #07090a;
  --panel: #0c1011;
  --panel-raised: #12171a;
  --forest: #4ec9a3;
  --moss: #3da888;
  --copper: #b07f3a;
  --blue: #6db6c4;
  --danger: #c45a4e;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 52px rgba(0,0,0,.55);
  --font-display: "Forum", Georgia, serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(78, 201, 163, 0.15), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(176, 127, 58, 0.13), transparent 30%),
    linear-gradient(135deg, #07090a 0%, #0c1011 52%, #07090a 100%),
    var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: var(--forest);
  text-decoration: none;
}

a:hover {
  color: #97d5b7;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.topbar,
.hero-grid,
.runbook,
.results-grid {
  width: 100%;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--copper);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.1vw, 4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: 0;
}

.mode-lock {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(78, 201, 163, 0.34);
  background: rgba(18, 23, 26, 0.86);
  color: var(--forest);
  font-weight: 800;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--moss);
  box-shadow: 0 0 0 6px rgba(78, 201, 163, 0.14);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.ceremony-panel,
.form-panel,
.result-card,
.console-card,
.runbook article {
  background: rgba(12, 16, 17, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.ceremony-panel {
  min-height: 456px;
  padding: 20px;
  display: flex;
  align-items: stretch;
}

.chain-visual {
  position: relative;
  width: 100%;
  min-height: 416px;
  border: 1px solid rgba(78, 201, 163, 0.22);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(78, 201, 163, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(78, 201, 163, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(18, 23, 26, 0.92), rgba(7, 9, 10, 0.96));
  background-size: 40px 40px, 40px 40px, auto;
}

.chain-line {
  position: absolute;
  inset: 17% 16%;
  border: 2px solid rgba(78, 201, 163, 0.24);
  transform: skewY(-10deg);
}

.node {
  position: absolute;
  z-index: 2;
  width: min(340px, 44%);
  min-height: 104px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line-strong);
  background: rgba(18, 23, 26, 0.96);
}

.node span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.node strong {
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  line-height: 1.25;
}

.node-origin {
  top: 10%;
  left: 7%;
  border-top: 6px solid var(--forest);
}

.node-architect {
  top: 38%;
  right: 8%;
  border-top: 6px solid var(--blue);
}

.node-master {
  bottom: 10%;
  left: 17%;
  border-top: 6px solid var(--copper);
}

.form-panel {
  padding: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.section-title.compact {
  margin-top: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 10px;
}

input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(7, 9, 10, 0.76);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
}

input:focus {
  outline: 3px solid rgba(78, 201, 163, 0.24);
  border-color: var(--forest);
}

input::placeholder {
  color: var(--faint);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.primary-action {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: var(--forest);
  color: #07110d;
  font-weight: 900;
  cursor: pointer;
}

.primary-action:hover {
  background: #6cbf99;
}

.primary-action:disabled {
  cursor: wait;
  background: var(--line-strong);
  color: var(--muted);
}

.runbook {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.runbook article {
  min-height: 116px;
  padding: 14px;
}

.runbook span {
  color: var(--copper);
  font-weight: 900;
}

.runbook h3 {
  margin: 14px 0 6px;
  font-size: 0.92rem;
}

.runbook p {
  color: var(--muted);
  line-height: 1.38;
  font-size: 0.84rem;
}

.console-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr 1fr 1.1fr;
  gap: 12px;
  margin-top: 16px;
}

.ceremony-run {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr 0.9fr 1.1fr;
  gap: 12px;
  margin-top: 16px;
}

.console-card {
  min-height: 192px;
  padding: 14px;
  overflow: hidden;
}

.status-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge.pass {
  border-color: rgba(78, 201, 163, 0.42);
  color: var(--forest);
  background: rgba(78, 201, 163, 0.08);
}

.status-badge.fail {
  border-color: rgba(196, 90, 78, 0.44);
  color: var(--danger);
  background: rgba(196, 90, 78, 0.08);
}

.status-badge.locked {
  border-color: rgba(176, 127, 58, 0.5);
  color: var(--copper);
  background: rgba(176, 127, 58, 0.08);
}

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

.check-list li,
.artifact-list li {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.check-list li.pass strong {
  color: var(--forest);
}

.check-list li.fail strong {
  color: var(--danger);
}

.check-list.compact li {
  min-height: 28px;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
}

.check-list span,
.artifact-list a {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.check-list strong,
.artifact-list span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
}

.artifact-list li {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.timeline-list li {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.timeline-list span,
.history-list strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.timeline-list strong,
.history-list span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.timeline-list li.pass strong {
  color: var(--forest);
}

.timeline-list li.fail strong {
  color: var(--danger);
}

.seal-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.secondary-action {
  width: 100%;
  min-height: 36px;
  margin-bottom: 12px;
  border: 1px solid rgba(78, 201, 163, 0.42);
  background: rgba(78, 201, 163, 0.12);
  color: var(--forest);
  font-weight: 900;
  cursor: pointer;
}

.secondary-action:hover {
  background: rgba(78, 201, 163, 0.18);
}

.secondary-action:disabled {
  border-color: var(--line);
  background: var(--panel-raised);
  color: var(--faint);
  cursor: not-allowed;
}

.secondary-action.subdued {
  margin-top: 4px;
  margin-bottom: 0;
  border-color: var(--line-strong);
  background: transparent;
}

.seal-metrics {
  grid-template-columns: 1fr;
  margin-bottom: 8px;
}

.seal-metrics div:last-child {
  grid-column: auto;
}

.history-list li {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.history-list div {
  display: grid;
  gap: 3px;
}

.history-list a {
  min-width: 44px;
  color: var(--forest);
  font-weight: 900;
  text-align: right;
}

.live-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.compact-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.compact-metrics div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.compact-metrics div:last-child {
  grid-column: 1 / -1;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

.result-card {
  min-height: 280px;
  padding: 16px;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 12px;
}

.card-head h2 {
  margin-bottom: 0;
  font-size: 0.98rem;
}

.card-head button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.card-head button:disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.metrics {
  display: grid;
  gap: 14px;
  margin: 0;
}

.metrics div {
  display: grid;
  gap: 5px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  font-family: var(--font-mono);
}

pre {
  min-height: 230px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: rgba(7, 9, 10, 0.72);
  border: 1px solid var(--line);
  padding: 14px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.error {
  color: var(--danger);
}

@media (max-width: 1080px) {
  .hero-grid,
  .console-grid,
  .ceremony-run,
  .results-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 18px;
  }

  .ceremony-panel {
    min-height: 470px;
    padding: 12px;
  }

  .node {
    width: 74%;
  }

  .node-origin,
  .node-master {
    left: 7%;
  }

  .node-architect {
    right: 7%;
  }

  .split,
  .runbook {
    grid-template-columns: 1fr;
  }
}
