/* =============================================================================
   @elements/style — terminal

   Dark CLI command bar — prompt glyph + command + copy button on a dark
   surface. Generic scoped children — no `.terminal-*` compound classes.

     <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(--term-bg);
  color: var(--term-ink);
  padding: 0.875rem 1rem 0.875rem 1.125rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: text;
  margin-bottom: var(--space-2-5);
  overflow: hidden;
}

:where(.terminal > .prompt) {
  color: var(--term-dim);
  flex-shrink: 0;
  user-select: none;
  font-weight: var(--font-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: #3a3a3a;
  color: inherit;
}

/* Copy button inside a terminal — dark variant of the generic .copy.
   Specificity (0,2,1) wins over .copy from button.css. */

.terminal > button.copy,
.terminal > .copy {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #d8d6d0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--font-medium);
  padding: 0.3125rem 0.6875rem;
  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(--term-ink);
  outline-offset: 2px;
}

.terminal > .copy > .done { display: none; }
.terminal > .copy.is-copied {
  background: #1f3a1c;
  color: var(--term-green);
  border-color: rgba(127, 168, 116, 0.3);
}
.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. Used
   for the license token on /purchase/success and /account.

     <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: 0.875rem;
  background: var(--bg-soft);
  margin-bottom: 0.875rem;
}
:where(.token-row > .key) {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}
:where(.token-row > .val) {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
