:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #f9fbfc;
  --ink: #18202a;
  --muted: #637083;
  --line: #dce3ea;
  --blue: #1f6feb;
  --teal: #008978;
  --amber: #c96f17;
  --red: #c83d3d;
  --green: #2a8754;
  --shadow: 0 20px 50px rgba(25, 35, 48, 0.12);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button,
video {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #142032;
  color: #ffffff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-button,
.icon-only {
  min-height: 38px;
  border-radius: 8px;
  background: #e9eef4;
  color: var(--ink);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 700;
}

.icon-only {
  display: grid;
  place-items: center;
  width: 38px;
}

.tool-button:hover,
.icon-only:hover,
.tool-button.is-active,
.icon-only.is-active {
  transform: translateY(-1px);
  background: #d8e6f7;
}

.tool-button.primary {
  background: var(--blue);
  color: #ffffff;
}

.tool-button.primary:hover {
  background: #1857bd;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(420px, 1fr) 330px;
  gap: 20px;
  padding: 20px;
  min-height: calc(100vh - 81px);
}

.value-statement {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid #cbd9e8;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: linear-gradient(90deg, #ffffff 0%, #f5f9fd 100%);
  box-shadow: 0 12px 32px rgba(25, 35, 48, 0.08);
}

.statement-kicker {
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.statement-copy {
  margin: 0;
  max-width: 980px;
  color: #263545;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.statement-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 8px;
}

.statement-metrics span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #ffffff;
  color: #27405a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.scenario-nav,
.insight-panel,
.video-stage {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scenario-nav {
  align-self: start;
  position: sticky;
  top: 101px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
}

.scenario-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.scenario-button:hover,
.scenario-button.is-active {
  background: #eef5fb;
}

.scenario-button.is-active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e9eef4;
  color: var(--blue);
  font-weight: 900;
}

.scenario-button strong,
.scenario-button span:last-child {
  display: block;
}

.scenario-button strong {
  margin-bottom: 3px;
  font-size: 15px;
}

.scenario-button span:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stage-column {
  min-width: 0;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.flow-step {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.flow-step.is-active {
  color: var(--ink);
  border-color: #9fc4ef;
  background: #f0f7ff;
}

.flow-index {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.flow-title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-stage {
  overflow: hidden;
  border-radius: 8px;
}

.stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.stage-heading h2 {
  margin: 8px 0 0;
  font-size: 21px;
  line-height: 1.25;
}

.scene-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.stage-facts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stage-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  background: #edf1f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#caseVideo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #101722;
  object-fit: contain;
}

.video-stage.is-vertical #caseVideo {
  aspect-ratio: 4 / 5;
  max-height: calc(100vh - 238px);
}

.case-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.case-card {
  overflow: hidden;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.case-card:hover,
.case-card.is-active {
  transform: translateY(-2px);
  border-color: #9fc4ef;
  box-shadow: 0 14px 30px rgba(25, 35, 48, 0.11);
}

.case-card.is-active {
  box-shadow: inset 0 0 0 2px #9fc4ef, 0 14px 30px rgba(25, 35, 48, 0.11);
}

.card-preview {
  display: block;
  width: 100%;
  height: 96px;
  background: #101722;
  object-fit: cover;
}

.card-body {
  padding: 11px;
}

.card-kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.card-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.insight-panel {
  align-self: start;
  position: sticky;
  top: 101px;
  overflow: hidden;
  border-radius: 8px;
}

.panel-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.current-case {
  background: #142032;
  color: #ffffff;
}

.section-label {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.current-case .section-label,
.current-case .case-subtitle {
  color: #bfd0e4;
}

#caseTitle {
  margin-bottom: 9px;
  font-size: 22px;
  line-height: 1.25;
}

.case-subtitle {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.talk-list,
.focus-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.talk-list li,
.focus-list li {
  position: relative;
  padding-left: 18px;
  color: #344255;
  font-size: 14px;
  line-height: 1.55;
}

.talk-list li::before,
.focus-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
}

.focus-list li::before {
  background: var(--amber);
}

.value-box {
  padding: 18px;
  background: #f7faf7;
  border-top: 4px solid var(--green);
}

.value-box p:last-child {
  margin: 0;
  color: #2c4938;
  line-height: 1.6;
}

body.speaker-mode .brand,
body.speaker-mode .scenario-nav,
body.speaker-mode .case-rail {
  display: none;
}

body.speaker-mode .app-shell {
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: calc(100vh - 75px);
  padding: 16px;
}

body.speaker-mode .stage-column {
  grid-column: 1;
}

body.speaker-mode .insight-panel {
  grid-column: 2;
  top: 16px;
}

body.speaker-mode #caseVideo {
  max-height: calc(100vh - 138px);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .value-statement {
    grid-template-columns: 1fr;
  }

  .statement-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .insight-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .case-rail {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    align-items: flex-start;
    padding: 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .statement-copy {
    font-size: 16px;
  }

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

  .scenario-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-strip {
    grid-template-columns: 1fr;
  }

  .flow-step {
    min-height: 46px;
  }

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

  .stage-heading,
  .topbar {
    flex-direction: column;
  }

  .stage-facts {
    justify-content: flex-start;
  }

  body.speaker-mode .app-shell {
    grid-template-columns: 1fr;
  }

  body.speaker-mode .insight-panel {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 19px;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .scenario-nav,
  .case-rail {
    grid-template-columns: 1fr;
  }

  .case-card {
    min-height: 190px;
  }

  .card-preview {
    height: 118px;
  }

  .value-statement {
    padding: 15px;
  }

  .statement-copy {
    font-size: 15px;
    line-height: 1.55;
  }
}
