.shell {
  min-height: 100vh;
  padding: 34px 40px 84px;
  background: var(--madarx-bg, #e8e8e5);
  color: #0f0f11;
  font-family: var(--font-geist-mono), 'IBM Plex Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid #0f0f11;
  padding-bottom: 14px;
  margin-bottom: 34px;
}

.lead,
.links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lead em,
.panelTitle small,
.meta b,
.orgGrid em,
.kv dt,
.step span,
.result b,
.matrix th,
.warStatus {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4a4a4d;
  font-style: normal;
  font-weight: 500;
}

.lead b {
  font-size: 13px;
  font-weight: 500;
}

.lead i,
.eyebrow,
.links a:hover,
.decision {
  color: var(--accent-500);
  font-style: normal;
}

.links a {
  color: #0f0f11;
  font-size: 11px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 34px;
  align-items: start;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 980px;
  margin: 0 0 16px;
  font-size: clamp(38px, 5.1vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 500;
}

.hero p,
.panel p,
.step p,
.warCard p {
  color: #4a4a4d;
  font-size: 14px;
  line-height: 1.65;
}

.meta,
.panel {
  border: 1px solid #0f0f11;
  background: #fff;
  padding: 22px 24px;
}

.meta {
  background: #dcdcd8;
}

.meta dl,
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
}

.meta dd,
.kv dd {
  margin: 0;
}

.modeStrip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid #0f0f11;
  background: #0f0f11;
  margin-bottom: 24px;
}

.modeStrip button,
.orgGrid button {
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.modeStrip button {
  min-height: 120px;
  padding: 16px;
  border: 0;
  border-right: 1px solid #2a2a2d;
  background: #0f0f11;
  color: #dcdcd8;
}

.modeStrip button:last-child {
  border-right: 0;
}

.modeStrip button b,
.orgGrid b,
.panelTitle b,
.result strong,
.step b,
.warCard b {
  display: block;
  font-weight: 600;
}

.modeStrip button b,
.panelTitle b {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.modeStrip button span,
.orgGrid small,
.agentList span,
.chips span {
  display: block;
  font-size: 11.5px;
  line-height: 1.45;
}

.modeStrip button span {
  margin-top: 8px;
  color: #9a9a9a;
}

.modeStrip button.on {
  background: #e8e8e5;
  color: #0f0f11;
}

.modeStrip button.on span {
  color: #4a4a4d;
}

.section {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 28px;
}

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

.dark {
  background: #0f0f11;
  color: #e8e8e5;
}

.dark p,
.dark small {
  color: #dcdcd8;
}

.panelTitle {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  border-bottom: 1px solid rgba(15, 15, 17, 0.2);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.dark .panelTitle {
  border-bottom-color: rgba(232, 232, 229, 0.22);
}

.bigClaim {
  font-size: clamp(22px, 3vw, 42px) !important;
  line-height: 1.04 !important;
  letter-spacing: -0.045em;
  color: #0f0f11 !important;
  margin: 0 0 16px;
}

.chips,
.agentList,
.resultMeta,
.archLayers,
.steps,
.warGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips span,
.agentList span,
.resultMeta span,
.archLayers span {
  border: 1px solid #0f0f11;
  background: #e8e8e5;
  padding: 8px 10px;
}

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

.orgGrid button {
  min-height: 104px;
  border: 1px solid #0f0f11;
  background: #e8e8e5;
  padding: 14px;
  color: #0f0f11;
}

.orgGrid button.on {
  background: #0f0f11;
  color: #e8e8e5;
}

.orgGrid button.on small,
.orgGrid button.on em {
  color: #dcdcd8;
}

.deptCard {
  background: #dcdcd8;
}

.simGrid,
.flowGrid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.controls {
  display: grid;
  gap: 10px;
}

.controls label {
  display: grid;
  gap: 6px;
  color: #4a4a4d;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.controls select,
.range {
  width: 100%;
  border: 1px solid #0f0f11;
  background: #fff;
  color: #0f0f11;
  padding: 10px;
  font: inherit;
  font-size: 12px;
}

.result {
  min-height: 100%;
  border: 1px solid #0f0f11;
  background: #0f0f11;
  color: #e8e8e5;
  padding: 20px;
}

.result strong {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.result p {
  color: #dcdcd8;
}

.resultMeta span {
  border-color: #4a4a4d;
  background: #1b1b1e;
  color: #e8e8e5;
}

.steps {
  align-items: stretch;
}

.step {
  flex: 1 1 180px;
  border: 1px solid #0f0f11;
  background: #fff;
  padding: 14px;
}

.archLayers {
  flex-direction: column;
}

.archLayers span {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

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

.metric {
  border: 1px solid #0f0f11;
  background: #dcdcd8;
  padding: 16px;
}

.metric b {
  display: block;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.matrixWrap {
  overflow-x: auto;
}

.matrix {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.45;
}

.matrix th,
.matrix td {
  border: 1px solid #0f0f11;
  padding: 12px;
  vertical-align: top;
}

.matrix th {
  background: #0f0f11;
  color: #e8e8e5;
}

.warGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}

.warCard {
  border: 1px solid #0f0f11;
  background: #fff;
  padding: 14px;
  min-height: 190px;
  opacity: 0.58;
}

.warCard.active {
  opacity: 1;
  background: #0f0f11;
  color: #e8e8e5;
}

.warCard.active p,
.warCard.active .warStatus {
  color: #dcdcd8;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #0f0f11;
  padding-top: 18px;
  color: #4a4a4d;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .shell { padding: 24px 18px 64px; }
  .hero,
  .section,
  .simGrid,
  .flowGrid { grid-template-columns: 1fr; }
  .modeStrip,
  .orgGrid,
  .perfGrid,
  .warGrid { grid-template-columns: 1fr; }
  .archLayers span { grid-template-columns: 1fr; }
}
