/* 06 / How it works, automation 07 (meeting notes to action tracker): overrides on top of flow.css.
   A 6 x 3 diagram grid with wider label gaps, the gold key node and green team node, the trace
   status line, the scroll hint, the follow-up loop key, the forgotten-promise pulse, and the
   example architecture lanes. */

/* ---------- Trace ---------- */

/* The text and the status keep the room of the longest case, so the diagram below never moves */
#how .mt-flow-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ash);
  min-height: 1.5em;
}

#how .mt-flow-status.is-empty {
  visibility: hidden;
}

#how .flow-trace-text {
  max-width: 72ch;
  min-height: 4.05em;
  -webkit-line-clamp: 3;
}

#how .flow-caption {
  text-wrap: pretty;
}

/* ---------- Scroll hint: shown only where a region scrolls sideways ---------- */

#how .mt-flow-swipe {
  display: none;
  margin: 0 0 10px;
  padding: 12px 16px 0;
  color: var(--ash);
}

#how .mt-flow-swipe:has(+ .flow-scrollwrap.is-scrollable) {
  display: block;
}

/* ---------- Diagram grid: 6 node columns (tracks 1, 3, 5, 7, 9, 11), 3 rows ----------
   The gaps are 34px, except the gap before "tasks" (56px, so its label fits on its own edge),
   the gap before "check" (56px) and the gap before "reminder" (120px, for "due soon or overdue"). */

#how .flow-dia {
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr) 120px minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  column-gap: 0;
  row-gap: 40px;
  min-width: 1180px;
  padding: 40px 30px 56px;
}

#how .flow-dia > .flow-node {
  align-self: center;
  height: 112px;
}

/* Key: "How to read it" fills the empty lower-left cells, under the first column */
#how .flow-key {
  grid-column: 1 / 4;
  grid-row: 3;
  align-self: center;
  padding-top: 0;
}

#how .mt-flow-key-sw--team {
  border-color: var(--ok);
  background: hsl(152 60% 48% / 0.14);
}

/* Key node: the recap, the answer that closes the meeting, is gold */
#how .flow-node.mt-flow-node--key {
  border-color: rgb(255 255 255 / 0.5);
}

#how .flow-node.mt-flow-node--key.is-done {
  border-color: rgb(255 255 255 / 0.7);
}

/* Tags sit on the card's top edge and are never wider than the card */
#how .mt-flow-tag-key {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-50%);
  padding: 2px 7px;
  border: 1px solid rgb(255 255 255 / 0.6);
  border-radius: 999px;
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  max-width: calc(100% - 24px);
  white-space: nowrap;
}

/* Team nodes: a person steps in. The tag sits inside the card. */
#how .flow-node.mt-flow-node--team {
  border-color: hsl(152 60% 48% / 0.45);
}

#how .flow-node.mt-flow-node--team.is-done {
  border-color: hsl(152 60% 48% / 0.6);
}

#how .flow-node.mt-flow-node--team.is-on {
  border-color: var(--ok);
  background: hsl(152 60% 48% / 0.07);
  box-shadow: 0 0 0 4px hsl(152 60% 48% / 0.12), 0 18px 40px -24px hsl(152 60% 48% / 0.6);
}

#how .mt-flow-team {
  align-self: flex-start;
  max-width: 100%;
  margin-bottom: 2px;
  padding: 2px 6px;
  border: 1px solid hsl(152 60% 48% / 0.6);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ok);
  white-space: nowrap;
}

/* Team edges: green when idle-but-reached, brighter once run */
#how .flow-e.mt-e-team {
  stroke: hsl(152 60% 48% / 0.35);
}

#how .flow-e.mt-e-team.is-done {
  stroke: hsl(152 60% 48% / 0.75);
}

#how .flow-run.mt-run-team {
  stroke: var(--ok);
}

/* Forgotten promise: the follow-up loop breathes while its trace runs */
#how .flow-run.mt-e-pulse.is-run {
  animation: mt-e-breathe 1.6s ease-in-out infinite;
}

@keyframes mt-e-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ---------- Legend ---------- */

#how .mt-flow-dot--team {
  background: var(--ok);
}

/* The loop key is a drawn swatch in the same dash pattern as the loop edge */
#how .flow-legend-r {
  margin-left: auto;
}

#how .mt-flow-loopkey {
  display: block;
  flex: none;
  width: 22px;
  height: 8px;
  color: var(--bone-70);
  overflow: visible;
}

/* ---------- Edge labels: ink pills on their own edge ---------- */

#how .flow-elabel {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--bone-70);
}

#how .flow-elab-bg {
  fill: var(--ink);
}

/* ---------- Diagram, phone sizes: the same grid, scrolled sideways (below 600px) ---------- */

@media (max-width: 640px) {
  #how .flow-seg {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-radius: 18px;
  }

  #how .flow-seg-b {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ---------- Example architecture ---------- */

#how .flow-canvas {
  width: 1200px;
  height: 420px;
}

#how .flow-cn {
  width: 200px;
}

/* Sub-nodes grow with their text, keeping 10px of air above and below it */
#how .flow-cn--sub {
  width: 172px;
  height: auto;
  min-height: 48px;
  padding: 10px 14px 10px 8px;
  border-radius: 24px;
}

#how .flow-cn--sub .flow-cn-t small {
  font-size: 12px;
  line-height: 1.3;
  text-wrap: balance;
}

/* ---------- Phone: the status reserves two lines (the longest status wraps there) ---------- */

@media (max-width: 640px) {
  #how .mt-flow-status {
    min-height: 3em;
  }
}

/* ---------- Static: no pulse ---------- */

#how.is-static .flow-run.mt-e-pulse.is-run {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  #how .flow-run.mt-e-pulse.is-run {
    animation: none;
  }
}

/* ---------- Phones (up to 600px): the diagram becomes a vertical stepper ----------
   One node per row in flow order, a short rule between neighbours, the lit step highlighted. The
   sideways canvas and its edge drawing are not needed here, so they are hidden. */

@media (max-width: 600px) {
  #how .flow-dia-scroll {
    overflow: visible;
  }

  #how .flow-dia {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    row-gap: 14px;
    min-width: 0;
    padding: 4px 0 0;
  }

  #how .flow-edges {
    display: none;
  }

  #how .flow-dia > .flow-node {
    grid-column: 1 !important;
    grid-row: auto !important;
    height: auto;
    min-height: 64px;
  }

  #how .flow-dia > .flow-node + .flow-node::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -14px;
    height: 14px;
    border-left: 1px dashed var(--line);
  }

  #how .flow-dia > .flow-key {
    grid-column: 1;
    grid-row: auto;
    order: 99;
    align-self: start;
    margin-top: 6px;
  }

  /* The example architecture keeps its sideways drawing; only its title wraps */
  #how .flow-win-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.4;
  }

  /* Segmented switch: a 2-column grid, the odd fifth option spans the row; 44px targets */
  #how .flow-seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }

  #how .flow-seg-b {
    min-height: 44px;
    text-align: center;
  }

  #how .flow-seg-b:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
