:root {
  --bg: #eef2f6;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #5f6b7a;
  --line: #cbd5e1;
  --blue: #1d4ed8;
  --blue-soft: #e8f0ff;
  --teal: #0f766e;
  --teal-soft: #e6f5f2;
  --green: #15803d;
  --green-soft: #e8f6ec;
  --amber: #b7791f;
  --amber-soft: #fff4da;
  --red: #b42318;
  --red-soft: #fff0ee;
  --slate: #334155;
  --slate-soft: #f1f5f9;
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans JP", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.stage {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 58px 1fr 58px;
}

.topbar,
.footer {
  background: rgba(255, 255, 255, 0.94);
  border-color: #d8e0ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  position: relative;
  z-index: 4;
}

.topbar {
  border-bottom: 1px solid #d8e0ea;
}

.footer {
  border-top: 1px solid #d8e0ea;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 900;
  color: #223047;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid #b7c4d4;
  background:
    linear-gradient(135deg, var(--blue) 0 44%, transparent 44%),
    linear-gradient(315deg, var(--teal) 0 50%, #ffffff 50%);
  flex: 0 0 auto;
}

.brand-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.counter,
.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.frame {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 116px);
  border: 0;
  display: block;
  background: var(--bg);
}

.nav,
.dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav button,
.dot {
  width: 36px;
  height: 36px;
  border: 1px solid #c5d0dd;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 900;
}

.dot {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.dot.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.slide {
  min-height: 100vh;
  padding: 34px clamp(24px, 4vw, 62px) 30px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.slide-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
}

h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  margin: 10px 0 0;
  max-width: 980px;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.5;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #c7d2df;
  border-radius: 7px;
  background: #fff;
  color: #314158;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  white-space: nowrap;
}

.canvas {
  min-height: 430px;
  background: var(--paper);
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  overflow: hidden;
}

.node,
.panel {
  background: #fff;
  border: 1px solid #bdc9d8;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 9px 22px rgba(15, 23, 42, 0.08);
}

.node strong,
.panel strong {
  display: block;
  margin-bottom: 5px;
  color: #142033;
  font-size: 15px;
  line-height: 1.25;
}

.node span,
.panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.blue { background: var(--blue-soft); border-color: #9db8f9; }
.teal { background: var(--teal-soft); border-color: #91d0c7; }
.green { background: var(--green-soft); border-color: #9bd4aa; }
.amber { background: var(--amber-soft); border-color: #e3c36d; }
.red { background: var(--red-soft); border-color: #f0aaa3; }
.slate { background: var(--slate-soft); border-color: #bdc9d8; }

.arrow {
  position: relative;
  height: 2px;
  background: #b8c5d4;
  align-self: center;
}

.arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-left: 9px solid #b8c5d4;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.risk-map {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 1.35fr) 1fr;
  gap: 20px;
  align-items: center;
}

.risk-card {
  min-height: 320px;
  border-radius: 8px;
  border: 1px solid #d4dde8;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.risk-card.cost { border-color: #f0aaa3; background: var(--red-soft); }
.risk-card.quality { border-color: #e3c36d; background: var(--amber-soft); }

.risk-title {
  display: grid;
  place-items: center;
  min-height: 66px;
  border-radius: 8px;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.cost .risk-title { background: var(--red); }
.quality .risk-title { background: var(--amber); }

.risk-words {
  display: grid;
  align-content: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.risk-words li {
  min-height: 50px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.42);
  display: grid;
  place-items: center;
  color: #1f2937;
  font-size: 24px;
  font-weight: 900;
}

.growth-track {
  min-height: 360px;
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  box-shadow: var(--shadow);
}

.track-title {
  text-align: center;
  color: #172033;
  font-size: 20px;
  font-weight: 900;
}

.turn-growth {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: end;
}

.growth-step {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
}

.growth-stack {
  align-self: end;
  border: 1px solid #c7d2df;
  border-radius: 8px;
  background:
    repeating-linear-gradient(to top, #e8f0ff 0, #e8f0ff 12px, #ffffff 12px, #ffffff 16px);
}

.h1 { height: 50px; }
.h5 { height: 92px; }
.h10 { height: 136px; }
.h20 { height: 202px; }
.h50 { height: 286px; }

.growth-step b {
  text-align: center;
  color: #172033;
  font-size: 15px;
  font-weight: 900;
}

.runtime-answer {
  border-radius: 8px;
  background: #172033;
  color: #fff;
  padding: 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.runtime-map {
  height: 100%;
  display: grid;
  grid-template-columns: 0.9fr 1.35fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.agent-stack {
  display: grid;
  gap: 10px;
  align-content: center;
}

.main-flow {
  display: grid;
  grid-template-rows: repeat(7, auto);
  gap: 10px;
  align-content: center;
}

.main-flow .node {
  min-height: 64px;
  display: grid;
  align-content: center;
  text-align: center;
}

.flow-arrow {
  height: 20px;
  width: 2px;
  background: #b8c5d4;
  justify-self: center;
  position: relative;
}

.flow-arrow::after {
  content: "";
  position: absolute;
  left: -5px;
  bottom: -2px;
  border-top: 9px solid #b8c5d4;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}

.agent-role-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.role-column {
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.role-column h3 {
  margin: 0 0 2px;
  color: #172033;
  font-size: 16px;
}

.decision-box {
  min-height: 92px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  background: #172033;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}

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

.memory-example {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.rule-strip,
.legend-row {
  display: grid;
  gap: 10px;
}

.rule-strip { grid-template-columns: repeat(4, 1fr); }
.legend-row { grid-template-columns: repeat(3, 1fr); }

.param {
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  min-height: 62px;
}

.param b {
  display: block;
  color: #172033;
  font-size: 15px;
  margin-bottom: 4px;
}

.param span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.round-table-wrap {
  overflow: auto;
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fbfdff;
}

.round-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  font-size: 12px;
}

.round-table th,
.round-table td {
  border-bottom: 1px solid #dbe3ee;
  border-right: 1px solid #e2e8f0;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  line-height: 1.32;
}

.round-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef4fb;
  color: #273548;
  font-weight: 900;
}

.round-table td:last-child,
.round-table th:last-child { border-right: none; }
.round-table tr:last-child td { border-bottom: none; }
.turn-no { width: 62px; color: #172033; font-weight: 900; white-space: nowrap; }
.prompt-cell { color: #334155; }
.trigger-cell { width: 190px; font-weight: 800; }
.summary-row td { background: var(--amber-soft); }
.drop-row td { background: var(--green-soft); }

.case-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.05fr;
  gap: 16px;
}

.case-column {
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.case-column h3 {
  margin: 0 0 2px;
  color: #172033;
  font-size: 16px;
}

.case-event {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fff;
  padding: 7px;
}

.case-event b {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.case-event span {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.case-runtime {
  display: grid;
  gap: 12px;
  align-content: center;
}

.case-core {
  min-height: 86px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.extension-layout {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.runtime-foundation {
  border-radius: 8px;
  background: #172033;
  color: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 36px rgba(23, 32, 51, 0.2);
}

.foundation-title {
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.capability {
  min-height: 48px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.adapter-band {
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.adapter-items {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.adapter-label {
  color: #172033;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.adapter-item {
  min-height: 48px;
  border: 1px solid #d4dde8;
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: stretch;
}

.domain-card {
  border: 1px solid #d4dde8;
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.domain-card h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
  line-height: 1.25;
}

.domain-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  align-content: start;
}

.domain-card li {
  min-height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: grid;
  align-items: center;
  padding: 4px 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .slide {
    padding: 22px 16px;
  }

  .slide-head,
  .risk-map,
  .runtime-map,
  .agent-role-layout,
  .contract-strip,
  .rule-strip,
  .legend-row,
  .case-layout,
  .extension-layout,
  .capability-grid,
  .adapter-band,
  .adapter-items,
  .domain-grid {
    display: block;
  }

  .canvas,
  .node,
  .panel,
  .param,
  .risk-card,
  .growth-track,
  .role-column,
  .case-column,
  .capability,
  .adapter-label,
  .adapter-item,
  .domain-card {
    margin-top: 12px;
  }

  .tag {
    justify-self: start;
  }

  .hint {
    display: none;
  }
}
