@layer components {
/* =============================================================================
   @elements/style — terminal

   Dark CLI command bar — prompt glyph + command + copy button on a fixed
   dark surface (--terminal-* slots; does not flip in dark mode).

     <div class="terminal">
       <span class="prompt">&gt;</span>
       <span class="cmd">elements license checkout lic_xxx</span>
       <button class="copy">
         <span class="default">copy</span>
         <span class="done">✓ copied</span>
       </button>
     </div>

   Toggle `.is-copied` on the copy button to flip into the confirmed state.

   Inline label above a terminal block uses `<p class="caption">…</p>`.
============================================================================= */

.terminal {
  background: var(--terminal-bg);
  color: var(--terminal-ink);
  padding: var(--space-3-5) var(--space-4);
  border-radius: var(--radius-surface);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: text;
  overflow: hidden;
}

:where(.terminal > .prompt) {
  color: var(--terminal-dim);
  flex-shrink: 0;
  user-select: none;
  font-weight: var(--weight-regular);
}

:where(.terminal > .cmd) {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: none;
}
:where(.terminal > .cmd::-webkit-scrollbar) { display: none; width: 0; height: 0; }
:where(.terminal > .cmd::selection),
:where(.terminal > .cmd *::selection) {
  background: color-mix(in srgb, var(--terminal-ink) 25%, transparent);
  color: inherit;
}

/* Copy button inside a terminal — dark variant. White-alpha washes are
   fine here because the surface is fixed dark in both modes. */

.terminal > button.copy,
.terminal > .copy {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--terminal-ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) 0;
  border-radius: var(--radius-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  flex-shrink: 0;
  height: auto;
  min-width: 0;
  width: 6.5rem;
  text-align: center;
  transition:
    background var(--duration-slow) var(--ease-out),
    border-color var(--duration-slow) var(--ease-out),
    color var(--duration-slow) var(--ease-out);
}
.terminal > .copy:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}
.terminal > .copy:focus-visible {
  outline: 2px solid var(--terminal-ink);
  outline-offset: 2px;
}

.terminal > .copy > .done { display: none; }
.terminal > .copy.is-copied {
  background: var(--success-950);
  color: var(--success-400);
  border-color: color-mix(in srgb, var(--success-400) 30%, transparent);
}
.terminal > .copy.is-copied > .default { display: none; }
.terminal > .copy.is-copied > .done    { display: inline; }

/* Caption above a terminal block. */
.caption {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--ink-soft);
  margin: var(--space-4) 0 var(--space-2);
}

/* ─── Token row (light variant) ─────────────────────────────────
   Inline label + mono value + copy button on a soft background.

     <div class="token-row">
       <span class="key">License token</span>
       <span class="val">lic_xxxxxxxx</span>
       <button class="copy">…</button>
     </div> */

.token-row {
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3-5);
  background: var(--bg-soft);
}
:where(.token-row > .key) {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  flex-shrink: 0;
}
:where(.token-row > .val) {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Inline CLI references in prose ────────────────────────────

     <span class="path">app/pages/home/index.html</span>
     <span class="cli"><span class="prompt">&gt;</span><span class="cmd">elements purchase</span></span> */

.path {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--accent-deep);
  background: var(--bg-panel);
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-xs);
}

.cli {
  font-family: var(--font-mono);
  font-size: 0.875em;
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1-5);
  background: var(--bg-panel);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-xs);
}
:where(.cli > .prompt) { color: var(--ink-dim); }
:where(.cli > .cmd)    { color: var(--accent-deep); font-weight: var(--weight-medium); }

}
