/* TGC Ultra · AliFilm design guide: liquid glass, film heart. Dark default. */

:root {
  --cta: linear-gradient(120deg, #f0334f, #8e0e3a);
  --cta-glow: rgba(190, 20, 60, 0.38);
  --spring: cubic-bezier(0.34, 1.4, 0.55, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* light (token baseline) */
  --bg: #ffffff;
  --bg-glow: radial-gradient(1200px 600px at 15% -10%, rgba(120, 140, 255, 0.16), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(240, 51, 79, 0.08), transparent 60%);
  --stage: #eef1f8;
  --text: #1c2a5e;
  --text-muted: #6f82c8;
  --accent: #4a5c88;
  --accent-2: #33415f;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(255, 255, 255, 0.9);
  --line: rgba(28, 42, 94, 0.12);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --card: rgba(28, 42, 94, 0.04);
  --card-hover: rgba(28, 42, 94, 0.08);
  --field: rgba(255, 255, 255, 0.85);
  --on-bg: #2a3a5e;
  --on-fg: #ffffff;
  --sel: #d61f4d;
  --sel-rgb: 214, 31, 77;
  --shadow: 0 10px 40px rgba(40, 60, 140, 0.12);
  --sheet-shadow: 0 6px 30px rgba(20, 30, 70, 0.18);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #000;
  --bg-glow: radial-gradient(1200px 600px at 15% -10%, rgba(110, 130, 255, 0.14), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(240, 51, 79, 0.10), transparent 60%);
  --stage: #07080c;
  --text: #f3f5fc;
  --text-muted: #b9c2dd;
  --accent: #c6cff5;
  --accent-2: #e3e8ff;
  --glass: rgba(10, 12, 20, 0.58);
  --glass-border: rgba(255, 255, 255, 0.2);
  --line: rgba(255, 255, 255, 0.12);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --card: rgba(255, 255, 255, 0.05);
  --card-hover: rgba(255, 255, 255, 0.09);
  --field: #14171f;
  --on-bg: #f3f5fc;
  --on-fg: #0a0c12;
  --sel: #ff6b86;
  --sel-rgb: 255, 107, 134;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --sheet-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

html[data-theme="black"] {
  --bg: #000;
  --bg-glow: none;
  --stage: #000;
  --text: #fff;
  --text-muted: #cdd4e8;
  --accent: #d8def9;
  --accent-2: #f0f3ff;
  --glass: #000;
  --glass-border: rgba(255, 255, 255, 0.22);
  --line: rgba(255, 255, 255, 0.16);
  --rim: none;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.07);
  --field: #000;
  --on-bg: #fff;
  --on-fg: #000;
  --sel: #ff6b86;
  --sel-rgb: 255, 107, 134;
  --shadow: none;
  --sheet-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.45 var(--font);
  color: var(--text);
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--rim), var(--shadow);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

/* ---------- header ---------- */
.top {
  height: 56px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  flex: none;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.mark { width: 24px; height: 24px; }
.wordmark { font-weight: 800; letter-spacing: 0.16em; font-size: 12px; }
.steps { flex: 1; display: flex; justify-content: center; gap: 6px; }
.step {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); padding: 6px 12px; border-radius: 999px;
  display: flex; align-items: center; gap: 7px;
}
.step::before {
  content: attr(data-n);
  width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 10px;
}
.step.done { color: var(--text); }
.step.done::before { content: '✓'; background: var(--on-bg); color: var(--on-fg); border-color: transparent; }
.top-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  transition: background .15s, transform .15s;
}
.icon-btn:hover { background: var(--card-hover); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 16px; line-height: 1; }

/* ---------- shell ---------- */
body { display: flex; flex-direction: column; }
.shell {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 360px;
  gap: 12px;
  padding: 0 12px 12px;
}
.rail { border-radius: 20px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.rail-left { padding: 16px 14px 0; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
h2, h3 {
  margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
h3 { color: var(--text-muted); margin-bottom: 10px; }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--card-hover); font-size: 10px; letter-spacing: 0; vertical-align: 1px;
}

/* search */
.search { position: relative; }
.search > svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--text-muted); }
.search input {
  width: 100%; height: 40px; border-radius: 12px; padding: 0 12px 0 36px;
  background: var(--field); border: 1px solid var(--line); outline: none; font-size: 14px;
}
.search input:focus { border-color: var(--sel); box-shadow: 0 0 0 3px rgba(var(--sel-rgb), 0.18); }
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: 46px; margin: 0; padding: 6px;
  list-style: none; border-radius: 14px; max-height: 300px; overflow: auto;
}
html[data-theme="dark"] .suggest { background: rgba(14, 16, 24, 0.94); }
.suggest li { padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--card-hover); }

.row-actions { display: flex; gap: 8px; margin: 10px 0 12px; }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1;
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--text-muted);
  font-weight: 600; font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.ghost:hover { color: var(--text); border-color: var(--text-muted); background: var(--card); }
.ghost svg { width: 15px; height: 15px; }
.ghost.sm { height: 32px; font-size: 11.5px; flex: 0 1 auto; }
.text-btn {
  background: none; border: 0; padding: 6px 4px; color: var(--text-muted); font-weight: 600; font-size: 12px;
}
.text-btn:hover { color: var(--text); }
.text-btn.danger:hover { color: #ff3b5c; }

/* card list */
.card-list { list-style: none; margin: 0 -6px; padding: 0 6px 14px; overflow: auto; flex: 1; }
.ci {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center;
  padding: 6px; border-radius: 12px; position: relative;
}
.ci:hover { background: var(--card); }
.ci img, .ci .ph { width: 40px; height: 56px; border-radius: 3px; object-fit: cover; background: var(--card-hover); }
.ci-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-meta { display: flex; gap: 6px; white-space: nowrap; overflow: hidden; align-items: center; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.tag.art { display: inline-flex; align-items: center; gap: 3px; background: none; color: var(--text-muted); cursor: pointer; }
.tag.art svg { width: 9px; height: 9px; }
.tag.art:hover { color: var(--sel); border-color: var(--sel); }
.tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 30px; }
.qty button { width: 28px; height: 28px; border: 0; background: none; border-radius: 999px; font-size: 15px; color: var(--text-muted); }
.qty button:hover { color: var(--text); background: var(--card-hover); }
.qty input { width: 30px; border: 0; background: none; text-align: center; font-weight: 700; outline: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { display: none; }
.ci .rm {
  position: absolute; right: -2px; top: -2px; width: 20px; height: 20px; border-radius: 999px; border: 0;
  background: var(--glass); color: var(--text-muted); font-size: 10px; opacity: 0; transition: opacity .15s;
}
.ci:hover .rm { opacity: 1; }
.ci .rm:hover { color: #ff3b5c; }
.ci.loading { opacity: 0.5; }

.hover-card {
  position: fixed; z-index: 50; width: 244px; border-radius: 12px; pointer-events: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.empty { text-align: center; color: var(--text-muted); padding: 34px 16px; }
.empty p { margin: 0 0 6px; }

/* ---------- stage ---------- */
.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-bar {
  border-radius: 999px; padding: 6px 8px 6px 14px; display: flex; align-items: center; gap: 12px;
}
.chips { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.chip { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 700; }
.chip + .chip::before { content: '·'; margin-right: 6px; color: var(--line); }
.zoom { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.zoom span { min-width: 34px; text-align: center; }
.warn {
  border-radius: 14px; padding: 10px 14px; font-size: 12.5px;
  background: rgba(255, 123, 84, 0.12); border: 1px solid rgba(255, 123, 84, 0.4); color: var(--text);
}
.sheets {
  flex: 1; min-height: 0; overflow: auto; border-radius: 20px; background: var(--stage);
  border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 30px;
}
.sheet-wrap { margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.sheet-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.sheet { background: #fff; box-shadow: var(--sheet-shadow); display: block; }
.sheet .margin { fill: none; stroke: #8fa0d8; stroke-dasharray: 2 2; }
.sheet-more { margin: 0 auto; color: var(--text-muted); font-size: 12px; }

/* ---------- settings ---------- */
.settings-scroll { flex: 1; overflow: auto; padding: 16px 16px 8px; }
.group { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: 0; }
.group > * + * { margin-top: 10px; }
.group > h3 + * { margin-top: 0; }
.hint { margin: 8px 0 0; color: var(--text-muted); font-size: 11.5px; }

.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.method {
  text-align: left; padding: 10px 11px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  transition: border-color .15s, background .15s, transform .15s;
}
.method:hover { background: var(--card-hover); }
.method:active { transform: scale(0.98); }
.method svg { width: 20px; height: 20px; margin-bottom: 6px; color: var(--text-muted); }
.method b { display: block; font-size: 12px; }
.method small { display: block; color: var(--text-muted); font-size: 10.5px; line-height: 1.35; margin-top: 2px; }
.method[aria-checked="true"] { border-color: var(--sel); box-shadow: 0 0 0 3px rgba(var(--sel-rgb), 0.15); }
.method[aria-checked="true"] svg { color: var(--sel); }

.seg { display: flex; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.seg button {
  flex: 1; height: 30px; border: 0; border-radius: 999px; background: none; font-size: 11.5px; font-weight: 600;
  color: var(--text-muted); padding: 0 6px; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--on-bg); color: var(--on-fg); }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.field select, .field input, .num {
  height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); padding: 0 10px;
  color: var(--text); font-weight: 500; font-size: 13px; outline: none; width: 100%;
}
.field select:focus, .num:focus-within { border-color: var(--sel); }
.num { display: flex; align-items: center; gap: 4px; }
.num input { border: 0; background: none; height: 100%; padding: 0; outline: none; width: 100%; min-width: 0; }
.num input[type="color"] { padding: 6px 0; cursor: pointer; }
.num i { font-style: normal; color: var(--text-muted); font-size: 11px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.slider { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.slider output { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.slider input { grid-column: 1 / -1; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 18px; background: none; width: 100%; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 999px; margin-top: -5.5px;
  background: var(--text); border: 2px solid var(--bg); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 999px; background: var(--text); border: 2px solid var(--bg); }
input[type="range"]:focus-visible::-webkit-slider-thumb { background: var(--sel); }

.toggle { display: flex; align-items: center; gap: 10px; font-size: 12.5px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 34px; height: 20px; border-radius: 999px; background: var(--card-hover); border: 1px solid var(--line); position: relative; flex: none; transition: background .2s; }
.sw::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: translate .25s var(--spring);
}
.toggle input:checked + .sw { background: var(--sel); border-color: transparent; }
.toggle input:checked + .sw::after { translate: 14px 0; }
.toggle input:focus-visible + .sw { outline: 2px solid var(--sel); outline-offset: 2px; }

.back-pick { display: flex; align-items: center; gap: 10px; }
.back-thumb { width: 36px; height: 50px; border-radius: 3px; border: 1px dashed var(--line); background: var(--card) center / cover; flex: none; }

.export { margin: 0; border-width: 1px 0 0; border-radius: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: none; }
.export-row { display: flex; gap: 8px; margin-top: 8px; }
.export-row .ghost { flex: 1; }
.cta {
  width: 100%; height: 46px; border: 0; border-radius: 999px; background: var(--cta); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 22px var(--cta-glow);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.cta:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 28px rgba(190, 20, 60, 0.5); }
.cta:active { transform: scale(0.97); }
.cta:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ---------- modals, toast, drop ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  position: relative; width: 100%; max-width: 420px; max-height: calc(100% - 32px);
  border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  animation: pop .35s var(--spring);
}
html[data-theme="dark"] .modal-card { background: rgba(14, 16, 24, 0.9); }
.modal-card.wide { max-width: 640px; }
.modal-card h3 { color: var(--text); font-size: 12px; margin: 0; }
.modal-card .hint { margin: -4px 0 0; }
.modal-card .text-btn { align-self: center; }
.x { position: absolute; right: 14px; top: 12px; border: 0; background: none; color: var(--text-muted); font-size: 14px; width: 30px; height: 30px; border-radius: 999px; }
.x:hover { background: var(--card-hover); color: var(--text); }
textarea {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--field); padding: 12px;
  font: 12.5px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; resize: vertical; outline: none; min-height: 160px;
}
textarea:focus { border-color: var(--sel); }
.print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; overflow: auto; min-height: 120px; padding: 2px; }
.pr { border: 0; padding: 0; background: none; text-align: left; border-radius: 8px; }
.pr img { width: 100%; aspect-ratio: 488 / 680; border-radius: 6px; display: block; background: var(--card-hover); transition: transform .15s; }
.pr:hover img { transform: translateY(-2px); }
.pr span { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.3; }
.pr.on img { outline: 2px solid var(--sel); outline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 200; translate: -50% 0;
  padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 12.5px; max-width: calc(100% - 32px);
  animation: up .4s var(--spring);
}
html[data-theme="dark"] .toast, html[data-theme="light"] .toast { background: rgba(16, 21, 33, 0.88); color: #f3f5fc; border-color: rgba(255, 255, 255, 0.16); }
html[data-theme="black"] .toast { background: #000; color: #fff; }
.drop {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: rgba(var(--sel-rgb), 0.12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.drop div { border: 2px dashed var(--sel); border-radius: 22px; padding: 40px 50px; font-weight: 700; background: var(--glass); }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }
@keyframes up { from { opacity: 0; translate: -50% 16px; } }

.tabs { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 300px minmax(0, 1fr) 320px; }
  .steps { display: none; }
}
@media (max-width: 960px) {
  body { overflow: hidden; }
  .shell { display: block; padding: 0 10px; margin-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .shell > section { display: none; height: 100%; }
  .shell[data-tab="cards"] #paneCards,
  .shell[data-tab="preview"] #panePreview,
  .shell[data-tab="settings"] #paneSettings { display: flex; }
  .sheets { padding: 16px; }
  .tabs {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
    height: 50px; border-radius: 999px; padding: 4px; gap: 4px; z-index: 60;
  }
  .tabs button { flex: 1; border: 0; background: none; border-radius: 999px; font-weight: 700; font-size: 12px; color: var(--text-muted); }
  .tabs button.on { background: var(--on-bg); color: var(--on-fg); }
  .tabs .count { background: rgba(var(--sel-rgb), 0.2); }
  .export { padding-bottom: 14px; }
  .hover-card { display: none; }
  .ci .rm { opacity: 1; }
}
@media (max-width: 480px) {
  .wordmark { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .stage-bar { border-radius: 18px; flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .icon-btn { width: 32px; height: 32px; }
}

.head-actions { display: flex; align-items: center; gap: 6px; }
.share-url {
  width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--field);
  padding: 0 12px; font: 12px ui-monospace, 'SF Mono', Menlo, monospace; color: var(--text-muted); outline: none;
}
.share-url:focus { border-color: var(--sel); }
.chip.true b { color: #3ccf7a; }
.chip.off b { color: #ff7b54; }

/* ---------- liminal.repair banner ---------- */
.promo {
  flex: none; display: flex; align-items: center; gap: 4px;
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px 16px;
  background: linear-gradient(90deg, rgba(240, 51, 79, 0.14), rgba(110, 130, 255, 0.14));
  border-bottom: 1px solid var(--line); font-size: 12px;
}
html[data-theme="black"] .promo { background: #000; }
.promo a { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--text); text-decoration: none; }
.promo a svg { width: 16px; height: 16px; flex: none; }
.promo a > span:first-of-type { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.promo b { color: var(--text); font-weight: 800; }
.promo-go {
  flex: none; font-weight: 700; font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--cta); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.promo a:hover .promo-go { filter: brightness(1.1); }
.promo-x { border: 0; background: none; color: var(--text-muted); width: 28px; height: 28px; border-radius: 999px; font-size: 11px; flex: none; }
.promo-x:hover { color: var(--text); background: var(--card-hover); }
@media (max-width: 600px) { .promo-long { display: none; } }

/* ---------- search mode + effect results ---------- */
.seg.mini { margin-top: 8px; }
.seg.mini button { height: 26px; font-size: 11px; }
.pr { position: relative; isolation: isolate; }
.pr .have {
  position: absolute; right: 6px; top: 6px; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--cta); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 4px 12px var(--cta-glow);
  z-index: 2; pointer-events: none; /* stay above the hover-lifted image */
}
.ci-qty-badge { color: var(--text); font-weight: 700; }
.promo[hidden] + .top { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }

.toggle.small { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
.toggle.small .sw { transform: scale(0.85); transform-origin: left center; margin-right: -4px; }
.foil-note {
  margin-top: 8px; display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 7px 7px 7px 12px; border-radius: 12px; font-size: 11.5px;
  background: rgba(255, 123, 84, 0.1); border: 1px solid rgba(255, 123, 84, 0.35);
}
.tag.foil { border-color: rgba(255, 123, 84, 0.6); color: #ff7b54; }
.pr.foil::after {
  content: 'FOIL'; position: absolute; left: 6px; top: 6px; z-index: 2; padding: 2px 6px; border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; color: #fff; background: rgba(255, 123, 84, 0.92);
}
.text-btn.inline { padding: 0; color: var(--sel); text-decoration: underline; text-underline-offset: 2px; }

.seg.game { margin-bottom: 10px; }
.seg.game button { height: 32px; font-size: 12px; font-weight: 700; }

.token-note { background: rgba(var(--sel-rgb), 0.08); border-color: rgba(var(--sel-rgb), 0.3); }
.ci { cursor: pointer; }
.ci.sel { background: rgba(var(--sel-rgb), 0.12); box-shadow: inset 0 0 0 1px rgba(var(--sel-rgb), 0.5); }

/* ---------- sheet card popover ---------- */
.sheet .cell { cursor: pointer; }
.sheet .cell:hover image { opacity: 0.85; }
.sheet .hl { pointer-events: none; }
.pop {
  position: fixed; z-index: 90; width: 300px; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px;
  animation: pop .3s var(--spring);
}
html[data-theme="dark"] .pop { background: rgba(14, 16, 24, 0.94); }
.pop .x { top: 8px; right: 8px; }
.pop-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 22px; }
.pop-head img { width: 64px; border-radius: 4px; flex: none; }
.pop-head b { display: block; font-size: 13px; line-height: 1.3; }
.pop-head small { display: block; color: var(--text-muted); font-size: 11px; margin: 2px 0 8px; }
.pop-head .qty { width: max-content; }
.pop-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pop-actions .text-btn { margin-left: auto; }
.pop.sheet-mode {
  left: 10px; right: 10px; width: auto; bottom: calc(66px + env(safe-area-inset-bottom)); top: auto;
}

.pr .have[data-dec] { cursor: pointer; pointer-events: auto; }
.pr .have[data-dec]::after { content: ' −'; font-weight: 700; opacity: 0.8; }
#printMode { margin: 0; }

/* ---------- legal ---------- */
.legal { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.legal p { margin: 0 0 8px; font-size: 10.5px; line-height: 1.5; color: var(--text-muted); opacity: 0.85; }
.legal a { color: inherit; }
.legal-short { margin-top: 18px !important; font-size: 10.5px; opacity: 0.75; }

.pop-art { position: relative; border: 0; padding: 0; background: none; border-radius: 4px; flex: none; cursor: pointer; }
.pop-art img { display: block; }
.pop-art span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; font-size: 9.5px; font-weight: 700; text-align: center;
  color: #fff; background: rgba(0, 0, 0, 0.62); border-radius: 0 0 4px 4px;
}
.pop-art:hover img { filter: brightness(1.08); }
.pop-art:hover span { background: var(--sel); }
