:root {
  --flow-action-bg: #f0f5f8;
  --flow-action-border: #d5e1e8;
  --flow-action-accent: #668397;
  --flow-review-bg: #faf5e9;
  --flow-review-border: #e9ddbd;
  --flow-review-accent: #9a793b;
  --flow-result-bg: #edf5ef;
  --flow-result-border: #cddfd2;
  --flow-result-accent: #527e64;
  --flow-detail-text: #626963;
}
html { overflow-y: auto; scroll-snap-type: none; }
body { line-height: 1.4; }
button { font: inherit; }
.page { width: min(820px, calc(100% - 48px)); margin: 36px auto; }
.flow-head { margin-bottom: 28px; }
.flow-head h1 { margin: 0; font-size: var(--heading---x-l); font-weight: 500; line-height: 1.4; }
.flow-head p { margin: 8px 0 0; color: var(--text---neutral---secondary); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab {
  font-size: var(--body---regular---s);
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border---neutral---subtle);
  border-radius: 0;
  background: var(--background---neutral---primary);
  color: var(--text---neutral---secondary);
  cursor: pointer;
}
.tab:hover { background: var(--background---brand---subtle); color: var(--text---brand---primary); }
.tab:focus-visible { outline: 2px solid var(--border---brand---default); outline-offset: 3px; }
.tab[aria-selected="true"] { background: var(--background---brand---primary); border-color: var(--background---brand---primary); color: var(--text---brand---inverse); }
[role="tabpanel"][hidden] { display: none; }
.panel { padding: 24px; border: 1px solid var(--border---neutral---subtle); background: var(--background---neutral---primary); }
.lane { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border---neutral---subtle); }
.lane:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.role { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 500; }
.role-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text---brand---primary); flex: none; }
.steps { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; min-width: 0; }
.step { min-width: 0; flex: 1 1 140px; padding: 12px; background: var(--flow-action-bg); border: 1px solid var(--flow-action-border); border-left: 2px solid var(--flow-action-accent); }
.step strong { display: block; font-weight: 500; }
.step span { display: block; margin-top: 4px; color: var(--flow-detail-text); font-size: var(--body---regular---s); }
.arrow { align-self: center; color: var(--text---neutral---tertiary); font-size: var(--heading---s); }
.system-step { background: var(--flow-result-bg); border-color: var(--flow-result-border); border-left-color: var(--flow-result-accent); }
.decision { background: var(--flow-review-bg); border-color: var(--flow-review-border); border-left-style: dashed; border-left-color: var(--flow-review-accent); }
.note { margin-top: 20px; padding: 12px; background: var(--background---neutral---secondary); color: var(--text---neutral---secondary); font-size: var(--body---regular---s); }
.legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; color: var(--text---neutral---secondary); font-size: var(--body---regular---s); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-mark { width: 16px; height: 12px; border: 1px solid var(--flow-action-border); border-left: 2px solid var(--flow-action-accent); background: var(--flow-action-bg); }
.legend-mark.system { background: var(--flow-result-bg); border-color: var(--flow-result-border); border-left-color: var(--flow-result-accent); }
.legend-mark.decision { background: var(--flow-review-bg); border-color: var(--flow-review-border); border-left-style: dashed; border-left-color: var(--flow-review-accent); }
html.flow-embedded, .flow-embedded body { background: var(--background---neutral---primary); }
.flow-embedded .page { width: 100%; margin: 0; }
.flow-embedded .flow-head { display: none; }
.flow-embedded .tabs { padding: 4px; margin: 0 0 20px; }
@media (max-width: 650px) {
  .page { width: calc(100% - 32px); margin: 24px auto; }
  .panel { padding: 16px; }
  .lane { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .role { min-height: auto; }
  .steps { flex-direction: column; }
  .step { flex: auto; }
  .arrow { transform: rotate(90deg); }
  .flow-embedded .page { width: 100%; margin: 0; }
}
