/* <valt-connect-action>. The rules and their measurements came over from hero.css when the hero and
 * the list's open card started sharing one button (2026-09-22); the list card's own plainer copy of
 * it is gone, and since 2026-09-24 so is the list card: its open row is the hero.
 *
 * Fused to the bottom edge: full bleed, square, the card's radius on its lower corners. 18/700 is the
 * label size at which the unchanged ink and fill clear their APCA floor, which is Lc 55 there against
 * the measured 60.8. At 14/600 the floor is 75 and the pair does not reach it, and darkening the ink
 * does not help because the fill is the limit.
 *
 * The action carries its OWN bottom radius rather than borrowing the card's clip. WebKit does not clip
 * a child that has made its own stacking context against a rounded, backdrop-filtered parent, so on the
 * phone this slab's square corners sat proudly outside the card's 16pt curve while Chrome clipped them
 * correctly and showed nothing wrong. Minus the card's 1px border, so the two curves are concentric. */
valt-connect-action { display: block; }
valt-connect-action .cta { position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 52px; border: 0; padding: 0;
  border-radius: 0 0 calc(var(--r-card) - 1px) calc(var(--r-card) - 1px);
  cursor: pointer; -webkit-appearance: none; touch-action: manipulation; font-family: var(--font);
  background: var(--signal); color: var(--signal-ink);
  transition: filter var(--t-feedback) var(--ease), background var(--t-feedback) var(--ease),
    color var(--t-feedback) var(--ease), box-shadow var(--t-feedback) var(--ease); }
valt-connect-action .lab { position: relative; z-index: 1;
  font: 700 18px/22px var(--font); letter-spacing: -.01em;
  transition: transform var(--t-feedback) var(--ease); }

/* The specular terminator: a hard light angle across the top half, the way light falls on a moulded
 * physical key rather than on a printed rectangle.
 *
 * Night lightens and day DARKENS, and that inversion is measured rather than stylistic. The day green
 * is dark enough that white is the correct ink, so a white highlight over it pushes the pair the wrong
 * way: 2.87:1 at 30% and still 4.17:1 at 10%, both under the WCAG AA floor of 4.5 this control is held
 * to (18/700 is 13.5pt bold, below the 14pt large-text cut). Darkening the same terminator measures
 * 8.45:1 at 30%. At night the white highlight is free: 10.28:1 against signal-ink, up from 8.14.
 * Day's terminator is a tenth, not 30%: at 30% the top half went to a muddy #375518 and the brand green
 * read as olive (day critique, 2026-09-22).
 * The day terminator belongs to the lit Connect face only. Written for every face it outranked the
 * connecting and connected light (0,3,1 over 0,2,1), so by day Cancel showed this static shade and the
 * amber never travelled (measured 2026-09-23). */
valt-connect-action .gloss { position: absolute; left: 0; right: 0; top: 0; height: 100%;
  z-index: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .06) 46%, transparent 47%); }
:root[data-theme="day"] valt-connect-action:not([data-mode="connecting"], [data-mode="connected"], [data-mode="change"]) .gloss {
  background: linear-gradient(180deg, rgba(0, 0, 0, .10) 0%, rgba(0, 0, 0, .03) 46%, transparent 47%); }

valt-connect-action .cta:hover { filter: brightness(1.07); }
/* The press belongs to the material: a lit face acknowledges with its label, not by scaling the whole
   slab. The whole-object scale was the generic answer and it fights the fixed light angle. */
valt-connect-action .cta:active .lab { transform: translateY(1px); }
/* The card clips its children, so an outward focus ring would be cut off by the corner radius. */
valt-connect-action .cta:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }

/* Connected and connecting are not the action the green is for. The tunnel being up is reported by the
   check in the band; the slab goes quiet and says what pressing it would do. */
valt-connect-action:is([data-mode="connected"], [data-mode="change"], [data-mode="connecting"]) .cta {
  background: var(--glass-cap); color: var(--text); box-shadow: inset 0 1px 0 var(--border); }

/* CONNECTING. The light itself travels: the same terminator sweeps the face on a loop, in the amber the
 * band's point already wears for this state, with a matching rim. This reports ACTIVITY, not progress:
 * no bar, no percentage, no estimate, because the tunnel gives none (DESIGN.md's "do not add" list
 * forbids a progress meter). The amber is a rim and a moving highlight, never the fill, which keeps the
 * label at 14.21:1 night / 17.03:1 day. As a boundary it measures 8.25:1 night and 3.23:1 day, both
 * over the 3:1 WCAG 1.4.11 wants. */
valt-connect-action[data-mode="connecting"] .cta {
  box-shadow: inset 0 1px 0 var(--border),
              inset 0 0 0 1px color-mix(in srgb, var(--attention) 55%, transparent); }
valt-connect-action[data-mode="connecting"] .gloss {
  top: -100%; height: 300%; will-change: transform;
  background: linear-gradient(180deg,
    transparent 0 28%,
    color-mix(in srgb, var(--attention) 10%, transparent) 30%,
    color-mix(in srgb, var(--attention) 62%, transparent) 33%,
    color-mix(in srgb, var(--attention) 10%, transparent) 36%,
    transparent 38% 100%);
  animation: valt-cta-working 1.9s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes valt-cta-working {
  0%, 100% { transform: translateY(-14%); }
  50%      { transform: translateY(14%); } }

/* CONNECTED. The live control is a PANE, not a fill: its own backdrop blur so it samples the map through
 * the card, a hairline, a lit top edge and a shallow inner shadow so it sits a little below the card's
 * face. It wears no hue: the verified tunnel is ONE point, the check in the band, and the palette forbids
 * green as a border. What marks the live state is MATERIAL, recessed and glassy where the idle action is
 * raised and lit, so a live tunnel is not dropped by a thumb reaching for where Connect used to be. */
valt-connect-action:is([data-mode="connected"], [data-mode="change"]) .cta {
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 0 0 1px var(--border),
              inset 0 1px 0 var(--glass-control-line),
              inset 0 10px 20px -14px rgba(0, 0, 0, .55); }
:root[data-theme="day"] valt-connect-action:is([data-mode="connected"], [data-mode="change"]) .cta {
  box-shadow: inset 0 0 0 1px var(--border),
              inset 0 1px 0 var(--glass-control-line),
              inset 0 10px 20px -14px rgba(10, 10, 20, .22); }

/* One sweep, once, on arrival, then nothing: a control that keeps moving after the job is done is
   reporting work that is not happening. */
valt-connect-action:is([data-mode="connected"], [data-mode="change"]) .gloss {
  top: -100%; height: 300%;
  background: linear-gradient(180deg,
    transparent 0 30%,
    color-mix(in srgb, var(--text) 34%, transparent) 33%,
    transparent 36% 100%);
  animation: valt-cta-settled var(--t-move) var(--ease) 1 both; }
@keyframes valt-cta-settled {
  from { transform: translateY(-18%); opacity: 1; }
  to   { transform: translateY(18%); opacity: 0; } }

/* THE LANDING (connect-action.js). For a moment the key is the green key again, lit the same way, and
 * it says what happened: a check and CONNECTED in the Connect label's own size and ink, so the pair is
 * the measured one (8.14:1 night, 5.08:1 day). The face is its own layer over the quiet pane, so when
 * it drains the pane and Disconnect are already underneath. */
valt-connect-action .flood { position: absolute; inset: 0; z-index: 2; display: none; align-items: center; justify-content: center;
  overflow: hidden; border-radius: inherit; pointer-events: none;
  background: var(--signal); color: var(--signal-ink); }
valt-connect-action[data-landing] .flood { display: flex; }
valt-connect-action[data-landing="hold"] .lab { opacity: 0; }
valt-connect-action .flood::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .06) 46%, transparent 47%); }
:root[data-theme="day"] valt-connect-action .flood::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, .10) 0%, rgba(0, 0, 0, .03) 46%, transparent 47%); }
valt-connect-action .done { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px;
  font: 700 18px/22px var(--font); letter-spacing: -.01em; }
valt-connect-action .done .word { font: inherit; }
valt-connect-action .tick { width: 24px; height: 24px; flex: none; overflow: visible; }
valt-connect-action .tick path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* One glint crossing the lit face, the terminator's light passing over the key once. Day is fainter
   for the reason the day terminator is: white over the dark green costs the label its contrast. */
valt-connect-action .glint { position: absolute; top: 0; bottom: 0; left: 0; width: 42%; z-index: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, .42) 50%, transparent 82%); }
:root[data-theme="day"] valt-connect-action .glint {
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, .20) 50%, transparent 82%); }

@media (prefers-reduced-motion: reduce) {
  valt-connect-action[data-mode="connecting"] .gloss { animation: none; transform: none; opacity: .85; }
  valt-connect-action:is([data-mode="connected"], [data-mode="change"]) .gloss { animation: none; opacity: 0; } }

/* The phone (U22, hero.css has the rule): the key is 46 tall, the label as it is. */
@media (max-width: 447.98px) { valt-connect-action .cta { height: 46px; } }
