:root {
  color-scheme: light;
  --bg: #f5f6f1;
  --surface: #ffffff;
  --surface-soft: #f0f3ea;
  --ink: #202421;
  --muted: #667068;
  --line: #d9dfd7;
  --green: #146b4a;
  --blue: #2f5d87;
  --amber: #a86522;
  --rose: #95495b;
  --dark: #19211d;
  --shadow: 0 14px 34px rgba(32, 36, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(32, 36, 33, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 36, 33, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 241, 0.94);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  align-items: end;
  gap: 3px;
  width: 32px;
  height: 32px;
}

.brand-mark span {
  display: block;
  width: 7px;
  border-radius: 2px;
}

.brand-mark span:nth-child(1) {
  height: 21px;
  background: var(--green);
}

.brand-mark span:nth-child(2) {
  height: 29px;
  background: var(--blue);
}

.brand-mark span:nth-child(3) {
  height: 14px;
  background: var(--amber);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 20px;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
}

.top-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

.top-actions a:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.top-actions .solid-link {
  border-color: var(--dark);
  background: var(--dark);
  color: #ffffff;
}

.brief-strip {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: start;
  padding: 26px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0;
}

.brief-strip h1,
.rail-title h2,
.stage-head h2,
.section-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.brief-strip h1 {
  max-width: 760px;
  font-size: 28px;
  line-height: 1.24;
}

.brief-note {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brief-note strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.brief-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.journey-overview {
  padding: 28px 32px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(240, 243, 234, 0.72);
}

.journey-heading {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(320px, 760px);
  gap: 32px;
  align-items: end;
  margin-bottom: 18px;
}

.journey-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.journey-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.journey-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
}

.journey-step {
  position: relative;
  min-width: 0;
  min-height: 294px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(32, 36, 33, 0.04);
}

.journey-step::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -10px;
  width: 10px;
  height: 1px;
  background: var(--line);
}

.journey-step:last-child::after {
  display: none;
}

.journey-step:hover {
  border-color: rgba(20, 107, 74, 0.46);
  background: #fbfcf7;
  box-shadow: 0 12px 26px rgba(20, 107, 74, 0.09);
}

.journey-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border-radius: 8px;
  background: var(--dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.journey-step strong {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.journey-step dl {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
}

.journey-step div {
  min-width: 0;
}

.journey-step dt,
.journey-summary span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

.journey-step dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.journey-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.journey-summary article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.journey-summary span,
.journey-summary strong {
  display: block;
}

.journey-summary strong {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.journey-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prototype-section {
  padding: 38px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.prototype-intro {
  display: grid;
  grid-template-columns: minmax(300px, 520px) minmax(360px, 780px);
  gap: 36px;
  align-items: end;
  margin-bottom: 20px;
}

.prototype-intro h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
}

.prototype-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.studio-app {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f4;
  box-shadow: 0 20px 54px rgba(32, 36, 33, 0.12);
}

.studio-topbar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(420px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.studio-title,
.studio-actions,
.studio-tabs {
  display: flex;
  align-items: center;
}

.studio-title {
  gap: 12px;
  min-width: 0;
}

.studio-logo {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--green) 0 30%, transparent 30% 38%, var(--blue) 38% 66%, transparent 66% 74%, var(--amber) 74% 100%);
}

.studio-title strong,
.studio-title small {
  display: block;
  overflow-wrap: anywhere;
}

.studio-title strong {
  font-size: 15px;
  line-height: 19px;
}

.studio-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.studio-tabs {
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f4ee;
}

.studio-tabs button,
.studio-actions button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.studio-tabs button {
  padding: 0 10px;
}

.studio-tabs button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.studio-actions {
  justify-content: flex-end;
  gap: 8px;
}

.studio-actions button {
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.studio-actions .primary,
.work-item .primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.studio-subbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7f9f4;
}

.studio-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.studio-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.studio-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.studio-signal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.studio-signal span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.studio-body {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr) 314px;
  min-height: 760px;
}

.studio-sidebar,
.studio-agent-panel {
  min-width: 0;
  padding: 14px;
  background: #eef2eb;
}

.studio-sidebar {
  border-right: 1px solid var(--line);
}

.studio-agent-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 1px solid var(--line);
}

.studio-main {
  min-width: 0;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(32, 36, 33, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(32, 36, 33, 0.03) 1px, transparent 1px),
    #fbfcf8;
  background-size: 36px 36px;
}

.studio-card,
.command-strip,
.decision-board,
.script-workbench,
.handoff-row article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.studio-card {
  padding: 14px;
}

.studio-card + .studio-card {
  margin-top: 12px;
}

.studio-card > span,
.command-strip span,
.decision-board header span,
.script-workbench header span,
.handoff-row span,
.work-item .item-meta span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

.project-health strong,
.model-policy strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.3;
}

.project-health p,
.work-item p,
.script-page p,
.script-page aside,
.handoff-row p,
.agent-line p,
.confirmation-panel p,
.model-policy p,
.asset-list dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.52;
}

.health-bar {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3d9;
}

.health-bar span {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--green);
}

.flow-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-rail > span {
  margin-bottom: 3px;
}

.studio-flow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-rail button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.flow-rail button i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--dark);
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
}

.flow-rail button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-rail button em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #edf1ea;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.flow-rail button.active {
  border-color: rgba(20, 107, 74, 0.48);
  background: #eaf4ec;
}

.flow-rail button.active i {
  background: var(--green);
}

.flow-rail button.active em {
  background: var(--green);
  color: #ffffff;
}

.flow-rail button:hover {
  border-color: rgba(20, 107, 74, 0.34);
  background: #f4faf4;
}

.asset-list dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.asset-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8faf5;
}

.asset-list dt {
  color: var(--muted);
  font-size: 13px;
}

.asset-list dd {
  color: var(--ink);
  font-weight: 800;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
  align-items: stretch;
  padding: 16px;
}

.command-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.24;
}

.command-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.next-step {
  padding: 12px;
  border-radius: 8px;
  background: #18211d;
  color: #f1f6ef;
}

.next-step span {
  color: #a9d5b5;
}

.next-step strong {
  font-size: 16px;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1.06fr);
  gap: 12px;
  margin-top: 12px;
}

.decision-board,
.script-workbench {
  padding: 14px;
}

.decision-board header,
.script-workbench header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.decision-board h3,
.script-workbench h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.3;
}

.decision-board header button,
.script-workbench header button,
.work-item button,
.confirmation-panel button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.work-item {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.work-item.urgent {
  border-left: 4px solid var(--rose);
}

.work-item.done {
  border-left: 4px solid var(--green);
}

.work-item.waiting {
  border-left: 4px solid var(--amber);
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-meta strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  border-radius: 6px;
  background: #f7ecee;
  color: var(--rose);
  font-size: 12px;
}

.item-meta strong.medium {
  background: #fbf0e5;
  color: var(--amber);
}

.item-meta strong.low {
  background: #eef3ea;
  color: var(--green);
}

.work-item h4 {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.35;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.script-page {
  position: relative;
  min-height: 430px;
  margin-top: 12px;
  padding: 42px 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 44px, rgba(20, 107, 74, 0.08) 45px, transparent 46px),
    #fffefa;
  box-shadow: inset 0 0 24px rgba(32, 36, 33, 0.035);
  font-family: "Courier New", Courier, monospace;
}

.script-page .scene-heading {
  color: var(--ink);
  font-weight: 800;
}

.script-page .script-line {
  margin: 0;
}

.script-page .script-line + .script-line {
  margin-top: 13px;
}

.script-page .character {
  margin-top: 24px;
  padding-left: 42%;
  color: var(--ink);
  font-weight: 800;
}

.script-page .dialogue {
  max-width: 320px;
  margin-left: 26%;
}

.script-page aside {
  position: absolute;
  right: 20px;
  bottom: 20px;
  max-width: 290px;
  padding: 12px;
  border: 1px solid rgba(20, 107, 74, 0.24);
  border-radius: 8px;
  background: #eef6ee;
  color: var(--green);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.script-page .evidence-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 18px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef6ee;
  color: var(--green);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.handoff-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.handoff-row article {
  padding: 14px;
}

.handoff-row strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
}

.agent-composer {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.agent-composer span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

.agent-composer strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.35;
}

.composer-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.composer-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.composer-box button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.agent-room,
.confirmation-panel,
.model-policy {
  min-width: 0;
}

.agent-line,
.confirmation-panel article {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.agent-line.active,
.agent-line.running {
  border-left: 4px solid var(--green);
}

.agent-line strong,
.confirmation-panel strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.agent-line small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef3ea;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.agent-progress {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe5dc;
}

.agent-progress span {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--green);
}

.confirmation-panel button {
  margin-top: 10px;
  border-color: rgba(20, 107, 74, 0.34);
  background: #eef6ee;
  color: var(--green);
}

.confirmation-panel .confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  align-items: start;
  min-height: calc(100vh - 64px);
  border-bottom: 1px solid var(--line);
}

.stage-rail,
.insight-rail {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow: auto;
  background: rgba(245, 246, 241, 0.9);
}

.stage-rail {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
}

.rail-title h2 {
  font-size: 22px;
  line-height: 1.25;
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.stage-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.stage-button:hover,
.stage-button.active {
  border-color: rgba(20, 107, 74, 0.48);
  box-shadow: 0 8px 18px rgba(20, 107, 74, 0.08);
}

.stage-button.active {
  background: #eef6ee;
}

.stage-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.stage-button.active .stage-number {
  background: var(--green);
}

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

.stage-name strong,
.stage-name small {
  display: block;
  overflow-wrap: anywhere;
}

.stage-name strong {
  font-size: 14px;
  line-height: 18px;
}

.stage-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.stage-board {
  min-width: 0;
  padding: 24px;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stage-head h2 {
  font-size: 30px;
  line-height: 1.16;
}

.stage-head p:last-child {
  max-width: 880px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.stage-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

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

.stage-detail-grid article,
.process-panel,
.collab-panel,
.insight-panel,
.agent-group,
.model-table article,
.competitor-grid article,
.mvp-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stage-detail-grid article {
  min-height: 260px;
  padding: 18px;
}

.stage-detail-grid h3,
.process-panel h3,
.collab-panel h3,
.insight-panel h3,
.competitor-grid h3,
.mvp-grid h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-detail-grid ul,
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.stage-detail-grid li,
.check-list li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.stage-detail-grid li::before,
.check-list li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.stage-detail-grid article:nth-child(2) li::before {
  background: var(--blue);
}

.stage-detail-grid article:nth-child(3) li::before {
  background: var(--amber);
}

.stage-detail-grid article:nth-child(4) li::before {
  background: var(--rose);
}

.process-panel {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 12px;
  padding: 18px;
  background: #18211d;
  color: #f1f6ef;
}

.process-panel .eyebrow {
  color: #a9d5b5;
}

.process-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.process-list li {
  position: relative;
  min-height: 160px;
  padding: 42px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #dfeadf;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.process-list li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 12px;
  left: 12px;
  color: #a9d5b5;
  font-size: 12px;
  font-weight: 800;
}

.collab-panel {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 12px;
  padding: 18px;
}

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

.role-card {
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf7;
}

.role-card strong {
  display: block;
  color: var(--green);
  font-size: 14px;
  line-height: 18px;
}

.role-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.insight-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 18px;
  border-left: 1px solid var(--line);
}

.insight-panel {
  padding: 16px;
  box-shadow: 0 8px 20px rgba(32, 36, 33, 0.04);
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.evidence-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf7;
}

.evidence-card strong {
  display: block;
  color: var(--blue);
  font-size: 13px;
}

.evidence-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.model-mini h3 {
  margin-top: 0;
}

.model-mini p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.mode-buttons button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.mode-buttons button.active {
  border-color: var(--green);
  background: #eef6ee;
  color: var(--green);
  font-weight: 800;
}

.mode-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.mode-card strong {
  display: block;
  font-size: 13px;
}

.section-band {
  padding: 38px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(300px, 760px);
  gap: 36px;
  align-items: end;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 28px;
  line-height: 1.2;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.agent-matrix,
.competitor-grid,
.mvp-grid {
  display: grid;
  gap: 12px;
}

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

.agent-group {
  padding: 16px;
}

.agent-group h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.agent-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.agent-row strong,
.agent-row span {
  display: block;
}

.agent-row strong {
  color: var(--green);
  font-size: 14px;
}

.agent-row span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.model-band {
  background: rgba(240, 243, 234, 0.72);
}

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

.model-table article {
  min-height: 164px;
  padding: 16px;
}

.model-table strong,
.model-table span {
  display: block;
}

.model-table strong {
  color: var(--dark);
  font-size: 15px;
}

.model-table span {
  margin-top: 9px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.model-table p,
.competitor-grid p,
.mvp-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.competitor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.competitor-grid article {
  min-height: 200px;
  padding: 18px;
}

.competitor-grid h3 {
  color: var(--blue);
}

.competitor-grid strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

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

.mvp-grid article {
  min-height: 220px;
  padding: 18px;
}

.mvp-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  border-radius: 8px;
  background: var(--dark);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.mvp-grid h3 {
  margin-top: 18px;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .studio-topbar {
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 1fr);
  }

  .studio-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .studio-body {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .studio-agent-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .insight-rail {
    position: static;
    grid-column: 1 / -1;
    height: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .process-list,
  .journey-flow,
  .agent-matrix,
  .model-table,
  .competitor-grid,
  .mvp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand {
    min-width: 0;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: visible;
    padding-bottom: 0;
    white-space: normal;
    font-size: 13px;
  }

  .top-actions a {
    min-height: 30px;
    padding: 0 8px;
  }

  .brief-strip,
  .journey-heading,
  .prototype-intro,
  .workspace,
  .section-heading,
  .process-panel,
  .collab-panel {
    display: block;
  }

  .brief-strip,
  .journey-overview,
  .prototype-section,
  .section-band {
    padding: 24px 16px;
  }

  .brief-note {
    margin-top: 16px;
  }

  .journey-heading p {
    margin-top: 12px;
  }

  .prototype-intro p {
    margin-top: 12px;
  }

  .studio-topbar,
  .studio-subbar,
  .studio-body,
  .command-strip,
  .work-grid,
  .handoff-row,
  .agent-composer,
  .composer-box,
  .studio-agent-panel {
    grid-template-columns: 1fr;
  }

  .studio-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .studio-signal {
    justify-content: flex-start;
  }

  .studio-sidebar,
  .studio-agent-panel {
    border: 0;
  }

  .studio-sidebar {
    border-bottom: 1px solid var(--line);
  }

  .studio-agent-panel {
    border-top: 1px solid var(--line);
  }

  .script-page {
    min-height: 360px;
    padding: 34px 26px 150px;
  }

  .script-page .character,
  .script-page .dialogue {
    margin-left: 0;
    padding-left: 0;
  }

  .script-page aside {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
  }

  .journey-flow,
  .journey-summary {
    grid-template-columns: 1fr;
  }

  .journey-step {
    min-height: auto;
  }

  .journey-step::after {
    display: none;
  }

  .stage-rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .stage-board {
    padding: 18px 16px;
  }

  .stage-head {
    display: block;
  }

  .stage-count {
    margin-top: 14px;
  }

  .stage-detail-grid,
  .role-chain,
  .insight-rail,
  .journey-summary,
  .agent-matrix,
  .model-table,
  .competitor-grid,
  .mvp-grid {
    grid-template-columns: 1fr;
  }

  .process-list {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .process-list li {
    min-height: 110px;
  }

  .role-chain {
    margin-top: 14px;
  }

  .insight-rail {
    padding: 18px 16px;
  }

  .section-heading p {
    margin-top: 12px;
  }
}

@media (max-width: 560px) {
  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-actions a {
    width: 100%;
    padding: 0 6px;
    white-space: normal;
    text-align: center;
  }

  .brief-strip h1 {
    width: 100%;
    max-width: 100%;
    font-size: 22px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .brief-note {
    width: 100%;
    max-width: 100%;
  }

  .stage-head h2,
  .journey-heading h2,
  .prototype-intro h2,
  .section-heading h2 {
    font-size: 22px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .studio-topbar,
  .studio-body,
  .studio-main,
  .studio-sidebar,
  .studio-agent-panel {
    min-width: 0;
  }

  .studio-main {
    padding: 12px;
  }

  .studio-subbar {
    padding: 10px 12px;
  }

  .studio-search {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .composer-box button {
    width: 100%;
  }

  .command-strip strong {
    font-size: 20px;
  }

  .script-page {
    padding: 28px 18px 170px;
  }

  .stage-list {
    grid-template-columns: 1fr;
  }

  .stage-detail-grid article {
    min-height: auto;
  }

  .mode-buttons {
    grid-template-columns: 1fr;
  }
}
