:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #627069;
  --paper: #f4f6f1;
  --panel: #ffffff;
  --line: #dfe5dd;
  --green: #1f6d4a;
  --green-soft: #e5f3eb;
  --amber: #9a5b10;
  --amber-soft: #fff0d9;
  --red: #a33a31;
  --red-soft: #fbe9e7;
  --blue: #265a8f;
  --blue-soft: #e8f1fa;
  --shadow: 0 14px 40px rgba(30, 45, 37, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 3.25rem max(2rem, calc((100vw - 1240px) / 2));
  color: #f8fbf8;
  background:
    radial-gradient(circle at 85% 15%, rgba(96, 179, 131, 0.26), transparent 28%),
    #183a2b;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.45rem;
  color: #76c89a;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.intro {
  max-width: 680px;
  margin: 1.25rem 0 0;
  color: #c8d8cf;
  font-size: 1.05rem;
  line-height: 1.65;
}

main,
footer {
  width: min(1240px, calc(100% - 4rem));
  margin: 0 auto;
}

.system-panel,
.identity-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 2rem 0;
  padding: 1.15rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.identity-panel {
  align-items: flex-start;
  margin-top: -1rem;
}

.system-panel h2,
.identity-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.identity-panel p {
  max-width: 520px;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.system-status,
.identity-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.identity-status {
  min-width: min(100%, 620px);
}

.identity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.identity-grid h3 {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.identity-grid table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 9px;
  background: var(--panel);
  font-size: 0.78rem;
}

.identity-grid th,
.identity-grid td {
  padding: 0.52rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.identity-grid th {
  color: var(--green);
  background: var(--green-soft);
}

.identity-grid pre {
  max-height: 180px;
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
  border-radius: 9px;
  background: #f0f3ef;
  font-size: 0.74rem;
}

.hidden {
  display: none;
}

.component-chip,
.status-chip,
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 750;
}

.component-chip::before {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.ready,
.success {
  color: var(--green);
  background: var(--green-soft);
}

.unavailable,
.failed {
  color: var(--red);
  background: var(--red-soft);
}

.running {
  color: var(--amber);
  background: var(--amber-soft);
}

.idle {
  color: var(--muted);
  background: #edf0ec;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 2fr);
  gap: 1.25rem;
  align-items: start;
}

.scenario-list {
  display: grid;
  gap: 0.7rem;
}

.scenario-card {
  width: 100%;
  padding: 1rem;
  text-align: left;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.scenario-card:hover,
.scenario-card.active {
  transform: translateY(-1px);
  border-color: #7da78f;
  box-shadow: var(--shadow);
}

.scenario-card.active {
  box-shadow: inset 4px 0 0 var(--green), var(--shadow);
}

.scenario-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.scenario-number {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 850;
}

.scenario-card h3 {
  margin: 0.55rem 0 0.2rem;
  font-size: 1rem;
}

.scenario-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.scenario-detail {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.7rem;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 0.2rem 0 0.55rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.035em;
}

.detail-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.actions {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
}

.button {
  border: 0;
  border-radius: 9px;
  padding: 0.7rem 1rem;
  font-weight: 760;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  color: white;
  background: var(--green);
}

.button-secondary {
  color: var(--ink);
  background: #e8ece7;
}

.button-quiet {
  color: #ecf7f0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}

.detail-section {
  padding: 1.4rem 1.7rem;
  background: var(--panel);
}

.detail-section.full {
  grid-column: 1 / -1;
}

.detail-section h3 {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
}

.detail-section ul,
.detail-section ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.65;
}

.alignment-note {
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  color: #244867;
  font-size: 0.88rem;
  line-height: 1.5;
}

.run-panel {
  padding: 1.4rem 1.7rem 1.8rem;
}

.run-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.run-heading h3 {
  margin: 0;
}

.protocol-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.protocol-toggle input {
  accent-color: var(--green);
}

.protocol-toggle small {
  color: var(--amber);
}

.event-log {
  max-height: 300px;
  overflow: auto;
  border: 1px solid #26352e;
  border-radius: 10px;
  background: #17231d;
  color: #d7e6dc;
}

.event {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
}

.event summary {
  display: grid;
  grid-template-columns: 8rem minmax(8rem, 12rem) 1fr;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.event summary::-webkit-details-marker {
  display: none;
}

.event pre {
  margin: 0.65rem 0 0 8.75rem;
  padding: 0.7rem;
  overflow: auto;
  border-radius: 7px;
  color: #bfd3c6;
  background: #101a15;
  white-space: pre-wrap;
}

.event:last-child {
  border-bottom: 0;
}

.event time,
.event-type {
  color: #83c69f;
}

.result {
  margin-top: 1rem;
}

.result summary {
  cursor: pointer;
  font-weight: 760;
}

.result pre {
  max-height: 420px;
  margin: 0.8rem 0 0;
  padding: 1rem;
  overflow: auto;
  border-radius: 10px;
  background: #f0f3ef;
  font-size: 0.76rem;
  line-height: 1.5;
}

.empty-state {
  display: grid;
  min-height: 620px;
  place-items: center;
  color: var(--muted);
}

footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 840px) {
  .hero,
  .detail-header,
  .system-panel,
  .identity-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace,
  .detail-grid,
  .identity-grid {
    grid-template-columns: 1fr;
  }

  .detail-section.full {
    grid-column: auto;
  }

  .system-status,
  .identity-chips {
    justify-content: flex-start;
  }

  .event summary {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .event pre {
    margin-left: 0;
  }
}
