/* Flow canvas — REQ-003 storyboard (wide layout, outside phone frame) */

.phone-stage-main.canvas-mode {
  width: min(1120px, 100%);
  max-width: 100%;
  align-items: stretch;
}

.phone-stage-main.canvas-mode .phone {
  display: none;
}

.flow-canvas-wrap {
  display: none;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.flow-canvas-wrap:not([hidden]) {
  display: block;
}

.phone-stage-main.canvas-mode .flow-canvas-wrap:not([hidden]) {
  display: block;
}

.flow-canvas-wrap[hidden],
.recording-canvas-wrap[hidden] {
  display: none !important;
}

.flow-canvas-root {
  padding: 20px 24px 28px;
  min-width: 0;
}

.flow-canvas-loading,
.flow-canvas-error {
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.flow-canvas-error { color: #b91c1c; }

.flow-canvas-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.flow-canvas-head h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.flow-canvas-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.flow-canvas-back {
  flex-shrink: 0;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.flow-phase {
  background: var(--phase-bg, #f1f5f9);
  border: 1px solid var(--phase-border, #cbd5e1);
  border-radius: 14px;
  padding: 16px 16px 20px;
  margin-bottom: 16px;
}

.flow-phase-head {
  margin-bottom: 14px;
}

.flow-phase-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.flow-phase-head p {
  margin: 0;
  font-size: 12px;
  color: #475569;
}

.flow-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.flow-step-wrap {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.flow-step {
  width: 220px;
  min-height: 280px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.flow-step-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  min-height: 88px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.flow-step-thumb i {
  font-size: 28px;
  color: var(--opay-dark);
}

.flow-step-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.flow-step-ui .flow-step-thumb { background: #eff6ff; }
.flow-step-ui .flow-step-thumb i { color: #2563eb; }
.flow-step-wallet .flow-step-thumb { background: #fefce8; }
.flow-step-wallet .flow-step-thumb i { color: #ca8a04; }
.flow-step-api .flow-step-thumb { background: #fdf4ff; }
.flow-step-api .flow-step-thumb i { color: #9333ea; }
.flow-step-done .flow-step-thumb { background: #ecfdf5; }
.flow-step-done .flow-step-thumb i { color: var(--opay-dark); }

.flow-step-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.flow-step-body h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #111;
}

.flow-step-sub {
  font-size: 11px;
  color: #64748b;
}

.flow-chip-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.flow-data-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.flow-data-chip {
  font-size: 10px;
  line-height: 1.35;
  background: #f1f5f9;
  color: #334155;
  border-radius: 6px;
  padding: 3px 6px;
}

.flow-step-link {
  margin-top: auto;
  border: 0;
  background: var(--opay-light);
  color: var(--opay-dark);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: center;
}

.flow-step-link:hover {
  background: #d1fae5;
}

.flow-arrow {
  flex: 0 0 auto;
  width: 28px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 18px;
}

.flow-api {
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
  margin-top: 4px;
}

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

.flow-api-tabs {
  display: flex;
  gap: 4px;
}

.flow-api-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  color: #64748b;
}

.flow-api-tab.on {
  border-color: var(--opay);
  background: var(--opay-light);
  color: var(--opay-dark);
}

.flow-api-panel.hidden { display: none; }

.flow-api-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.flow-api-method {
  font-size: 9px;
  font-weight: 700;
  background: #1e293b;
  color: #fff;
  border-radius: 4px;
  padding: 2px 5px;
}

.flow-api-path {
  font-size: 9px;
  color: #475569;
  word-break: break-all;
}

.flow-api-details {
  margin-bottom: 4px;
}

.flow-api-details summary {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.flow-api-pre {
  margin: 4px 0 0;
  padding: 8px;
  background: #0f172a;
  color: #a7f3d0;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.4;
  overflow: auto;
  max-height: 140px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Nav — canvas items */
.nav-canvas-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #334155;
}

.nav-canvas-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 6px 4px;
}

.nav-canvas-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
}

.nav-canvas-item i {
  font-size: 16px;
  color: #93c5fd;
  flex-shrink: 0;
}

.nav-canvas-item.on {
  background: #0f766e;
  color: #fff;
}

.nav-canvas-item.on i { color: #99f6e4; }

@media (max-width: 900px) {
  .flow-canvas-root { padding: 14px 12px 20px; }
  .flow-step { width: 200px; min-height: 260px; }
}
