:root {
  --app-header-height: 45px;
  --route-bar-height: 30px;
  --shell-height: var(--app-header-height);
  --ink: #171717;
  --muted: #686868;
  --line: #dededb;
  --soft: #f5f5f2;
  --orange: #f5a400;
  --blue: #246bfd;
  --blue-soft: #edf3ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: #fff;
}

button,
a {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 107, 253, 0.35);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  width: 100vw;
  height: var(--app-header-height);
  border-bottom: 1px solid #dededb;
  border-radius: 1px;
  background: #ffffff;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.design-studio-header-inner {
  display: grid;
  width: min(calc(100% - 64px), 1280px);
  height: 100%;
  margin: 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.design-studio-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-self: start;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.design-studio-brand strong {
  letter-spacing: 0;
}

.design-studio-workspaces {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 5vw, 84px);
}

.design-studio-workspaces a {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.design-studio-workspaces a {
  min-height: 44px;
  transition: opacity 160ms ease;
}

.design-studio-workspaces a:hover {
  opacity: 0.62;
}

.design-studio-workspaces a[aria-current="page"] {
  font-weight: 600;
}

@media (max-width: 720px) {
  .design-studio-header-inner {
    width: 100%;
    padding: 0 16px;
    grid-template-columns: auto 1fr;
  }

  .design-studio-workspaces {
    grid-column: 2;
    justify-self: end;
    gap: 20px;
  }
}

@media (max-width: 420px) {
  .design-studio-header-inner {
    padding: 0 12px;
  }

  .design-studio-brand,
  .design-studio-workspaces a {
    font-size: 10.5px;
  }

  .design-studio-workspaces {
    gap: 8px;
  }
}

body[data-route-bar="on"] {
  --shell-height: calc(var(--app-header-height) + var(--route-bar-height));
}

.route-bar {
  position: sticky;
  z-index: 39;
  top: var(--app-header-height);
  display: flex;
  height: var(--route-bar-height);
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.route-bar[hidden] {
  display: none;
}

.brand {
  display: flex;
  gap: 9px;
  align-items: center;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 12px;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.header-crumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  width: 100%;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.header-crumb a:hover {
  color: var(--blue);
}

.header-crumb strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
}

.design-toggle {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.design-toggle[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
}

#app {
  min-height: calc(100vh - var(--shell-height));
  outline: none;
}

.home-page,
.surface-page,
.flow-page {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto;
}

.quiet-heading {
  display: grid;
  gap: 5px;
  padding: 18px 0 14px;
}

.quiet-heading p,
.surface-heading p,
.flow-heading p,
.design-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.quiet-heading h1,
.surface-heading h1,
.flow-heading h1 {
  margin: 0;
  letter-spacing: 0;
}

.quiet-heading h1 {
  font-size: 21px;
}

.quiet-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.surface-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
  padding: 8px 0 24px;
}

.work-section > h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0;
}

.later-work {
  margin: 4px 0 34px;
  padding-top: 18px;
}

.secondary-work {
  grid-template-columns: repeat(2, minmax(0, 250px));
  justify-content: start;
  gap: 26px;
}

.surface-link {
  display: grid;
  justify-items: center;
}

.surface-screen {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 430 / 879;
  overflow: hidden;
  transition: transform 150ms ease;
}

.surface-screen::after {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  content: "";
}

.surface-link:hover .surface-screen {
  transform: translateY(-4px);
}

.surface-link:hover .surface-screen::after {
  border-color: var(--blue);
}

.surface-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.surface-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--soft);
}

.surface-placeholder span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.surface-link.is-pending .surface-screen::after {
  border-color: var(--line);
}

.surface-caption {
  display: grid;
  width: min(100%, 220px);
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding-top: 8px;
}

.surface-caption strong {
  font-size: 15px;
}

.surface-caption span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.surface-caption small {
  grid-column: 2;
  grid-row: 1;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
}

.crumb {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.crumb a:hover {
  color: var(--blue);
}

.crumb strong {
  color: var(--ink);
}

.surface-heading {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink);
}

.surface-heading h1 {
  max-width: 680px;
  margin-top: 4px;
  font-size: 17px;
}

.flow-preview-list {
  border-bottom: 1px solid var(--ink);
}

.flow-preview {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(420px, 1.3fr);
  gap: 30px;
  align-items: center;
  min-height: 230px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.flow-preview:last-child {
  border-bottom: 0;
}

.flow-preview:hover h2 {
  color: var(--blue);
}

.flow-preview-copy > span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
}

.flow-preview-copy h2 {
  margin: 6px 0;
  font-size: 18px;
  letter-spacing: 0;
}

.flow-preview-copy p {
  max-width: 420px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.status {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.preview-sequence {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
}

.preview-sequence figure {
  width: 100px;
  margin: 0;
}

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

.preview-sequence figcaption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.preview-arrow {
  align-self: center;
  color: var(--orange);
  font-size: 18px;
}

.source-pending {
  display: grid;
  width: 100%;
  min-height: 150px;
  align-content: center;
  padding: 18px;
  border-left: 2px solid var(--line);
}

.source-pending span {
  color: var(--muted);
  font-size: 10px;
}

.flow-heading {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(320px, 1.3fr);
  gap: 24px;
  align-items: end;
  padding: 7px 0 8px;
}

.flow-heading h1 {
  margin-top: 3px;
  font-size: 16px;
}

.flow-heading > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.board-shell {
  position: relative;
  height: calc(100vh - 74px);
  min-height: 560px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.board-workspace {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
}

body[data-design="on"] .board-workspace {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.board-viewport {
  width: 100%;
  height: 100%;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
}

.workbench-board-shell .board-viewport {
  scrollbar-width: none;
}

.workbench-board-shell .board-viewport::-webkit-scrollbar {
  display: none;
}

.board-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}

.board,
.board-stage {
  position: relative;
}

.board-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.flow-connectors {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.flow-connectors {
  z-index: 0;
}

.flow-edge {
  fill: none;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.user-edge {
  stroke: var(--orange);
}

.system-edge {
  stroke: var(--blue);
}

.flow-node {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  cursor: pointer;
  outline: 0;
}

.flow-node:focus-visible .phone-shot {
  outline: 2px solid rgba(36, 107, 253, 0.5);
  outline-offset: 4px;
}

.flow-screen {
  width: 100%;
  margin: 0;
}

.phone-shot {
  position: relative;
  width: 100%;
}

.phone-shot > img {
  display: block;
  width: 100%;
  height: auto;
}

.flow-screen figcaption {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 18px;
  margin-top: 10px;
  padding: 0 2px 4px;
  font-size: 9px;
  line-height: 1.4;
}

.flow-screen figcaption strong {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 9px;
}

.flow-screen figcaption span {
  color: var(--muted);
}

.click-frame {
  position: absolute;
  z-index: 3;
  border: 2px solid var(--orange);
  pointer-events: none;
}

.click-frame.shape-card {
  border-radius: 10px;
}

.click-frame.shape-circle {
  border-radius: 50%;
}

.click-frame.shape-pill {
  border-radius: 999px;
}

.click-frame b {
  position: absolute;
  top: -9px;
  left: -9px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 8px;
}

.action-label,
.branch-label {
  position: absolute;
  z-index: 3;
  padding: 4px 7px;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff;
}

.action-label {
  display: grid;
  gap: 3px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.workbench-board-shell .action-label {
  width: 190px;
  white-space: nowrap;
}

.branch-label {
  display: grid;
  gap: 3px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.workbench-board-shell .branch-label {
  width: 190px;
}

.action-label strong,
.branch-label strong {
  font-size: 8px;
}

.user-label {
  color: var(--orange);
}

.system-label {
  color: var(--blue);
}

.terminal-label {
  position: absolute;
  z-index: 3;
  width: 180px;
  padding: 5px 7px;
  transform: translateX(-50%);
  background: transparent;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff;
}

.design-frame,
.design-panel {
  display: none;
}

.design-frame {
  position: absolute;
  z-index: 5;
  border: 1.5px dashed var(--blue);
  border-radius: 4px;
  pointer-events: none;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.design-frame.is-focused {
  border-style: solid;
  background: rgba(36, 107, 253, 0.12);
  box-shadow: 0 0 0 3px rgba(36, 107, 253, 0.16);
}

.design-frame b {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 8px;
}

.design-panel {
  z-index: 7;
  min-width: 0;
  overflow: auto;
  padding: 18px 16px;
  border-left: 1px solid var(--blue);
  background: #fff;
}

.design-panel h2 {
  margin: 4px 0 14px;
  font-size: 15px;
  letter-spacing: 0;
}

.design-panel ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.design-panel li {
  margin: 0;
  padding: 0;
}

.design-note {
  display: grid;
  width: 100%;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  min-height: 58px;
  align-items: start;
  padding: 8px 5px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.design-note:hover,
.design-note.is-active {
  background: var(--blue-soft);
}

.design-note > b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 8px;
}

.design-note div,
.design-note strong,
.design-note span {
  display: block;
}

.design-note strong {
  font-size: 10px;
  line-height: 1.35;
}

.design-note span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

body[data-design="on"] .design-frame,
body[data-design="on"] .design-panel {
  display: block;
}

body[data-design="on"] .board-controls {
  right: 290px;
}

.board-controls {
  position: absolute;
  z-index: 10;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: 32px 52px 32px 40px;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
}

.board-design-toggle {
  position: absolute;
  z-index: 10;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.board-controls button,
.zoom-field {
  display: grid;
  min-height: 30px;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.board-controls button {
  cursor: pointer;
}

.board-controls button:hover {
  background: var(--blue-soft);
}

.zoom-field {
  grid-template-columns: 1fr auto;
  gap: 1px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 8px;
}

.zoom-field input {
  width: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: right;
  appearance: textfield;
}

.zoom-field input::-webkit-inner-spin-button,
.zoom-field input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.zoom-field:focus-within {
  box-shadow: inset 0 0 0 1px var(--blue);
}

.flow-workbench-page {
  width: 100%;
  height: calc(100vh - var(--shell-height));
  margin: 0;
  overflow: hidden;
}

.flow-workbench {
  --left-rail-width: clamp(190px, 12vw, 230px);
  --right-rail-width: clamp(210px, 14vw, 260px);
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: var(--left-rail-width) minmax(0, 1fr) var(--right-rail-width);
  overflow: hidden;
  transition: grid-template-columns 160ms ease;
}

.flow-workbench.is-left-collapsed {
  --left-rail-width: 40px;
}

.flow-workbench.is-right-collapsed {
  --right-rail-width: 40px;
}

.workbench-rail {
  min-width: 0;
  height: 100%;
  overflow: auto;
  background: #fff;
}

.workbench-design-rail {
  border-right: 1px solid var(--line);
}

.workbench-outline-rail {
  border-left: 1px solid var(--line);
}

.rail-heading {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 74px;
  padding: 15px 44px 12px 15px;
  border-bottom: 1px solid var(--line);
}

.rail-heading p,
.rail-heading h1,
.rail-heading span {
  margin: 0;
  letter-spacing: 0;
}

.rail-heading p {
  color: var(--blue);
  font-size: 8px;
  font-weight: 900;
}

.rail-heading h1 {
  font-size: 14px;
}

.rail-heading span {
  color: var(--muted);
  font-size: 9px;
}

.rail-toggle {
  position: absolute;
  top: 12px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.rail-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.rail-toggle span {
  color: inherit;
  font-size: 18px;
  line-height: 1;
}

.flow-workbench.is-left-collapsed .workbench-design-rail,
.flow-workbench.is-right-collapsed .workbench-outline-rail {
  overflow: hidden;
}

.flow-workbench.is-left-collapsed .workbench-design-rail > :not(.rail-heading),
.flow-workbench.is-right-collapsed .workbench-outline-rail > :not(.rail-heading),
.flow-workbench.is-left-collapsed .workbench-design-rail .rail-heading > :not(.rail-toggle),
.flow-workbench.is-right-collapsed .workbench-outline-rail .rail-heading > :not(.rail-toggle) {
  display: none;
}

.flow-workbench.is-left-collapsed .workbench-design-rail .rail-heading,
.flow-workbench.is-right-collapsed .workbench-outline-rail .rail-heading {
  min-height: 100%;
  padding: 0;
  border-bottom: 0;
}

.flow-workbench.is-left-collapsed .workbench-design-rail .rail-toggle,
.flow-workbench.is-right-collapsed .workbench-outline-rail .rail-toggle {
  top: 10px;
  right: 5px;
}

.workbench-design-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 10px 18px;
  list-style: none;
}

.workbench-design-list .design-note {
  min-height: 64px;
  padding: 10px 6px;
}

.workbench-design-list .design-note strong {
  font-size: 10px;
}

.workbench-design-list .design-note span {
  font-size: 8px;
  line-height: 1.4;
}

.workbench-design-list .design-brief-task {
  cursor: default;
}

.workbench-design-list .design-brief-task:hover {
  background: #fff;
}

.workbench-design-list .design-brief-task > b {
  background: var(--ink);
}

.workbench-guidance {
  display: grid;
  gap: 7px;
  margin: 0 15px 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.workbench-guidance p {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.workbench-guidance strong {
  color: var(--ink);
  font-size: 8px;
}

.workbench-guidance p:nth-child(2) strong {
  color: var(--blue);
}

.workbench-guidance p:nth-child(3) strong {
  color: #b56d00;
}

.workbench-canvas {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.workbench-board-shell {
  height: 100%;
  min-height: 0;
  border: 0;
}

.workbench-board-shell .board-workspace,
body[data-design="on"] .workbench-board-shell .board-workspace {
  display: block;
  height: 100%;
}

.workbench-board-shell .board-controls,
body[data-design="on"] .workbench-board-shell .board-controls {
  right: 10px;
  bottom: 10px;
}

.flow-workbench-page .design-frame,
body[data-design="on"] .flow-workbench-page .design-frame {
  display: none;
}

.flow-workbench-page .design-frame.is-focused,
body[data-design="on"] .flow-workbench-page .design-frame.is-focused {
  display: block;
}

.current-focus {
  display: grid;
  gap: 4px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

.current-focus span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.current-focus strong {
  color: var(--blue);
  font-size: 9px;
  line-height: 1.45;
}

.outline-tree {
  padding: 12px 12px 16px;
  border-bottom: 1px solid var(--line);
}

.outline-root {
  display: block;
  padding: 3px 3px 8px;
  font-size: 10px;
  font-weight: 900;
}

.outline-tree ul,
.outline-tree ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.outline-tree > ul {
  border-left: 1px solid var(--line);
}

.outline-surface > a,
.outline-flow > a {
  display: grid;
  min-width: 0;
  align-items: center;
}

.outline-surface > a {
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 6px 4px 6px 11px;
  color: var(--muted);
  font-size: 9px;
}

.outline-surface > a span {
  color: #999;
  font-size: 8px;
}

.outline-surface.is-current > a {
  color: var(--ink);
}

.outline-flow-list {
  margin-left: 11px !important;
  border-left: 1px solid var(--line);
}

.outline-flow > a {
  gap: 2px;
  padding: 7px 6px 7px 11px;
}

.outline-flow > a strong,
.outline-flow > a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-flow > a strong {
  color: var(--muted);
  font-size: 8px;
}

.outline-flow > a span {
  color: var(--muted);
  font-size: 9px;
}

.outline-flow.is-current > a strong {
  color: var(--blue);
}

.outline-flow.is-current > a span {
  color: var(--ink);
  font-weight: 700;
}

.outline-step-list {
  margin-left: 11px !important;
  padding: 2px 0 5px 9px !important;
  border-left: 1px solid var(--line);
}

.outline-step {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-height: 28px;
  padding: 4px 5px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.outline-step:hover,
.outline-step.is-active {
  background: var(--blue-soft);
  color: var(--ink);
}

.outline-step strong {
  color: var(--blue);
  font-size: 8px;
}

.outline-step span {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-step[data-depth="1"] {
  padding-left: 12px;
}

.outline-step[data-depth="2"] {
  padding-left: 20px;
}

.flow-context {
  display: grid;
  gap: 7px;
  padding: 13px 15px 24px;
}

.flow-context > div {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
}

.flow-context > div > span,
.flow-context > strong {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
}

.flow-context h2,
.flow-context p {
  margin: 0;
  letter-spacing: 0;
}

.flow-context h2 {
  font-size: 13px;
}

.flow-context p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.flow-context > strong {
  margin-top: 5px;
}

.flow-storyboard {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-storyboard li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.flow-storyboard b {
  color: var(--blue);
  font-size: 8px;
  line-height: 1.5;
}

.flow-storyboard span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.screen-action-menu {
  position: absolute;
  z-index: 20;
  display: grid;
  width: 196px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.screen-action-menu[hidden] {
  display: none;
}

.screen-action-menu button,
.screen-action-menu a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  min-height: 34px;
  align-items: center;
  padding: 5px 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.screen-action-menu button:hover,
.screen-action-menu a:hover {
  background: var(--blue-soft);
}

.screen-action-menu button:disabled,
.screen-action-menu a[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
}

.screen-action-menu button > span,
.screen-action-menu a > span {
  color: var(--blue);
  font-size: 14px;
  text-align: center;
}

.screen-action-menu strong {
  font-size: 10px;
}

.flow-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 28px;
  align-items: start;
  padding: 16px 0 20px;
}

.flow-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 6px 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.flow-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.flow-summary h1 {
  grid-column: 1;
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.flow-summary span {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.flow-boundary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: baseline;
}

.flow-footer strong {
  color: var(--muted);
  font-size: 8px;
}

.flow-footer p {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.flow-footer nav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.flow-footer nav a {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.flow-footer nav a.active {
  border-color: var(--blue);
  color: var(--blue);
}

.missing-flow {
  display: grid;
  min-height: 460px;
  align-content: center;
  justify-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.workbench-canvas .missing-flow {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 32px;
  border: 0;
}

.missing-flow > div {
  display: grid;
  max-width: 560px;
  gap: 0;
  justify-items: center;
}

.missing-flow > div > span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
}

.missing-flow h2 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.missing-flow p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.missing-flow small {
  margin-top: 12px;
  color: #999;
  font-size: 8px;
}

@media (max-width: 820px) {
  .surface-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .secondary-work {
    grid-template-columns: repeat(2, minmax(0, 220px));
  }

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

  .preview-sequence {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .route-bar {
    padding: 0 12px;
  }

  .header-crumb {
    gap: 4px;
    font-size: 9px;
  }

  .header-crumb strong {
    font-size: 9px;
  }

  .home-page,
  .surface-page,
  .flow-page {
    width: min(calc(100% - 24px), 1180px);
  }

  .flow-workbench-page {
    width: 100%;
  }

  .flow-workbench {
    --left-rail-width: min(52vw, 190px);
    --right-rail-width: min(58vw, 210px);
  }

  .surface-gallery {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .surface-screen,
  .surface-caption {
    width: min(76vw, 260px);
  }

  .flow-heading {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .board-shell {
    height: calc(100vh - var(--shell-height));
    min-height: 520px;
  }

  body[data-design="on"] .board-workspace {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  body[data-design="on"] .board-controls {
    right: 230px;
  }

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

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

  .flow-summary span {
    grid-column: 1;
    grid-row: auto;
  }

  .flow-footer nav {
    justify-content: flex-start;
  }

  .design-toggle {
    max-width: 150px;
    padding-inline: 8px;
    font-size: 9px;
  }
}

@media print {
  .app-header,
  .route-bar,
  .board-controls,
  .board-design-toggle,
  .flow-footer nav {
    display: none !important;
  }

  .board-shell {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}
