/* ─────────────────────────────────────────────── solutions.bamya.co

   The AI building blocks portfolio, on top of panel.css. Every colour is a
   panel.css token, so the page stays in the one palette: teal (--you,
   --live) for what the parts do, violet (--them) for the business areas and
   for what arrives from outside, amber (--warn) only for what a check flags.

   Parts, in page order:

     the hero          a smaller headline (the line is long)
     the principles    one row of four between two rules (not a full panel)
     the blocks        the area filter, and the card front: the part's name,
                       the outcome, the business value, the proof, where it
                       fits, and Details when the catalogue has them
     combinations      three columns under a thick rule, with block tags
     the steps         panel.css .cards, plus a small step label
     the dialog        a block's details and its use cases, and the Show me
                       view: the diagram (drawn by solutions-diagram.js) and
                       the worked example document
*/

/* ───────────────────────────────────────────── hero */

/* panel.css sizes h1 for a three-word line; this one is nine words. */
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); }

/* ───────────────────────────────────────────── the example document

   A use case's worked example, in the Show me view: the message with the
   words that do not match highlighted, what the check found, and what would
   change if the person accepts. */
.ex {
  background: var(--raise);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px 22px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.ex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ex-title { font-weight: 700; font-size: 0.98rem; }

.ex-badge {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 10px;
}

/* Who sent it, or what the record is: one faint line under the title. */
.ex-meta {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.ex-msg {
  padding: 16px 0;
  font-size: 0.98rem;
  line-height: 1.65;
}

/* The highlighter on the words that do not match the order. */
.ex-msg mark {
  background: var(--warn);
  color: #261600;
  border-radius: 3px;
  padding: 1px 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.ex-flag {
  border-left: 3px solid var(--warn);
  background: rgba(255, 180, 84, 0.07);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px 14px;
}

.ex-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.ex-flag .ex-label { color: var(--warn); }

.ex-flag dl {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  gap: 6px 12px;
  font-size: 0.9rem;
}

.ex-flag dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 3px;
}

.ex-accept {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
}

.ex-accept .ex-label { color: var(--you); }

.ex-accept p { color: var(--dim); font-size: 0.92rem; }

/* Decorative: spans, not buttons, so nothing on the page invites a click
   that does nothing. */
.ex-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.ex-btns .cta { font-size: 11.5px; padding: 9px 16px; pointer-events: none; }

/* ───────────────────────────────────────────── principles strip

   A row of four, not a screen: .panel's 100svh would leave four sentences
   floating in an empty viewport. */
.panel.strip { min-height: 0; padding: 70px 0; }

.pr-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.pr { padding: 28px 24px; }

.pr + .pr { border-left: 1px solid var(--line); }

.pr h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.pr p { color: var(--dim); font-size: 0.93rem; line-height: 1.55; }

@media (max-width: 900px) {
  .pr-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr + .pr { border-left: 0; }
  .pr:nth-child(even) { border-left: 1px solid var(--line); }
  .pr:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .pr-row { grid-template-columns: minmax(0, 1fr); }
  .pr:nth-child(even) { border-left: 0; }
  .pr + .pr { border-top: 1px solid var(--line); }
  .pr { padding: 22px 4px; }
}

/* ───────────────────────────────────────────── the area filter

   Shown by the page's script, so without it the chips never appear and every
   block shows every line, which is the "All areas" state anyway. */
.bb-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.bb-chip {
  appearance: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.bb-chip:hover { color: var(--text); border-color: var(--text); }

.bb-chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.bb-chip:focus-visible { outline: 2px solid var(--you); outline-offset: 3px; }

.bb-count {
  flex-basis: 100%;
  text-align: center;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* ───────────────────────────────────────────── the block card */

.bb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

@media (max-width: 900px) {
  .bb-grid { grid-template-columns: minmax(0, 1fr); }
}

/* An author display beats the hidden attribute's UA rule, so it is restated
   for everything the filter hides. */
.bb[hidden], .bb-reuse li[hidden] { display: none; }

.bb {
  display: flex;
  flex-direction: column;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 26px 26px;
  text-align: left;
  transition: border-color 0.25s;
}

.bb:hover { border-color: var(--line-strong); }

/* The part's name, over the outcome it is sold on. */
.bb-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--you);
  margin-bottom: 10px;
}

.bb h3 {
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.bb-does { font-size: 0.98rem; }

.bb-how {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bb-how li {
  position: relative;
  padding-left: 18px;
  color: var(--dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

.bb-how li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 1px;
  background: var(--faint);
}

.bb-result {
  margin-top: 18px;
  border: 1px dashed rgba(56, 217, 190, 0.4);
  background: rgba(56, 217, 190, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

.bb-result span { display: block; }

.bb-result span + span { margin-top: 4px; }

.bb-reuse { margin-top: 20px; }

.bb-reuse h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.bb-reuse ul { list-style: none; }

.bb-reuse li {
  display: grid;
  grid-template-columns: 8.6em minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.5;
}

.bb-area {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--them);
  padding-top: 3px;
}

@media (max-width: 520px) {
  .bb { padding: 22px 18px 20px; }
  .bb-reuse li { display: block; }
  .bb-area { display: block; padding: 0 0 2px; }
}

/* ───────────────────────────────────────────── combinations */

.combos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3.5vw, 44px);
  margin-top: 46px;
  text-align: left;
}

@media (max-width: 900px) {
  .combos { grid-template-columns: minmax(0, 1fr); }
}

.combo { border-top: 3px solid var(--text); padding-top: 22px; }

.combo h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 10px;
}

.combo p { color: var(--dim); font-size: 0.95rem; }

.combo-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.combo-tags li {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ───────────────────────────────────────────── the steps */

.card .bb-step {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--you);
  margin-bottom: 12px;
}

/* Details and Diagram: centred at the foot of the card, level across a row
   of cards (the card is a column and the buttons take the space left above
   them). */
.bb-actions {
  margin-top: auto;
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.bb-details,
.bb-diagram {
  font-size: 13.5px;
  padding: 14px 40px;
  cursor: pointer;
  background: none;
}

.bb .bb-reuse { margin-bottom: 26px; }

/* .cta sets display, which beats the hidden attribute's UA rule. */
.bb-details[hidden],
.bb-diagram[hidden] { display: none; }

.bb-details:focus-visible,
.bb-diagram:focus-visible,
.sd-show-btn:focus-visible,
.sd-back:focus-visible,
.sd-x:focus-visible,
.dg-play:focus-visible { outline: 2px solid var(--you); outline-offset: 3px; }

/* ───────────────────────────────────────────── the dialog */

html.sd-open,
html.sd-open body { overflow: hidden; }

.sd {
  --sd-bg: var(--raise);
  width: min(1240px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100svh - 24px);
  margin: auto;
  padding: 0;
  background: var(--sd-bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  /* A slim scrollbar in the page's own greys, teal under the pointer.
     Firefox and Chrome read the standard pair; Safari the pseudo-elements. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sd:hover { scrollbar-color: rgba(56, 217, 190, 0.45) transparent; }

.sd::-webkit-scrollbar { width: 12px; }
.sd::-webkit-scrollbar-track { background: transparent; margin: 16px 0; }
.sd::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border: 4px solid var(--sd-bg);
  border-radius: 12px;
}
.sd::-webkit-scrollbar-thumb:hover { background: rgba(56, 217, 190, 0.55); }

.sd::backdrop {
  background: rgba(5, 7, 8, 0.74);
  backdrop-filter: blur(4px);
}

.sd[open] { animation: sd-in 0.28s ease-out; }

@keyframes sd-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.sd-inner { position: relative; padding: 34px clamp(18px, 4vw, 56px) 48px; }

.sd-x {
  position: sticky;
  top: 0;
  float: right;
  margin: -12px -18px 0 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--sd-bg);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.sd-x:hover { border-color: var(--text); }

.sd-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--you);
  margin-bottom: 12px;
}

/* The dialog's text runs the full width of the dialog. text-shadow: none,
   because panel.css gives every h2 the brand-pair split, which sits under the
   letters as a fringe even at rest. */
.sd .sd-h {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  text-shadow: none;
}

.sd-p { color: var(--dim); font-size: 1.05rem; }

.sd-p + .sd-p { margin-top: 12px; }

.sd-h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 30px 0 12px;
}

.sd-cases { list-style: none; }

.sd-cases li {
  display: grid;
  grid-template-columns: 8.6em minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.sd-cases li:last-child { border-bottom: 1px solid var(--line); }

.sd-cases .bb-area { padding-top: 0; }

.sd-show-btn {
  font-size: 11.5px;
  padding: 8px 16px;
  white-space: nowrap;
  cursor: pointer;
  background: none;
}

.sd-tech { margin-top: 28px; }

.sd-tech summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.sd-tech summary:hover { color: var(--text); }

.sd-tech .bb-how { margin-top: 14px; }

.sd-back {
  appearance: none;
  background: none;
  border: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 0;
  margin-bottom: 18px;
  cursor: pointer;
}

.sd-back:hover { color: var(--text); }

.sd-loading {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding: 40px 0;
}

.sd-diagram { margin-top: 26px; }

.sd-example > .ex { max-width: 560px; margin-top: 30px; box-shadow: none; }

/* The two places an alert lands, side by side in one container: the email
   and the record in your system, with its flagged rows. */
.ex-pair {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px clamp(14px, 2.4vw, 26px) 26px;
  background: rgba(255, 255, 255, 0.015);
}

.ex-pair-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}

/* The record is a table and needs the room more than the email does. */
.ex-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1180px) {
  .ex-pair-grid { grid-template-columns: minmax(0, 1fr); }
}

.ex-pair .ex { box-shadow: none; background: var(--raise-2); }

.ex-table-wrap { overflow-x: auto; margin-top: 12px; }

.ex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.ex-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--line-strong);
}

.ex-table td {
  padding: 9px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.ex-table tbody tr:first-child td { border-top: 0; }

.ex-table td:last-child, .ex-table th:last-child { text-align: right; white-space: nowrap; }

/* A note is the only cell in its row, so it is also a last child: it wraps
   and reads left to right like a sentence. */
.ex-table tr.ex-note td { text-align: left; white-space: normal; }

/* A flagged row: tinted in its level's colour, with a bar down its left. */
.ex-table tr.is-flag td { background: rgba(255, 180, 84, 0.08); }
.ex-table tr.is-flag td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.ex-table tr.f-error td { background: rgba(255, 91, 91, 0.09); }
.ex-table tr.f-error td:first-child { box-shadow: inset 3px 0 0 #ff5b5b; }
.ex-table tr.f-alert td { background: rgba(167, 139, 250, 0.09); }
.ex-table tr.f-alert td:first-child { box-shadow: inset 3px 0 0 var(--them); }

.ex-table tr.ex-note td {
  border-top: 0;
  padding-top: 0;
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(255, 180, 84, 0.08);
  box-shadow: inset 3px 0 0 var(--warn);
}
.ex-table tr.ex-note.f-error td { background: rgba(255, 91, 91, 0.09); box-shadow: inset 3px 0 0 #ff5b5b; }
.ex-table tr.ex-note.f-alert td { background: rgba(167, 139, 250, 0.09); box-shadow: inset 3px 0 0 var(--them); }

.ex-chk {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  color: var(--faint);
}

.ex-chk.f-warning { border-color: var(--warn); color: var(--warn); }
.ex-chk.f-error   { border-color: #ff5b5b; color: #ff8a8a; }
.ex-chk.f-alert   { border-color: var(--them); color: var(--them); }
.ex-chk.f-match   { border-color: var(--you); color: var(--you); }

/* match: the row an answer points to (teal, it is the work, not a problem). */
.ex-table tr.f-match td { background: rgba(56, 217, 190, 0.08); }
.ex-table tr.f-match td:first-child { box-shadow: inset 3px 0 0 var(--you); }
.ex-table tr.ex-note.f-match td { background: rgba(56, 217, 190, 0.08); box-shadow: inset 3px 0 0 var(--you); }

/* The chat panel: the question on the right, the answer on the left, the
   answer's one button under it (decorative, like the example's others). */
.ex-chat .ex-q,
.ex-chat .ex-a {
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 11px 14px;
  margin-top: 14px;
}

.ex-chat .ex-q {
  margin-left: auto;
  max-width: 86%;
  width: fit-content;
  background: var(--raise);
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 4px 14px;
}

.ex-chat .ex-a {
  max-width: 94%;
  background: rgba(56, 217, 190, 0.06);
  border: 1px solid rgba(56, 217, 190, 0.45);
  border-radius: 14px 14px 14px 4px;
}

.ex-chat mark {
  background: rgba(56, 217, 190, 0.22);
  color: var(--text);
  border-radius: 3px;
  padding: 0 3px;
}

.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.ex-chat .ex-action {
  display: inline-block;
  font-size: 11px;
  padding: 8px 14px;
  pointer-events: none;
}

/* On a phone or a narrow tablet the record becomes a list: one block per
   row, each value with its column's name beside it (data-label, set by the
   renderer), and the flag's tint and bar on the whole block. */
@media (max-width: 700px) {
  .ex-pair { padding: 16px 12px 18px; }
  .ex-pair .ex { padding: 14px 12px 16px; }
  .ex-table thead { display: none; }
  .ex-table, .ex-table tbody, .ex-table tr, .ex-table td { display: block; width: 100%; }
  .ex-table tbody tr:not(.ex-note) { padding: 8px 10px; border-top: 1px solid var(--line); }
  .ex-table tbody tr:first-child { border-top: 0; }
  .ex-table td,
  .ex-table td:last-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 2px 0;
    text-align: right;
    white-space: normal;
  }
  .ex-table td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: left;
    padding-top: 2px;
  }
  .ex-table td:empty { display: none; }
  .ex-table tr.is-flag td,
  .ex-table tr.is-flag td:first-child,
  .ex-table tr.ex-note td { background: none; box-shadow: none; }
  .ex-table tr.is-flag { background: rgba(255, 180, 84, 0.08); box-shadow: inset 3px 0 0 var(--warn); }
  .ex-table tr.f-error { background: rgba(255, 91, 91, 0.09); box-shadow: inset 3px 0 0 #ff5b5b; }
  .ex-table tr.f-alert { background: rgba(167, 139, 250, 0.09); box-shadow: inset 3px 0 0 var(--them); }
  .ex-table tr.f-match { background: rgba(56, 217, 190, 0.08); box-shadow: inset 3px 0 0 var(--you); }
  .ex-table tr.ex-note { padding: 0 10px 10px; background: rgba(255, 180, 84, 0.08); box-shadow: inset 3px 0 0 var(--warn); }
  .ex-table tr.ex-note.f-error { background: rgba(255, 91, 91, 0.09); box-shadow: inset 3px 0 0 #ff5b5b; }
  .ex-table tr.ex-note.f-alert { background: rgba(167, 139, 250, 0.09); box-shadow: inset 3px 0 0 var(--them); }
  .ex-table tr.ex-note.f-match { background: rgba(56, 217, 190, 0.08); box-shadow: inset 3px 0 0 var(--you); }
  .ex-table tr.ex-note td { display: block; text-align: left; padding: 0; }
  .ex-table tr.ex-note td::before { content: none; }
}
}

@media (max-width: 620px) {
  .sd-cases li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sd-show-btn { justify-self: start; margin-top: 4px; }
}

/* ───────────────────────────────────────────── the diagram

   solutions-diagram.js builds: a caption (the step playing), a stage (an SVG
   wire layer under a CSS grid of nodes, and the wire labels) and a bar (play
   and the legend). .is-tall is the grid turned on its side for a phone. */

.dg-caption {
  display: flex;
  gap: 14px;
  align-items: baseline;
  min-height: 3.4em;
  margin-bottom: 18px;
}

.dg-n {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--you);
}

.dg-text { font-size: 1.05rem; }

.dg-stage {
  position: relative;
  padding: 10px 0;
}

.dg-wires {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.dg-wire {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.5;
  transition: stroke 0.3s;
}

.dg-wire.is-on {
  stroke: rgba(56, 217, 190, 0.6);
  stroke-width: 2;
  stroke-dasharray: 5 7;
  animation: dg-dash 0.9s linear infinite;
}

@keyframes dg-dash { to { stroke-dashoffset: -24; } }

.dg-dot.t-you { fill: var(--live); filter: drop-shadow(0 0 5px rgba(69, 236, 208, 0.9)); }
.dg-dot.t-them { fill: var(--them); filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.9)); }
.dg-dot.t-flag { fill: var(--warn); filter: drop-shadow(0 0 6px rgba(255, 180, 84, 0.95)); }

/* A flow's tone colours its wire too: amber is an issue being flagged. */
.dg-wire.is-on.t-flag { stroke: rgba(255, 180, 84, 0.7); }
.dg-wire.is-on.t-them { stroke: rgba(167, 139, 250, 0.6); }

/* column-gap is read by solutions-diagram.js (COL_GAP): change both. */
/* grid-auto-rows keeps an empty row as tall as a box, so a shape can leave
   one free for its wires to travel through (the assistant's trip down to the
   system and back up). */
.dg-grid {
  position: relative;
  z-index: 1;
  display: grid;
  column-gap: 72px;
  row-gap: 22px;
  grid-auto-rows: minmax(74px, auto);
  align-items: center;
}

.is-tall .dg-grid { column-gap: 12px; row-gap: 46px; }

.dg-node {
  position: relative;
  min-height: 74px;
  padding: 10px 12px 11px;
  border-radius: 12px;
  background: var(--raise-2);
  border: 1px solid var(--line-strong);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s, opacity 0.3s;
  opacity: 0.72;
}

.dg-node.is-on { opacity: 1; }

.dg-node.is-hit { transform: scale(1.04); }

.dg-kind {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

.dg-label { display: block; font-size: 0.95rem; line-height: 1.25; }

.dg-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--dim);
}

.is-tall .dg-node { padding: 8px 9px 9px; min-height: 64px; }
.is-tall .dg-label { font-size: 0.82rem; }
.is-tall .dg-sub { font-size: 0.72rem; }

/* The five kinds a business reader needs: who is outside (violet), your
   systems (grey), the AI building block at work (teal, the one that stands
   out), your team (round) and the result for the business (teal outline). */
.dg-node.k-party   { border-color: rgba(167, 139, 250, 0.55); }
.dg-node.k-party .dg-kind { color: var(--them); }
.dg-node.k-block   {
  border: 1.5px solid rgba(56, 217, 190, 0.75);
  background: linear-gradient(rgba(56, 217, 190, 0.09), rgba(56, 217, 190, 0.09)), var(--raise-2);
}
.dg-node.k-block .dg-kind { color: var(--live); }
.dg-node.k-person  { border-color: rgba(238, 242, 243, 0.45); border-radius: 28px; }
.dg-node.k-person .dg-kind { color: var(--text); }
.dg-node.k-outcome { border: 1px dashed rgba(56, 217, 190, 0.6); }
.dg-node.k-outcome .dg-kind { color: var(--you); }

.dg-node.is-on.k-party  { box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.5), 0 0 22px rgba(167, 139, 250, 0.25); }
.dg-node.is-on.k-block,
.dg-node.is-on.k-outcome { box-shadow: 0 0 0 1px rgba(56, 217, 190, 0.5), 0 0 24px rgba(56, 217, 190, 0.25); }
.dg-node.is-on.k-system,
.dg-node.is-on.k-person { box-shadow: 0 0 0 1px rgba(238, 242, 243, 0.4), 0 0 22px rgba(238, 242, 243, 0.12); }

.dg-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

/* A label wraps to the column gap (72px less a margin), so a two-word label
   fits between two nodes instead of being dropped for covering one. */
.dg-wl {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 66px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--faint);
  background: var(--sd-bg, var(--bg));
  border-radius: 6px;
  padding: 2px 4px;
}

/* On a phone the wires are short and vertical; their labels would sit on
   the nodes, and the captions already say what moves. */
.is-tall .dg-wl,
.dg-wl[hidden] { display: none; }

.dg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.dg-play {
  appearance: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
}

.dg-play:hover { border-color: var(--text); }

.dg-play[disabled] { opacity: 0.5; cursor: default; }

.dg-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.dg-legend li { display: flex; align-items: center; gap: 6px; }

.dg-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--raise-2);
}

.dg-legend .k-party i   { border-color: var(--them); }
.dg-legend .k-block i   { border-color: var(--live); background: rgba(56, 217, 190, 0.2); }
.dg-legend .k-person i  { border-color: var(--text); border-radius: 50%; }
.dg-legend .k-outcome i { border: 1px dashed var(--you); }

@media (prefers-reduced-motion: reduce) {
  .sd[open] { animation: none; }
  .dg-wire.is-on { animation: none; }
  .dg-node { transition: none; }
}

/* ───────────────────────────────────────────── the source note */

.foot-bottom .foot-source { max-width: 46em; }
