/* ============================================================
   THE LAST PACKET interface layer — shop, admin, cart, glitch FX
   Loads after styles.css and extends the existing palette.
   ============================================================ */
:root {
  --void: #02050d;
  --magenta: #ff2fd6;
  --uv: #a855f7;
  --amber: #ffb347;
  --red: #ff4d6b;
  --green: #57ff8f;
  --line: rgba(103, 235, 255, 0.28);
  --line-dim: rgba(103, 235, 255, 0.14);
  --panel-deep: rgba(6, 12, 24, 0.92);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

/* ---------- fluorescent terminal buttons (site-wide upgrade) ---------- */
.primary-button,
.secondary-button,
.dossier-toggle,
.tbtn {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 2px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(8, 16, 30, 0.85);
  border: 1px solid var(--cyan);
  color: var(--text);
  padding: 0.6rem 1.25rem;
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: none;
}

.tbtn::before {
  content: ">_";
  color: var(--magenta);
  opacity: 0;
  margin-right: 0.15rem;
  transition: opacity 0.15s ease;
}

.tbtn:hover,
.tbtn:focus-visible {
  background: var(--cyan);
  color: #04121a;
  box-shadow: 0 0 18px rgba(103, 235, 255, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.12);
  outline: none;
}

.tbtn:hover::before,
.tbtn:focus-visible::before {
  opacity: 1;
  color: #04121a;
}

.tbtn.mg { border-color: var(--magenta); }
.tbtn.mg:hover, .tbtn.mg:focus-visible { background: var(--magenta); color: #17020f; box-shadow: 0 0 18px rgba(255, 47, 214, 0.55); }
.tbtn.uv { border-color: var(--uv); }
.tbtn.uv:hover, .tbtn.uv:focus-visible { background: var(--uv); color: #0b0518; box-shadow: 0 0 18px rgba(168, 85, 247, 0.55); }
.tbtn.gr { border-color: var(--green); }
.tbtn.gr:hover, .tbtn.gr:focus-visible { background: var(--green); color: #04140a; box-shadow: 0 0 18px rgba(87, 255, 143, 0.55); }
.tbtn.rd { border-color: var(--red); }
.tbtn.rd:hover, .tbtn.rd:focus-visible { background: var(--red); color: #1a040a; box-shadow: 0 0 18px rgba(255, 77, 107, 0.55); }
.tbtn.ghost { border-color: var(--line); color: var(--muted); }
.tbtn.ghost:hover, .tbtn.ghost:focus-visible { background: transparent; color: var(--text); border-color: var(--cyan); box-shadow: 0 0 14px rgba(103, 235, 255, 0.3); }
.tbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.tbtn.big { padding: 0.85rem 2rem; font-size: 0.8rem; min-width: 240px; }

.primary-button:hover,
.secondary-button:hover,
.dossier-toggle:hover {
  box-shadow: 0 0 20px rgba(103, 235, 255, 0.4), inset 0 0 16px rgba(65, 242, 190, 0.14);
}

/* ---------- top-left flickering SHOP button ---------- */
#shop-nav-btn {
  position: fixed;
  top: 1.05rem;
  left: 1.05rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.05rem;
  background: rgba(4, 10, 20, 0.86);
  border: 1px solid var(--magenta);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(255, 47, 214, 0.35), inset 0 0 12px rgba(255, 47, 214, 0.08);
  animation: shop-btn-flicker 7.2s infinite steps(1);
  text-decoration: none;
}

#shop-nav-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--magenta);
  filter: drop-shadow(0 0 5px rgba(255, 47, 214, 0.9));
}

#shop-nav-btn .blink {
  color: var(--magenta);
  animation: caret-blink 1.1s infinite steps(1);
}

#shop-nav-btn:hover,
#shop-nav-btn:focus-visible {
  background: var(--magenta);
  color: #17020f;
  animation: none;
  outline: none;
  box-shadow: 0 0 26px rgba(255, 47, 214, 0.7);
}

#shop-nav-btn:hover svg { fill: #17020f; filter: none; }

@keyframes shop-btn-flicker {
  0%, 100% { opacity: 1; }
  6% { opacity: 0.55; }
  6.6% { opacity: 1; }
  7.4% { opacity: 0.75; }
  8% { opacity: 1; }
  41% { opacity: 1; }
  41.5% { opacity: 0.4; }
  42.2% { opacity: 1; }
  67% { opacity: 0.85; }
  68% { opacity: 1; }
  90% { opacity: 1; }
  90.6% { opacity: 0.5; }
  91.2% { opacity: 1; }
}

@keyframes caret-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* ---------- glitch / FX toggle (sits under the SHOP button) ---------- */
.fx-toggle {
  position: fixed;
  top: 3.8rem;
  left: 1.05rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  background: rgba(4, 10, 20, 0.86);
  border: 1px solid rgba(103, 235, 255, 0.4);
  border-radius: 2px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(103, 235, 255, 0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fx-toggle:hover,
.fx-toggle:focus-visible {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(103, 235, 255, 0.4);
}

.fx-toggle-track {
  position: relative;
  width: 30px;
  height: 15px;
  border-radius: 8px;
  background: rgba(103, 235, 255, 0.18);
  border: 1px solid rgba(103, 235, 255, 0.5);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex: none;
}

.fx-toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(103, 235, 255, 0.9);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.fx-toggle-label { white-space: nowrap; }

/* OFF state */
.fx-toggle[aria-checked="false"] .fx-toggle-track {
  background: rgba(120, 130, 150, 0.12);
  border-color: rgba(120, 130, 150, 0.4);
}
.fx-toggle[aria-checked="false"] .fx-toggle-thumb {
  transform: translateX(15px);
  background: #6b7280;
  box-shadow: none;
}
.fx-toggle[aria-checked="false"] .fx-toggle-label { color: var(--muted); }

/* ---------- lite mode: kill decorative/heavy FX when toggled off ---------- */
html.fx-off #glitch-fx { display: none !important; }

html.fx-off .glitch::before,
html.fx-off .glitch::after,
html.fx-off #shop-nav-btn,
html.fx-off .site-portal-flicker {
  animation: none !important;
}

html.fx-off .fx-glitch,
html.fx-off .fx-glitch-heavy { animation: none !important; }

@media (max-width: 720px) {
  .fx-toggle { top: 3rem; left: 0.7rem; padding: 0.3rem 0.5rem 0.3rem 0.35rem; font-size: 0.54rem; }
}

/* ---------- cart FAB + drawer ---------- */
#cart-fab {
  position: fixed;
  right: 0;
  top: 42%;
  z-index: 40;
  writing-mode: vertical-rl;
  padding: 0.9rem 0.5rem;
  background: rgba(4, 10, 20, 0.9);
  border: 1px solid var(--emerald);
  border-right: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px 0 0 3px;
  box-shadow: 0 0 14px rgba(65, 242, 190, 0.3);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

#cart-fab:hover { background: rgba(65, 242, 190, 0.14); box-shadow: 0 0 22px rgba(65, 242, 190, 0.55); }

#cart-fab .cart-count {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--void);
  background: var(--emerald);
  writing-mode: horizontal-tb;
  font-weight: 700;
  min-width: 1.3rem;
  text-align: center;
  border-radius: 2px;
  letter-spacing: 0;
  padding: 0.05rem 0.2rem;
}

#cart-fab.bump { animation: cart-bump 0.4s ease; }
@keyframes cart-bump { 0% { transform: scale(1); } 35% { transform: scale(1.12); box-shadow: 0 0 30px rgba(65, 242, 190, 0.8); } 100% { transform: scale(1); } }

#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 92vw);
  z-index: 70;
  background: var(--panel-deep);
  border-left: 1px solid var(--emerald);
  box-shadow: -12px 0 46px rgba(2, 5, 13, 0.85), 0 0 32px rgba(65, 242, 190, 0.14);
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1);
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
}

#cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--emerald);
}

.cart-drawer-head button {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  cursor: pointer;
  padding: 0.1rem 0.5rem;
}

.cart-items { flex: 1; overflow-y: auto; padding: 0.6rem 1rem; }

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-dim);
  font-size: 0.78rem;
}

.cart-row .cr-name { color: var(--text); }
.cart-row .cr-price { color: var(--amber); text-align: right; }
.cart-row .cr-qty { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.72rem; }
.cart-row .cr-qty button {
  background: rgba(8, 16, 30, 0.9);
  border: 1px solid var(--line);
  color: var(--cyan);
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
  font-family: var(--mono);
}
.cart-row .cr-qty button:hover { border-color: var(--cyan); box-shadow: 0 0 8px rgba(103, 235, 255, 0.4); }
.cart-row .cr-remove {
  background: none;
  border: none;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  justify-self: end;
  opacity: 0.7;
}
.cart-row .cr-remove:hover { opacity: 1; text-shadow: 0 0 8px rgba(255, 77, 107, 0.7); }

.cart-empty { color: var(--muted); font-size: 0.75rem; padding: 1.4rem 0; text-align: center; letter-spacing: 0.1em; }

.cart-drawer-foot { padding: 0.9rem 1rem 1.1rem; border-top: 1px solid var(--line); }
.cart-total-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.8rem;
  letter-spacing: 0.1em;
}
.cart-total-line b { color: var(--green); }
.cart-drawer-foot .tbtn { width: 100%; margin-bottom: 0.5rem; }

/* ---------- SPA views ---------- */
.app-view { display: none; }
.app-view.is-active { display: block; }

/* route transition warp */
#warp-stage {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
}
#warp-stage.active { display: flex; }
#warp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#warp-label { position: relative; z-index: 2; text-align: center; font-family: var(--mono); }
#warp-label .big { font-size: 1.5rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 20px var(--cyan); }
#warp-label .small { margin-top: 0.6rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; }

/* ---------- screen glitch engine ---------- */
#glitch-fx { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: none; }
body.fx-glitch #glitch-fx { display: block; }

#glitch-fx .gl-bar {
  position: absolute;
  left: 0;
  width: 100%;
  mix-blend-mode: screen;
  background: linear-gradient(90deg, rgba(255, 47, 214, 0.22), rgba(103, 235, 255, 0.2) 45%, transparent 90%);
  animation: gl-bar-shift 0.24s steps(3) infinite;
}

@keyframes gl-bar-shift {
  0% { transform: translateX(-3%); }
  33% { transform: translateX(4%); }
  66% { transform: translateX(-1.5%); }
  100% { transform: translateX(2%); }
}

body.fx-glitch { animation: screen-jitter 0.26s steps(2); }
body.fx-glitch-heavy { animation: screen-jitter-heavy 0.5s steps(4); }

@keyframes screen-jitter {
  0% { transform: translate(0, 0); filter: none; }
  25% { transform: translate(-4px, 2px); filter: hue-rotate(18deg); }
  60% { transform: translate(3px, -2px); }
  100% { transform: translate(0, 0); filter: none; }
}

@keyframes screen-jitter-heavy {
  0% { transform: translate(0, 0) skewX(0); filter: none; }
  15% { transform: translate(-9px, 3px) skewX(1.2deg); filter: hue-rotate(45deg) saturate(1.6); }
  30% { transform: translate(7px, -4px) skewX(-1deg); filter: invert(0.08) hue-rotate(-30deg); }
  55% { transform: translate(-5px, 1px); filter: saturate(2); }
  80% { transform: translate(3px, -1px) skewX(0.6deg); filter: none; }
  100% { transform: translate(0, 0); filter: none; }
}

/* ---------- terminal toast + modal notifications ---------- */
#toast-root {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(460px, 92vw);
  pointer-events: none;
}

.term-toast {
  pointer-events: auto;
  background: var(--panel-deep);
  border: 1px solid var(--emerald);
  box-shadow: 0 0 26px rgba(65, 242, 190, 0.28);
  font-family: var(--mono);
  animation: toast-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.term-toast.warn { border-color: var(--amber); box-shadow: 0 0 26px rgba(255, 179, 71, 0.28); }
.term-toast.bad { border-color: var(--red); box-shadow: 0 0 26px rgba(255, 77, 107, 0.3); }
.term-toast.info { border-color: var(--cyan); box-shadow: 0 0 26px rgba(103, 235, 255, 0.28); }

.term-toast .tt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.32rem 0.65rem;
  border-bottom: 1px solid var(--line-dim);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--emerald);
}
.term-toast.warn .tt-head { color: var(--amber); }
.term-toast.bad .tt-head { color: var(--red); }
.term-toast.info .tt-head { color: var(--cyan); }

.term-toast .tt-head button {
  background: none;
  border: none;
  color: inherit;
  font-family: var(--mono);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 0.1rem;
}

.term-toast .tt-body { padding: 0.55rem 0.7rem 0.65rem; font-size: 0.76rem; line-height: 1.5; color: var(--text); }
.term-toast .tt-body::before { content: "> "; color: var(--magenta); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scaleY(0.7); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.term-modal-back {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(2, 5, 13, 0.78);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.term-modal {
  width: min(620px, 94vw);
  max-height: 86vh;
  overflow: auto;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 46px rgba(139, 99, 255, 0.18);
  font-family: var(--mono);
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes modal-in { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }

.term-modal .tm-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--line-dim);
  background: rgba(10, 18, 32, 0.9);
}
.term-modal .tm-chrome span { font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.term-modal .tm-chrome button { background: none; border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); cursor: pointer; padding: 0.05rem 0.5rem; }
.term-modal .tm-chrome button:hover { color: var(--red); border-color: var(--red); }

.term-modal .tm-body { padding: 1.1rem 1.35rem 1.25rem; }
.term-modal .tm-eyebrow { font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--magenta); margin: 0 0 0.5rem; }
.term-modal h3 { margin: 0 0 0.8rem; font-family: "Orbitron", var(--mono); font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.term-modal p { color: #cfe3f1; line-height: 1.65; font-size: 0.8rem; margin: 0 0 0.75rem; }
.term-modal .tm-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

/* terminal form fields */
.tfield { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; }
.tfield label { font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.tfield input,
.tfield select,
.tfield textarea {
  background: rgba(4, 10, 20, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.55rem 0.7rem;
  outline: none;
  border-radius: 2px;
}
.tfield input:focus, .tfield select:focus, .tfield textarea:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(103, 235, 255, 0.25); }
.tfield textarea { min-height: 90px; resize: vertical; }
.tfield-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.tfield-check { flex-direction: row; align-items: center; gap: 0.55rem; }
.tfield-check input { accent-color: var(--magenta); width: 1rem; height: 1rem; }

/* ============================================================
   SHOP
   ============================================================ */
#view-shop, #view-cart, #view-checkout, #view-admin {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  font-family: var(--mono);
}

.shop-shell {
  position: relative;
  max-width: 1475px;
  margin: 0 auto;
  padding: 4.6rem 1.4rem 7rem;
  z-index: 2;
}

#shop-3d { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.85; }

.shop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  padding: 0.7rem 1rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow);
}

.shop-topbar .st-title { font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text); }
.shop-topbar .st-title em { color: var(--magenta); font-style: normal; }
.shop-topbar .st-status { font-size: 0.62rem; letter-spacing: 0.2em; color: var(--green); text-transform: uppercase; }
.shop-topbar .st-status::before { content: "● "; animation: caret-blink 1.6s infinite steps(1); }

.shop-main { display: grid; grid-template-columns: minmax(375px, 500px) 1fr; gap: 1.6rem; align-items: start; }

/* ---------- 90s featured ad ---------- */
.store-feature {
  position: relative;
  border: 3px double var(--amber);
  background:
    repeating-linear-gradient(45deg, rgba(255, 179, 71, 0.045) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, rgba(20, 12, 34, 0.96), rgba(6, 8, 20, 0.98));
  padding: 1.3rem 1.2rem 1.4rem;
  box-shadow: 0 0 34px rgba(255, 179, 71, 0.16), inset 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.store-feature .ad-banner {
  position: absolute;
  top: 14px;
  right: -44px;
  transform: rotate(38deg);
  background: var(--magenta);
  color: #17020f;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding: 0.28rem 3rem;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(255, 47, 214, 0.6);
}

.store-feature .ad-eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 0.55rem;
}

.store-feature h2 {
  font-family: "Orbitron", var(--mono);
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.06;
  margin: 0 0 0.9rem;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 8px rgba(232, 224, 255, 0.5), 0 0 26px rgba(255, 47, 214, 0.45);
}

.store-feature .ad-screen {
  position: relative;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 47, 214, 0.2), transparent 62%),
    radial-gradient(circle at 50% 60%, rgba(103, 235, 255, 0.14), transparent 55%),
    #030710;
  height: 190px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  overflow: hidden;
}

.store-feature .ad-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.store-feature .ad-glyph { font-size: 4.6rem; filter: drop-shadow(0 0 18px rgba(255, 47, 214, 0.85)); animation: ad-glyph-float 5s ease-in-out infinite; }
@keyframes ad-glyph-float { 0%, 100% { transform: translateY(4px) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }

.store-feature .ad-tagline { font-size: 0.72rem; letter-spacing: 0.12em; color: var(--amber); text-transform: uppercase; margin: 0 0 0.6rem; }
.store-feature .ad-desc { font-size: 0.78rem; line-height: 1.65; color: #cfe3f1; margin: 0 0 1rem; }

.store-feature .ad-priceline { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }

.store-feature .ad-price {
  position: relative;
  font-family: "Orbitron", var(--mono);
  font-size: 1.45rem;
  font-weight: 900;
  color: #171003;
  background: var(--amber);
  padding: 0.45rem 0.9rem;
  transform: rotate(-3deg);
  clip-path: polygon(3% 12%, 8% 0, 94% 4%, 100% 22%, 97% 88%, 90% 100%, 6% 96%, 0 78%);
  box-shadow: 0 0 26px rgba(255, 179, 71, 0.55);
  animation: price-pulse 2.4s ease-in-out infinite;
}
.store-feature .ad-price small { display: block; font-size: 0.48rem; letter-spacing: 0.28em; font-weight: 700; }
@keyframes price-pulse { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(-3deg) scale(1.05); } }

.store-feature .ad-footnote { margin-top: 0.9rem; font-size: 0.56rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

/* ---------- category tiles ---------- */
.shop-catalog h2.sc-heading {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  font-weight: 500;
}
.shop-catalog h2.sc-heading em { color: var(--cyan); font-style: normal; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.cat-tile {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  padding: 1.5rem 1.2rem 1.3rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--mono);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  overflow: hidden;
}

.cat-tile::after {
  content: attr(data-index);
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.cat-tile .ct-glyph { font-size: 2.1rem; display: block; margin-bottom: 0.7rem; filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.7)); }
.cat-tile .ct-name { font-size: 0.95rem; letter-spacing: 0.24em; text-transform: uppercase; display: block; margin-bottom: 0.35rem; }
.cat-tile .ct-sub { font-size: 0.66rem; color: var(--muted); letter-spacing: 0.08em; }
.cat-tile .ct-count { position: absolute; bottom: 0.7rem; right: 0.8rem; font-size: 0.6rem; color: var(--cyan); letter-spacing: 0.14em; }

.cat-tile:hover, .cat-tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--magenta);
  box-shadow: 0 0 24px rgba(255, 47, 214, 0.3), inset 0 0 22px rgba(168, 85, 247, 0.1);
  outline: none;
}

/* ---------- product grid ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 1rem; }

.prod-card {
  border: 1px solid var(--line);
  background: var(--panel-deep);
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
}

.prod-card:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 0 22px rgba(103, 235, 255, 0.25); }

.prod-card .pc-art {
  height: 120px;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  background:
    radial-gradient(circle at 50% 55%, rgba(139, 99, 255, 0.22), transparent 65%),
    #050a16;
  border-bottom: 1px solid var(--line-dim);
  position: relative;
  overflow: hidden;
}
.prod-card .pc-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px);
}
/* ---------- blur-fill image treatment (cards, ad, modal) ---------- */
.img-fill {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
}
.img-fill .if-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.25);
  filter: blur(22px) saturate(1.25) brightness(0.7);
  opacity: 0.75;
  z-index: 0;
}
.img-fill .if-main {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
}
.img-fill[data-zoom] { cursor: zoom-in; }
.img-fill[data-zoom]:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }

/* ---------- full-screen image viewer ---------- */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
  background: rgba(2, 5, 13, 0.9);
  cursor: zoom-out;
  animation: modal-in 0.2s ease;
}
.img-lightbox .ilb-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
  filter: blur(40px) saturate(1.2) brightness(0.5);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}
.img-lightbox .ilb-main {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  object-fit: contain;
  border: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 99, 255, 0.2);
}
.img-lightbox .ilb-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: rgba(4, 10, 20, 0.86);
  border: 1px solid var(--magenta);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(255, 47, 214, 0.35);
}
.img-lightbox .ilb-close:hover { background: var(--magenta); color: #17020f; }

.prod-card .pc-body { padding: 0.75rem 0.85rem 0.9rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.prod-card .pc-name { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.prod-card .pc-tag { font-size: 0.64rem; color: var(--muted); line-height: 1.5; flex: 1; }
.prod-card .pc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }
.prod-card .pc-price { color: var(--amber); font-size: 0.85rem; }
.prod-card .pc-stock { font-size: 0.56rem; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.prod-card .pc-stock.low { color: var(--red); }
.prod-card .tbtn { margin: 0 0.85rem 0.85rem; font-size: 0.62rem; padding: 0.45rem 0.6rem; }

.prod-back-row { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ---------- shop dock (game-style bottom nav) ---------- */
.shop-dock {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 0.45rem;
  padding: 0.4rem;
  background: rgba(4, 10, 20, 0.88);
  border: 1px solid var(--line);
  box-shadow: 0 0 26px rgba(2, 5, 13, 0.8);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 96vw;
}

.dock-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dock-btn:hover { color: var(--text); border-color: var(--uv); box-shadow: 0 0 14px rgba(168, 85, 247, 0.4); }
.dock-btn.on { color: var(--magenta); border-color: var(--magenta); text-shadow: 0 0 10px rgba(255, 47, 214, 0.7); }

/* ---------- cart + checkout pages ---------- */
.page-panel {
  max-width: 1075px;
  margin: 0 auto;
  padding: 5.2rem 1.4rem 6rem;
  position: relative;
  z-index: 2;
}

.page-panel .pp-box { border: 1px solid var(--line); background: var(--panel-deep); padding: 1.4rem 1.6rem 1.6rem; box-shadow: var(--shadow); }
.page-panel h1 { font-family: "Orbitron", var(--mono); font-size: 1.2rem; letter-spacing: 0.22em; text-transform: uppercase; margin: 0 0 1.2rem; color: var(--text); }
.page-panel h1 em { color: var(--emerald); font-style: normal; }

table.tl-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; margin: 0 0 1rem; }
table.tl-table th {
  color: var(--muted);
  text-align: left;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
table.tl-table td { padding: 0.55rem; border-bottom: 1px solid var(--line-dim); color: var(--text); }
table.tl-table tr.clickable { cursor: pointer; }
table.tl-table tr.clickable:hover td { background: rgba(103, 235, 255, 0.05); color: var(--cyan); }
table.tl-table .num { text-align: right; }
table.tl-table .amber { color: var(--amber); }

.checkout-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.4rem; align-items: start; }
.checkout-summary { border: 1px solid var(--line-dim); padding: 1rem; font-size: 0.75rem; }
.checkout-summary .cs-row { display: flex; justify-content: space-between; padding: 0.3rem 0; color: var(--muted); }
.checkout-summary .cs-row.total { border-top: 1px solid var(--line); margin-top: 0.5rem; padding-top: 0.65rem; color: var(--text); font-size: 0.85rem; }
.checkout-summary .cs-row.total b { color: var(--green); }
/* A discount reads as a credit, so it gets its own colour and a minus sign. */
.checkout-summary .cs-row.cs-discount,
.checkout-summary .cs-row.cs-discount b { color: var(--magenta); }
.cs-code { border-top: 1px solid var(--line-dim); margin-top: 0.75rem; padding-top: 0.75rem; }
.cs-code label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.cs-code-row { display: flex; gap: 0.5rem; }
.cs-code-row input {
  flex: 1;
  min-width: 0;
  background: rgba(2, 8, 16, 0.9);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.5rem 0.6rem;
  text-transform: uppercase;
}
.cs-code-row input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 12px rgba(103, 235, 255, 0.25); }
.cs-code-row .tbtn { padding: 0.5rem 0.9rem; min-width: 0; }
.cs-code-on { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin: 0; color: var(--green); font-size: 0.7rem; }
.cs-code-drop { background: none; border: none; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: 0.66rem; }
.cs-code-drop:hover { color: var(--red); }
.cs-code-err { margin: 0.5rem 0 0; color: var(--red); font-size: 0.68rem; }
/* Says plainly that this checkout is not the cart, so a shopper mid-buy-now
   never wonders where the rest of their basket went. */
.buynow-note {
  border: 1px solid var(--magenta);
  background: rgba(255, 47, 214, 0.07);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  margin: 0 0 1rem;
  font-size: 0.72rem;
  line-height: 1.5;
}
.buynow-note b { color: var(--magenta); letter-spacing: 0.16em; }
.buynow-note button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0;
  margin-left: 0.35rem;
}
.buynow-note button:hover { color: var(--cyan); }

/* Category section headers inside the admin product table. */
table.tl-table tr.pf-group td {
  background: rgba(103, 235, 255, 0.06);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-dim);
  padding: 0.5rem 0.55rem;
}
table.tl-table tr.pf-group:hover td { color: inherit; }
/* Status filter chips above the admin orders table. */
.ord-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.9rem; }
.ord-chip {
  background: rgba(5, 12, 24, 0.85);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.38rem 0.7rem;
}
.ord-chip span {
  margin-left: 0.4rem;
  color: var(--text);
  font-size: 0.6rem;
}
.ord-chip:hover { border-color: var(--cyan); color: var(--cyan); }
.ord-chip.on { border-color: var(--cyan); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(103, 235, 255, 0.15); }

/* Per-row duplicate control in the admin product table. */
.pf-dup {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.pf-dup:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.pf-dup:disabled { opacity: 0.4; cursor: wait; }

.pf-group-name {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}
/* Unseen-since-last-visit count on an admin tab. */
.tab-badge {
  display: inline-block;
  min-width: 1.15rem;
  margin-left: auto;
  padding: 0.05rem 0.32rem;
  border-radius: 999px;
  background: var(--magenta);
  color: #17020f;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0;
}
/* On a filled tab the badge has to invert — a coloured pill on a magenta or
   cyan field is unreadable. */
.admin-tab.on .tab-badge,
.admin-tab:hover .tab-badge { background: rgba(0, 0, 0, 0.55); color: #ffffff; }

.pf-group-n {
  margin-left: 0.6rem;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.06rem 0.4rem;
}
.checkout-shell { display: flex; flex-direction: column; gap: 1rem; }
.checkout-tabs { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.checkout-tab {
  background: rgba(5, 12, 24, 0.85);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.checkout-tab.is-active { border-color: var(--cyan); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(103, 235, 255, 0.15), 0 0 16px rgba(103, 235, 255, 0.12); }
.checkout-panel { display: none; }
.checkout-panel.is-active { display: block; }
.summary-card { border: 1px solid var(--line-dim); padding: 0.95rem; margin-bottom: 1rem; background: rgba(4, 10, 20, 0.5); }
.account-card {
  border: 1px solid rgba(103, 235, 255, 0.2);
  background: linear-gradient(180deg, rgba(11, 22, 39, 0.95), rgba(7, 14, 28, 0.92));
  padding: 1rem;
  box-shadow: inset 0 0 0 1px rgba(103, 235, 255, 0.05);
}
.account-card.compact { margin: 1rem 0; }
.account-card.gated { max-width: 560px; }
.order-kicker { margin: 0 0 0.45rem; font-size: 0.62rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--cyan); }
.order-meta { margin: 0; font-size: 0.72rem; color: var(--muted); line-height: 1.7; }
.account-card h3 { margin: 0 0 0.45rem; font-family: "Orbitron", var(--mono); font-size: 0.92rem; letter-spacing: 0.08em; text-transform: uppercase; }
.customer-login-form { margin-top: 1rem; }
.checkout-note { font-size: 0.64rem; color: var(--muted); line-height: 1.7; margin: 0 0 1rem; }
.checkout-optin {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.95rem 1rem;
  margin: 1rem 0;
  border: 1px solid rgba(168, 85, 247, 0.36);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.1), rgba(255, 47, 214, 0.06));
  cursor: pointer;
}
.checkout-optin input { margin-top: 0.18rem; width: 1.1rem; height: 1.1rem; accent-color: var(--magenta); }
.checkout-optin strong { display: block; font-size: 0.84rem; color: var(--text); margin-bottom: 0.25rem; }
.checkout-optin small { display: block; color: var(--muted); line-height: 1.6; font-size: 0.7rem; }
.password-wrap[hidden] { display: none; }
.history-empty {
  border: 1px dashed var(--line);
  padding: 1rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
  background: rgba(4, 10, 20, 0.42);
}
.history-empty p { margin: 0; }
.order-history-list { display: grid; gap: 1rem; }
.order-card {
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.72);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.order-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 0.9rem; }
.order-card-head h3 { margin: 0 0 0.25rem; font-size: 0.98rem; }
.reorder-btn { min-width: 180px; justify-content: center; }
.order-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.order-items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  border-top: 1px solid var(--line-dim);
  padding-top: 0.55rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.order-item-stage { display: block; margin-top: 0.25rem; color: var(--cyan); font-size: 0.62rem; letter-spacing: 0.05em; }
.order-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0 0 1rem; padding: 0; }
.order-progress li { position: relative; display: grid; justify-items: center; gap: 0.4rem; color: var(--muted); text-align: center; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; }
.order-progress li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 0.78rem; left: calc(50% + 0.8rem); width: calc(100% - 1.6rem); height: 1px; background: var(--line); }
.order-progress li span { position: relative; z-index: 1; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-deep); }
.order-progress li.done, .order-progress li.current { color: var(--green); }
.order-progress li.done span, .order-progress li.current span { border-color: var(--green); box-shadow: 0 0 12px rgba(61, 255, 142, 0.25); }
.order-progress li.done:not(:last-child)::after { background: var(--green); }
.order-progress li.current { color: var(--amber); }
.order-progress li.current span { border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 190, 59, 0.3); }
.order-tracking { margin: -0.35rem 0 1rem; color: var(--cyan); font-size: 0.72rem; }
.order-item-fulfillment { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 0.4rem; min-width: 430px; }
.order-item-fulfillment select, .order-item-fulfillment input { min-width: 0; border: 1px solid var(--line); background: rgba(4, 10, 20, 0.92); color: var(--text); padding: 0.45rem 0.5rem; font: 0.68rem var(--mono); }
.order-item-fulfillment select:focus, .order-item-fulfillment input:focus { outline: none; border-color: var(--cyan); }
.order-artsadd-download { margin-top: 0.8rem; }

/* ============================================================
   ADMIN
   ============================================================ */
/* The admin is a work surface, not a reading column: the products table has
   nine columns and would otherwise scroll sideways on a monitor with room to
   spare. The cap rises in steps so it never outgrows the screen it is on. */
.admin-shell { max-width: 1580px; margin: 0 auto; padding: 5.2rem 1.4rem 6rem; position: relative; z-index: 2; }

@media (min-width: 1700px) {
  .admin-shell { max-width: 1840px; padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 2000px) {
  .admin-shell { max-width: 96vw; }
  /* A little more room for the section rail once the pane is comfortable. */
  .admin-workspace { grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; }
}

.admin-login {
  max-width: 525px;
  margin: 10vh auto 0;
  border: 1px solid var(--magenta);
  background: var(--panel-deep);
  padding: 1.6rem 1.8rem 1.8rem;
  box-shadow: 0 0 40px rgba(255, 47, 214, 0.18);
}
.admin-login .al-eyebrow { font-size: 0.6rem; letter-spacing: 0.32em; color: var(--magenta); text-transform: uppercase; margin: 0 0 0.5rem; }
.admin-login h1 { font-family: "Orbitron", var(--mono); font-size: 1.1rem; letter-spacing: 0.18em; margin: 0 0 1.1rem; text-transform: uppercase; }
.admin-login .al-hint { font-size: 0.66rem; color: var(--muted); margin-top: 0.9rem; line-height: 1.6; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  padding: 0.7rem 1rem;
  margin-bottom: 1.1rem;
}
.admin-topbar .at-title { font-size: 0.74rem; letter-spacing: 0.28em; text-transform: uppercase; }
.admin-topbar .at-title em { color: var(--amber); font-style: normal; }
.admin-topbar .at-user { font-size: 0.64rem; color: var(--muted); letter-spacing: 0.1em; }
.admin-topbar .at-user b { color: var(--green); }

.admin-workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1rem; align-items: start; }
.admin-nav,
.admin-side,
.admin-pane {
  border: 1px solid var(--line);
  background: var(--panel-deep);
  box-shadow: var(--shadow);
}
.admin-nav,
.admin-side { position: sticky; top: 5rem; padding: 1rem; }
.admin-nav-kicker,
.admin-side-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
}
/* The section rail reads as a column of terminal buttons, matching .tbtn:
   same ground, border, ">_" prefix and transition. The active section is a
   solid magenta fill rather than a magenta outline, so the tab you are on is
   unmistakable at a glance. */
.admin-tabs { display: flex; flex-direction: column; gap: 0.45rem; }
.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: rgba(8, 16, 30, 0.85);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.admin-tab::before {
  content: ">_";
  color: var(--magenta);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.admin-tab:hover,
.admin-tab:focus-visible {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04121a;
  box-shadow: 0 0 18px rgba(103, 235, 255, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.12);
  outline: none;
}
.admin-tab:hover::before,
.admin-tab:focus-visible::before { opacity: 1; color: #04121a; }

.admin-tab.on {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #17020f;
  box-shadow: 0 0 18px rgba(255, 47, 214, 0.55);
}
.admin-tab.on::before { opacity: 1; color: #17020f; }
/* Hovering the section you are already on keeps it magenta rather than
   flipping to cyan, which read as a different selection. */
.admin-tab.on:hover,
.admin-tab.on:focus-visible {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #17020f;
  box-shadow: 0 0 22px rgba(255, 47, 214, 0.7);
}

.admin-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; min-width: 0; }
.admin-pane {
  padding: 1.35rem 1.5rem 1.55rem;
  min-width: 0;
  background:
    radial-gradient(circle at 88% 0%, rgba(103, 235, 255, 0.08), transparent 28%),
    linear-gradient(155deg, rgba(10, 22, 38, 0.98), rgba(4, 10, 20, 0.96));
}
.admin-pane .ap-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-pane .ap-note { font-size: 0.66rem; color: var(--muted); line-height: 1.7; }
.admin-pane .ap-note b { color: var(--amber); }
.admin-side {
  position: static;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 1rem;
}
.admin-side > .admin-side-card:first-child { grid-column: span 2; }
.admin-side[hidden] { display: none !important; }
.admin-side-card {
  border: 1px solid var(--line-dim);
  background: rgba(4, 10, 20, 0.55);
  padding: 0.9rem;
}
.admin-side-card h3 {
  margin: 0 0 0.35rem;
  font-family: "Orbitron", var(--mono);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-jump-list { display: grid; gap: 0.45rem; }
.admin-jump-btn { width: 100%; justify-content: center; }

.badge { display: inline-block; font-size: 0.56rem; letter-spacing: 0.18em; text-transform: uppercase; border: 1px solid var(--line); padding: 0.14rem 0.5rem; color: var(--muted); }
.badge.ok { border-color: var(--green); color: var(--green); }
.badge.warn { border-color: var(--amber); color: var(--amber); }
.badge.feat { border-color: var(--magenta); color: var(--magenta); }

.overview-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.overview-range-group { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: flex-start; }
.overview-range {
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.7);
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.overview-range.on,
.overview-range:hover { color: var(--cyan); border-color: var(--cyan); }
.overview-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.overview-kpi {
  border: 1px solid var(--line-dim);
  background:
    linear-gradient(120deg, rgba(103, 235, 255, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(11, 22, 39, 0.96), rgba(7, 14, 28, 0.92));
  padding: 1.05rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.overview-kpi::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--magenta), transparent 86%); opacity: .65; }
.overview-kpi:hover { transform: translateY(-2px); border-color: rgba(103, 235, 255, .48); box-shadow: 0 12px 30px rgba(0, 0, 0, .24), 0 0 20px rgba(103, 235, 255, .08); }
.overview-kpi span,
.overview-kpi small,
.overview-mini-grid span,
.overview-row span,
.ticket-item small,
.overview-watch-item span,
.overview-watch-item em {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.6;
}
.overview-kpi strong {
  display: block;
  margin: 0.4rem 0 0.35rem;
  font-family: "Orbitron", var(--mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--text);
}
.overview-card-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 1rem; }
.overview-card {
  border: 1px solid var(--line-dim);
  background: rgba(4, 10, 20, 0.52);
  padding: 1rem;
  min-width: 0;
}
.overview-chart-card {
  width: 100%;
  margin-bottom: 1rem;
  padding: 1.1rem 1rem .7rem;
  background:
    linear-gradient(180deg, rgba(10, 23, 39, .82), rgba(3, 9, 18, .92)),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(103, 235, 255, .025) 60px);
  border-color: rgba(103, 235, 255, .26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 45px rgba(0,0,0,.18);
}
.chart-card-head { align-items: flex-start; }
.chart-card-head > div:first-child { max-width: 650px; }
.chart-card-head .admin-side-kicker { margin-bottom: .35rem; }
.chart-card-head h3 { font-size: 1rem; }
.chart-card-head p { margin-top: .4rem; line-height: 1.6; }
.chart-legend { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: .45rem; font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chart-legend span::before { content: ""; width: 18px; height: 3px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chart-legend .gross { color: var(--cyan); }
.chart-legend .captured { color: var(--magenta); }
.chart-legend .orders { color: var(--amber); }
.chart-legend .orders::before { height: 9px; opacity: .5; box-shadow: none; }
.overview-sales-chart { position: relative; width: 100%; min-height: 330px; touch-action: pan-y; overflow: hidden; }
.sales-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid path { display: none; }
.chart-grid line { stroke: rgba(103, 235, 255, .1); stroke-dasharray: 3 6; }
.chart-axis path,
.chart-axis line { stroke: rgba(103, 235, 255, .22); }
.chart-axis text { fill: #70849a; font-family: var(--mono); font-size: 10px; }
.chart-axis-orders text { fill: rgba(255, 179, 71, .72); }
.order-bar { fill: rgba(255, 179, 71, .15); stroke: rgba(255, 179, 71, .25); transition: fill .15s ease; }
.order-bar:hover { fill: rgba(255, 179, 71, .3); }
.sales-area { fill: url(#overview-sales-gradient); }
.sales-line { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.sales-line.gross { stroke: var(--cyan); }
.sales-line.captured { stroke: var(--magenta); stroke-width: 1.6; stroke-dasharray: 5 5; }
.chart-overlay { fill: transparent; cursor: crosshair; }
.chart-focus-line { stroke: rgba(255,255,255,.3); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-focus-dot { fill: #07101d; stroke: var(--cyan); stroke-width: 3; filter: drop-shadow(0 0 7px var(--cyan)); }
.sales-chart-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: .2rem;
  width: 200px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .12s ease, transform .12s ease;
  border: 1px solid rgba(103, 235, 255, .48);
  background: rgba(3, 9, 18, .96);
  box-shadow: 0 14px 35px rgba(0,0,0,.42), 0 0 22px rgba(103,235,255,.1);
  padding: .72rem .8rem;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.45;
}
.sales-chart-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.sales-chart-tooltip b { color: var(--text); margin-bottom: .2rem; }
.sales-chart-tooltip span:nth-child(2) { color: var(--cyan); }
.sales-chart-tooltip span:nth-child(3) { color: var(--magenta); }
.chart-empty { min-height: 260px; display: grid; place-items: center; color: var(--amber); font-size: .7rem; text-align: center; }
.overview-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 0.8rem; }
.overview-card-head h3 { margin: 0; font-family: "Orbitron", var(--mono); font-size: 0.88rem; letter-spacing: 0.08em; text-transform: uppercase; }
.overview-card-head p { margin: 0; font-size: 0.64rem; color: var(--muted); }
.overview-list,
.ticket-feed { display: grid; gap: 0.7rem; }
.overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
  gap: 0.9rem;
  align-items: center;
  border-top: 1px solid var(--line-dim);
  padding-top: 0.7rem;
}
.overview-row:first-child { border-top: 0; padding-top: 0; }
.overview-row p,
.ticket-item b,
.overview-watch-item b { margin: 0; color: var(--text); }
.overview-bar-wrap { display: grid; gap: 0.35rem; justify-items: end; }
.overview-bar {
  width: 100%;
  height: 0.5rem;
  border: 1px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.overview-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.65), rgba(103, 235, 255, 0.95));
}
.overview-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.overview-mini-grid > div,
.overview-watch-item,
.ticket-item {
  border: 1px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.7rem;
}
.ticket-item {
  text-align: left;
  width: 100%;
}
.ticket-item.is-button {
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.ticket-item .badge { margin-bottom: 0.45rem; }
.ticket-feed.compact { gap: 0.5rem; }
.overview-watch-list { display: grid; gap: 0.55rem; }
.overview-watch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
}
.overview-watch-item span { grid-column: 1 / 2; }
.overview-watch-item em { grid-column: 2 / 3; grid-row: 1 / span 2; text-align: right; font-style: normal; color: var(--amber); }
.overview-footer-note { margin-top: 1rem; }

.import-zone { border: 1px dashed var(--line); padding: 1rem; margin-bottom: 1rem; }
.import-zone p { font-size: 0.68rem; color: var(--muted); margin: 0 0 0.7rem; line-height: 1.6; }
.import-zone p code { font-family: var(--mono); color: var(--cyan); }

/* import review: dim rows that can't be selected (missing SKU/name) */
tr.imp-invalid td { opacity: 0.5; }
.imp-cb { accent-color: var(--magenta); width: 1rem; height: 1rem; cursor: pointer; }

/* product modal: size / option selector */
.pv-size-row { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.2rem 0 0.9rem; }
.pv-size-row label { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.pv-size-row select {
  background: rgba(4, 10, 20, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 2px;
  outline: none;
}
.pv-size-row select:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(103, 235, 255, 0.25); }
.cart-row .cr-variant { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--uv); }

/* admin: product filter/sort bar + multi-select */
.prod-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.prod-filters input, .prod-filters select {
  background: rgba(4, 10, 20, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 0.5rem 0.6rem;
  border-radius: 2px;
  outline: none;
}
.prod-filters input { flex: 1; min-width: 180px; }
.prod-filters input:focus, .prod-filters select:focus { border-color: var(--cyan); box-shadow: 0 0 10px rgba(103, 235, 255, 0.25); }
.pf-selall { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pf-cb, #pf-all { accent-color: var(--magenta); width: 1rem; height: 1rem; cursor: pointer; }

/* admin: bulk-edit bar (shown when products are selected) */
.prod-bulk {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  border: 1px solid var(--magenta);
  background: rgba(255, 47, 214, 0.06);
  padding: 0.55rem 0.7rem;
  margin: 0 0 0.8rem;
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(255, 47, 214, 0.12);
}
.prod-bulk .pf-bulk-label { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--magenta); }
.prod-bulk .pf-bulk-group { display: flex; align-items: center; gap: 0.35rem; }
.prod-bulk select, .prod-bulk input {
  background: rgba(4, 10, 20, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.45rem 0.55rem;
  border-radius: 2px;
  outline: none;
}
.prod-bulk select:focus, .prod-bulk input:focus { border-color: var(--cyan); box-shadow: 0 0 10px rgba(103, 235, 255, 0.25); }
.prod-bulk .tbtn { padding: 0.4rem 0.7rem; font-size: 0.6rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .shop-main { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .order-card-head { flex-direction: column; }
  .reorder-btn { width: 100%; }
  .admin-workspace,
  .admin-content,
  .overview-card-grid,
  .overview-kpis { grid-template-columns: 1fr; }
  .admin-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-nav,
  .admin-side { position: static; }
}

@media (max-width: 640px) {
  #shop-nav-btn { top: 0.7rem; left: 0.7rem; padding: 0.5rem 0.75rem; font-size: 0.62rem; }
  .cat-grid { grid-template-columns: 1fr; }
  .shop-shell { padding-top: 4rem; }
  .shop-dock { bottom: 0.5rem; gap: 0.2rem; }
  .dock-btn { padding: 0.42rem 0.55rem; font-size: 0.56rem; }
  table.tl-table .hide-sm { display: none; }
  .tfield-row,
  .order-items li { grid-template-columns: 1fr; }
  .order-progress li { font-size: 0.5rem; letter-spacing: 0; }
  .order-item-fulfillment { grid-template-columns: 1fr; min-width: 220px; }
  .admin-tabs { flex-direction: row; flex-wrap: wrap; }
  .admin-tab { width: auto; }
  .overview-row,
  .overview-watch-item { grid-template-columns: 1fr; }
  .overview-watch-item em { grid-column: 1; grid-row: auto; text-align: left; }
  .admin-side { grid-template-columns: 1fr; }
  .admin-side > .admin-side-card:first-child { grid-column: auto; }
  .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card-head { display: grid; }
  .chart-legend { justify-content: flex-start; }
  .overview-sales-chart { margin-left: -0.65rem; width: calc(100% + 1.3rem); }
}

/* reduced effects: kill decorative animation */
body.reduced-effects #shop-nav-btn,
body.reduced-effects .store-feature .ad-price,
body.reduced-effects .store-feature .ad-glyph { animation: none !important; }

/* ============================================================
   ARTIST STORES (ArtsAdd vendor pages)
   ============================================================ */
.cat-tile.vendor-tile { border-color: var(--uv); }
.cat-tile.vendor-tile:hover,
.cat-tile.vendor-tile:focus-visible {
  border-color: var(--uv);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.35), inset 0 0 22px rgba(168, 85, 247, 0.12);
}

.artist-hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 1.6rem;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  padding: 1.2rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow);
}

/* ---------- artist/guest product cards: image fills the frame ----------
   Even columns, image covers the full width + a fixed square ratio, so no
   blur backdrop is needed. */
.img-fill.img-cover .if-main { object-fit: cover; filter: none; }
.artist-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.artist-grid .pc-art {
  height: auto;
  aspect-ratio: 1 / 1;
  background: #050a16;
}
.artist-grid .pc-art::after { display: none; } /* drop the CRT scanlines over product photos */
.artist-grid .prod-card { overflow: hidden; }

.artist-banner {
  position: relative;
  min-height: 200px;
  border: 1px solid var(--line-dim);
  overflow: hidden;
}

.artist-meta { display: flex; flex-direction: column; justify-content: center; }
.artist-meta .ad-eyebrow { color: var(--uv); margin: 0 0 0.5rem; }
.artist-name {
  font-family: "Orbitron", var(--mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-transform: uppercase;
  margin: 0 0 0.7rem;
  color: var(--text);
  text-shadow: 0 0 10px rgba(232, 224, 255, 0.5), 0 0 26px rgba(168, 85, 247, 0.5);
}
.artist-bio { font-size: 0.82rem; line-height: 1.7; color: #cfe3f1; margin: 0 0 0.7rem; }
.artist-note { font-size: 0.66rem; letter-spacing: 0.08em; color: var(--amber); text-transform: uppercase; margin: 0 0 1rem; }
.artist-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .artist-hero { grid-template-columns: 1fr; }
  .artist-banner { min-height: 150px; }
}

/* admin: artist onboarding guide */
.artist-guide {
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.6);
  margin-bottom: 1.2rem;
  border-radius: 2px;
}
.artist-guide > summary {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  list-style: none;
}
.artist-guide > summary::-webkit-details-marker { display: none; }
.artist-guide[open] > summary { border-bottom: 1px solid var(--line-dim); }
.artist-guide .ag-body { padding: 0.9rem 1.1rem 1.1rem; font-size: 0.74rem; line-height: 1.7; color: #cfe3f1; }
.artist-guide .ag-body ol, .artist-guide .ag-body ul { margin: 0.5rem 0 0.5rem 1.1rem; padding: 0; }
.artist-guide .ag-body li { margin-bottom: 0.5rem; }
.artist-guide .ag-body code {
  font-family: var(--mono);
  background: rgba(103, 235, 255, 0.1);
  border: 1px solid var(--line-dim);
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  font-size: 0.9em;
  color: var(--cyan);
  word-break: break-word;
}

/* Subcategory rows in the admin category tree read as nested. */
.tl-table tr.cat-child td:first-child { padding-left: .3rem; }
.tl-table tr.cat-child td:nth-child(2) { color: var(--text); opacity: .88; }

/* Admin ticket thread inside the modal. */
.ticket-thread { max-height: 320px; overflow-y: auto; margin: .6rem 0 1rem; display: grid; gap: .5rem; }
.ticket-msg { padding: .55rem .7rem; border: 1px solid var(--line-dim); border-radius: 3px; background: rgba(255,255,255,.03); }
.ticket-msg.staff { background: rgba(103,235,255,.07); border-color: var(--line); }
.ticket-msg b { font-size: .74rem; color: var(--text); }
.ticket-msg small { margin-left: .5rem; font-size: .66rem; color: var(--muted); }
.ticket-msg p { margin: .3rem 0 0; font-size: .8rem; line-height: 1.5; white-space: pre-wrap; color: var(--text); }

/* ---------- admin: settings sections ----------
   Each block of configuration is a card that says what it is for, so the tab
   reads as labelled groups rather than one long column of inputs. */
.set-intro { margin-bottom: 1.1rem; }

.set-group {
  margin: 1.8rem 0 .8rem;
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan);
  border-bottom: 1px solid var(--line);
  padding-bottom: .4rem;
}

#settings-form > .set-group:first-child { margin-top: .6rem; }

/* Cards holding a wide table opt out of the reading-width cap, which exists
   so settings forms do not stretch to 1300px. Without this the product
   catalog's later columns sit off the right edge behind a scrollbar. */
.set-card.set-card-wide { max-width: none; }

.set-card {
  max-width: 620px;
  margin: 0 0 .9rem;
  border: 1px solid var(--line-dim);
  border-radius: 4px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
}

.set-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .8rem .95rem;
  background: rgba(103, 235, 255, .05);
  border-bottom: 1px solid var(--line-dim);
}

.set-card-head h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.set-card-head p {
  margin: .25rem 0 0;
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 46ch;
}

.set-badges {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  flex: none;
}

.set-card-body { padding: .95rem; }
.set-card-body > .tfield:last-child,
.set-card-body > .tfield-row:last-child { margin-bottom: 0; }

/* A secondary line inside a field label — "saved: sk_…", "optional", etc. */
.set-hint {
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: .4rem;
}

.set-note {
  margin: .45rem 0 0;
  font-size: .72rem;
  line-height: 1.55;
  color: var(--muted);
}

.set-note code,
.set-uri code {
  font-family: var(--mono);
  font-size: .92em;
  color: var(--cyan);
}

/* The OAuth redirect URI has to be copied verbatim — give it room. */
.set-uri {
  margin: .4rem 0 .6rem;
  padding: .5rem .65rem;
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--line-dim);
  border-radius: 3px;
  word-break: break-all;
  font-size: .76rem;
}

.set-save {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  max-width: 620px;
  margin: 0 0 1.6rem;
  padding-top: .2rem;
}

.set-save .ap-note { margin: 0; font-size: .72rem; }

@media (max-width: 700px) {
  .set-card-head { flex-direction: column; }
  .set-card-head p { max-width: none; }
}

/* ---------- order backlog alarm ----------
   A glowing banner above the admin top bar once orders start sitting, and a
   heat ramp on the order rows themselves: warm red-orange at three days,
   dark red and pulsing past a week. */
/* Must out-rank the display:flex below — an author rule beats the browser's
   own [hidden] rule, so without this the banner never actually hides. */
.admin-alert[hidden] { display: none; }
.admin-alert {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  border: 1px solid var(--red);
  background: linear-gradient(90deg, rgba(124, 10, 28, 0.55), rgba(255, 77, 107, 0.12));
  padding: 0.7rem 1rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 0 26px rgba(255, 77, 107, 0.35), inset 0 0 22px rgba(255, 77, 107, 0.12);
  animation: admin-alert-glow 2.8s ease-in-out infinite;
}
.admin-alert .aa-mark { font-size: 1.1rem; color: var(--red); text-shadow: 0 0 12px rgba(255, 77, 107, 0.8); }
.admin-alert .aa-body {
  flex: 1 1 16rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: #ffd9e0;
}
.admin-alert .aa-body b { color: #fff; }
.admin-alert .aa-hot { color: var(--red); text-shadow: 0 0 10px rgba(255, 77, 107, 0.7); }
.admin-alert .aa-sub {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 217, 224, 0.65);
}
/* Past a week anywhere in the queue, the banner itself burns harder. */
.admin-alert.critical {
  background: linear-gradient(90deg, rgba(160, 6, 30, 0.75), rgba(255, 47, 60, 0.18));
  animation-duration: 1.6s;
}
@keyframes admin-alert-glow {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 77, 107, 0.25), inset 0 0 18px rgba(255, 77, 107, 0.08); }
  50% { box-shadow: 0 0 40px rgba(255, 77, 107, 0.6), inset 0 0 28px rgba(255, 77, 107, 0.2); }
}

/* Row heat. --ord-heat / --ord-edge are set per row by admin.js, so the ramp
   is a continuous colour rather than a handful of tiers. */
table.tl-table tr.ord-aged td { background: var(--ord-heat); }
table.tl-table tr.ord-aged td:first-child { box-shadow: inset 3px 0 0 var(--ord-edge); }
table.tl-table tr.ord-critical td { animation: ord-row-pulse 2.2s ease-in-out infinite; }
table.tl-table tr.ord-critical td:first-child { animation-name: ord-row-pulse-edge; }
@keyframes ord-row-pulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(255, 40, 70, 0); }
  50% { box-shadow: inset 0 0 26px rgba(255, 40, 70, 0.55); }
}
@keyframes ord-row-pulse-edge {
  0%, 100% { box-shadow: inset 3px 0 0 var(--ord-edge), inset 0 0 0 rgba(255, 40, 70, 0); }
  50% { box-shadow: inset 3px 0 0 var(--ord-edge), inset 0 0 26px rgba(255, 40, 70, 0.55); }
}
.ord-age {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.ord-age.hot { color: var(--red); text-shadow: 0 0 10px rgba(255, 77, 107, 0.6); }

@media (prefers-reduced-motion: reduce) {
  .admin-alert,
  table.tl-table tr.ord-critical td,
  table.tl-table tr.ord-critical td:first-child { animation: none; }
  .admin-alert { box-shadow: 0 0 26px rgba(255, 77, 107, 0.35); }
  table.tl-table tr.ord-critical td { box-shadow: inset 0 0 26px rgba(255, 40, 70, 0.45); }
  table.tl-table tr.ord-critical td:first-child { box-shadow: inset 3px 0 0 var(--ord-edge), inset 0 0 26px rgba(255, 40, 70, 0.45); }
}

/* Date columns in the admin product table: present but quiet, so the row still
   reads as SKU → name → price. */
table.tl-table td.pf-date {
  font-size: 0.66rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- split delivery notice at checkout ----------
   Shown when part of an order cannot ship from stock. It has to be
   acknowledged, so it is styled as a warning rather than a footnote. */
.checkout-split {
  margin: 0.9rem 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--amber);
  background: rgba(40, 26, 4, 0.4);
}
.checkout-split.needs-ack {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(255, 77, 107, 0.35);
}
.cs-split-head {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.cs-split-list { margin: 0 0 0.5rem; padding-left: 1.1rem; font-size: 0.7rem; line-height: 1.75; color: var(--text); }
.cs-split-note { margin: 0 0 0.6rem; font-size: 0.66rem; line-height: 1.7; color: var(--muted); }
.cs-split-ack { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.7rem; line-height: 1.5; cursor: pointer; }
.cs-split-ack input { margin-top: 0.15rem; }
