:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-soft: #edf5f1;
  --ink: #172422;
  --muted: #5c6d68;
  --line: #d4ded9;
  --primary: #0f766e;
  --primary-strong: #0b4f4a;
  --primary-soft: #d9f0eb;
  --accent: #8a6f25;
  --danger: #b42318;
  --ok: #15803d;
  --shadow: 0 18px 45px rgba(23, 36, 34, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 20% 0%, rgba(15, 118, 110, 0.08), transparent 28rem), var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  min-height: 44px;
}

button:disabled {
  cursor: default;
  opacity: 0.62;
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.38);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}

.hero__copy,
.hero__panel,
.detail-panel,
.simulator-controls,
.simulator-output,
.handoff-card,
.dialogue-panel,
.dialogue-output,
  .report-panel,
  .workshop-block,
  .prompt-card,
.architecture-card,
.atlas-card,
.task-card,
.evidence-card,
.history-card,
.history-empty,
.resource-card,
.modern-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero__copy {
  padding: 30px;
}

.hero__copy h1 {
  margin: 4px 0 10px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__panel {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px;
  background: linear-gradient(145deg, #ffffff, var(--surface-soft));
}

.hero__panel span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero__panel strong {
  font-size: 1.35rem;
  line-height: 1.35;
}

.app-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.status-dot,
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.09);
  color: var(--primary-strong);
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-dot::before {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
  content: "";
}

.status-dot.is-offline::before {
  background: var(--accent);
}

.text-button {
  min-height: 32px;
  border: 0;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 14px;
  backdrop-filter: blur(12px);
  background: rgba(246, 248, 245, 0.9);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.nav-button,
.chip,
.event-button,
.character-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 9px 14px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-button {
  flex: 0 0 auto;
  white-space: nowrap;
  scroll-snap-align: center;
}

.module-picker {
  display: none;
}

.session-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 4px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.session-summary {
  min-width: 0;
}

.session-summary strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.session-summary small {
  color: var(--muted);
}

.session-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece8;
}

.session-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.2s ease;
}

.session-actions,
.button-row,
.mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.danger-button {
  min-height: 44px;
  border: 1px solid rgba(180, 35, 24, 0.3);
  border-radius: 8px;
  background: #fff7f6;
  color: var(--danger);
  padding: 10px 14px;
  font-weight: 800;
}

.nav-button:hover,
.chip:hover,
.event-button:hover,
.character-button:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.nav-button.is-active,
.chip.is-active,
.character-button.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.view {
  display: none;
  padding-top: 10px;
  scroll-margin-top: 76px;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 22px 0 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.section-heading p:not(.eyebrow) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.map-layout,
.trade-layout,
.character-layout,
.simulator-layout,
.dialogue-layout,
.task-layout,
.workshop-layout,
.score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.map-layout > *,
.trade-layout > *,
.character-layout > *,
.simulator-layout > *,
.dialogue-layout > *,
.task-layout > *,
.workshop-layout > *,
.score-layout > *,
.facilitator-console > * {
  min-width: 0;
}

.map-stage,
.network-stage,
.character-graph {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    #fbfcfa;
  background-size: 48px 48px;
}

.map-svg,
.network-svg,
.character-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.sea-fill {
  fill: #f2f8f6;
}

.atlas-label {
  fill: rgba(15, 118, 110, 0.52);
  font-size: 18px;
  font-weight: 800;
}

.continent {
  fill: rgba(15, 118, 110, 0.08);
  stroke: rgba(15, 118, 110, 0.28);
  stroke-width: 2;
}

.sea-route,
.land-route,
.trade-link,
.relation-line {
  stroke: rgba(138, 111, 37, 0.55);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
}

.land-route {
  stroke: rgba(15, 118, 110, 0.44);
  stroke-dasharray: 9 9;
}

.diplomacy-route {
  stroke: rgba(15, 118, 110, 0.72);
  stroke-width: 5;
  stroke-dasharray: 3 8;
  fill: none;
  stroke-linecap: round;
}

.comparison-route {
  stroke: rgba(138, 111, 37, 0.7);
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
}

.risk-ring,
.comparison-ring {
  fill: rgba(180, 35, 24, 0.06);
  stroke: rgba(180, 35, 24, 0.34);
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.comparison-ring {
  fill: rgba(138, 111, 37, 0.08);
  stroke: rgba(138, 111, 37, 0.42);
}

.map-note {
  fill: var(--primary-strong);
  font-size: 16px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 4px;
}

.trade-link.is-risk {
  stroke: rgba(180, 35, 24, 0.52);
  stroke-dasharray: 8 8;
}

.map-node,
.character-node {
  outline: none;
}

.map-node circle,
.character-node circle {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 3;
  transition: fill 0.18s ease, transform 0.18s ease;
}

.map-node text,
.character-node text {
  fill: var(--ink);
  font-size: 17px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.map-node.is-active circle,
.character-node.is-active circle {
  fill: var(--primary);
  stroke: var(--primary-strong);
}

.map-node.is-active text,
.character-node.is-active text {
  fill: #ffffff;
  stroke: rgba(11, 79, 74, 0.45);
}

.detail-panel {
  padding: 20px;
}

.detail-panel h3 {
  margin: 0 0 8px;
  font-size: 1.24rem;
}

.detail-panel p {
  margin: 0 0 12px;
  color: var(--muted);
}

.tag-row,
.metric-list,
.timeline-controls,
.event-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.metric {
  display: grid;
  grid-template-columns: 88px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece8;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.fact-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.fact-table th,
.fact-table td {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.fact-table th {
  width: 82px;
  color: var(--muted);
  font-weight: 700;
}

.gallery,
.atlas-grid,
.evidence-grid,
.resource-grid,
.modern-grid,
.prompt-grid,
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.architecture-card,
.atlas-card,
.evidence-card,
.resource-card,
.modern-card,
.prompt-card,
.task-card {
  padding: 18px;
}

.atlas-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.atlas-card.is-active {
  border-color: rgba(15, 118, 110, 0.48);
  background: linear-gradient(145deg, #ffffff, var(--primary-soft));
}

.atlas-layer-button {
  margin-top: 12px;
}

.geojson-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 20px;
}

.geojson-panel .block-head {
  align-items: start;
}

.geojson-panel .block-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.zoom-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.zoom-controls .is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 800;
}

.gazetteer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.gazetteer-map {
  min-width: 0;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    #fbfcfa;
  background-size: 44px 44px;
}

.gazetteer-svg {
  display: block;
  width: 100%;
  min-height: 430px;
}

.gazetteer-sea {
  fill: #f2f8f6;
}

.gazetteer-land {
  fill: rgba(15, 118, 110, 0.08);
  stroke: rgba(15, 118, 110, 0.28);
  stroke-width: 2;
}

.gazetteer-east {
  fill: rgba(138, 111, 37, 0.08);
  stroke: rgba(138, 111, 37, 0.28);
}

.gazetteer-route {
  fill: none;
  stroke: rgba(138, 111, 37, 0.56);
  stroke-linecap: round;
  stroke-width: 2.5;
}

.gazetteer-route--comparison {
  stroke-dasharray: 8 8;
}

.gazetteer-point {
  outline: none;
}

.gazetteer-point circle {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 3;
}

.gazetteer-point text {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-linejoin: round;
  stroke-width: 5px;
}

.gazetteer-point.pending circle {
  stroke: var(--accent);
  stroke-dasharray: 4 4;
}

.gazetteer-point.non-pleiades circle {
  stroke: #7c3aed;
}

.gazetteer-point.is-active circle {
  fill: var(--primary);
  stroke: var(--primary-strong);
}

.gazetteer-list {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 16px;
}

.gazetteer-list h3 {
  margin: 0 0 8px;
}

.gazetteer-list > p {
  margin: 0 0 12px;
  color: var(--muted);
}

.gazetteer-items {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.gazetteer-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.gazetteer-item.is-active {
  border-color: rgba(15, 118, 110, 0.48);
  background: var(--primary-soft);
}

.gazetteer-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-button {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  padding: 0;
  text-align: left;
  font-weight: 900;
}

.architecture-visual,
.evidence-visual {
  display: grid;
  place-items: center;
  height: 106px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(138, 111, 37, 0.12));
  color: var(--primary-strong);
  font-size: 2.4rem;
  font-weight: 800;
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

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

.evidence-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.evidence-card .evidence-visual {
  height: 96px;
  margin-bottom: 0;
  font-size: 1.8rem;
}

.evidence-body h3 {
  margin: 6px 0 4px;
}

.evidence-body p {
  margin: 0 0 8px;
  color: var(--muted);
}

.evidence-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  vertical-align: middle;
}

.source-line {
  margin-top: 10px;
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.evidence-levels {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.evidence-level {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.evidence-level strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.evidence-level span {
  color: var(--primary-strong);
}

.citation-boundary {
  margin-top: 16px;
  border: 1px solid rgba(138, 111, 37, 0.3);
  border-radius: 8px;
  background: #fbfaf4;
  padding: 14px;
}

.citation-boundary p {
  margin: 7px 0 0;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.timeline-year {
  color: var(--primary-strong);
  font-size: 1.1rem;
  font-weight: 800;
}

.timeline-item h3 {
  margin: 0 0 6px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.compact-list {
  margin: 0;
  padding-left: 1.3rem;
}

.compact-list li + li {
  margin-top: 8px;
}

.resource-card strong,
.modern-card strong,
.prompt-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.risk-meter {
  margin-top: 12px;
}

.risk-meter .bar span {
  background: linear-gradient(90deg, var(--ok), var(--accent), var(--danger));
}

.character-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.radar-wrap {
  display: grid;
  place-items: center;
  margin: 14px 0;
}

.radar-svg {
  width: min(100%, 280px);
  height: auto;
}

.radar-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.radar-shape {
  fill: rgba(15, 118, 110, 0.24);
  stroke: var(--primary);
  stroke-width: 2;
}

.simulator-controls,
.simulator-output,
.dialogue-panel,
.dialogue-output,
.report-panel,
.workshop-block {
  padding: 20px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field span,
.range-label {
  color: var(--muted);
  font-weight: 700;
}

select,
input[type="text"],
textarea,
input[type="range"] {
  width: 100%;
}

select,
input[type="text"],
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input[type="range"] {
  accent-color: var(--primary);
}

.range-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.range-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.event-buttons {
  margin-top: 16px;
}

.event-button {
  border-radius: 8px;
}

.turn-field {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.turn-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.action-hint {
  margin: -2px 0 14px;
  border-left: 3px solid var(--accent);
  background: #fbfaf4;
  color: var(--muted);
  padding: 9px 11px;
  font-size: 0.9rem;
}

.primary-button,
.ghost-button {
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.score-ring {
  width: 168px;
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 0 54%, transparent 55%),
    conic-gradient(var(--primary) calc(var(--score) * 1%), #e3ebe7 0);
}

.score-ring strong {
  font-size: 2.25rem;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 12px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 800;
}

.status-pill.verified,
.status-pill.verified-search {
  background: #dcfce7;
  color: #166534;
}

.status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.non-pleiades {
  background: #ede9fe;
  color: #5b21b6;
}

.factor-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.state-chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.state-chip span {
  color: var(--muted);
  font-weight: 800;
}

.state-chip b {
  float: right;
  color: var(--primary-strong);
}

.state-chip .bar {
  clear: both;
  margin: 10px 0;
}

.state-chip small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.factor {
  display: grid;
  grid-template-columns: 96px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.strategy-list {
  margin: 12px 0 0;
  padding-left: 1.2rem;
}

.round-history {
  margin-top: 16px;
}

.history-card,
.history-empty {
  padding: 20px;
}

.history-empty h3,
.history-card h3 {
  margin: 0;
}

.history-empty p {
  margin: 8px 0 0;
  color: var(--muted);
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.history-head span {
  color: var(--muted);
  font-weight: 700;
}

.resilience-chart {
  width: 100%;
  height: 160px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.chart-grid {
  fill: none;
  stroke: rgba(92, 109, 104, 0.22);
  stroke-width: 0.8;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--accent);
  stroke: #ffffff;
  stroke-width: 1.2;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.history-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.prompt-card textarea {
  width: 100%;
  min-height: 184px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fbfcfa;
}

.dialogue-output h3,
.report-panel h3 {
  margin: 0 0 10px;
}

.dialogue-output p,
.report-panel p {
  color: var(--muted);
}

.dialogue-question {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialogue-answer {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.dialogue-answer p {
  margin: 0;
}

.generated-prompt {
  min-height: 132px;
  background: #f8faf8;
}

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

.task-card {
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.task-card:hover,
.task-card.is-active {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.task-card span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.task-card h3 {
  margin: 0 0 8px;
}

.task-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.task-card ol {
  margin: 0;
  padding-left: 1.2rem;
}

.report-preview {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.report-preview p {
  margin: 6px 0;
}

.workshop-main {
  display: grid;
  gap: 16px;
}

.facilitator-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, var(--surface-soft));
  box-shadow: var(--shadow);
  padding: 20px;
}

.console-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 14px;
  align-items: end;
}

.console-fields h3 {
  margin: 0;
}

.console-fields .field {
  margin-bottom: 0;
}

.timer-panel {
  display: grid;
  align-content: center;
  gap: 5px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.timer-panel > span {
  color: var(--muted);
  font-weight: 800;
}

.timer-panel > strong {
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  line-height: 1.15;
}

.workshop-side {
  display: grid;
  gap: 16px;
}

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

.block-head h3,
.workshop-block h3 {
  margin: 0;
}

.block-head span {
  color: var(--muted);
  font-weight: 800;
}

.agenda-list,
.checklist,
.leaderboard {
  display: grid;
  gap: 10px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.agenda-item.is-current {
  margin-inline: -10px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 8px;
  background: var(--primary-soft);
  padding: 12px 10px;
}

.agenda-item.is-done {
  opacity: 0.72;
}

.agenda-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}

.agenda-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.agenda-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.agenda-item span,
.group-card span {
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.agenda-item h4,
.group-card h4,
.debrief-list h4 {
  margin: 0 0 6px;
}

.agenda-item p,
.group-card p,
.mission-card p,
.rubric-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.rubric-card small {
  color: var(--primary-strong);
  line-height: 1.5;
}

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

.group-card,
.rubric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.group-card {
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.group-card:hover,
.group-card.is-active {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.check-row:first-child {
  border-top: 0;
}

.check-row input {
  margin-top: 5px;
  accent-color: var(--primary);
}

.mission-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.mission-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.group-notes {
  display: grid;
  gap: 2px;
}

.note-field textarea {
  min-height: 82px;
}

.score-layout {
  margin-top: 16px;
}

.score-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 14px;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.workshop-block {
  min-width: 0;
}

.score-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.score-table caption {
  padding: 0 0 10px;
  color: var(--muted);
  text-align: left;
}

.score-table th,
.score-table td {
  padding: 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.score-table th {
  color: var(--muted);
}

.score-input {
  width: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.leader-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.leader-row:first-child {
  border-top: 0;
}

.leader-row > span {
  display: grid;
  place-items: center;
  width: 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.leader-row strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.debrief-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.debrief-list ol {
  margin: 0;
  padding-left: 1.2rem;
}

.debrief-list li + li {
  margin-top: 8px;
}

.source-list {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.source-list h3 {
  margin: 0 0 8px;
}

.source-list ul {
  margin: 0;
  padding-left: 1.2rem;
}

.source-list li + li {
  margin-top: 10px;
}

.source-list span {
  color: var(--muted);
}

.asset-registry {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 20px;
}

.map-asset-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.map-asset-preview img {
  display: block;
  width: 100%;
  height: auto;
}

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

.asset-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.asset-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-strong);
}

.asset-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.asset-card a {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.asset-thumb {
  display: grid;
  min-height: 118px;
  margin-bottom: 12px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f5;
  color: var(--muted);
  font-weight: 700;
}

.asset-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.asset-thumb--empty {
  padding: 16px;
  text-align: center;
}

.copy-button {
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 12px;
}

.handoff-card {
  margin-top: 16px;
  padding: 20px;
}

.handoff-card h3 {
  margin-top: 0;
}

.empty-note {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateY(24px);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.is-error {
  background: var(--danger);
}

@media (max-width: 920px) {
  .hero,
  .map-layout,
  .trade-layout,
  .character-layout,
  .evidence-layout,
  .gazetteer-layout,
  .simulator-layout,
  .dialogue-layout,
  .task-layout,
  .workshop-layout,
  .score-layout {
    grid-template-columns: 1fr;
  }

  .session-bar,
  .facilitator-console {
    grid-template-columns: 1fr;
  }

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

  .timer-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .gallery,
  .atlas-grid,
  .evidence-grid,
  .resource-grid,
  .modern-grid,
  .prompt-grid,
  .task-grid,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-grid,
  .rubric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .hero__copy {
    padding: 22px;
  }

  .top-nav {
    display: none;
  }

  .module-picker {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 0 -9px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 248, 245, 0.94);
    backdrop-filter: blur(12px);
    padding: 9px;
  }

  .module-picker span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
  }

  .module-picker select {
    min-height: 44px;
  }

  .session-bar,
  .facilitator-console,
  .geojson-panel,
  .asset-registry,
  .workshop-block,
  .simulator-controls,
  .simulator-output,
  .dialogue-panel,
  .dialogue-output,
  .report-panel {
    padding: 16px;
  }

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

  .session-actions .primary-button {
    grid-column: 1 / -1;
  }

  .console-fields {
    grid-template-columns: 1fr;
  }

  .timer-panel > strong {
    font-size: 2.4rem;
  }

  .geojson-panel .block-head,
  .zoom-controls {
    justify-content: flex-start;
  }

  .gazetteer-map,
  .gazetteer-svg {
    min-height: 360px;
  }

  .gazetteer-items {
    max-height: none;
  }

  .map-stage,
  .network-stage,
  .character-graph,
  .map-svg,
  .network-svg,
  .character-svg {
    min-height: 380px;
  }

  .gallery,
  .atlas-grid,
  .evidence-grid,
  .resource-grid,
  .modern-grid,
  .prompt-grid,
  .task-grid,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .evidence-card,
  .state-grid,
  .history-list,
  .agenda-item {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .metric,
  .factor {
    grid-template-columns: 76px 1fr 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
