:root {
  --bg: #07111f;
  --panel: #0f1d32;
  --panel-2: #132645;
  --text: #ecf3ff;
  --muted: #b3c4e5;
  --line: rgba(255,255,255,0.12);
  --signal: #57c8ff;
  --steward: #f6c85f;
  --danger: #ff6b6b;
  --button: #1d3b67;
  --button-strong: #2f63b0;
  --shadow: 0 20px 40px rgba(0,0,0,0.22);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #142845 0%, #07111f 55%, #030812 100%);
  color: var(--text);
}
.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}
.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.hero > div, .hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--signal);
  font-size: 12px;
  margin: 0 0 8px;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
}
.subtitle, .byline {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}
.byline { margin-top: 10px; font-weight: 600; }
.hero-card-title {
  font-weight: 700;
  margin: 0 0 8px;
}
.mini-steps { margin: 0; padding-left: 20px; color: var(--muted); }
.grid {
  display: grid;
  gap: 18px;
}
.two-col {
  grid-template-columns: 1fr 1fr;
}
.full-span { grid-column: 1 / -1; }
.panel {
  background: rgba(14, 27, 47, 0.86);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin: 0;
  font-size: 22px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
  font-size: 13px;
}
.pill.muted { opacity: 0.7; }
.field-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
label { font-weight: 600; }
input, textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(4, 10, 18, 0.7);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}
textarea { resize: vertical; min-height: 110px; }
.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.wrap-row { flex-wrap: wrap; }
button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.primary-button {
  background: linear-gradient(135deg, #4d8ef7, #366fca);
  color: white;
}
.secondary-button {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--line);
}
.danger-button {
  background: rgba(255,107,107,0.14);
  color: #ffd5d5;
  border: 1px solid rgba(255,107,107,0.35);
}
.status-box, .helper-text, .scenario-text { color: var(--muted); }
.status-box { margin: 12px 0 0; }
.chat-log {
  min-height: 360px;
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 6px;
  margin-bottom: 12px;
}
.chat-bubble {
  max-width: 85%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.55;
}
.chat-bubble p { margin: 0; }
.chat-bubble.assistant {
  justify-self: start;
  background: rgba(87,200,255,0.12);
  border: 1px solid rgba(87,200,255,0.28);
}
.chat-bubble.user {
  justify-self: end;
  background: rgba(246,200,95,0.12);
  border: 1px solid rgba(246,200,95,0.3);
}
.result-box, .empty-state {
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.18);
  padding: 18px;
  min-height: 180px;
  color: var(--muted);
}
.score-hero {
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.score-hero.signal-side { background: rgba(87,200,255,0.12); }
.score-hero.steward-side { background: rgba(246,200,95,0.14); }
.score-label { margin: 0; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; }
.score-value { margin: 8px 0 4px; font-size: 48px; font-weight: 800; }
.score-subtitle { margin: 0; font-weight: 700; }
.result-copy p { margin: 0 0 14px; color: var(--muted); }
.result-copy strong { color: var(--text); }
.metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.metric-chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  font-size: 13px;
}
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.wall-card {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.signal-border { box-shadow: inset 0 0 0 1px rgba(87,200,255,0.45); }
.steward-border { box-shadow: inset 0 0 0 1px rgba(246,200,95,0.45); }
.wall-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.wall-name { margin: 0; font-weight: 800; }
.wall-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  font-weight: 800;
}
.wall-tag { margin: 10px 0 8px; color: var(--signal); font-weight: 700; }
.wall-summary, .wall-compliment { margin: 0 0 8px; color: var(--muted); }
.details-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.details-box summary { cursor: pointer; font-weight: 700; }
.plain-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.plain-list.numbered { list-style: decimal; }
.count-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.count-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.count-card.signal-side { background: rgba(87,200,255,0.12); }
.count-card.steward-side { background: rgba(246,200,95,0.14); }
.count-label { margin: 0 0 6px; color: var(--muted); }
.count-value { margin: 0; font-size: 36px; font-weight: 800; }
.table-wrap { overflow: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: left;
  vertical-align: top;
}
.data-table th { color: var(--muted); font-weight: 700; }
@media (max-width: 960px) {
  .hero, .two-col {
    grid-template-columns: 1fr;
  }
  .count-grid {
    grid-template-columns: 1fr;
  }
}

.lens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.lens-card {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.lens-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.lens-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.wall-excerpt { margin: 0 0 8px; color: var(--text); font-style: italic; }
