/* ============================================================
   Graphic Era EDP Portal — brand layer on top of Bootstrap 5.
   Design language from the event poster: deep indigo field,
   bokeh glow, heavy yellow display type, white pill cards.
   ============================================================ */

:root {
  --indigo-950: #1a1960;
  --indigo-900: #232180;
  --indigo-800: #2c2a9c;
  --indigo-700: #3734b8;
  --indigo-100: #e4e3f7;
  --yellow: #ffc60b;
  --yellow-bright: #ffd53e;
  --ink: #1c1b4b;
  --ink-soft: #55538a;
  --line: rgba(28, 27, 75, 0.12);
  --font-display: 'Archivo', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
  --shadow-card: 0 18px 44px rgba(12, 11, 46, 0.35);
}

body {
  font-family: var(--font-body);
  color: #fff;
  background-color: var(--indigo-900);
  background-image:
    radial-gradient(42rem 30rem at 85% -5%, rgba(255, 198, 11, 0.14), transparent 60%),
    radial-gradient(36rem 28rem at -10% 40%, rgba(255, 122, 40, 0.16), transparent 55%),
    radial-gradient(50rem 40rem at 50% 110%, rgba(20, 18, 90, 0.9), transparent 70%),
    linear-gradient(168deg, var(--indigo-800) 0%, var(--indigo-900) 48%, var(--indigo-950) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Bokeh dots like the poster's blurred lights */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(6px 6px at 12% 22%, rgba(255, 210, 90, 0.35) 40%, transparent 60%),
    radial-gradient(9px 9px at 88% 30%, rgba(255, 170, 60, 0.28) 40%, transparent 60%),
    radial-gradient(5px 5px at 74% 76%, rgba(255, 220, 120, 0.3) 40%, transparent 60%),
    radial-gradient(7px 7px at 22% 82%, rgba(160, 160, 255, 0.3) 40%, transparent 60%),
    radial-gradient(4px 4px at 60% 12%, rgba(255, 255, 255, 0.25) 40%, transparent 60%);
}

.page-wrap { position: relative; z-index: 1; }

/* ---------- Brand header ---------- */
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 1.65rem; letter-spacing: 0.2px; }
.brand-tag { font-style: italic; font-size: 0.76rem; color: var(--indigo-100); margin-top: 3px; }
.brand-schools {
  border-left: 2px solid rgba(255, 255, 255, 0.35);
  padding-left: 14px;
  font-size: 0.72rem;
  color: var(--indigo-100);
  line-height: 1.45;
}
.brand-schools strong { color: #fff; display: block; font-size: 0.8rem; }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo-100);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 7px 16px;
  background: rgba(255, 255, 255, 0.06);
}
.display-brand {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--yellow);
  line-height: 1.05;
  letter-spacing: -0.5px;
  font-size: clamp(1.9rem, 7vw, 3.5rem);
  text-wrap: balance;
}
.sub-brand { color: var(--indigo-100); font-size: clamp(0.95rem, 2.5vw, 1.1rem); }

h1, h2, h3, h4, .card-title { font-family: var(--font-display); }

/* ---------- Info pills (date / venue like poster footer) ---------- */
.pill {
  border-radius: 14px;
  padding: 12px 22px;
  font-family: var(--font-display);
  box-shadow: var(--shadow-card);
  display: inline-block;
  text-align: left;
}
.pill .k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.pill .v { font-size: 1.02rem; font-weight: 800; }
.pill.yellow { background: var(--yellow); color: var(--ink); }
.pill.white { background: #fff; color: var(--indigo-800); }

/* ---------- Cards ---------- */
.card-brand {
  background: #fff;
  color: var(--ink);
  border: none;
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}
.card-brand .card-body { padding: 1.7rem 1.4rem; }
@media (min-width: 640px) { .card-brand .card-body { padding: 2.1rem 2rem; } }
.card-brand h2, .card-brand h3 { font-weight: 800; letter-spacing: -0.3px; color: var(--ink); }
.hint { color: var(--ink-soft); font-size: 0.9rem; }

.card-glass {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 22px;
  backdrop-filter: blur(6px);
}

/* ---------- Forms ---------- */
.form-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--indigo-800);
  margin-bottom: 0.35rem;
}
.form-control, .form-select {
  font-family: var(--font-body);
  background: #f4f4fb;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.72rem 0.95rem;
  color: var(--ink);
}
.form-control:focus, .form-select:focus {
  background: #fff;
  border-color: var(--indigo-700);
  box-shadow: 0 0 0 0.25rem rgba(55, 52, 184, 0.14);
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.02em; }
.btn-brand-yellow {
  background: var(--yellow);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  box-shadow: 0 10px 26px rgba(255, 198, 11, 0.35);
}
.btn-brand-yellow:hover, .btn-brand-yellow:focus { background: var(--yellow-bright); color: var(--ink); }
.btn-brand-indigo {
  background: var(--indigo-800);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
}
.btn-brand-indigo:hover, .btn-brand-indigo:focus { background: var(--indigo-700); color: #fff; }
.btn-brand-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}
.btn-brand-ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.08); }

.badge-soft {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------- Tabs ---------- */
.nav-pills-brand {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 5px;
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-pills-brand::-webkit-scrollbar { display: none; }
.nav-pills-brand .nav-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--indigo-100);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  white-space: nowrap;
}
.nav-pills-brand .nav-link.active { background: var(--yellow); color: var(--ink); }

/* ---------- Stats ---------- */
.stat {
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
  height: 100%;
}
.stat .n { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; color: var(--indigo-800); line-height: 1.15; }
.stat .l { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Tables ---------- */
.table-brand { font-size: 0.9rem; margin-bottom: 0; }
.table-brand thead th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table-brand td { color: var(--ink); vertical-align: top; }

/* ---------- Live badge ---------- */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e6f7ef;
  color: #22a06b;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 5px 12px;
}
.badge-live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22a06b;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Material / feedback items ---------- */
.item { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.item .t { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--ink); }
.item .d { color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; white-space: pre-wrap; }
.item .meta { font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }

.stars { color: var(--yellow); letter-spacing: 2px; font-size: 1.05rem; }
.star-input .bi { font-size: 1.8rem; color: #d8d7ee; cursor: pointer; transition: transform 0.1s, color 0.1s; }
.star-input .bi.on { color: var(--yellow); }
.star-input .bi:hover { transform: scale(1.15); }

/* ---------- Toast ---------- */
#appToast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1100;
  max-width: calc(100vw - 40px);
  text-align: center;
}
#appToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.footer-brand { text-align: center; color: var(--indigo-100); font-size: 0.78rem; opacity: 0.8; }

/* Modal polish */
.modal-content { border-radius: 22px; border: none; }
.modal-title { font-family: var(--font-display); font-weight: 800; color: var(--ink); }

/* ============================================================
   MOBILE OPTIMISATION
   ============================================================ */

/* Prevent iOS auto-zoom on focus: inputs must be >= 16px */
.form-control, .form-select { font-size: 1rem; }

/* Comfortable tap targets everywhere */
.btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Safe-area for notched phones */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Tab pills: one scrollable row on every screen, never awkward wrapping */
.nav-pills-brand {
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

@media (max-width: 767.98px) {
  /* iOS: fixed background-attachment is janky/broken — fall back to scroll */
  body { background-attachment: scroll; }

  /* Compact header */
  .brand-name { font-size: 1.35rem; }
  .brandbar { padding-top: 12px !important; padding-bottom: 8px !important; }

  /* Tab pills stretch edge-to-edge and scroll */
  .nav-pills-brand {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
  }
  .nav-pills-brand .nav-link { padding: 0.65rem 1rem; font-size: 0.82rem; }

  /* Cards hug the screen a little tighter */
  .card-brand { border-radius: 18px; }
  .card-brand .card-body { padding: 1.35rem 1.1rem; }
  .pill { padding: 10px 16px; }

  /* Stat cards: tighter on phones */
  .stat { padding: 12px 14px; }
  .stat .n { font-size: 1.5rem; }

  /* Bigger, easier star rating */
  .star-input .bi { font-size: 2.2rem; padding: 2px 4px; }

  /* Touch-friendly icon buttons (44px Apple HIG minimum) */
  .btn-sm {
    min-height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Full-width primary actions on phones */
  .btn-brand-yellow, .btn-brand-indigo { width: 100%; }
  .brandbar .btn-brand-ghost, .btn-sm.btn-brand-yellow, .btn-sm.btn-brand-indigo { width: auto; }

  /* Toast clears the thumb zone */
  #appToast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   FUTURISTIC FX LAYER
   Animated aurora, HUD grid, particles, shine, glow, reveals.
   All layers are injected by assets/fx.js and are aria-hidden.
   ============================================================ */

/* ---------- Background stage ---------- */
.fx-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Slow-panning HUD grid, faded by a radial mask */
.fx-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  animation: fxGridPan 26s linear infinite;
}
@keyframes fxGridPan { to { background-position: 46px 92px, 46px 92px; } }

/* Aurora orbs — pure radial gradients (no filter: cheap on mobile) */
.fx-orb {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}
.fx-o1 {
  width: 55vmax; height: 55vmax; top: -22vmax; right: -18vmax;
  background: radial-gradient(circle, rgba(255, 198, 11, 0.16) 0%, rgba(255, 140, 40, 0.07) 40%, transparent 68%);
  animation: fxDrift1 22s ease-in-out infinite alternate;
}
.fx-o2 {
  width: 48vmax; height: 48vmax; bottom: -20vmax; left: -16vmax;
  background: radial-gradient(circle, rgba(90, 84, 255, 0.22) 0%, rgba(55, 52, 184, 0.1) 45%, transparent 70%);
  animation: fxDrift2 28s ease-in-out infinite alternate;
}
.fx-o3 {
  width: 34vmax; height: 34vmax; top: 30%; left: 55%;
  background: radial-gradient(circle, rgba(255, 90, 160, 0.09) 0%, transparent 65%);
  animation: fxDrift3 34s ease-in-out infinite alternate;
}
@keyframes fxDrift1 { to { transform: translate(-9vmax, 7vmax) scale(1.12); } }
@keyframes fxDrift2 { to { transform: translate(8vmax, -6vmax) scale(1.08); } }
@keyframes fxDrift3 { to { transform: translate(-10vmax, -8vmax) scale(1.2); } }

/* Horizontal scanline sweeping down, very faint */
.fx-scan {
  position: absolute;
  left: 0; right: 0; top: -10%;
  height: 22vh;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.028), transparent);
  animation: fxScan 9s linear infinite;
}
@keyframes fxScan { to { transform: translateY(130vh); } }

/* Rising particles */
.fx-particles { position: absolute; inset: 0; }
.fx-particles span {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: rgba(190, 190, 255, 0.8);
  box-shadow: 0 0 8px rgba(160, 160, 255, 0.6);
  animation: fxRise linear infinite;
}
.fx-particles .fx-p-yellow {
  background: rgba(255, 210, 90, 0.9);
  box-shadow: 0 0 10px rgba(255, 198, 11, 0.65);
}
@keyframes fxRise {
  0%   { transform: translateY(0) translateX(0); }
  50%  { transform: translateY(-55vh) translateX(14px); }
  100% { transform: translateY(-110vh) translateX(-10px); }
}

/* ---------- Staggered reveal ----------
   Uses transitions (not animations) so it composes with elements
   that carry their own looping animations (eyebrow, display type).
   fx.js removes both classes after the reveal finishes. */
.fx-pre {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--fx-d, 0ms),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--fx-d, 0ms);
}
.fx-pre.fx-in { opacity: 1; transform: none; }

/* ---------- Display type: shimmer + glow ---------- */
.display-brand {
  background: linear-gradient(100deg, var(--yellow) 0%, #ffe58a 28%, var(--yellow) 55%, #f7a928 80%, var(--yellow) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 198, 11, 0.28));
  animation: fxTextShine 6s linear infinite;
}
.display-brand .text-white, .display-brand .alt { -webkit-text-fill-color: #fff; }
@keyframes fxTextShine { to { background-position: 220% center; } }

/* Eyebrow: breathing glow */
.eyebrow { animation: fxEyebrow 3.6s ease-in-out infinite; }
@keyframes fxEyebrow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 198, 11, 0); border-color: rgba(255, 255, 255, 0.28); }
  50% { box-shadow: 0 0 20px rgba(255, 198, 11, 0.22); border-color: rgba(255, 198, 11, 0.55); }
}

/* ---------- Cards ---------- */
.card-brand { transition: transform 0.25s ease, box-shadow 0.25s ease; }
@media (pointer: fine) {
  .card-brand:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 60px rgba(12, 11, 46, 0.45), 0 0 0 1px rgba(255, 198, 11, 0.18);
  }
}

/* Glass cards: flowing gradient border */
.card-glass { position: relative; }
.card-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(120deg, rgba(255, 198, 11, 0.55), rgba(255, 255, 255, 0.08) 30%, rgba(90, 84, 255, 0.65) 60%, rgba(255, 198, 11, 0.55));
  background-size: 280% 280%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: fxBorderFlow 7s linear infinite;
  pointer-events: none;
}
@keyframes fxBorderFlow { to { background-position: 280% 0; } }

/* ---------- Stats: neon edge + gradient number ---------- */
.stat {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--yellow), var(--indigo-700));
}
.stat::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  animation: fxStatSheen 5.5s ease-in-out infinite;
}
@keyframes fxStatSheen {
  0%, 55% { left: -80%; }
  75%, 100% { left: 140%; }
}
.stat .n {
  background: linear-gradient(120deg, var(--indigo-800), var(--indigo-700) 60%, #6a63ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (pointer: fine) {
  .stat:hover { box-shadow: 0 22px 50px rgba(12, 11, 46, 0.5), 0 0 24px rgba(255, 198, 11, 0.15); }
}

/* ---------- Buttons: shine sweep + glow ---------- */
.btn-brand-yellow, .btn-brand-indigo {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-brand-yellow::after, .btn-brand-indigo::after {
  content: '';
  position: absolute;
  top: 0; left: -90%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
  pointer-events: none;
}
.btn-brand-yellow:hover::after, .btn-brand-indigo:hover::after { left: 140%; }
.btn-brand-yellow:hover { box-shadow: 0 14px 34px rgba(255, 198, 11, 0.5); transform: translateY(-1px); }
.btn-brand-indigo:hover { box-shadow: 0 14px 34px rgba(55, 52, 184, 0.55); transform: translateY(-1px); }
.btn-brand-yellow:active, .btn-brand-indigo:active { transform: translateY(1px) scale(0.99); }

/* ---------- Pills: lift + glow ---------- */
.pill { transition: transform 0.2s ease, box-shadow 0.25s ease; will-change: transform; }
@media (pointer: fine) {
  .pill.yellow:hover { box-shadow: 0 18px 44px rgba(255, 198, 11, 0.4); }
  .pill.white:hover { box-shadow: 0 18px 44px rgba(255, 255, 255, 0.22); }
}

/* ---------- Tabs: active glow ---------- */
.nav-pills-brand .nav-link { transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.nav-pills-brand .nav-link.active { box-shadow: 0 0 18px rgba(255, 198, 11, 0.45); }

/* Spinning icon for refresh buttons */
.fx-spin { display: inline-block; animation: fxSpin 0.8s linear infinite; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* ---------- Live badge: radar ping ---------- */
.badge-live { position: relative; }
.badge-live::before { box-shadow: 0 0 0 0 rgba(34, 160, 107, 0.5); animation: fxPing 1.8s ease-out infinite; }
@keyframes fxPing {
  0%   { box-shadow: 0 0 0 0 rgba(34, 160, 107, 0.5); opacity: 1; }
  70%  { box-shadow: 0 0 0 8px rgba(34, 160, 107, 0); opacity: 0.6; }
  100% { box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); opacity: 1; }
}

/* ---------- Inputs: focus glow ---------- */
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(55, 52, 184, 0.14), 0 0 20px rgba(90, 84, 255, 0.2);
}

/* ---------- Items & table rows ---------- */
.item { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
@media (pointer: fine) {
  .item:hover { border-color: rgba(55, 52, 184, 0.35); box-shadow: 0 10px 26px rgba(28, 27, 75, 0.1); transform: translateY(-2px); }
}
tbody tr { transition: background 0.15s ease, box-shadow 0.15s ease; }
.table-brand tbody tr:hover { background: #f6f6fc; box-shadow: inset 3px 0 0 var(--yellow); }

/* ---------- Chrome polish ---------- */
::selection { background: var(--yellow); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--indigo-950); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--indigo-700), var(--indigo-800));
  border-radius: 999px;
  border: 2px solid var(--indigo-950);
}
::-webkit-scrollbar-thumb:hover { background: var(--indigo-700); }
html { scrollbar-color: var(--indigo-700) var(--indigo-950); }

/* ---------- Reduced motion: kill it all ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-bg { display: none; }
  .fx-pre { opacity: 1; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* Mobile: fewer/cheaper layers */
@media (max-width: 767.98px) {
  .fx-o3, .fx-scan { display: none; }
  .fx-grid { background-size: 38px 38px; }
}

/* ---------- Responsive "flip" tables: rows become cards on phones ---------- */
@media (max-width: 767.98px) {
  .table-flip thead { display: none; }
  .table-flip tbody { display: block; }
  .table-flip tbody tr {
    display: block;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #fff;
  }
  .table-flip tbody tr:hover { background: #fff; }
  .table-flip td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    border: none !important;
    padding: 5px 0;
    text-align: right;
    max-width: none !important;
    white-space: normal !important;
  }
  .table-flip td::before {
    content: attr(data-label);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-soft);
    flex-shrink: 0;
    text-align: left;
  }
  .table-flip td[data-label=""]::before { display: none; }
  .table-flip td.cell-actions {
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1.5px solid var(--line) !important;
  }
  .table-flip td.cell-empty { justify-content: center; text-align: center; }
  /* Hide the serial number cell as a row header instead */
  .table-flip td.cell-index {
    justify-content: flex-start;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--indigo-800);
  }
}

