/* ss-sheet.css: the one popup look for the whole site (2026-11-24).
 *
 * Measured from the card sheet (DvSheet + .cm-vsheet* in collection.css).
 * Spec: docs/popup-review/SPEC-ONE-SHEET.md. Used by ss-sheet.jsx (React) and
 * ss-sheet-vanilla.js (plain JS). Load AFTER styles.css when the page has it;
 * works without it (every variable has a fallback).
 *
 * <link rel="stylesheet" href="/ss-sheet.css?v=1" />
 *
 * Frame (built by the scripts, you rarely write these by hand):
 *   .ss-sheet-back            backdrop (fixed, dims the page)
 *   .ss-sheet                 the panel; sizes .ss-sheet--wide, .ss-sheet--card
 *   .ss-sheet-head            title row: .ss-sheet-title + .ss-sheet-x (close, 44px)
 *   .ss-sheet-body            scrolls inside itself
 *   .ss-sheet-foot            pinned, solid accent rule above, clears the iPhone home bar
 * Buttons (vertical, full width; Actions builds them):
 *   .ss-sheet-acts            the stack
 *   .ss-sheet-btn + --primary (the ONE filled) | --ghost (outline) | --quiet (plain text)
 *                 + --danger  (red text, never filled) | .is-busy
 * Question: .ss-sheet-ask, .ss-sheet-ask-q, .ss-sheet-ask-detail
 * Text helpers: .ss-sheet-text, .ss-sheet-msg (soft note), .ss-sheet-err, .ss-sheet-eyebrow,
 *               .ss-sheet-row (menu row, like More), .ss-sheet-row-hint,
 *               .ss-sheet-details (a "How this works" fold: <details class="ss-sheet-details"><summary>..)
 * Stepper (the card sheet's quantity pill): .ss-sheet-step, .ss-sheet-step-btn, .ss-sheet-step-n
 * Form controls, for any popup body:
 *   <label class="ss-field"><span class="ss-label">Name</span><input class="ss-input"></label>
 *   <textarea class="ss-input">, <select class="ss-select">
 *   <label class="ss-check"><input type="checkbox"><span>Sleeved</span></label>
 *   <label class="ss-radio"><input type="radio" name="x"><span>Deck</span></label>
 *     add .ss-check--box / .ss-radio--box for the boxed row look; .ss-hint for a quiet line
 *   <div class="ss-chips"><label class="ss-chip"><input type="checkbox"><span>Foil</span></label>
 *                         <button class="ss-chip" aria-pressed="true">NM</button></div>
 * Card sheet: .ss-sheet-card-* (CardSheet builds them).
 * .ss-sheet-scope: put on any wrapper to use these pieces outside a sheet (optional).
 * Stacking: z-index = var(--ss-sheet-z, 100) + 2 per sheet already open. A page
 * whose own overlays sit higher sets :root { --ss-sheet-z: 9600; }.
 */

/* Private tokens, each with a fallback. Declared on the frame and on every
   piece that may be used outside a sheet (a button or row on a page). */
.ss-sheet-back, .ss-sheet-scope, .ss-sheet-acts, .ss-sheet-btn, .ss-sheet-eyebrow, .ss-sheet-row,
.ss-sheet-details, .ss-sheet-step, .ss-sheet-text, .ss-sheet-msg, .ss-sheet-err, .ss-sheet-ask {
  --ss-bg: var(--bg, #f4efe4);
  --ss-bg2: var(--bg-2, #fffdf6);
  --ss-bg3: var(--bg-3, #ece4d5);
  --ss-line: var(--line, rgba(23, 19, 12, 0.16));
  --ss-line2: var(--line-2, rgba(23, 19, 12, 0.34));
  --ss-ink: var(--ink, #17130c);
  --ss-ink2: var(--ink-2, #4a4436);
  --ss-ink3: var(--ink-3, #857d69);
  --ss-ink4: var(--ink-4, #736a55);
  --ss-accent: var(--cm-accent, #D05D25);
  --ss-accent-fg: var(--cm-accent-fg, #ffffff);
  --ss-accent-soft: var(--cm-accent-soft, rgba(208, 93, 37, 0.14));
  --ss-danger: #b3372b;
  --ss-sans: var(--cm-sans, "Archivo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  --ss-mono: var(--cm-mono, "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace);
}
.ss-sheet-back {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  margin: 0; padding: 0;
  background: rgba(23, 19, 12, 0.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  font-family: var(--ss-sans); font-size: 16px; line-height: 1.55; color: var(--ss-ink);
  text-align: left; letter-spacing: normal; text-transform: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  animation: ss-sheet-fade 160ms ease-out;
}
.ss-sheet-back, .ss-sheet-back *, .ss-sheet-back *::before, .ss-sheet-back *::after { box-sizing: border-box; }

.ss-sheet {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: 100%;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  margin: 0; padding: 0; outline: none; overflow: hidden;
  background: var(--ss-bg2); color: var(--ss-ink);
  border: 1px solid var(--ss-line); border-bottom: 0; border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(23, 19, 12, 0.22);
  animation: ss-sheet-rise 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Head: optional title and the round close button. */
.ss-sheet-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  min-height: 60px; margin: 0; padding: 8px 8px 0 16px;
}
.ss-sheet-title {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 0;
  font-family: var(--ss-sans); font-size: 19px; font-weight: 700; line-height: 1.25;
  letter-spacing: -0.01em; text-transform: none; color: var(--ss-ink); overflow-wrap: anywhere;
}
.ss-sheet-x {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0 0 0 auto; padding: 0;
  border: 1px solid var(--ss-line); border-radius: 50%; background: var(--ss-bg2); color: var(--ss-ink);
  font: inherit; line-height: 1; cursor: pointer; touch-action: manipulation; box-shadow: none;
}
.ss-sheet-x svg { display: block; width: 16px; height: 16px; }
.ss-sheet-x:hover { border-color: var(--ss-ink3); }
.ss-sheet-x:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: 2px; }

/* Body scrolls inside itself; the page never moves. */
.ss-sheet-body {
  flex: 1 1 auto; min-height: 0; margin: 0;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 18px 16px 8px;
}
.ss-sheet-head + .ss-sheet-body { padding-top: 10px; }
.ss-sheet-body:last-child { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.ss-sheet-body.is-asking { opacity: 0.4; pointer-events: none; }
/* While a question is open, its answer is the only filled button: a filled button in
   the faded body behind it drops to an outline. */
.ss-sheet-body.is-asking .ss-sheet-btn--primary,
.ss-sheet-body.is-asking .cm-btn--primary {
  background: transparent; color: var(--ss-ink); border-color: var(--ss-line); box-shadow: none;
}

/* Foot: pinned, above the home bar. A solid accent rule marks where the
   scrolling part ends and the pinned buttons begin (owner's ask 11-25: the
   dashed grey line was too faint to see). */
.ss-sheet-foot {
  flex: 0 0 auto; margin: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--ss-accent); background: var(--ss-bg2);
}

/* Card size keeps one height while open, so nothing above a control moves. */
.ss-sheet--card { height: calc(100vh - 24px); height: calc(100dvh - 24px); max-height: 820px; }

@media (min-width: 700px) {
  .ss-sheet-back { align-items: center; padding: 24px; }
  .ss-sheet {
    max-width: 440px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
    border-bottom: 1px solid var(--ss-line); border-radius: 18px;
    box-shadow: 0 24px 64px rgba(23, 19, 12, 0.18);
    animation-name: ss-sheet-pop;
  }
  .ss-sheet--wide { max-width: 640px; }
  .ss-sheet--card { height: min(780px, calc(100vh - 48px)); max-height: calc(100vh - 48px); }
  .ss-sheet-head { padding: 10px 10px 0 22px; }
  .ss-sheet-body { padding: 22px 22px 10px; }
  .ss-sheet-head + .ss-sheet-body { padding-top: 12px; }
  .ss-sheet-body:last-child { padding-bottom: 22px; }
  .ss-sheet-foot { padding: 12px 22px 18px; }
}

@keyframes ss-sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ss-sheet-rise { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes ss-sheet-pop { from { transform: translateY(10px) scale(0.985); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ss-sheet-back, .ss-sheet, .ss-sheet-btn.is-busy::before { animation: none; }
  .ss-sheet-btn { transition: none; }
}

/* ── Buttons: vertical, full width, one filled. */
.ss-sheet-acts { display: flex; flex-direction: column; gap: 8px; margin: 0 0 6px; padding: 0; }
.ss-sheet-foot > .ss-sheet-acts:last-child { margin-bottom: 0; }
.ss-sheet-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: auto; min-height: 46px; margin: 0; padding: 10px 20px;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ss-ink);
  font-family: var(--ss-sans); font-size: 14px; font-weight: 600; line-height: 1.25; letter-spacing: normal;
  text-align: center; text-decoration: none; text-transform: none; white-space: normal; overflow-wrap: anywhere;
  box-shadow: none; cursor: pointer; touch-action: manipulation;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.ss-sheet-btn:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: 3px; }
.ss-sheet-btn--primary {
  background: var(--ss-accent); color: var(--ss-accent-fg); border-color: var(--ss-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px -8px rgba(208, 93, 37, 0.5);
}
.ss-sheet-btn--primary:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); }
.ss-sheet-btn--ghost { background: transparent; color: var(--ss-ink); border-color: var(--ss-line); }
.ss-sheet-btn--ghost:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--ss-ink3); background: var(--ss-bg2); }
.ss-sheet-btn--quiet { background: transparent; border-color: transparent; color: var(--ss-ink3); font-weight: 500; }
.ss-sheet-btn--quiet:hover:not(:disabled):not([aria-disabled="true"]) { color: var(--ss-ink); background: var(--ss-bg3); }
.ss-sheet-btn--danger, .ss-sheet-btn--quiet.ss-sheet-btn--danger { color: var(--ss-danger); }
.ss-sheet-btn--quiet.ss-sheet-btn--danger:hover:not(:disabled) { color: var(--ss-danger); background: var(--ss-bg3); }
.ss-sheet-btn:disabled, .ss-sheet-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.ss-sheet-btn.is-busy { opacity: 0.75; cursor: progress; }
.ss-sheet-btn.is-busy::before {
  content: ""; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: ss-sheet-spin 700ms linear infinite;
}
@keyframes ss-sheet-spin { to { transform: rotate(360deg); } }

/* ── A question inside the sheet (replaces the foot while it is up). */
.ss-sheet-ask { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.ss-sheet-ask-q { margin: 2px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; text-align: center; color: var(--ss-ink); overflow-wrap: anywhere; }
.ss-sheet-ask-detail { margin: -4px 0 0; font-size: 13.5px; line-height: 1.45; text-align: center; color: var(--ss-ink2); overflow-wrap: anywhere; }
.ss-sheet-ask .ss-sheet-acts { margin: 0; }

/* ── Text helpers. */
.ss-sheet-text { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--ss-ink2); }
.ss-sheet-msg { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--ss-accent-soft); font-size: 14px; line-height: 1.45; color: var(--ss-ink); }
.ss-sheet-err { margin: 0 0 12px; font-size: 13.5px; line-height: 1.4; color: var(--ss-danger); font-weight: 600; }
.ss-sheet-eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 4px; padding: 0;
  font-family: var(--ss-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ss-accent);
}
.ss-sheet-eyebrow::before { content: ""; flex: 0 0 auto; width: 22px; height: 1px; background: var(--ss-ink4); }
.ss-sheet-row {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  width: 100%; min-height: 48px; margin: 0; padding: 6px 12px;
  border: 0; border-bottom: 1px dashed var(--ss-line); border-radius: 0; background: transparent; color: var(--ss-ink);
  font-family: var(--ss-sans); font-size: 15px; font-weight: 600; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer;
}
@media (hover: hover) { .ss-sheet-row:hover:not(:disabled) { background: var(--ss-accent-soft); border-radius: 12px; } }
.ss-sheet-row:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: -2px; border-radius: 12px; }
.ss-sheet-row:disabled { opacity: 0.5; cursor: default; }
.ss-sheet-row-hint { font-family: var(--ss-mono); font-size: 11.5px; font-weight: 400; color: var(--ss-ink3); }

/* A fold: "How this works", or a card sheet section. Closed by default. */
.ss-sheet-details { margin: 0; padding: 0; border-bottom: 1px dashed var(--ss-line); }
.ss-sheet-details > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 6px 4px;
  list-style: none; cursor: pointer; color: var(--ss-ink3);
  font-family: var(--ss-mono); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em;
}
.ss-sheet-details > summary::-webkit-details-marker { display: none; }
.ss-sheet-details > summary::after {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin: -3px 4px 0 auto;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.ss-sheet-details[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.ss-sheet-details > summary:hover { color: var(--ss-ink); }
.ss-sheet-details > summary:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: -2px; border-radius: 10px; }
.ss-sheet-details-body { padding: 0 4px 14px; font-size: 14px; line-height: 1.5; color: var(--ss-ink2); }

/* ── The quantity stepper: one soft pill, two round buttons, the number between. */
.ss-sheet-step { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--ss-bg3); }
.ss-sheet-step-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0 0 2px;
  border: 0; border-radius: 50%; background: var(--ss-bg2); color: var(--ss-ink); box-shadow: 0 1px 3px rgba(23, 19, 12, 0.18);
  font: 600 22px/1 var(--ss-sans); cursor: pointer; touch-action: manipulation;
}
.ss-sheet-step-btn:hover:not(:disabled) { color: var(--ss-accent); }
.ss-sheet-step-btn:disabled { opacity: 0.4; cursor: default; }
.ss-sheet-step-n {
  min-width: 52px; height: 44px; margin: 0; padding: 0 4px; border: 0; border-radius: 999px; background: transparent; color: var(--ss-ink);
  font-family: var(--ss-mono); font-size: 20px; font-weight: 700; line-height: 44px; text-align: center;
}
.ss-sheet-step-btn:focus-visible, .ss-sheet-step-n:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: 1px; }

/* ── Form controls in the house style. Cream fill, 12px or pill radius, terracotta focus. */
.ss-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 0; min-width: 0; border: 0; }
.ss-label {
  display: block; margin: 0; padding: 0 0 0 2px;
  font-family: var(--cm-mono, "JetBrains Mono", ui-monospace, Menlo, monospace); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3, #857d69); line-height: 1.4;
}
.ss-hint { display: block; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-3, #857d69); }
.ss-input, .ss-select {
  display: block; width: 100%; min-width: 0; min-height: 46px; margin: 0; padding: 10px 14px;
  border: 1.5px solid var(--line-2, rgba(23, 19, 12, 0.34)); border-radius: 12px;
  background: var(--bg-2, #fffdf6); color: var(--ink, #17130c);
  font-family: var(--cm-sans, "Archivo", "Inter", -apple-system, sans-serif); font-size: 16px; line-height: 1.35;
  box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
textarea.ss-input { min-height: 96px; resize: vertical; }
.ss-input::placeholder { color: var(--ink-3, #857d69); opacity: 1; }
.ss-select {
  border-radius: 999px; padding: 0 44px 0 16px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23857d69' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 12px 8px;
}
.ss-select::-ms-expand { display: none; }
.ss-input:focus, .ss-select:focus, .ss-input:focus-visible, .ss-select:focus-visible {
  border-color: var(--cm-accent, #D05D25); box-shadow: 0 0 0 3px var(--cm-accent-soft, rgba(208, 93, 37, 0.14));
}
.ss-input:disabled, .ss-select:disabled { opacity: 0.55; cursor: not-allowed; }
.ss-input[aria-invalid="true"] { border-color: #b3372b; }

/* Checkbox and radio rows. */
.ss-check, .ss-radio {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 4px 2px;
  font-family: var(--cm-sans, "Archivo", "Inter", -apple-system, sans-serif); font-size: 15px; line-height: 1.35; color: var(--ink, #17130c);
  cursor: pointer; text-transform: none; letter-spacing: normal;
}
.ss-check > input, .ss-radio > input {
  flex: 0 0 auto; position: relative; width: 22px; height: 22px; margin: 0; padding: 0;
  border: 1.5px solid var(--line-2, rgba(23, 19, 12, 0.34)); background: var(--bg-2, #fffdf6) no-repeat center;
  -webkit-appearance: none; appearance: none; cursor: pointer; outline: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.ss-check > input { border-radius: 6px; }
.ss-radio > input { border-radius: 50%; }
.ss-check > input:checked {
  border-color: var(--cm-accent, #D05D25); background-color: var(--cm-accent, #D05D25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11' viewBox='0 0 14 11'%3E%3Cpath d='M1.5 5.5l4 4 7-8' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px 11px;
}
.ss-check > input:indeterminate {
  border-color: var(--cm-accent, #D05D25); background-color: var(--cm-accent, #D05D25);
  background-image: linear-gradient(#ffffff, #ffffff); background-size: 10px 2px;
}
.ss-radio > input:checked { border-color: var(--cm-accent, #D05D25); background-image: radial-gradient(circle, var(--cm-accent, #D05D25) 0 5px, transparent 5.5px); }
.ss-check > input:focus-visible, .ss-radio > input:focus-visible { box-shadow: 0 0 0 3px var(--cm-accent-soft, rgba(208, 93, 37, 0.14)); border-color: var(--cm-accent, #D05D25); }
.ss-check > input:disabled, .ss-radio > input:disabled { opacity: 0.5; cursor: not-allowed; }
.ss-check > span, .ss-radio > span { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
/* Consecutive rows sit at a 44px pitch inside a field. */
.ss-field > .ss-check + .ss-check, .ss-field > .ss-radio + .ss-radio { margin-top: -6px; }
.ss-field > .ss-check--box + .ss-check--box, .ss-field > .ss-radio--box + .ss-radio--box { margin-top: 0; }
.ss-check-text { display: flex; flex-direction: column; gap: 2px; }
/* Boxed row: for a short list of choices (the version add modes look). */
.ss-check--box, .ss-radio--box {
  margin: 0 0 6px; padding: 8px 12px; border: 1px solid var(--line, rgba(23, 19, 12, 0.16)); border-radius: 12px; background: var(--bg-2, #fffdf6);
}
.ss-check--box:has(> input:checked), .ss-radio--box:has(> input:checked) { border-color: var(--cm-accent, #D05D25); background: var(--cm-accent-soft, rgba(208, 93, 37, 0.14)); }

/* Chips: a pill group for short choices. Children are label.ss-chip (with a
   hidden checkbox or radio) or button.ss-chip with aria-pressed. */
.ss-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.ss-chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin: 0; padding: 0 16px;
  border: 1px solid var(--line, rgba(23, 19, 12, 0.16)); border-radius: 999px; background: var(--bg-2, #fffdf6); color: var(--ink, #17130c);
  font-family: var(--cm-sans, "Archivo", "Inter", -apple-system, sans-serif); font-size: 14px; font-weight: 600; line-height: 1.2;
  text-transform: none; letter-spacing: normal; cursor: pointer; touch-action: manipulation; box-shadow: none;
}
.ss-chip > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ss-chip:has(> input:checked), .ss-chip[aria-pressed="true"] {
  border-color: var(--cm-accent, #D05D25); background: var(--cm-accent-soft, rgba(208, 93, 37, 0.14)); color: var(--cm-accent, #D05D25);
}
.ss-chip:has(> input:focus-visible), button.ss-chip:focus-visible { outline: 2px solid var(--cm-accent, #D05D25); outline-offset: 2px; }
.ss-chip:has(> input:disabled), button.ss-chip:disabled { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) { .ss-chip:hover { border-color: var(--ink-3, #857d69); } }

/* ── The card sheet: image, name, one quiet line, then the buttons. */
.ss-sheet-card-stage { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 14px; touch-action: pan-y; }
.ss-sheet-card-frame { position: relative; flex: 0 0 auto; }
.ss-sheet-card-art {
  display: block; width: 220px; aspect-ratio: 488 / 680; overflow: hidden;
  border-radius: 4.75% / 3.4%; background: var(--ss-bg3); box-shadow: 0 8px 24px rgba(23, 19, 12, 0.28);
}
.ss-sheet-card-art img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }
.ss-sheet-card-ph { display: flex; align-items: center; justify-content: center; height: 100%; padding: 12px; text-align: center; color: var(--ss-ink2); font-size: 15px; }
@media (max-height: 700px) { .ss-sheet-card-art { width: 180px; } }
.ss-sheet-card-arrow {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0 0 3px;
  border: 1px solid var(--ss-line); border-radius: 50%; background: var(--ss-bg2); color: var(--ss-ink);
  font: 400 28px/1 var(--ss-sans); cursor: pointer; touch-action: manipulation; box-shadow: none;
}
.ss-sheet-card-arrow:hover:not(:disabled) { border-color: var(--ss-ink3); }
.ss-sheet-card-arrow:disabled { opacity: 0.3; cursor: default; }
.ss-sheet-card-arrow:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: 2px; }
.ss-sheet-card-clip {
  position: absolute; top: -10px; right: -12px; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 1px solid var(--ss-line); border-radius: 50%; background: var(--ss-bg2); color: var(--ss-ink);
  box-shadow: 0 2px 8px rgba(23, 19, 12, 0.22); cursor: pointer; touch-action: manipulation;
}
.ss-sheet-card-clip svg { display: block; width: 18px; height: 18px; }
.ss-sheet-card-clip.is-on { background: var(--ss-accent); border-color: var(--ss-accent); color: var(--ss-accent-fg); }
.ss-sheet-card-clip:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: 2px; }
.ss-sheet-card-head { margin: 0 0 14px; text-align: center; }
.ss-sheet-card-count { margin: 0 0 2px; font-family: var(--ss-mono); font-size: 11px; line-height: 1.4; letter-spacing: 0.08em; color: var(--ss-ink3); }
.ss-sheet-card-name { margin: 0 0 4px; padding: 0; font-family: var(--ss-sans); font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: normal; text-transform: none; color: var(--ss-ink); overflow-wrap: anywhere; }
/* Up to two lines, and two lines of room are always kept, so a long "where it lives"
   list wraps instead of being cut, and the buttons below never move. */
.ss-sheet-card-status {
  margin: 0; min-height: 2.8em; font-family: var(--ss-mono); font-size: 12.5px; line-height: 1.4; color: var(--ss-ink3);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}
.ss-sheet-card-status--accent { color: var(--ss-accent); }
.ss-sheet-card-label { display: block; margin: 0 0 8px; text-align: center; font-family: var(--ss-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ss-ink3); }
.ss-sheet-card-extra { margin: 0 0 16px; }
.ss-sheet-card-secs { margin: 10px 0 0; border-top: 1px dashed var(--ss-line); }

/* Screen-reader only text. */
.ss-sheet-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
