/* ==========================================================================
   K09 — Patterns (kit/patterns.html)
   Annotated step flows, the five UI states and focus-management rules.
   ========================================================================== */

/* ---- Flows ----------------------------------------------------------------
   <article class="flow"> = one flow: title + page reference, a row of
   numbered steps and an optional handwritten note.
   Step modifiers:
     .flow-step--convert  red outline — the conversion step
     .flow-step--risk     dashed plum outline — where things can go wrong */
.flow-list {
  margin-top: 32px;
}

.flow {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.flow__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.flow__title {
  font-size: var(--t-h3);
}

.flow__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow__note {
  margin: 12px 0 0;
  font-size: 22px;
  color: var(--accent-text);
}

/* ---- Flow step ------------------------------------------------------------ */
.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.flow-step__no {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}

.flow-step__title {
  font-size: 15px;
  font-weight: 600;
}

.flow-step__desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.flow-step--convert {
  border-color: var(--accent);
}

.flow-step--convert .flow-step__no {
  color: var(--accent-text);
}

.flow-step--risk {
  border-color: var(--error);
  border-style: dashed;
}

/* ---- States --------------------------------------------------------------- */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}

.state-card {
  --state: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.state-card__label {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--state);
}

.state-card__text {
  font-size: 15px;
}

.state-card__action {
  font-size: 14px;
  text-decoration: underline;
}

.state-card--error {
  --state: var(--error);
  border-color: var(--error);
  border-style: dashed;
}

.state-card--success {
  --state: var(--success);
  border-color: var(--success);
}

.state-card--warning {
  --state: var(--warning);
  border-color: var(--warning);
}

/* ---- Numbered rule list (focus management) -------------------------------- */
.rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0 40px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.rule-list__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rule-list__no {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}
