:root {
  color-scheme: dark;
  --ink: #f4f8fb;
  --muted: #91a8b8;
  --dim: #607887;
  --base: #06111b;
  --base-soft: #091823;
  --panel: rgba(13, 32, 45, 0.9);
  --panel-strong: #0d2130;
  --line: rgba(135, 176, 198, 0.16);
  --line-strong: rgba(71, 217, 255, 0.34);
  --cyan: #47d9ff;
  --cyan-deep: #1aa7cc;
  --lime: #d6ff4f;
  --orange: #ffb85c;
  --red: #ff7180;
  --green: #79e6ae;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --radius: 18px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--base);
  background-size: 42px 42px;
  font-size: 1rem;
  line-height: 1.65;
}

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

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(214, 255, 79, 0.8);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one {
  top: -18rem;
  right: -8rem;
  background: var(--cyan);
}

.ambient-two {
  bottom: -22rem;
  left: -12rem;
  background: var(--lime);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 17, 27, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--lime);
  background: linear-gradient(145deg, rgba(71, 217, 255, 0.16), rgba(214, 255, 79, 0.08));
  font-weight: 900;
  letter-spacing: -0.07em;
}

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

.brand strong {
  font-size: 0.98rem;
  line-height: 1.25;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.save-state i,
.legend i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(121, 230, 174, 0.7);
}

.button,
.icon-button,
.tool-menu button,
.tool-menu label {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 12px;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #07131f;
  background: var(--lime);
  box-shadow: 0 10px 28px rgba(214, 255, 79, 0.13);
}

.button.secondary {
  color: #06111b;
  background: var(--cyan);
}

.button.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-weight: 800;
}

.tool-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 202px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #102533;
  box-shadow: var(--shadow);
}

.tool-menu button,
.tool-menu label {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.tool-menu button:hover,
.tool-menu label:hover {
  background: rgba(255, 255, 255, 0.06);
}

.danger-text {
  color: var(--red) !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: min(1500px, 100%);
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 74px;
  align-self: start;
  height: calc(100vh - 74px);
  padding: 26px 18px 30px;
  border-right: 1px solid var(--line);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 35px 1fr;
  column-gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item span {
  grid-row: 1 / 3;
  color: var(--dim);
  font-weight: 850;
  line-height: 1.45;
}

.nav-item b {
  color: var(--ink);
  font-size: 0.92rem;
}

.nav-item small {
  font-size: 0.76rem;
}

.nav-item:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.nav-item.active {
  border-color: rgba(71, 217, 255, 0.26);
  background: linear-gradient(90deg, rgba(71, 217, 255, 0.12), rgba(71, 217, 255, 0.025));
}

.nav-item.active span {
  color: var(--cyan);
}

.progress-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 30px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.progress-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) var(--progress), rgba(255, 255, 255, 0.08) 0);
}

.progress-ring::after {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--base-soft);
  content: "";
}

.progress-ring strong {
  z-index: 1;
  font-size: 0.75rem;
}

.progress-card b,
.progress-card small {
  display: block;
}

.progress-card b {
  font-size: 0.86rem;
}

.progress-card small {
  color: var(--muted);
  font-size: 0.76rem;
}

.handoff-note {
  margin-top: 18px;
  padding: 15px;
  border-left: 2px solid var(--orange);
  color: var(--muted);
  background: rgba(255, 184, 92, 0.05);
}

.handoff-note span {
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.handoff-note p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.6;
}

.main-content {
  min-width: 0;
  padding: 42px clamp(22px, 4vw, 66px) 80px;
}

.view {
  max-width: 1180px;
  margin: 0 auto;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-intro.compact {
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.23;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 850px;
  font-size: clamp(2rem, 4.2vw, 4rem);
}

.compact h1 {
  font-size: clamp(2rem, 3.3vw, 3.2rem);
}

.page-intro p {
  max-width: 770px;
  margin: 12px 0 0;
  color: var(--muted);
}

.mission-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(71, 217, 255, 0.1), rgba(214, 255, 79, 0.045));
  box-shadow: 0 14px 60px rgba(0, 0, 0, 0.15);
}

.mission-strip > div > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.mission-strip h2 {
  margin-top: 4px;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.mission-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 8px;
  margin: 0;
}

.mission-meta div {
  min-width: 112px;
  padding: 8px 12px;
  border-left: 1px solid var(--line);
}

.mission-meta dt {
  color: var(--muted);
  font-size: 0.7rem;
}

.mission-meta dd {
  margin: 1px 0 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.flow-section {
  margin-top: 42px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading.simple {
  align-items: center;
}

.section-heading h2 {
  font-size: 1.35rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.legend i:first-child {
  background: var(--cyan);
}

.legend i:last-child {
  margin-left: 7px;
  background: var(--green);
}

.flow-track {
  display: grid;
  grid-template-columns: repeat(8, minmax(105px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 4px 3px 12px;
  scrollbar-color: var(--line-strong) transparent;
}

.flow-node {
  position: relative;
  min-height: 132px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(10, 28, 40, 0.82);
  text-align: left;
  cursor: pointer;
  transition: border 160ms ease, transform 160ms ease, background 160ms ease;
}

.flow-node::after {
  position: absolute;
  top: 34px;
  right: -11px;
  z-index: 2;
  width: 11px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.flow-node:last-child::after {
  display: none;
}

.flow-node:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.flow-node.active {
  border-color: var(--cyan);
  color: var(--ink);
  background: linear-gradient(155deg, rgba(71, 217, 255, 0.18), rgba(13, 33, 48, 0.96));
  box-shadow: 0 12px 35px rgba(71, 217, 255, 0.1);
}

.flow-node.done {
  border-color: rgba(121, 230, 174, 0.32);
}

.node-index {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 850;
}

.node-index i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.flow-node.active .node-index i {
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.flow-node.done .node-index i {
  background: var(--green);
}

.flow-node b,
.flow-node small {
  display: block;
}

.flow-node b {
  margin-top: 17px;
  color: var(--ink);
  font-size: 0.92rem;
}

.flow-node small {
  margin-top: 7px;
  font-size: 0.73rem;
  line-height: 1.45;
}

.step-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.65fr);
  gap: 20px;
  margin-top: 18px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(214, 255, 79, 0.28);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(214, 255, 79, 0.07);
  font-size: 0.72rem;
  font-weight: 850;
}

.detail-main h2 {
  margin-top: 12px;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
}

.detail-summary {
  max-width: 800px;
  margin: 12px 0 22px;
  color: var(--muted);
}

.detail-actions {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-actions li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
}

.detail-actions span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(71, 217, 255, 0.09);
  font-size: 0.72rem;
  font-weight: 900;
}

.detail-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.info-block {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.info-block > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.info-block p {
  margin: 5px 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.info-block.warning {
  border-color: rgba(255, 113, 128, 0.24);
  background: rgba(255, 113, 128, 0.055);
}

.info-block.warning > span {
  color: var(--red);
}

.owner-time {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-tag {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
}

.checklist-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.check-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.check-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.check-group-head span {
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.check-group-head b {
  font-size: 0.82rem;
}

.check-items {
  display: grid;
}

.check-row {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  gap: 11px;
  align-items: start;
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row:hover {
  background: rgba(255, 255, 255, 0.024);
}

.check-row input,
.rule-acknowledge input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--lime);
}

.check-row em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
}

.check-row:has(input:checked) strong {
  color: var(--muted);
  text-decoration: line-through;
}

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

.script-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.script-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.script-card-head span {
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.script-card h2 {
  margin-top: 6px;
  font-size: 1.2rem;
}

.script-copy {
  flex: 1;
  margin: 18px 0;
  padding-left: 15px;
  border-left: 2px solid rgba(214, 255, 79, 0.5);
  color: #d9e5ec;
  white-space: pre-wrap;
}

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

.small-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.small-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.review-board {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
}

.metric-inputs,
.conversion-panel,
.retro-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field label,
.retro-card label,
.dialog-field label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.field input,
.dialog-field input,
.dialog-field textarea,
.retro-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(4, 14, 22, 0.7);
}

.field input,
.dialog-field input {
  min-height: 46px;
  padding: 0 12px;
}

.field input:focus,
.dialog-field input:focus,
.dialog-field textarea:focus,
.retro-card textarea:focus {
  border-color: var(--cyan);
}

.conversion-list {
  display: grid;
  gap: 11px;
}

.conversion-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.conversion-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.conversion-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.conversion-row strong {
  color: var(--lime);
  font-size: 1.15rem;
}

.bar {
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.bar i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
}

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

.retro-card textarea {
  min-height: 160px;
  margin-top: 10px;
  padding: 12px;
  resize: vertical;
}

.rules-grid {
  display: grid;
  gap: 13px;
}

.rule-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
  gap: 15px;
  align-items: stretch;
}

.rule-number {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--cyan);
  background: var(--panel);
  font-size: 1.05rem;
  font-weight: 900;
}

.rule-bad,
.rule-good {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.rule-bad {
  border-color: rgba(255, 113, 128, 0.22);
  background: rgba(255, 113, 128, 0.05);
}

.rule-good {
  border-color: rgba(121, 230, 174, 0.2);
  background: rgba(121, 230, 174, 0.05);
}

.rule-bad b,
.rule-good b {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
}

.rule-bad b {
  color: var(--red);
}

.rule-good b {
  color: var(--green);
}

.rule-bad p,
.rule-good p {
  margin: 0;
  color: #cfdae1;
  font-size: 0.9rem;
}

.rule-acknowledge {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(214, 255, 79, 0.24);
  border-radius: var(--radius);
  background: rgba(214, 255, 79, 0.055);
}

.rule-acknowledge label {
  display: flex;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  font-weight: 750;
}

.editor-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 34px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--ink);
  background: #0b1e2b;
  box-shadow: var(--shadow);
}

.editor-dialog::backdrop {
  background: rgba(1, 8, 13, 0.76);
  backdrop-filter: blur(7px);
}

.editor-dialog form {
  display: grid;
  max-height: inherit;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 1.35rem;
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 22px;
  overflow: auto;
}

.dialog-field {
  display: grid;
  gap: 7px;
}

.dialog-field textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

.dialog-hint {
  margin: -5px 0 0;
  color: var(--dim);
  font-size: 0.72rem;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 24px;
  background: rgba(3, 10, 16, 0.62);
  backdrop-filter: blur(3px);
}

.tour-layer[hidden] {
  display: none;
}

.tour-card {
  width: min(620px, 100%);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: #0d2331;
  box-shadow: var(--shadow);
}

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

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.tour-highlight {
  position: relative;
  z-index: 90 !important;
  box-shadow: 0 0 0 4px var(--lime), 0 0 70px rgba(214, 255, 79, 0.42) !important;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(390px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #123044;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .flow-track {
    grid-template-columns: repeat(8, 130px);
  }

  .step-detail,
  .review-board {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .topbar {
    padding: 0 16px;
  }

  .save-state,
  #editCurrentButton {
    display: none;
  }

  #tourButton {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 74px;
    z-index: 15;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 17, 27, 0.94);
    backdrop-filter: blur(15px);
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .nav-item {
    display: block;
    width: auto;
    padding: 8px 12px;
    text-align: center;
  }

  .nav-item span,
  .nav-item small {
    display: none;
  }

  .progress-card,
  .handoff-note {
    display: none;
  }

  .main-content {
    padding: 30px 18px 70px;
  }

  .page-intro,
  .mission-strip {
    align-items: start;
    flex-direction: column;
  }

  .mission-meta {
    width: 100%;
  }

  .checklist-layout,
  .script-grid,
  .retrospective {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand small,
  #editCurrentButton {
    display: none;
  }

  .brand strong {
    max-width: 9.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mission-meta,
  .detail-side,
  .input-grid {
    grid-template-columns: 1fr;
  }

  .mission-meta div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .legend {
    align-self: start;
  }

  .rule-row {
    grid-template-columns: 40px 1fr;
  }

  .rule-number {
    grid-row: 1 / 3;
  }

  .tour-actions {
    flex-wrap: wrap;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    color: #10212c;
    background: #fff;
  }

  .topbar,
  .sidebar,
  .ambient,
  .page-intro .button,
  .small-button,
  .toast,
  .tour-layer {
    display: none !important;
  }

  .app-shell,
  .step-detail,
  .review-board {
    display: block;
  }

  .main-content {
    padding: 0;
  }

  .view {
    display: block !important;
    max-width: none;
    margin-bottom: 32px;
  }

  .mission-strip,
  .step-detail,
  .check-group,
  .script-card,
  .metric-inputs,
  .conversion-panel,
  .retro-card,
  .rule-number,
  .rule-bad,
  .rule-good {
    break-inside: avoid;
    color: #10212c;
    background: #fff;
    box-shadow: none;
  }

  .flow-track {
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
  }

  .flow-node {
    color: #425865;
    background: #fff;
  }

  .flow-node b,
  .page-intro p,
  .detail-summary,
  .script-copy,
  .rule-bad p,
  .rule-good p {
    color: #10212c;
  }

  .checklist-layout,
  .script-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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