/* The chapters' drivers (demos/drivers.js): a chapter's copy column that runs its live window. One active-state look on every
   chapter, in the chapter's accent (--t-accent): .is-active (hover, focus or the idle timer) and [aria-pressed="true"] (pinned).
   Match's keyword chips are the first (demos/match-driver.js); later chapters reuse the panel, the status line and the look. */

.drv { border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 16px; margin-top: 6px; min-width: 0; }
.drv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.drv-h { font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; color: var(--ink-3); text-wrap: balance; }

/* the chips: pills that are real buttons. Solid = found, dashed = not decided yet */
.drv-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.drv-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  font: inherit; font-size: 15px; font-weight: 650; line-height: 1.2; text-align: left; white-space: nowrap;
  min-height: 40px; padding: 8px 14px 8px 11px; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 38%, transparent);
  transition: color 300ms ease, background 300ms ease, border-color 300ms ease, box-shadow 400ms var(--spring), transform 500ms var(--spring);
}
.drv-chip[data-status="missing"] { border-style: dashed; border-color: color-mix(in srgb, var(--ink) 60%, transparent); background: transparent; }
.drv-chip[data-status="no"] { border-color: var(--ink-3); color: var(--ink-3); background: transparent; text-decoration: line-through; }
.drv-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.drv-ic--ring { stroke-width: 2.1; }
.drv-word { min-width: 0; overflow: hidden; text-overflow: clip; }
.drv-chip:hover { transform: translateY(-2px); }
.drv-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* the one active look: the chapter's accent (hover, focus or the idle timer) and the same when pinned */
.drv-chip.is-active, .drv-chip[aria-pressed="true"] {
  color: var(--t-accent); border-color: var(--t-accent);
  background: color-mix(in srgb, var(--t-accent) 14%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-accent) 20%, transparent);
}
.drv-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--t-accent) 22%, transparent); }

/* the live count and the key */
.drv-meter { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.drv-count { font-size: 17px; font-weight: 600; color: var(--ink-2); text-wrap: balance; }
.drv-count b { font-size: 28px; font-weight: 800; font-stretch: 112%; line-height: 1; color: var(--t-accent); margin-right: 2px; font-variant-numeric: tabular-nums; }
.drv-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-3); }
.drv-key span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.drv-key .drv-ic { width: 14px; height: 14px; }

/* the status line: a hint, the question for a dashed word, or what the answer did. One slot, one height, so nothing below moves. */
.drv-say { min-height: 92px; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; }
.drv-say p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); text-wrap: balance; }
.drv-say b { font-weight: 700; color: var(--ink); }
.drv-note { outline: none; }
.drv-q { font-size: 17px; }
.drv-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.drv-yes, .drv-no { appearance: none; font: inherit; font-size: 14px; font-weight: 650; padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.drv-yes { border: 0; background: var(--t-accent); color: #101113; }
.drv-no { border: 1px solid rgba(255, 255, 255, .2); background: none; color: var(--ink-2); font-weight: 500; }
.drv-yes:disabled, .drv-no:disabled { opacity: .5; cursor: default; }
.drv-yes:focus-visible, .drv-no:focus-visible, #drv-reset:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* (the chips arrive with their list: the Sequence entrance in entrances.css, triggered; they used to gather on their own scroll timeline) */
@keyframes drv-gather {
  from { opacity: 0; transform: translate(var(--sx, 0), var(--sy, var(--mo-dist))) rotate(var(--sr, 0deg)) scale(.92); }
  to { opacity: 1; transform: none; }
}

/* a word that just got its yes settles into place */
html .drv-chips[data-mo] .drv-chip.just.just { animation: drv-pop 700ms var(--mo-ease, cubic-bezier(.34, 1.56, .64, 1)); animation-timeline: auto; animation-range: normal; }
@keyframes drv-pop { from { transform: scale(.88); } to { transform: none; } }

/* the Match chapter's "Try it." line, between "What the ad wants" and the words (touch screens get the tap wording) */
.drv-try { margin: 2px 0 14px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.drv-try b { color: var(--page-acc, var(--yellow)); font-weight: 700; }
.drv-try-touch { display: none; }
@media (hover: none) { .drv-try-fine { display: none; } .drv-try-touch { display: inline; } }
