/* "How your data flows" (public/google-data-flow.mjs). Story-mode look: stickers, ink outlines,
   sun/hot/green chips. Mobile first: the full diagram stacks at phone width and runs left to right
   once its own box is wide enough (container query), so it never scrolls sideways. */
.gdf { --gdf-ink: var(--ink, #16130a); --gdf-line: var(--line-2, rgb(22 19 10 / 18%)); container: gdf / inline-size; min-width: 0; }
.gdf[hidden] { display: none; }
.gdf-loading, .gdf-error { margin: 0; padding: 14px 16px; font-size: 14px; color: var(--ink-2, rgb(22 19 10 / 72%)); }
.gdf-error .btn { margin-left: 6px; }

/* ── Full ── */
.gdf--full { padding: 20px; display: grid; gap: 16px; }
.gdf-in-sheet.gdf--full { padding: 4px 0 0; box-shadow: none; background: transparent; border-radius: 0; }
/* In the pop-up the sheet already has the title and art. */
.gdf-in-sheet .gdf-head { grid-template-columns: minmax(0, 1fr); }
.gdf-in-sheet .gdf-head-art, .gdf-in-sheet .gdf-head .gc-kicker, .gdf-in-sheet .gdf-title { display: none; }
.gdf-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.gdf-head .gc-kicker { margin: 0 0 6px; }
.gdf-head-art { width: 64px; height: 64px; }
.gdf-title { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); line-height: 1.04; outline-offset: 4px; }
.gdf-lead { margin: 0 0 10px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2, rgb(22 19 10 / 72%)); }
.gdf-verdict { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.gdf-verdict .sm-sticker { white-space: normal; }

.gdf-diagram { display: grid; gap: 6px; }
.gdf-row-label { margin: 8px 0 2px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3, rgb(22 19 10 / 60%)); }
.gdf-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }

.gdf--full .gdf-node {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--gdf-ink), 4px 4px 0 var(--gdf-ink); min-width: 0;
}
.gdf--full .gdf-node > img { width: 48px; height: 48px; object-fit: contain; }
.gdf--full .gdf-node.is-coming { background: transparent; box-shadow: none; outline: 2px dashed var(--gdf-line); outline-offset: -2px; }
.gdf--full .gdf-node.is-coming > img { opacity: 0.45; filter: grayscale(1); }
.gdf--full .gdf-node.is-flagged { box-shadow: inset 0 0 0 2px var(--hot, #ff5c8a), 4px 4px 0 var(--hot, #ff5c8a); }
.gdf-node-flag { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--hot, #ff5c8a); color: #fff; font-weight: 900; font-size: 14px; box-shadow: 0 0 0 2px #fff; }
.gdf-node-body { display: grid; gap: 2px; min-width: 0; }
.gdf-node-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3, rgb(22 19 10 / 60%)); }
.gdf-node-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; color: var(--gdf-ink); overflow-wrap: anywhere; }
.gdf-node-name { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.gdf-node-line { font-size: 12.5px; line-height: 1.35; color: var(--ink-2, rgb(22 19 10 / 72%)); overflow-wrap: anywhere; }
.gdf-node-coming { color: var(--ink-3, rgb(22 19 10 / 60%)); font-weight: 700; }

/* The arrow between two stops: vertical when stacked. */
.gdf--full .gdf-link { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0 6px 36px; }
.gdf--full .gdf-arrow { position: absolute; left: 37px; top: 0; bottom: 0; width: 0; border-left: 3px solid var(--gdf-ink); }
.gdf--full .gdf-arrow::after { content: ''; position: absolute; left: -8px; bottom: -1px; border: 6.5px solid transparent; border-top: 9px solid var(--gdf-ink); border-bottom: 0; }
.gdf--full .gdf-link.is-not_linked .gdf-arrow, .gdf--full .gdf-link.is-not_checked .gdf-arrow { border-left-style: dashed; border-left-color: var(--gdf-line); }
.gdf--full .gdf-link.is-not_linked .gdf-arrow::after, .gdf--full .gdf-link.is-not_checked .gdf-arrow::after { border-top-color: var(--gdf-line); }
.gdf--full .gdf-link.is-mismatch .gdf-arrow { border-left-color: var(--hot, #ff5c8a); }
.gdf--full .gdf-link.is-mismatch .gdf-arrow::after { border-top-color: var(--hot, #ff5c8a); }
.gdf--full .gdf-link .gdf-chip { margin-left: 20px; }

.gdf-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.gdf-chip-glyph { font-weight: 900; }
.gdf-chip.is-linked { background: var(--green-soft, #dcf2e4); color: var(--green, #167a43); }
.gdf-chip.is-not_linked { background: var(--sun-soft, #fff4b8); color: var(--ink, #16130a); }
.gdf-chip.is-mismatch { background: var(--hot, #ff5c8a); color: #fff; }
.gdf-chip.is-not_checked { background: #efece1; color: var(--ink-2, rgb(22 19 10 / 72%)); background-image: repeating-linear-gradient(135deg, rgb(22 19 10 / 8%) 0 5px, transparent 5px 10px); }

@container gdf (max-width: 480px) {
  .gdf-head { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .gdf-head-art { width: 48px; height: 48px; }
  .gdf--full .gdf-node { padding: 10px 12px; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .gdf--full .gdf-node > img { width: 40px; height: 40px; }
  .gdf--full .gdf-link { padding-left: 30px; min-height: 40px; }
  .gdf--full .gdf-arrow { left: 31px; }
}
@container gdf (min-width: 600px) {
  .gdf--full .gdf-row { display: flex; align-items: stretch; }
  .gdf--full .gdf-node { flex: 1 1 0; grid-template-columns: minmax(0, 1fr); justify-items: start; align-content: start; gap: 6px; padding: 12px 10px; }
  .gdf--full .gdf-node > img { width: 40px; height: 40px; }
  .gdf--full .gdf-node-id { font-size: 12px; }
  .gdf--full .gdf-node-name { font-size: 13.5px; }
  .gdf--full .gdf-node-line { font-size: 12px; }
  .gdf--full .gdf-link { flex: 0 0 48px; flex-direction: column; justify-content: center; gap: 6px; padding: 0 2px; min-height: 0; }
  .gdf--full .gdf-arrow { position: relative; left: auto; top: auto; bottom: auto; width: 100%; height: 0; border-left: 0; border-top: 3px solid var(--gdf-ink); }
  .gdf--full .gdf-arrow::after { left: auto; right: -1px; bottom: auto; top: -8px; border: 6.5px solid transparent; border-left: 9px solid var(--gdf-ink); border-right: 0; }
  .gdf--full .gdf-link.is-not_linked .gdf-arrow, .gdf--full .gdf-link.is-not_checked .gdf-arrow { border-top-style: dashed; border-top-color: var(--gdf-line); }
  .gdf--full .gdf-link.is-not_linked .gdf-arrow::after, .gdf--full .gdf-link.is-not_checked .gdf-arrow::after { border-left-color: var(--gdf-line); border-top-color: transparent; }
  .gdf--full .gdf-link.is-mismatch .gdf-arrow { border-top-color: var(--hot, #ff5c8a); }
  .gdf--full .gdf-link.is-mismatch .gdf-arrow::after { border-left-color: var(--hot, #ff5c8a); border-top-color: transparent; }
  .gdf--full .gdf-link .gdf-chip { margin: 0; padding: 3px 4px; font-size: 9px; letter-spacing: 0.02em; white-space: normal; text-align: center; line-height: 1.15; justify-content: center; flex-direction: column; gap: 1px; }
  /* Shorter rows (how wins get counted) keep the same stop width as the main row. */
  .gdf--full .gdf-diagram--four .gdf-row[style*="--gdf-n:3"] { padding-right: calc((100% - 3 * 48px) / 4 + 48px); }
  .gdf--full .gdf-diagram--four .gdf-row[style*="--gdf-n:2"] { padding-right: calc((100% - 3 * 48px) / 2 + 2 * 48px); }
}
@container gdf (min-width: 820px) {
  .gdf--full .gdf-node { padding: 14px; }
  .gdf--full .gdf-node-id { font-size: 13.5px; }
  .gdf--full .gdf-link { flex-basis: 62px; }
  .gdf--full .gdf-link .gdf-chip { font-size: 10px; padding: 3px 6px; }
  .gdf--full .gdf-diagram--four .gdf-row[style*="--gdf-n:3"] { padding-right: calc((100% - 3 * 62px) / 4 + 62px); }
  .gdf--full .gdf-diagram--four .gdf-row[style*="--gdf-n:2"] { padding-right: calc((100% - 3 * 62px) / 2 + 2 * 62px); }
}

/* The words list (text equivalent, and where each fix lives). */
.gdf-words-title { margin: 6px 0 0; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3, rgb(22 19 10 / 60%)); }
.gdf-words { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gdf-word { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 16px; background: var(--surface-2, #f3f1e8); }
.gdf-word.is-mismatch { background: var(--hot-soft, #ffe1ea); }
.gdf-word.is-not_linked { background: var(--sun-soft, #fff4b8); }
.gdf-word-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: #fff; box-shadow: inset 0 0 0 2px var(--gdf-ink); }
.gdf-word.is-linked .gdf-word-mark { background: var(--green, #167a43); color: #fff; box-shadow: none; }
.gdf-word.is-mismatch .gdf-word-mark { background: var(--hot, #ff5c8a); color: #fff; box-shadow: none; }
.gdf-word p { margin: 0; overflow-wrap: anywhere; }
.gdf-word-title { font-size: 14.5px; line-height: 1.35; }
.gdf-word-status { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2, rgb(22 19 10 / 72%)); white-space: nowrap; }
.gdf-word-say { font-size: 14px; line-height: 1.45; margin-top: 3px !important; }
.gdf-word-fix { font-size: 14px; line-height: 1.45; margin-top: 3px !important; font-weight: 700; }
.gdf-word-fix::before { content: '→ '; }
.gdf-word-actions { margin-top: 8px !important; }
.gdf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.gdf-checked { font-size: 12px; color: var(--ink-3, rgb(22 19 10 / 60%)); }

/* ── Compact strip (under a Google level's header, and the desktop side rail) ── */
.gdf--compact { display: grid; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--cream, #fffbe6); box-shadow: inset 0 0 0 1px var(--line, rgb(22 19 10 / 10%)); align-content: start; }
.gdf-compact-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.gdf-compact-title { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3, rgb(22 19 10 / 60%)); }
.gdf-compact-head .sm-sticker { white-space: normal; }
.gdf--compact .gdf-row { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr); align-items: start; }
.gdf--compact .gdf-row[style*="--gdf-n:3"] { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr); }
.gdf--compact .gdf-node { position: relative; display: grid; justify-items: center; text-align: center; gap: 2px; min-width: 0; }
.gdf--compact .gdf-node > img { width: 36px; height: 36px; object-fit: contain; }
.gdf--compact .gdf-node.is-coming > img { opacity: 0.4; filter: grayscale(1); }
.gdf--compact .gdf-node-flag { top: -4px; right: calc(50% - 26px); width: 18px; height: 18px; font-size: 11px; }
.gdf--compact .gdf-node-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.15; }
.gdf--compact .gdf-node-id { font-size: 10.5px; font-weight: 600; line-height: 1.2; color: var(--ink-2, rgb(22 19 10 / 72%)); overflow-wrap: anywhere; min-height: 1.2em; }
.gdf--compact .gdf-node.is-coming .gdf-node-id { word-break: normal; font-family: inherit; font-style: italic; }
.gdf--compact .gdf-link { position: relative; height: 36px; display: grid; place-items: center; }
.gdf--compact .gdf-arrow { position: absolute; left: -4px; right: -4px; top: 50%; border-top: 2px solid var(--gdf-ink); }
.gdf--compact .gdf-link.is-not_linked .gdf-arrow, .gdf--compact .gdf-link.is-not_checked .gdf-arrow { border-top-style: dashed; border-top-color: var(--gdf-line); }
.gdf--compact .gdf-link.is-mismatch .gdf-arrow { border-top-color: var(--hot, #ff5c8a); }
.gdf-dot { position: relative; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 900; background: #fff; box-shadow: inset 0 0 0 1.5px var(--gdf-ink); }
.gdf-link.is-linked .gdf-dot { background: var(--green, #167a43); color: #fff; box-shadow: none; }
.gdf-link.is-mismatch .gdf-dot { background: var(--hot, #ff5c8a); color: #fff; box-shadow: none; }
.gdf-link.is-not_linked .gdf-dot { background: var(--sun, #ffe14a); }
.gdf-compact-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.gdf-compact-foot .btn { padding-left: 0; }

/* Loading: the same shape as the loaded view, so nothing below it moves. Before the module even
   arrives, the empty holder already keeps that room. */
.gdf-strip:empty, .gdf-rail:empty { display: block; min-height: 166px; }
.gdf-confirm:empty, .gw-flow:empty { display: block; min-height: 420px; }
@media (max-width: 480px) { .gdf-strip:empty { min-height: 196px; } .gdf-confirm:empty, .gw-flow:empty { min-height: 900px; } }
.gdf-node.is-skel > img { opacity: 0.35; filter: grayscale(1); }
.gdf-skel-bar { display: inline-block; width: 78%; max-width: 120px; height: 0.9em; border-radius: 6px; vertical-align: middle; background: rgb(22 19 10 / 8%); }
.gdf-skel-bar.is-short { width: 52%; }
.gdf--compact .gdf-node.is-skel .gdf-skel-bar { width: 80%; }
.gdf-words-details > summary { cursor: pointer; list-style: none; padding: 6px 0; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.gdf-words-details > summary::-webkit-details-marker { display: none; }
.gdf-words-details > summary::before { content: '▸'; font-size: 14px; transition: transform 160ms ease; }
.gdf-words-details[open] > summary::before { transform: rotate(90deg); }
.gdf-words-details[open] > summary { margin-bottom: 8px; }

/* Narrow strips (phones): labels and IDs keep two lines each, loaded or not, so the height holds. */
@container gdf (max-width: 420px) {
  .gdf--compact .gdf-row { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr); }
  .gdf--compact .gdf-row[style*="--gdf-n:3"] { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr); }
  .gdf--compact .gdf-node-label { min-height: 2.3em; display: flex; align-items: flex-start; justify-content: center; }
  .gdf--compact .gdf-node-id { min-height: 2.4em; font-size: 9.5px; letter-spacing: -0.01em; }
  .gdf-dot { width: 16px; height: 16px; font-size: 9.5px; }
}

/* Google Ads cleared: the diagram spans the cleared card, with Move on right under it. */
.lv-cleared > .gdf-confirm, .lv-cleared > .lv-cleared-actions { grid-column: 1 / -1; }
.lv-cleared > .gdf-confirm { box-shadow: inset 0 0 0 2px var(--ink, #16130a); }

/* The level frame puts the strip right under the step dots. */
.lv-frame > .gdf--compact { margin: 0; }
/* The side rail copy only makes sense next to the levels (two columns). */
.gc-side .gdf--compact { background: #fff; box-shadow: inset 0 0 0 1px var(--line, rgb(22 19 10 / 10%)), var(--shadow-card); border-radius: 24px; padding: 16px; }
@media (max-width: 1040px) { .gc-side .gdf-rail { display: none; } }

@media (prefers-reduced-motion: reduce) { .gdf * { transition: none !important; animation: none !important; } }
