/* <valt-tunnel-state>. The band folds open from nothing when there is a tunnel to report and folds
   away when there is not: grid rows from 0fr to 1fr, so the card grows by exactly the band and
   nothing is measured in script. visibility as well, delayed on the way out, so a folded band is
   not a live region nobody can see. */
valt-tunnel-state { display: grid; grid-template-rows: 0fr; visibility: hidden; font-family: var(--font); color: var(--text);
  transition: grid-template-rows var(--t-move) var(--ease), visibility 0s linear var(--t-move); }
valt-tunnel-state[shown] { grid-template-rows: 1fr; visibility: visible;
  transition: grid-template-rows var(--t-move) var(--ease), visibility 0s linear 0s; }
valt-tunnel-state .fold { min-height: 0; overflow: hidden; }
/* 13px, because at 11 the state did not read at arm's length. */
valt-tunnel-state .bar { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-bottom: 1px solid var(--border); }
valt-tunnel-state .w { min-width: 0; font: 600 13px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The (i) beside Nothing loading (N64): text-2 at rest, the band's height, its tap area grown to --tap without moving
   the word (a pseudo-element). */
valt-tunnel-state .why { position: relative; flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin: 0 -4px 0 -2px; padding: 0;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); cursor: pointer; -webkit-appearance: none; }
/* The card clips 4 px above the icon, so the --tap square leans down: 4 above, the rest below, 10 each side. */
valt-tunnel-state .why::after { content: ""; position: absolute; top: -4px; bottom: calc(24px - var(--tap) + 4px); left: calc((24px - var(--tap)) / 2); right: calc((24px - var(--tap)) / 2); }
/* The fold clips while it opens and closes; once open (tunnel-state.js data-open) it lets the (i)'s full --tap square out,
   above the card's own layers. */
valt-tunnel-state[data-open] .fold { overflow: visible; }
valt-tunnel-state .why { z-index: 2; }
valt-tunnel-state .why:hover { color: var(--text); }
valt-tunnel-state .why:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* The light. A 14 box so the dot and the connected disc share a centre and the word never moves. */
valt-tunnel-state .pt { position: relative; flex: none; width: 14px; height: 14px; display: grid; place-items: center; }
valt-tunnel-state .dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--text-2);
  transition: background var(--t-feedback) var(--ease); }
valt-tunnel-state[data-point="working"] .dot { background: var(--attention); animation: valt-tunnel-breathe 1.6s ease-in-out infinite; }
/* Nothing loading and No network (hero.js): the same dot, steady, in the error red. */
valt-tunnel-state[data-point="trouble"] .dot { background: var(--error); }
@keyframes valt-tunnel-breathe { 50% { opacity: .35; } }
valt-tunnel-state .tick { position: absolute; inset: 0; width: 14px; height: 14px; display: none; overflow: visible; }
valt-tunnel-state .tick circle { fill: var(--signal); }
valt-tunnel-state .tick path { fill: none; stroke: var(--signal-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* One pulse off the disc on arrival (tunnel-state.js), the ribbon's echo of the globe beacon's ring. */
valt-tunnel-state .echo { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--signal); opacity: 0; pointer-events: none; }
valt-tunnel-state[data-point="done"] .dot { display: none; }
valt-tunnel-state[data-point="done"] .tick { display: block; }

@media (prefers-reduced-motion: reduce) {
  valt-tunnel-state, valt-tunnel-state[shown] { transition: none; }
  valt-tunnel-state[data-point="working"] .dot { animation: none; } }
