/* ============================================================================
 * Component Playground — TEMPLATE CHROME + token-based component CSS
 *
 * Two visual layers, kept deliberately distinct (per the playground brief):
 *   1. CHROME  — the tool around the component. Quiet, neutral, monospace token
 *      strings, hairline outlines. Built from Vendoo neutral/surface tokens so it
 *      recedes and never competes with the component on stage.
 *   2. COMPONENT — the Vendoo Button itself (.btn), built strictly from system
 *      tokens lifted from the Button spec. This is the only saturated-purple
 *      thing on the page, so the eye reads chrome vs. specimen instantly.
 *
 * Every value traces to a token in colors_and_type.css / tokens.css.
 * ========================================================================== */

:root {
  /* chrome aliases — all sourced from system neutral/surface tokens */
  --pg-ink:    var(--sys-on-surface);
  --pg-muted:  var(--sys-on-surface-variant);
  --pg-faint:  var(--sys-outline);
  --pg-line:   var(--sys-outline-variant);
  --pg-page:   var(--sys-surface);                    /* #FDF7FF tinted page */
  --pg-panel:  var(--sys-surface-container-lowest);   /* #FFFFFF cards */
  --pg-panel2: var(--sys-surface-container-low);       /* #F8F1FF inset */
  --pg-accent: var(--sys-primary);
  --pg-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--pg-page);
  color: var(--pg-ink);
  font-family: "Lexend", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* shared monospace token chip used everywhere a token name is shown */
.tok {
  font-family: var(--pg-mono);
  font-size: 11.5px;
  color: var(--pg-accent);
  background: color-mix(in srgb, var(--pg-accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--pg-accent) 16%, transparent);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  white-space: nowrap;
}
.tok--plain { color: var(--pg-muted); background: transparent; border-color: var(--pg-line); }

/* ── Page scaffold ─────────────────────────────────────────────────────── */
.pg-wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px 140px; }

/* Back link to the playground index — quiet chrome, sits above the banner. */
.pg-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 28px 0 0; padding: 7px 14px 7px 10px;
  border: 1px solid var(--pg-line); border-radius: var(--radius-full);
  background: var(--pg-panel); color: var(--pg-muted);
  font-family: "Lexend", system-ui, sans-serif; font-size: 13px; font-weight: 500;
  letter-spacing: 0.1px; text-decoration: none;
  transition: color var(--dur-medium) var(--ease-standard),
              border-color var(--dur-medium) var(--ease-standard),
              background var(--dur-medium) var(--ease-standard);
}
.pg-back v-icon { width: 18px; height: 18px; transition: transform var(--dur-medium) var(--ease-standard); }
.pg-back:hover {
  color: var(--pg-accent); border-color: var(--pg-accent);
  background: color-mix(in srgb, var(--pg-accent) 6%, var(--pg-panel));
}
.pg-back:hover v-icon { transform: translateX(-3px); }
.pg-back + .pg-banner { margin-top: 14px; }

/* Template banner — explains the slot model; visually marks this as a reusable
   template, not a one-off page. Distinct dark ink bar. */
.pg-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 28px 0 8px; padding: 14px 20px;
  background: var(--sys-inverse-surface); color: var(--sys-inverse-on-surface);
  border-radius: var(--radius-lg);
}
.pg-banner .bdot { width: 9px; height: 9px; border-radius: var(--radius-full); background: var(--sys-inverse-primary); flex: none; }
.pg-banner .btext { font-size: 13px; line-height: 1.5; letter-spacing: 0.2px; }
.pg-banner .btext b { font-weight: 600; }
.pg-banner code { font-family: var(--pg-mono); font-size: 12px; background: rgba(255,255,255,0.12); padding: 1px 6px; border-radius: 4px; }

/* ── Header (slot: meta) ──────────────────────────────────────────────── */
.pg-header { padding: 40px 0 8px; }
.pg-eyebrow {
  font-family: var(--pg-mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--pg-accent); font-weight: 600;
}
.pg-titlerow { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 10px 0 14px; }
h1.pg-title { font-size: 46px; font-weight: 700; letter-spacing: -0.02em; color: var(--pg-ink); margin: 0; line-height: 1; }
.pg-status {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid var(--pg-line); border-radius: var(--radius-full);
  font-size: 12.5px; color: var(--pg-muted); background: var(--pg-panel);
}
.pg-status .ver { font-family: var(--pg-mono); color: var(--pg-ink); font-weight: 600; }
.pg-status .dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--sys-secondary); }
.pg-lede { font-size: 16.5px; line-height: 1.6; color: var(--pg-muted); max-width: 720px; margin: 0; }
.pg-props { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pg-props .chip { font-size: 12.5px; padding: 6px 12px; border: 1px solid var(--pg-line); border-radius: var(--radius-full); color: var(--pg-ink); background: var(--pg-panel); }
.pg-props .chip b { color: var(--pg-accent); font-weight: 600; }

/* ── Section shell + slot tag ─────────────────────────────────────────── */
.pg-section { margin-top: 56px; }
.pg-sechead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.pg-sechead .num {
  font-family: var(--pg-mono); font-size: 12px; font-weight: 600; color: var(--pg-faint);
}
.pg-sechead h2 { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--pg-ink); font-weight: 600; margin: 0; }
.pg-slot {
  margin-left: auto; font-family: var(--pg-mono); font-size: 11px; color: var(--pg-muted);
  background: var(--pg-panel2); border: 1px dashed var(--pg-line); border-radius: var(--radius-sm);
  padding: 3px 9px;
}
.pg-slot::before { content: "slot · "; color: var(--pg-faint); }
.pg-secdesc { font-size: 14.5px; line-height: 1.55; color: var(--pg-muted); max-width: 720px; margin: 0 0 22px; }
.pg-secdesc .tok { font-size: 11px; }

/* ── 2. LIVE PREVIEW ──────────────────────────────────────────────────── */
.pg-live { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }

.pg-stagewrap { border: 1px solid var(--pg-line); border-radius: var(--radius-xl); background: var(--pg-panel); overflow: hidden; box-shadow: var(--elev-1); }
.pg-stagebar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--pg-line); background: var(--pg-panel2);
}
.pg-stagebar .grouplbl { font-family: var(--pg-mono); font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--pg-faint); }
.pg-stagebar .spacer { flex: 1; }

/* segmented control (used for theme + viewport) */
.pg-seg { display: inline-flex; gap: 4px; background: var(--pg-panel); border: 1px solid var(--pg-line); border-radius: var(--radius-sm); padding: 3px; }
.pg-seg button {
  font: inherit; font-size: 12.5px; line-height: 1; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border: none; background: transparent; color: var(--pg-muted);
  border-radius: 5px; cursor: pointer; transition: background var(--dur-medium) var(--ease-standard), color var(--dur-medium) var(--ease-standard);
}
.pg-seg button v-icon { width: 15px; height: 15px; }
.pg-seg button[aria-pressed="true"] { background: var(--pg-ink); color: var(--sys-surface-container-lowest); }
.pg-seg button:hover:not([aria-pressed="true"]) { color: var(--pg-ink); }

/* the stage: a neutral surface the component sits centered on; theme-able.
   Surface fill and dot color are driven by CSS vars so Tweaks can retarget them. */
.pg-stage {
  --pg-stage-surface: var(--sys-surface-container-lowest);
  --pg-stage-dot: var(--pg-line);
  display: flex; align-items: center; justify-content: center;
  min-height: 340px; padding: 56px 32px;
  background:
    radial-gradient(var(--pg-stage-dot) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--pg-stage-surface);
  transition: background-color var(--dur-long) var(--ease-standard);
}
.pg-stage[data-grid="off"] { background: var(--pg-stage-surface); }
.pg-stage.pg-theme-dark { --pg-stage-dot: rgba(255,255,255,0.07); }
/* live-preview specimen zoom wrapper */
.pg-zoom { transform-origin: center; transition: transform var(--dur-medium) var(--ease-standard); }
/* viewport frame inside the stage */
.pg-vp {
  width: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center;
  transition: max-width var(--dur-long) var(--ease-standard);
}
.pg-vp[data-vp="mobile"]  { max-width: 375px; }
.pg-vp[data-vp="tablet"]  { max-width: 768px; }
.pg-vp[data-vp="desktop"] { max-width: 100%; }
.pg-vpmeta { font-family: var(--pg-mono); font-size: 10.5px; color: var(--pg-faint); padding: 8px 14px; border-top: 1px solid var(--pg-line); display: flex; justify-content: space-between; }
.pg-vpmeta .pg-theme-dark-readout { color: var(--pg-accent); }

/* ── 3. CONTROLS PANEL (slot: controls) ───────────────────────────────── */
.pg-controls { display: flex; flex-direction: column; gap: 12px; }
.pg-grp { border: 1px solid var(--pg-line); border-radius: var(--radius-lg); background: var(--pg-panel); padding: 15px 16px; }
.pg-grp > .h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px;
}
.pg-grp > .h .name { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--pg-muted); font-weight: 600; }
.pg-grp > .h .api { font-family: var(--pg-mono); font-size: 10px; color: var(--pg-faint); }

/* select rendered as wrapping segmented buttons */
.pg-optrow { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-optrow button {
  font: inherit; font-size: 12.5px; line-height: 1; padding: 8px 11px;
  border: 1px solid var(--pg-line); background: var(--pg-panel); color: var(--pg-ink);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--dur-medium) var(--ease-standard);
}
.pg-optrow button[aria-pressed="true"] { background: var(--pg-accent); border-color: var(--pg-accent); color: var(--sys-on-primary); }
.pg-optrow button:hover:not([aria-pressed="true"]) { border-color: var(--pg-faint); }

/* text input */
.pg-txt { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--pg-line); border-radius: var(--radius-sm); color: var(--pg-ink); background: var(--pg-panel); }
.pg-txt:focus { outline: var(--border-strong) solid var(--pg-accent); outline-offset: -1px; }

/* switch + icon picker rows */
.pg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pg-row + .pg-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--pg-line); }
.pg-row .lhs { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--pg-ink); font-size: 13.5px; }
.pg-row .lhs v-icon { width: 17px; height: 17px; color: var(--pg-muted); flex: none; }
.pg-row .rhs { display: flex; align-items: center; gap: 8px; }
.pg-sw { width: 42px; height: 24px; border-radius: var(--radius-full); background: var(--sys-surface-dim); position: relative; cursor: pointer; border: none; transition: background var(--dur-medium) var(--ease-standard); flex: none; }
.pg-sw[aria-checked="true"] { background: var(--pg-accent); }
.pg-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: var(--radius-full); background: var(--sys-surface-container-lowest); transition: transform var(--dur-medium) var(--ease-standard); }
.pg-sw[aria-checked="true"]::after { transform: translateX(18px); }
.pg-pick { font: inherit; font-family: var(--pg-mono); font-size: 11.5px; padding: 6px 8px; border: 1px solid var(--pg-line); border-radius: var(--radius-sm); background: var(--pg-panel); color: var(--pg-ink); cursor: pointer; max-width: 130px; }
.pg-pick:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-pick:focus { outline: var(--border-strong) solid var(--pg-accent); outline-offset: -1px; }

/* per-item editor (kind: "items") — one compact card per list/menu item */
.pg-items { display: flex; flex-direction: column; gap: 10px; }
.pg-item { border: 1px solid var(--pg-line); border-radius: var(--radius-md); background: var(--sys-surface-container-lowest); padding: 11px 12px; }
.pg-item__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.pg-item__name { font-size: 13px; font-weight: 600; color: var(--pg-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-pick--state { font-family: inherit; font-size: 12px; max-width: none; flex: none; }
.pg-item__slot { display: grid; grid-template-columns: 64px auto 1fr; align-items: center; gap: 9px; }
.pg-item__slot + .pg-item__slot { margin-top: 7px; }
.pg-item__lbl { font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--pg-muted); font-weight: 600; }
.pg-item__slot .pg-pick { max-width: none; width: 100%; justify-self: stretch; }

/* ── Specimen frames (states matrix + variant grid + anatomy) ─────────── */
.pg-frames { display: grid; gap: 16px; }
.pg-frames.states  { grid-template-columns: repeat(6, 1fr); }
.pg-frames.grid    { grid-template-columns: 132px 1fr 1fr; gap: 16px 18px; align-items: stretch; }
.pg-frame { border: 1px solid var(--pg-line); border-radius: var(--radius-lg); overflow: hidden; background: var(--pg-panel); display: flex; flex-direction: column; }
.pg-fstage {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 26px 16px; min-height: 96px;
  background: radial-gradient(var(--pg-line) 1px, transparent 1px) 0 0 / 13px 13px;
}
.pg-fcap { font-size: 11.5px; padding: 9px 13px; border-top: 1px solid var(--pg-line); display: flex; flex-direction: column; gap: 2px; }
.pg-fcap .nm { color: var(--pg-ink); font-weight: 600; }
.pg-fcap .pr { font-family: var(--pg-mono); font-size: 10px; color: var(--pg-faint); }
/* grid headers */
.pg-colhead { font-size: 12px; font-weight: 600; color: var(--pg-muted); display: flex; align-items: center; justify-content: center; }
.pg-rowhead { font-size: 13px; font-weight: 600; color: var(--pg-ink); display: flex; flex-direction: column; justify-content: center; align-items: flex-end; text-align: right; gap: 2px; }
.pg-rowhead small { color: var(--pg-faint); font-weight: 400; font-size: 11px; font-family: var(--pg-mono); }

/* ── 6. TOKEN INSPECTOR (slot: tokens) ────────────────────────────────── */
.pg-inspector { border: 1px solid var(--pg-line); border-radius: var(--radius-lg); overflow: hidden; background: var(--pg-panel); }
.pg-toktable { width: 100%; border-collapse: collapse; font-size: 13px; }
.pg-toktable th, .pg-toktable td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--pg-line); vertical-align: middle; }
.pg-toktable th { font-size: 10.5px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--pg-muted); background: var(--pg-panel2); }
.pg-toktable tr:last-child td { border-bottom: none; }
.pg-toktable .grouprow td { background: var(--pg-panel2); font-family: var(--pg-mono); font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--pg-faint); padding: 7px 16px; }
.pg-toktable .role { color: var(--pg-ink); font-weight: 500; white-space: nowrap; }
.pg-toktable .val { font-family: var(--pg-mono); font-size: 11.5px; color: var(--pg-muted); }
.pg-swrow { display: flex; align-items: center; gap: 9px; }
.pg-swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,0.12); flex: none; }
.pg-swatch.empty { background: var(--pg-panel); border: 1.5px dashed var(--pg-faint); }

/* ── 7. ANATOMY (slot: anatomy) ───────────────────────────────────────── */
.pg-anatomy { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.pg-anastage {
  border: 1px solid var(--pg-line); border-radius: var(--radius-lg); background: var(--pg-panel);
  padding: 72px 64px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  background-image: radial-gradient(var(--pg-line) 1px, transparent 1px); background-size: 16px 16px;
}
.pg-measure { display: flex; flex-direction: column; gap: 10px; }
.pg-measure .m { display: flex; align-items: baseline; gap: 10px; padding: 11px 14px; border: 1px solid var(--pg-line); border-radius: var(--radius-md); background: var(--pg-panel); }
.pg-measure .m .k { font-size: 12.5px; color: var(--pg-muted); flex: 1; }
.pg-measure .m .v { font-family: var(--pg-mono); font-size: 12px; color: var(--pg-ink); font-weight: 600; }
.pg-measure .m .t { font-family: var(--pg-mono); font-size: 10px; color: var(--pg-faint); width: 100%; margin-top: 2px; }
.pg-measure .m { flex-wrap: wrap; }

/* anatomy callout guides drawn around the specimen */
.pg-anabox { position: relative; }
.pg-dim { position: absolute; font-family: var(--pg-mono); font-size: 10px; color: var(--pg-accent); background: var(--pg-panel); padding: 1px 5px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--pg-accent) 30%, transparent); white-space: nowrap; }
.pg-guide { position: absolute; background: color-mix(in srgb, var(--pg-accent) 45%, transparent); }

/* ── 8. ACCESSIBILITY (slot: a11y) ────────────────────────────────────── */
.pg-a11y { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.pg-card { border: 1px solid var(--pg-line); border-radius: var(--radius-lg); background: var(--pg-panel); padding: 18px 18px; }
.pg-card h3 { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--pg-muted); font-weight: 600; margin: 0 0 14px; }
.pg-ratio { display: flex; align-items: baseline; gap: 10px; }
.pg-ratio .big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; color: var(--pg-ink); line-height: 1; font-family: var(--pg-mono); }
.pg-ratio .unit { font-size: 14px; color: var(--pg-faint); }
.pg-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; margin-top: 14px; }
.pg-badge v-icon { width: 15px; height: 15px; }
.pg-badge.pass { background: var(--success-bg, #EBF7E3); color: var(--success, #2E5615); }
.pg-badge.fail { background: var(--sys-error-container); color: var(--sys-on-error-container); }
.pg-badge.warn { background: var(--sys-primary-fixed); color: var(--sys-on-primary-fixed); }
.pg-pair { display: flex; gap: 8px; margin-top: 16px; }
.pg-pair .chip { flex: 1; border: 1px solid var(--pg-line); border-radius: var(--radius-sm); padding: 8px 10px; }
.pg-pair .chip .sw { width: 100%; height: 26px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); }
.pg-pair .chip .lb { font-size: 10px; color: var(--pg-faint); margin-top: 6px; }
.pg-pair .chip .tk { font-family: var(--pg-mono); font-size: 10px; color: var(--pg-muted); }
.pg-notes { display: flex; flex-direction: column; gap: 0; }
.pg-note { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--pg-line); }
.pg-note:last-child { border-bottom: none; }
.pg-note v-icon { width: 18px; height: 18px; color: var(--pg-accent); flex: none; margin-top: 1px; }
.pg-note .nbody { font-size: 13.5px; line-height: 1.5; color: var(--pg-muted); }
.pg-note .nbody b { color: var(--pg-ink); font-weight: 600; }
.pg-note .nbody code, .pg-note .nbody .tok { font-size: 11px; }

/* ── Bottom: reproduce-config prompt ──────────────────────────────────── */
.pg-prompt { border: 1px solid var(--pg-line); border-radius: var(--radius-lg); overflow: hidden; background: var(--sys-inverse-surface); }
.pg-prompt .head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.pg-prompt .head .lbl { font-family: var(--pg-mono); font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--sys-inverse-on-surface); opacity: 0.8; }
.pg-prompt .head .spacer { flex: 1; }
.pg-copybtn {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 7px 13px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  background: var(--sys-inverse-primary); color: var(--sys-on-primary);
  transition: filter var(--dur-medium) var(--ease-standard);
}
.pg-copybtn v-icon { width: 15px; height: 15px; }
.pg-copybtn:hover { filter: brightness(1.08); }
.pg-prompt pre {
  margin: 0; padding: 18px 20px; font-family: var(--pg-mono); font-size: 13px; line-height: 1.65;
  color: var(--sys-inverse-on-surface); white-space: pre-wrap; word-break: break-word;
}
.pg-prompt pre .hl { color: var(--sys-inverse-primary); font-weight: 600; }

/* ════════════════════════════════════════════════════════════════════════
 * COMPONENT — Vendoo Button. Built strictly from system tokens (Button spec).
 * Lifted from the design system's canonical Button implementation so the
 * playground previews the real component, not a re-draw.
 * ════════════════════════════════════════════════════════════════════════ */
.btn {
  --sl: transparent; --slp: transparent;
  font: var(--type-label-large); letter-spacing: 0.1px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-xs); position: relative; overflow: hidden;
  white-space: nowrap; padding: 0; isolation: isolate;
  transition: background-color var(--dur-medium) var(--ease-standard);
}
.btn__content { display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.btn::after { content: ""; position: absolute; inset: 0; background: var(--sl); opacity: 0; transition: opacity var(--dur-medium) var(--ease-standard); z-index: 0; }
.btn:hover::after { opacity: 1; }
.btn:active::after { background: var(--slp); opacity: 1; }

/* sizes — Small 48 / Medium 56, icon size coupled to button size */
.btn--small  { height: var(--size-control-default); padding: 0 var(--space-12); }
.btn--small  .btn__content { gap: var(--space-4); }
.btn--small  v-icon { width: var(--size-icon-medium); height: var(--size-icon-medium); }
.btn--medium { height: var(--size-control-large); padding: 0 var(--space-24); }
.btn--medium .btn__content { gap: var(--space-10); }
.btn--medium v-icon { width: var(--size-icon-default); height: var(--size-icon-default); }

/* variants */
.btn--filled  { background: var(--sys-primary); color: var(--sys-on-primary); --sl: var(--state-layers-onPrimary-opacity-0_08); --slp: var(--state-layers-onPrimary-opacity-0_16); }
.btn--tonal   { background: var(--sys-secondary-container); color: var(--sys-on-secondary-container); --sl: var(--state-layers-onSecondaryContainer-opacity-0_08); --slp: var(--state-layers-onSecondaryContainer-opacity-0_16); }
.btn--outline { background: transparent; color: var(--sys-on-surface-variant); border: var(--border-default) solid var(--sys-outline-variant); --sl: var(--state-layers-onSurface-opacity-0_08); --slp: var(--state-layers-onSurface-opacity-0_10); }
.btn--text    { background: transparent; color: var(--sys-primary); --sl: var(--state-layers-primary-opacity-0_08); --slp: var(--state-layers-primary-opacity-0_10); }

/* disabled — LOCKED: onSurface 8% container + content 0.38, never a gray fill */
.btn--disabled, .btn:disabled {
  cursor: not-allowed; background: var(--state-layers-onSurface-opacity-0_08);
  color: var(--sys-on-surface); border: none; --sl: transparent; --slp: transparent;
}
.btn--outline.btn--disabled { background: transparent; border: var(--border-default) solid var(--sys-outline-variant); }
.btn--disabled .btn__content { opacity: var(--state-disabled-content); }
.btn--disabled::after { display: none; }

/* loading dots — Filled / Small in Figma; surfaced for all here */
.btn .dots { display: inline-flex; gap: 4px; align-items: center; }
.btn .dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pgdot 1s infinite ease-in-out; }
.btn .dots i:nth-child(2) { animation-delay: 0.15s; }
.btn .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pgdot { 0%,80%,100% { opacity: 0.35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .btn .dots i { animation: none; opacity: 0.7; } }

/* simulated interaction states (driven by the State control / states matrix) */
.btn.is-hover::after { opacity: 1; }
.btn.is-press::after { background: var(--slp); opacity: 1; }
/* focus ring — DS focus indicator uses the primary color at border-strong */
.btn.is-focus { outline: var(--border-strong) solid var(--sys-primary); outline-offset: 2px; }
.btn.is-focus::after { opacity: 1; }

/* ── Tweak-driven presentation modes ─────────────────────────────────── */
/* chrome density — scales the rhythm between sections + inside control groups */
.pg-wrap[data-density="compact"] .pg-section { margin-top: 36px; }
.pg-wrap[data-density="compact"] .pg-grp { padding: 11px 13px; }
.pg-wrap[data-density="compact"] .pg-fstage { padding: 18px 14px; min-height: 78px; }
.pg-wrap[data-density="comfy"] .pg-section { margin-top: 76px; }
.pg-wrap[data-density="comfy"] .pg-grp { padding: 19px 20px; }
.pg-wrap[data-density="comfy"] .pg-fstage { padding: 34px 18px; min-height: 116px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .pg-live, .pg-anatomy, .pg-a11y { grid-template-columns: 1fr; }
  .pg-frames.states { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .pg-wrap { padding: 0 18px 100px; }
  h1.pg-title { font-size: 36px; }
  .pg-frames.states { grid-template-columns: repeat(2, 1fr); }
  .pg-frames.grid { grid-template-columns: 1fr; }
  .pg-frames.grid .pg-colhead, .pg-frames.grid .pg-rowhead { display: none; }
}
