/* ═══════════════════════════════════════════════════════════════
   AB CHEM INDIA — MODERN STYLES v4.0
   Scientific Luxury Aesthetic | Unified Light + Dark Theme System
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── THEME VARIABLES (Light Default) ────────────────────────── */
:root {
  /* Core Surfaces & Backgrounds */
  --bg: #f0f4f8;
  --bg-deep: #e8edf5;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.92);
  --image-bg: #ffffff;
  --card-bg: #ffffff;
  --specs-bg: linear-gradient(135deg, #f8fafc, #f1f5f9);
  --table-header-bg: linear-gradient(135deg, #0f172a, #1e3a6e);
  --table-hover-bg: rgba(14, 165, 233, 0.05);
  --input-bg: #f8fafc;
  --input-focus-bg: #ffffff;
  --footer-bg: linear-gradient(145deg, #060d1f 0%, #0f2847 35%, #0a1f3d 65%, #081729 100%);
  --hero-bg: linear-gradient(145deg, #060d1f 0%, #0f2847 35%, #0a1f3d 65%, #081729 100%);

  /* Typography & Accents */
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --primary: #0f172a;
  --accent: #0284c7;
  --accent-bright: #0ea5e9;
  --accent-lt: #e0f2fe;
  --accent2: #6366f1;
  --accent2-lt: #ede9fe;
  --teal: #0d9488;
  --teal-lt: #ccfbf1;
  --success: #10b981;
  --success-lt: #d1fae5;
  --warning: #f59e0b;
  --warning-lt: #fef3c7;
  --danger: #ef4444;
  --danger-lt: #fee2e2;

  /* Borders & UI */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 30px rgba(14,165,233,0.18);

  /* Animation Tokens */
  --speed-fast: 0.15s;
  --speed: 0.25s;
  --speed-slow: 0.45s;
  --speed-xslow: 0.7s;
  --ease-out-expo: cubic-bezier(0.16,1,0.3,1);
  --ease-bounce: cubic-bezier(0.34,1.56,0.64,1);
}

/* ── DARK THEME OVERRIDES ───────────────────────────────────── */
/*
  BLOCK 1: JS toggle sets data-theme="dark" on <html>.
  These variables override :root immediately on all child elements.
*/
[data-theme="dark"] {
  --bg: #0d1424;
  --bg-deep: #080e1c;
  --surface: #161f33;
  --surface-2: #1c2844;
  --surface-glass: rgba(22,31,51,0.95);
  --text: #e8edf5;
  --text-secondary: #b8c4d6;
  --muted: #7a90a8;
  --primary: #e8edf5;
  --accent-lt: #0a2035;
  --accent2-lt: #171638;
  --success-lt: #062318;
  --warning-lt: #1a1105;
  --danger-lt: #200808;
  --teal-lt: #062424;
  --border: #263347;
  --border-strong: #344660;
  --image-bg: linear-gradient(135deg, #131d30 0%, #1a2844 100%);
  --card-bg: #161f33;
  --specs-bg: linear-gradient(135deg, #111827, #1c2844);
  --table-header-bg: linear-gradient(135deg, #0a1020, #111827);
  --table-hover-bg: rgba(255,255,255,0.03);
  --input-bg: #1c2844;
  --input-focus-bg: #161f33;
  --footer-bg: linear-gradient(145deg, #040810, #08111f, #050a17);
  --hero-bg: linear-gradient(145deg, #02060f 0%, #0a1a2f 50%, #051526 100%);
}

/*
  BLOCK 2: OS-level dark preference — only activates when the user
  has NOT explicitly chosen a light theme via the toggle.
*/
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0d1424;
    --bg-deep: #080e1c;
    --surface: #161f33;
    --surface-2: #1c2844;
    --surface-glass: rgba(22,31,51,0.95);
    --text: #e8edf5;
    --text-secondary: #b8c4d6;
    --muted: #7a90a8;
    --primary: #e8edf5;
    --accent-lt: #0a2035;
    --accent2-lt: #171638;
    --success-lt: #062318;
    --warning-lt: #1a1105;
    --danger-lt: #200808;
    --teal-lt: #062424;
    --border: #263347;
    --border-strong: #344660;
    --image-bg: linear-gradient(135deg, #131d30 0%, #1a2844 100%);
    --card-bg: #161f33;
    --specs-bg: linear-gradient(135deg, #111827, #1c2844);
    --table-header-bg: linear-gradient(135deg, #0a1020, #111827);
    --table-hover-bg: rgba(255,255,255,0.03);
    --input-bg: #1c2844;
    --input-focus-bg: #161f33;
    --footer-bg: linear-gradient(145deg, #040810, #08111f, #050a17);
    --hero-bg: linear-gradient(145deg, #02060f 0%, #0a1a2f 50%, #051526 100%);
  }
}

/* ── SCISHELF BRAND OVERRIDE ────────────────────────────────────
   Shared pages (qgen_compound.php, the supplier directory) render on
   both abchem.co.in and scishelf.com from the same file --
   qgen_current_brand() (qgen_brand.php) stamps data-brand="scishelf"
   on <html> when the request came in on that domain. Additive only:
   swaps just the accent/primary tokens already used throughout
   .pd-*/.qc-*; every other rule in this file is untouched, and the
   unstamped (abchem) case renders exactly as before this block. */
[data-brand="scishelf"] {
  --accent: #1E5E3F;
  --accent-bright: #2E7D53;
  --accent-lt: #E8F0EA;
  --primary: #1E5E3F;
}
[data-theme="dark"][data-brand="scishelf"] {
  --accent: #5FBE8A;
  --accent-bright: #7ACFA0;
  --accent-lt: #16281E;
  --primary: #5FBE8A;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"])[data-brand="scishelf"] {
    --accent: #5FBE8A;
    --accent-bright: #7ACFA0;
    --accent-lt: #16281E;
    --primary: #5FBE8A;
  }
}

/* ═══════════════════════════════════════════════════════════════
   BASE & TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--primary);
}
a { text-decoration: none; color: inherit; transition: color var(--speed) ease; }
img { max-width: 100%; vertical-align: middle; }
img:not(.logo-img):not(.footer-logo-img):not(.mini-img) { height: auto; display: block; }
input, select, button, textarea { font-family: inherit; }
code, .font-mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* Scroll Reveal Utility */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,0.4); } 50% { box-shadow: 0 0 0 10px rgba(14,165,233,0); } }
@keyframes pulse-badge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-12px); } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-18px) rotate(3deg); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes slideInFromBottom { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbFloat { 0%, 100% { transform: translate(0,0) scale(1); opacity: 0.6; } 33% { transform: translate(30px,-30px) scale(1.05); opacity: 0.8; } 66% { transform: translate(-20px,20px) scale(0.95); opacity: 0.5; } }
@keyframes particleDrift { 0% { transform: translate(0,0) scale(1); opacity:0.4; } 50% { transform: translate(var(--px),var(--py)) scale(1.2); opacity:0.7; } 100% { transform: translate(0,0) scale(1); opacity:0.4; } }
@keyframes borderGlow { 0%, 100% { border-color: rgba(14,165,233,0.3); } 50% { border-color: rgba(14,165,233,0.7); } }

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER — GLASSMORPHISM STICKY
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  background: rgba(9,18,36,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 0 24px;
  position: sticky; top: 0; z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.04) inset;
  transition: all var(--speed) ease;
  animation: fadeInDown 0.5s var(--ease-out-expo) both;
}
.site-header::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(6,182,212,0.05) 0%, transparent 30%, transparent 70%, rgba(99,102,241,0.05) 100%);
  pointer-events: none;
}
.site-header.scrolled {
  background: rgba(7,14,28,0.99);
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.05) inset;
  border-bottom-color: rgba(255,255,255,0.10);
}
.site-header.scrolled .header-container { height: 56px; }
.header-container { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: nowrap; height: 64px; overflow: visible; transition: height var(--speed) var(--ease-out-expo); }
.header-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; max-height: 44px; overflow: hidden; transition: transform var(--speed) var(--ease-bounce); }
.header-logo:hover { transform: scale(1.04); }
.logo-img { width: 28px !important; height: 28px !important; min-width: 28px; min-height: 28px; max-width: 28px !important; max-height: 28px !important; display: inline-block !important; flex-shrink: 0; object-fit: contain; filter: brightness(1.1) drop-shadow(0 0 8px rgba(14,165,233,0.4)); overflow: hidden; }
.logo-text { color: #fff; font-family: 'Inter', system-ui, sans-serif; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.logo-accent { color: #38bdf8; background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-tagline { display: block; font-size: 0.58rem; color: rgba(255,255,255,0.45); font-family: 'Inter', sans-serif; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.2; margin-top: 1px; }
.header-tagline-accent { color: rgba(56,189,248,0.7); }

.search-wrapper { position: relative; flex: 1; max-width: 580px; margin: 0 20px; display: flex; align-items: center; gap: 8px; }
.search-form { display: flex; width: 100%; }
.search-input { flex: 1; padding: 9px 16px; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px 0 0 8px; font-size: 0.85rem; background: rgba(255,255,255,0.07); color: #fff; transition: all var(--speed) ease; }
.search-input:focus { outline: none; border-color: rgba(14,165,233,0.5); background: rgba(255,255,255,0.1); box-shadow: 0 0 0 3px rgba(14,165,233,0.12); }
.search-input::placeholder { color: rgba(255,255,255,0.38); }
.search-btn { padding: 9px 14px; background: linear-gradient(135deg, #0284c7, #6366f1); border: none; border-radius: 0 8px 8px 0; cursor: pointer; color: #fff; font-size: 14px; transition: all var(--speed) ease; }
.search-btn:hover { background: linear-gradient(135deg, #0369a1, #4f46e5); transform: scale(1.02); }
/* Generic pill-button look, reused by the scope-choice modal and by the
   List Search / Structure Search inline toggles below. Not used directly in
   the header search bar anymore — that one caused a real layout bug (see
   memory `search-scope-toggle`): the fixed 64px-tall header row clipped a
   second wrapped row, rendering the toggle above the visible viewport
   ("a blue line, not clickable"). The header now relies solely on the
   scope-choice modal (#scope-modal in this file) instead of a persistent
   inline toggle. */
.scope-btn { flex: 1; padding: 5px 10px; border: none; border-radius: 5px; background: transparent; color: rgba(255,255,255,0.55); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; cursor: pointer; transition: all var(--speed) ease; }
.scope-btn:hover { color: rgba(255,255,255,0.85); }
.scope-btn.active { background: linear-gradient(135deg, #0284c7, #6366f1); color: #fff; }
/* Light-theme variant for panels on a white/light card background (List Search, etc.) */
.scope-toggle-light { display: flex; gap: 4px; padding: 3px; background: #f1f5f9; border: 1px solid var(--border); border-radius: 9px; }
.scope-toggle-light .scope-btn { flex: 1; padding: 7px 10px; border: none; border-radius: 6px; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.scope-toggle-light .scope-btn:hover { color: var(--accent); }
.scope-toggle-light .scope-btn.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
/* Inline (not full-width) dark variant, for placement next to a panel title bar
   like List Search's .adv-panel-header, rather than stacked above a search input. */
.adv-scope-toggle { display: flex; flex: 0 0 auto; gap: 4px; padding: 2px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: 7px; }
.adv-scope-toggle .scope-btn { padding: 5px 10px; border: none; border-radius: 5px; background: transparent; color: rgba(255,255,255,0.6); font-size: 0.7rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: all var(--speed) ease; }
.adv-scope-toggle .scope-btn:hover { color: #fff; }
.adv-scope-toggle .scope-btn.active { background: linear-gradient(135deg, #0284c7, #6366f1); color: #fff; }

/* ── Scope-choice modal ─────────────────────────────────────────
   Shown whenever a search is attempted (header, List Search, Structure
   Search) with no Impurities/Standards-vs-Fine-Chem choice made yet.
   Injected once into <body> by js/utils.js; reused by every page. */
.scope-modal-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(8,15,30,0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.15s ease both; }
.scope-modal-overlay[hidden] { display: none; }
.scope-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 420px; width: 100%; padding: 28px 24px 22px; position: relative; animation: fadeInUp 0.25s var(--ease-out-expo) both; }
.scope-modal h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--text); }
.scope-modal-sub { margin: 0 0 18px; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.scope-modal-choices { display: flex; flex-direction: column; gap: 10px; }
.scope-modal-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: all var(--speed) ease; }
.scope-modal-choice:hover { border-color: var(--accent); background: var(--accent-lt); }
.scope-modal-choice strong { color: var(--text); font-size: 0.92rem; }
.scope-modal-choice span { color: var(--muted); font-size: 0.76rem; }
.scope-modal-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: none; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 50%; transition: all var(--speed) ease; }
.scope-modal-close:hover { background: var(--surface-2); color: var(--text); }

/* ── Cross-database suggestion (no results in one catalog, checked the
   other) — search.php's SSR empty state, List Search's per-term rows, and
   get_quote.php's unmatched-lines panel all reuse these two classes. */
.cross-db-suggestion { margin: 14px auto; max-width: 480px; padding: 14px 18px; border-radius: var(--radius); font-size: 0.85rem; }
.cross-db-suggestion p { margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.cross-db-found { background: var(--accent2-lt); border: 1px solid var(--accent2); }
.cross-db-none { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.cross-db-none p { margin: 0; color: var(--muted); }
.bst-cross-suggest { color: var(--accent2); font-size: 0.82rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.bst-cross-suggest:hover { text-decoration: underline; }
@media (max-width: 560px) { .adv-panel-header { flex-wrap: wrap; gap: 8px; } }
.structure-search-link { display: inline-flex; align-items: center; gap: 4px; padding: 7px 11px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); border-radius: 8px; font-size: 0.78rem; font-weight: 500; white-space: nowrap; border: 1px solid rgba(255,255,255,0.1); transition: all var(--speed) ease; flex-shrink: 0; }
.structure-search-link:hover { background: rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.3); color: #fff; }

/* ── Header advanced-search trigger button ──────────────────── */
.header-adv-btn {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; color: rgba(255,255,255,0.7); cursor: pointer;
  transition: all var(--speed-fast); outline: none;
}
.header-adv-btn:hover,
.header-adv-btn[aria-expanded="true"] {
  background: rgba(14,165,233,0.18); border-color: rgba(14,165,233,0.4); color: #38bdf8;
}
.header-adv-dot {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #38bdf8; box-shadow: 0 0 6px rgba(56,189,248,0.8);
}

/* ── Advanced search popover ────────────────────────────────── */
.header-adv-dropdown {
  position: absolute;
  top: calc(100% + 10px); left: 0;
  min-width: 360px; max-width: 420px;
  background: rgba(10,20,40,0.98);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(14,165,233,0.08) inset;
  z-index: 1300;
  animation: slideDown 0.18s var(--ease-out-expo) both;
  overflow: hidden;
}
/* collapse with hidden attribute */
.header-adv-dropdown[hidden] { display: none; }

.hadv-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.hadv-title {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.9); letter-spacing: 0.04em;
}
.hadv-close {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; color: rgba(255,255,255,0.5); cursor: pointer;
  transition: all var(--speed-fast);
}
.hadv-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.hadv-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.hadv-row { display: flex; align-items: flex-start; gap: 10px; }
.hadv-label {
  font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.07em;
  padding-top: 5px; flex-shrink: 0; width: 46px;
}

/* Match mode pills */
.hadv-mode-pills { display: flex; gap: 5px; }
.hadv-pill {
  padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.55); cursor: pointer; transition: all var(--speed-fast);
}
.hadv-pill.active,
.hadv-pill:hover { background: rgba(14,165,233,0.2); border-color: rgba(14,165,233,0.45); color: #38bdf8; }

/* Field checkboxes */
.hadv-fields { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.hadv-check {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px; font-size: 0.76rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55); cursor: pointer; transition: all var(--speed-fast);
}
.hadv-check:has(input:checked) { background: rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.35); color: #7dd3fc; }
.hadv-check input { accent-color: #38bdf8; width: 11px; height: 11px; }

.hadv-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 14px; border-top: 1px solid rgba(255,255,255,0.07);
}
.hadv-go-btn {
  padding: 7px 18px; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  background: linear-gradient(135deg, #0284c7, #6366f1); color: #fff;
  border: none; cursor: pointer; transition: all var(--speed-fast);
}
.hadv-go-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.hadv-full-link {
  font-size: 0.76rem; color: rgba(255,255,255,0.45); text-decoration: none;
  transition: color var(--speed-fast);
}
.hadv-full-link:hover { color: #38bdf8; }

/* Hide adv button on tiny screens — use full advanced search page instead */
@media (max-width: 640px) { .header-adv-btn { display: none; } }

#search-ac-dropdown, .ac-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: rgba(15,23,42,0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(14,165,233,0.1); z-index: 1200; display: none; max-height: 320px; overflow-y: auto; animation: slideDown 0.2s var(--ease-out-expo) both; }
.ac-item { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; gap: 12px; transition: background var(--speed-fast) ease; }
.ac-item:hover, .ac-item.ac-focused { background: rgba(14,165,233,0.14); outline: none; }
.ac-item:last-child { border-bottom: none; }
.ac-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ac-main strong { color: #f1f5f9; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-formula { color: rgba(148,163,184,0.75); font-size: 0.74rem; font-family: 'JetBrains Mono', monospace; }
.ac-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ac-cas { color: rgba(148,163,184,0.75); font-size: 0.73rem; font-family: 'JetBrains Mono', monospace; }
.ac-inchikey { color: rgba(148,163,184,0.75); font-size: 0.68rem; font-family: 'JetBrains Mono', monospace; }
.ac-type { color: rgba(129,140,248,0.9); font-size: 0.68rem; background: rgba(99,102,241,0.15); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.mobile-search-wrapper { position: relative; margin-bottom: 10px; }

/* ── Compact mobile search toggle (lens icon) ────────────────
   Hidden on desktop; only shown once the full inline search bar
   is hidden below, so it never appears alongside the full bar. */
.mobile-search-toggle {
  display: none !important; /* button removed from header; rule kept to prevent accidental re-show */
}

.main-nav { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
/* ── Nav dropdowns ────────────────────────────────────────────── */
.nav-dropdown-wrap { position: relative; display: inline-flex; }
.nav-dropdown-btn {
    background: transparent; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    color: rgba(255,255,255,0.72); padding: 7px 12px; border-radius: 8px;
    font-weight: 500; font-size: 0.85rem; white-space: nowrap;
    transition: all var(--speed) ease; position: relative; font-family: inherit;
}
.nav-dropdown-btn:hover, .nav-dropdown-btn[aria-expanded="true"] {
    color: #fff; background: rgba(255,255,255,0.07);
}
.nav-dropdown-caret {
    transition: transform 0.2s ease; flex-shrink: 0; margin-left: 1px;
}
.nav-dropdown-btn[aria-expanded="true"] .nav-dropdown-caret { transform: rotate(180deg); }
.nav-dropdown {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    min-width: 240px;
    background: rgba(9,18,36,0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(14,165,233,0.08);
    padding: 6px; z-index: 1300;
    animation: dropdownIn 0.18s var(--ease-out-expo) both;
}
.nav-dropdown[hidden] { display: none; }
@keyframes dropdownIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-dropdown-item {
    display: flex; align-items: flex-start; gap: 11px; padding: 10px 12px;
    border-radius: 9px; text-decoration: none;
    transition: background 0.15s ease; color: inherit;
}
.nav-dropdown-item:hover { background: rgba(255,255,255,0.07); }
.nav-di-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; line-height: 1; }
.nav-di-title { display: block; color: rgba(255,255,255,0.9); font-weight: 600; font-size: 0.84rem; line-height: 1.3; }
.nav-di-sub   { display: block; color: rgba(255,255,255,0.42); font-size: 0.74rem; font-weight: 400; margin-top: 1px; line-height: 1.3; }
/* ── end nav dropdowns ────────────────────────────────────────── */
.nav-link { color: rgba(255,255,255,0.72); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 0.85rem; text-decoration: none; white-space: nowrap; transition: all var(--speed) ease; position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: 4px; left: 50%; right: 50%; height: 2px; background: linear-gradient(90deg, #38bdf8, #818cf8); border-radius: 2px; transition: left var(--speed) ease, right var(--speed) ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.nav-link:hover::after { left: 10px; right: 10px; }
.nav-link.active { color: #fff; background: rgba(14,165,233,0.15); }
.nav-link-admin { background: rgba(14,165,233,0.15); color: #38bdf8; border: 1px solid rgba(14,165,233,0.2); }
.nav-link-outline { border: 1px solid rgba(255,255,255,0.15); }
.nav-link-signin { background: linear-gradient(135deg, #0284c7, #6366f1); color: #fff !important; font-weight: 600; padding: 7px 16px; box-shadow: 0 4px 14px rgba(14,165,233,0.25); transition: all var(--speed) ease; }
.nav-link-signin:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(14,165,233,0.38); }
.nav-link-signin::after { display: none; }
.cart-link { position: relative; color: rgba(255,255,255,0.8) !important; transition: color 0.2s; }
.cart-link:hover { color: #fff !important; }
.cart-badge { position: absolute; top: -4px; right: -6px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 2px 6px rgba(239,68,68,0.5); border: 1.5px solid rgba(255,255,255,0.3); animation: pulse-badge 2s ease-in-out infinite; }

.mobile-menu-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 10px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; flex-shrink: 0; }
.hamburger-line { display: block; width: 22px; height: 2px; background: rgba(255,255,255,0.8); margin: 5px 0; border-radius: 2px; transition: all var(--speed) ease; }
.mobile-menu { display: none; width: 100%; padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.06); animation: slideDown 0.3s var(--ease-out-expo); }
.mobile-nav-link { display: block; color: rgba(255,255,255,0.75); padding: 10px 4px; font-weight: 500; font-size: 0.92rem; text-decoration: none; transition: color var(--speed-fast); border-bottom: 1px solid rgba(255,255,255,0.04); }
.mobile-nav-link:hover { color: #fff; }
.mobile-nav-link-danger { color: #f87171 !important; }
.mobile-nav-link-accent { color: #38bdf8 !important; font-weight: 600; }

/* Mobile menu grouped sections */
.mobile-nav-section {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 6px 0 2px;
}
.mobile-nav-section:first-of-type { border-top: none; }
.mobile-nav-heading {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.32);
    padding: 10px 4px 4px;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — GRADIENT + ANIMATED
   ═══════════════════════════════════════════════════════════════ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 10px; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 0.88rem; letter-spacing: -0.01em; border: none; cursor: pointer; transition: all var(--speed) var(--ease-out-expo); text-decoration: none; position: relative; overflow: hidden; }
.btn::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0); transition: background var(--speed-fast); }
.btn:hover::before { background: rgba(255,255,255,0.06); }
.btn-primary { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); color: #fff; box-shadow: 0 4px 14px rgba(2,132,199,0.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(2,132,199,0.38); background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { border: 1.5px solid var(--accent); color: var(--accent); background: transparent; }
.btn-outline:hover { background: var(--accent); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(2,132,199,0.22); }

/* Color-variant outline buttons — same shape/motion as .btn-outline, different accent per role */
.btn-teal { border: 1.5px solid var(--teal); color: var(--teal); background: transparent; }
.btn-teal:hover { background: var(--teal); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13,148,136,0.25); }
.btn-violet { border: 1.5px solid var(--accent2); color: var(--accent2); background: transparent; }
.btn-violet:hover { background: var(--accent2); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.25); }
.btn-amber { border: 1.5px solid var(--warning); color: var(--warning); background: transparent; }
.btn-amber:hover { background: var(--warning); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245,158,11,0.25); }
.btn-success { border: 1.5px solid var(--success); color: var(--success); background: transparent; }
.btn-success:hover { background: var(--success); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16,185,129,0.25); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; border-radius: 8px; }
.btn-small { padding: 4px 8px; font-size: 12px; margin: 2px; }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; border: none; padding: 14px 32px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 16px; box-shadow: 0 4px 14px rgba(16,185,129,0.3); transition: all var(--speed) ease; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,185,129,0.4); background: linear-gradient(135deg, #34d399, #10b981); }
.btn-danger { background: none; border: 1.5px solid var(--danger); color: var(--danger); padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all var(--speed) ease; }
.btn-danger:hover { background: var(--danger); color: white; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */
.hero { background: var(--hero-bg); color: #fff; padding: 100px 40px; text-align: center; position: relative; overflow: hidden; min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero::before { content: ''; position: absolute; top: -30%; left: -20%; width: 80%; height: 80%; background: radial-gradient(ellipse, rgba(14,165,233,0.18) 0%, transparent 65%); animation: orbFloat 12s ease-in-out infinite; pointer-events: none; }
.hero::after { content: ''; position: absolute; bottom: -20%; right: -15%; width: 70%; height: 70%; background: radial-gradient(ellipse, rgba(99,102,241,0.14) 0%, transparent 60%); animation: orbFloat 16s ease-in-out infinite reverse; pointer-events: none; }
.hero h1 { font-family: 'Inter', system-ui, sans-serif; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 18px; position: relative; z-index: 1; animation: fadeInDown 0.8s var(--ease-out-expo) both; background: linear-gradient(135deg, #ffffff 0%, #bfdbfe 40%, #c7d2fe 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: -0.03em; }
.hero p { color: rgba(226,232,240,0.85); margin-bottom: 32px; font-size: 1.1rem; line-height: 1.7; max-width: 680px; position: relative; z-index: 1; animation: fadeInUp 0.8s 0.15s var(--ease-out-expo) both; }
.hero .btn { position: relative; z-index: 1; animation: fadeInUp 0.8s 0.25s var(--ease-out-expo) both; }
.hero-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-particles span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(14,165,233,0.5); animation: particleDrift var(--duration,8s) ease-in-out infinite; }
/* Hero carousel — one slide per product/service category, sharing the
   single ambient gradient/orb backdrop above so it reads as one continuous
   scene with rotating content, not N separate hero blocks. */
.hero-eyebrow { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #7dd3fc; background: rgba(14,165,233,0.14); border: 1px solid rgba(14,165,233,0.3); padding: 4px 14px; border-radius: 20px; margin-bottom: 16px; position: relative; z-index: 1; animation: fadeInDown 0.8s var(--ease-out-expo) both; }
.hero-icon { display: block; font-size: 2.4rem; line-height: 1; margin-bottom: 14px; position: relative; z-index: 1; animation: scaleIn 0.6s var(--ease-bounce) both; }
.hero-slides { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.hero-slide { display: none; flex-direction: column; align-items: center; }
.hero-slide.is-active { display: flex; }
.hero-dots { display: flex; gap: 8px; margin-top: 6px; position: relative; z-index: 1; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); border: 0; padding: 0; cursor: pointer; transition: all 0.25s var(--ease-out-expo); }
.hero-dot:hover { background: rgba(255,255,255,0.55); }
.hero-dot.is-active { background: #fff; width: 24px; border-radius: 5px; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.hero-arrow:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
.hero-arrow-prev { left: 20px; }
.hero-arrow-next { right: 20px; }
@media (max-width: 768px) { .hero-arrow { display: none; } }

/* ═══════════════════════════════════════════════════════════════
   CATALOG PAGE — MODERN GRID & SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.catalog-layout { display: grid; grid-template-columns: 290px 1fr; gap: 24px; padding: 28px 32px; max-width: 1480px; margin: 0 auto; }
.catalog-sidebar { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); height: fit-content; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; overflow-x: hidden; box-shadow: var(--shadow); animation: fadeInLeft 0.6s var(--ease-out-expo) both; scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.4) transparent; }
.catalog-sidebar::-webkit-scrollbar { width: 4px; }
.catalog-sidebar::-webkit-scrollbar-track { background: transparent; }
.catalog-sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 2px; }
.catalog-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.7); }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: linear-gradient(135deg, #0f172a, #1e3a6e); border-bottom: 1px solid rgba(255,255,255,0.06); }
.sb-title { font-family: 'Inter', system-ui, sans-serif; font-size: 0.88rem; font-weight: 600; color: #fff; letter-spacing: 0.05em; text-transform: uppercase; }
.sb-clear { font-size: 0.75rem; color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); cursor: pointer; padding: 3px 10px; border-radius: 6px; transition: all var(--speed-fast); }
.sb-clear:hover { background: rgba(255,255,255,0.15); color: #fff; }
.sb-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 14px 4px; }
.sb-chips:empty { padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; padding: 3px 8px 3px 10px; border-radius: 20px; background: linear-gradient(135deg, var(--accent-lt), var(--accent2-lt)); color: var(--accent); border: 1px solid var(--border); cursor: pointer; transition: all var(--speed-fast); animation: scaleIn 0.2s var(--ease-bounce) both; }
.chip:hover { background: linear-gradient(135deg, var(--accent2-lt), var(--accent-lt)); }
.chip-x { font-size: 14px; opacity: 0.6; line-height: 1; }
.sb-section { border-bottom: 1px solid var(--border); }
.sb-section:last-of-type { border-bottom: none; }
.sb-sec-header { width: 100%; display: flex; align-items: center; gap: 8px; padding: 13px 18px; background: none; border: none; cursor: pointer; text-align: left; transition: background var(--speed-fast); }
.sb-sec-header:hover { background: var(--surface-2); }
.sb-sec-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); flex: 1; }
.sb-sec-count { font-size: 0.68rem; background: linear-gradient(135deg, var(--accent-lt), var(--accent2-lt)); color: var(--accent); padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.sb-chevron { font-size: 12px; color: var(--muted); transition: transform var(--speed) ease; }
.sb-section:not(.open) .sb-chevron { transform: rotate(-90deg); }
.sb-sec-body { display: none; padding: 4px 16px 14px; }
.sb-section.open .sb-sec-body { display: block; }
.sb-hint { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }
.sort-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.sort-select, .dir-btn, .type-pill, .purity-btn, .mw-input { background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); }
.sort-select { flex: 1; padding: 8px 10px; border-radius: 8px; font-size: 0.84rem; cursor: pointer; transition: border-color var(--speed-fast); }
.sort-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2,132,199,0.1); background: var(--surface); }
.dir-btn { width: 34px; height: 34px; border-radius: 8px; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--speed-fast); flex-shrink: 0; }
.dir-btn:hover { border-color: var(--accent); color: var(--accent); }
.dir-btn.active { background: var(--accent-lt); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.type-pills { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.type-pill, .purity-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; padding: 5px 10px; border-radius: 20px; cursor: pointer; transition: all var(--speed-fast); white-space: nowrap; background: var(--surface-2); }
.type-pill:hover, .purity-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.type-pill.active, .purity-btn.active { background: var(--accent-lt); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pill-cnt { font-size: 0.68rem; background: rgba(0,0,0,0.07); padding: 1px 5px; border-radius: 10px; }
.type-pill.active .pill-cnt { background: rgba(29,78,216,0.12); }
/* ── Sidebar: parent drug search + checklist ─────────────────── */
.sb-search-wrap {
  position: relative; margin-bottom: 8px; margin-top: 4px;
}
.sb-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.sb-search-input {
  width: 100%; padding: 6px 10px 6px 28px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 0.82rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.sb-search-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.sb-search-input::placeholder { color: var(--muted); }

.parent-drug-list {
  display: flex; flex-direction: column; gap: 1px;
  max-height: 260px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.parent-drug-list::-webkit-scrollbar { width: 4px; }
.parent-drug-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px; cursor: pointer;
  transition: background 0.12s; user-select: none;
}
.pd-item:hover { background: var(--surface-2); }
.pd-item.checked { background: var(--accent-lt); }

.pd-check {
  flex-shrink: 0; width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--accent);
}
.pd-name {
  flex: 1; font-size: 0.83rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-item.checked .pd-name { color: var(--accent); font-weight: 600; }
.pd-cnt {
  flex-shrink: 0; font-size: 0.68rem; padding: 1px 6px;
  border-radius: 10px; background: rgba(0,0,0,0.06); color: var(--muted);
}
.pd-item.checked .pd-cnt { background: rgba(14,165,233,0.15); color: var(--accent); }

.sb-show-more {
  width: 100%; margin-top: 6px; padding: 5px;
  background: none; border: 1px dashed var(--border); border-radius: 7px;
  color: var(--accent); font-size: 0.78rem; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.sb-show-more:hover { background: var(--accent-lt); border-color: var(--accent); }

.avail-rows { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.avail-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background var(--speed-fast); }
.avail-row:hover { background: var(--surface-2); }
.avail-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.avail-label { flex: 1; font-size: 0.84rem; color: var(--muted); }
.avail-label em { font-style: normal; font-size: 0.72rem; }
.avail-switch { width: 34px; height: 18px; border-radius: 9px; background: var(--border); position: relative; transition: background var(--speed); flex-shrink: 0; border: 1px solid var(--border-strong); }
.avail-thumb { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: transform var(--speed); box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.avail-row.on .avail-switch { background: var(--accent-lt); border-color: var(--accent); }
.avail-row.on .avail-thumb  { transform: translateX(16px); background: var(--accent); }
.avail-row.on .avail-label  { color: var(--text); font-weight: 500; }
.mw-range-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mw-input { flex: 1; width: 0; padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; transition: border-color var(--speed-fast); }
.mw-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2,132,199,0.1); background: var(--surface); }
.mw-sep { font-size: 0.85rem; color: var(--muted); flex-shrink: 0; }
.sb-footer { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.btn-apply { width: 100%; padding: 10px; background: linear-gradient(135deg, #0f172a, #1e3a6e); color: white; border: none; border-radius: 8px; font-family: 'Inter', system-ui, sans-serif; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all var(--speed) ease; }
.btn-apply:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,23,42,0.3); }

.pagination-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
#pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pag-btn, .pp-btn { min-width: 36px; height: 36px; padding: 0 10px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 0.84rem; color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: all var(--speed-fast); font-weight: 500; }
.pag-btn:hover, .pp-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.pag-btn.active, .pp-btn.active { background: linear-gradient(135deg, #0284c7, #6366f1); color: white; border-color: transparent; box-shadow: 0 4px 12px rgba(2,132,199,0.28); font-weight: 700; }
.pag-btn.disabled { opacity: 0.38; pointer-events: none; }
.pag-btn.pag-dots { border-color: transparent; background: none; pointer-events: none; }
.per-page-strip { display: flex; align-items: center; gap: 4px; }
.per-page-label { font-size: 0.78rem; color: var(--muted); margin-right: 4px; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT CARDS — ELEVATED DESIGN
   ═══════════════════════════════════════════════════════════════ */
.catalog-content { animation: fadeIn 0.5s var(--ease-out-expo) both; }
.catalog-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.catalog-header h1 { margin: 0; font-size: 1.6rem; color: var(--primary); }
#product-grid, .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 20px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--speed-slow) var(--ease-out-expo); display: flex; flex-direction: column; height: 100%; position: relative; animation: fadeInUp 0.5s var(--ease-out-expo) both; }
.product-card::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(14,165,233,0.05) 0%, rgba(99,102,241,0.05) 100%); opacity: 0; transition: opacity var(--speed); pointer-events: none; }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 0 0 1px rgba(14,165,233,0.15); border-color: rgba(14,165,233,0.25); }
.product-card:hover::before { opacity: 1; }

.product-card-image, .product-image, .ss-card-img, #jsme_container { background: var(--image-bg); border: 1px solid var(--border); transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* Card image: 200px tall with minimal padding so even busy structures
   (steroids, peptides, fused polycyclics) render fully inside object-fit:contain. */
.product-card-image { position: relative; width: 100%; height: 200px; display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); place-items: center; overflow: hidden; }
.prod-img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; box-sizing: border-box; transition: transform 0.5s var(--ease-out-expo); }
.product-image img, .ss-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; transition: transform 0.5s var(--ease-out-expo); }
.product-card:hover .prod-img, .ss-card:hover .ss-card-img img { transform: scale(1.04); }
.product-card:hover .product-image { box-shadow: var(--shadow-glow); }
.prod-img--logo { object-fit: contain; padding: 28px; opacity: 0.3; filter: grayscale(1); }
/* DISCUSS-20 (DECIDED 2026-05-23): dark-mode structure images.
   Old approach used filter:invert which mangles colored substructure
   highlights (yellow→blue, etc). New approach: give the image card a
   light off-white background even in dark mode so white-bg PNGs render
   naturally. Image bytes are never altered. */
[data-theme="dark"] .product-card-image,
[data-theme="dark"] .product-image,
[data-theme="dark"] .ss-card-img,
[data-theme="dark"] .pd-image {
    background: #f1f5f9;  /* light slate — friendly to white-bg PNGs */
    border-color: rgba(255,255,255,0.08);
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .product-card-image,
    html:not([data-theme="light"]) .product-image,
    html:not([data-theme="light"]) .ss-card-img,
    html:not([data-theme="light"]) .pd-image {
        background: #f1f5f9;
        border-color: rgba(255,255,255,0.08);
    }
}

.avail-ribbon { text-align: center; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 0; width: 100%; }
.avail-ribbon--in-stock { background: var(--success-lt); color: #065f46; }
.avail-ribbon--backorder { background: var(--warning-lt); color: #92400e; }

.avail-ribbon--on-request { background: var(--accent-lt); color: #075985; }
.avail-ribbon--discontinued { background: var(--danger-lt); color: #991b1b; }

.product-card-content { padding: 16px; flex: 1; display: flex; flex-direction: column; background: transparent; }
.product-card-title { font-family: 'Inter', system-ui, sans-serif; font-size: 0.9rem; font-weight: 600; line-height: 1.4; margin: 0 0 12px 0; letter-spacing: -0.01em; }
.product-card-title a { color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-title a:hover { color: var(--accent); }

/* Full compound name caption — shown below the (possibly clamped) card title
   when a search matched on a generic fragment like "Impurity A" rather than
   the whole name, so users can tell look-alike impurity cards apart. */
.product-card-fullname {
    font-size: 0.78rem; line-height: 1.4; margin: 0 0 8px 0;
    color: var(--muted); word-break: break-word; overflow-wrap: anywhere;
}
/* Pull only the first caption right up under the title; if more than one
   caption is present (full name + IUPAC + matched synonym can all appear
   together when a search term matches multiple fields), each subsequent one
   just stacks with its own top-margin instead of overlapping. */
.product-card-title + .product-card-fullname { margin-top: -6px; }
.product-card-fullname .pcf-label { font-weight: 600; color: var(--muted); }
.product-card-fullname .pcf-value { color: var(--text); }
/* IUPAC name and matched-synonym captions reuse the same base style but get
   a faint left accent so it's visually clear they're a different field from
   the "full compound name" caption above them. */
.product-card-iupac, .product-card-synonym {
    padding-left: 8px; border-left: 2px solid var(--border, #e2e2e2);
}

/* Search term highlighting — used in search results (simple + advanced) so
   users can see WHY a compound name matched their query. */
mark.search-hl {
    background: var(--warning-lt);
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}
.product-specs-grid, .product-specs, .ss-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; background: var(--specs-bg); padding: 10px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--border); }
.spec-item { display: flex; flex-direction: column; gap: 2px; }
.spec-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.spec-value { font-size: 0.78rem; font-weight: 600; font-family: 'JetBrains Mono', monospace; color: var(--text); word-break: break-word; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); background: transparent; }
.product-type-badge { font-size: 0.68rem; background: var(--accent-lt); color: var(--accent); padding: 4px 10px; border-radius: 20px; font-weight: 600; letter-spacing: 0.02em; }
.view-details-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--accent); text-decoration: none; padding: 6px 10px; border-radius: 8px; transition: all var(--speed-fast); font-family: 'Inter', system-ui, sans-serif; }
.view-details-btn:hover { background: var(--accent-lt); transform: translateX(3px); }
.stock-badge, .availability-badge { display: none; }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT DETAIL PAGE
   ═══════════════════════════════════════════════════════════════ */
.product-container { max-width: 1200px; margin: 36px auto; padding: 0 24px; }

/* ═══════════════════════════════════════════════════════════════
   RELATED COMPOUND CALLOUT (free-base / salt pairs, etc.)
   ═══════════════════════════════════════════════════════════════ */
.related-compound-callout {
    background: linear-gradient(135deg, rgba(2,132,199,0.08), rgba(2,132,199,0.03));
    border: 1.5px solid rgba(2,132,199,0.25);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.related-compound-callout-title {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--primary, #0284c7);
    white-space: nowrap;
}
.related-compound-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    text-decoration: none;
    max-width: 320px;
    transition: background var(--speed-fast, 0.15s) ease;
}
.related-compound-item:hover { background: rgba(2,132,199,0.08); }
.related-compound-name {
    font-weight: 600;
    color: var(--text, #1e293b);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.related-compound-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.related-compound-badge.badge-stock { background: #dcfce7; color: #166534; }
.related-compound-admin-note {
    width: 100%;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed rgba(2,132,199,0.25);
    font-size: 0.72rem;
    color: #92400e;
}
.product-main { background: var(--surface); padding: 36px; border-radius: var(--radius-xl); border: 1px solid var(--border); margin-bottom: 24px; box-shadow: var(--shadow); animation: fadeInUp 0.5s var(--ease-out-expo) both; }
.product-grid { display: grid; grid-template-columns: 300px 1fr; gap: 44px; }
.product-image-section { text-align: center; }
.product-image { background: var(--image-bg); border-radius: var(--radius-lg); min-height: 300px; margin-bottom: 20px; transition: box-shadow var(--speed); }
.product-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.product-title { color: var(--primary); margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.03em; }
.product-header .availability-badge { position: static; padding: 6px 14px; border-radius: 24px; font-size: 14px; font-weight: 600; }
.product-header .in-stock { background: var(--success-lt); color: #065f46; }
.product-header .backorder { background: var(--warning-lt); color: #92400e; }
.product-detail .specs-grid, .product-main .specs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; margin: 24px 0; background: var(--specs-bg); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); }
.quick-order-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.quick-order-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.synonyms-section, .identifiers-section { background: var(--surface); padding: 24px 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.synonyms-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.synonym-tag { background: var(--accent-lt); color: var(--accent); padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); transition: all var(--speed-fast); }
.synonym-tag:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.identifier-item { margin-bottom: 16px; }
.identifier-item label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.identifier-item code { display: block; padding: 10px 14px; background: var(--surface-2); border-radius: 8px; font-size: 13px; word-break: break-all; border: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; color: var(--text); }
.action-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: var(--radius); font-weight: 600; font-size: 15px; cursor: pointer; transition: all var(--speed) var(--ease-out-expo); border: none; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
.btn-save { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-save:hover { border-color: var(--warning); background: var(--warning-lt); transform: translateY(-2px); }
.btn-save.saved { background: var(--warning-lt); border-color: var(--warning); color: #92400e; }
.btn-cart { background: linear-gradient(135deg, #0284c7, #0369a1); color: white; box-shadow: 0 4px 14px rgba(2,132,199,0.28); }
.btn-cart:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(2,132,199,0.38); }
.btn-quote { background: linear-gradient(135deg, #0f172a, #1e3a6e); color: white; box-shadow: 0 4px 14px rgba(15,23,42,0.2); }
.btn-quote:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,0.3); }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT DETAIL — COMPACT MODERN CARD (v5)
   Dense info layout with Inter + JetBrains Mono typography.
   ═══════════════════════════════════════════════════════════════ */
.pd-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.pd-grid { display: grid; grid-template-columns: 280px 1fr; gap: 28px; }
@media (max-width: 820px) { .pd-grid { grid-template-columns: 1fr; gap: 18px; } }

.pd-aside { display: flex; flex-direction: column; gap: 12px; }
.pd-image { position: relative; background: var(--image-bg); border: 1px solid var(--border); border-radius: 12px; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: box-shadow var(--speed); }
.pd-image img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 14px; transition: transform 0.4s var(--ease-out-expo); }
.pd-image--zoomable { cursor: zoom-in; }
.pd-image--zoomable:hover img { transform: scale(1.03); }
.pd-image--zoomable .zoom-hint { position: absolute; bottom: 10px; right: 10px; font-size: 20px; opacity: 0.35; pointer-events: none; transition: opacity .2s; }
.pd-image--zoomable:hover .zoom-hint { opacity: 0.85; }
/* DISCUSS-20: image bytes preserved — light bg on .pd-image (above) does the work */

.pd-actions { display: flex; flex-direction: column; gap: 6px; }
.pd-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 12.5px; line-height: 1.2;
  cursor: pointer; transition: all .2s var(--ease-out-expo);
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
}
.pd-btn--save  { background: var(--surface); color: var(--text); border-color: var(--border); }
.pd-btn--save:hover  { border-color: var(--warning); background: var(--warning-lt); transform: translateY(-1px); }
.pd-btn--save.saved  { background: var(--warning-lt); border-color: var(--warning); color: #92400e; }
.pd-btn--cart  { background: linear-gradient(135deg, #0284c7, #0369a1); color: white; box-shadow: 0 2px 8px rgba(2,132,199,0.25); }
.pd-btn--cart:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(2,132,199,0.35); }
.pd-btn--quote { background: linear-gradient(135deg, #0f172a, #1e3a6e); color: white; box-shadow: 0 2px 8px rgba(15,23,42,0.18); }
.pd-btn--quote:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,23,42,0.28); }

.pd-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pd-catalog { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; background: var(--accent-lt); color: var(--accent); border-radius: 6px; letter-spacing: 0.02em; }
/* .pd-title — product detail compound name. Was .pd-name but collided with
   the parent-drug filter list .pd-name in the catalog sidebar. */
.pd-title { margin: 0; flex: 1 1 200px; font-family: 'Inter', system-ui, sans-serif; font-size: clamp(1.1rem, 2.2vw, 1.45rem); font-weight: 700; color: var(--primary); letter-spacing: -0.02em; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }
.pd-avail { font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pd-avail.in-stock { background: var(--success-lt); color: #065f46; }
.pd-avail.backorder { background: var(--warning-lt); color: #92400e; }

.pd-identity, .pd-attrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; padding: 11px 14px; background: var(--specs-bg); border: 1px solid var(--border); border-radius: 10px; }
.pd-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-k { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pd-v { font-size: 0.82rem; font-weight: 600; color: var(--text); word-break: break-word; }
.pd-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }
.pd-link { color: var(--accent); text-decoration: none; }
.pd-link:hover { text-decoration: underline; }
.pd-link svg { vertical-align: -2px; }

.pd-cas-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pd-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; line-height: 1.3; white-space: nowrap; }
.pd-badge--verified  { background: #dcfce7; color: #166534; }
.pd-badge--multi     { background: #dbeafe; color: #1e40af; }
.pd-badge--unverified{ background: #fef3c7; color: #92400e; }

.pd-iupac { padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.pd-iupac .pd-k { display: block; margin-bottom: 4px; }
.pd-iupac-text { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; font-weight: 500; color: var(--text); line-height: 1.55; word-break: break-word; }

.pd-other-cas { padding: 10px 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; }
[data-theme="dark"] .pd-other-cas { background: rgba(120,53,15,0.18); border-color: rgba(245,158,11,0.35); }
.pd-other-cas .pd-k { color: #92400e; display: block; margin-bottom: 5px; }
[data-theme="dark"] .pd-other-cas .pd-k { color: #fcd34d; }
.pd-cas-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-cas-list code { font-family: 'JetBrains Mono', monospace; font-size: 0.74rem; background: #fef3c7; color: #78350f; padding: 2px 8px; border-radius: 4px; border: 1px solid #fde68a; font-weight: 500; }
[data-theme="dark"] .pd-cas-list code { background: rgba(245,158,11,0.18); color: #fcd34d; border-color: rgba(245,158,11,0.35); }

/* Pharmacopeia auto-links */
.pd-pharma { padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.pd-pharma .pd-k { display: block; margin-bottom: 6px; }
.pd-pharma-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-pharma-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-family: 'Inter', system-ui, sans-serif; font-size: 0.74rem; font-weight: 600; text-decoration: none; transition: all .15s var(--ease-out-expo); }
.pd-pharma-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pd-pharma-link[data-std="EP"]  { color: #1e40af; }
.pd-pharma-link[data-std="USP"] { color: #b91c1c; }
.pd-pharma-link[data-std="JP"]  { color: #c2410c; }
.pd-pharma-link[data-std="IP"]  { color: #15803d; }
.pd-pharma-link[data-std="WHO"] { color: #6d28d9; }
.pd-pharma-link:hover[data-std="EP"]  { border-color: #1e40af; }
.pd-pharma-link:hover[data-std="USP"] { border-color: #b91c1c; }
.pd-pharma-link:hover[data-std="JP"]  { border-color: #c2410c; }
.pd-pharma-link:hover[data-std="IP"]  { border-color: #15803d; }
.pd-pharma-link:hover[data-std="WHO"] { border-color: #6d28d9; }

/* ═══════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; }
.form-label { font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input, .form-select, .form-textarea, .filter-input, .filter-select, .quantity-input {
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; transition: all var(--speed-fast); background: var(--input-bg); width: 100%; color: var(--text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .filter-input:focus, .filter-select:focus, .quantity-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2,132,199,0.1); background: var(--input-focus-bg);
}
input::placeholder, textarea::placeholder, .filter-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; padding-top: 10px; cursor: pointer; font-size: 0.9rem; }
.form-checkbox { width: 18px; height: 18px; accent-color: var(--accent); }
.signin-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--muted); }
.remember-label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   TABLES & DATA
   ═══════════════════════════════════════════════════════════════ */
.data-table, .admin-table, .product-table, .order-items-table, .items-table, .cart-table { width: 100%; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border-collapse: collapse; }
.data-table th, .admin-table th, .product-table thead th, .order-items-table th, .items-table th, .cart-table th {
  background: var(--table-header-bg); color: #ffffff; padding: 13px 16px; text-align: left; font-weight: 600; font-size: 0.84rem;
}
.data-table td, .admin-table td, .product-table tbody td, .order-items-table td, .items-table td, .cart-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle;
}
.data-table tr:hover td, .admin-table tr:hover td, .product-table tbody tr:hover td { background: var(--table-hover-bg); }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD & ADMIN
   ═══════════════════════════════════════════════════════════════ */
.dashboard-container, .admin-container, .admin-products-container { max-width: 1440px; margin: 0 auto; padding: 28px 24px; animation: fadeIn 0.5s ease both; }
.dashboard-header, .admin-header, .page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.dashboard-header h1, .admin-header h1, .page-header h1 { color: var(--primary); margin: 0; font-size: 1.9rem; }
.user-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; background: var(--accent-lt); color: var(--accent); margin-left: 8px; }
.dashboard-nav, .admin-tabs, .nav-tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 2px solid var(--border); padding-bottom: 0; flex-wrap: wrap; }
.dashboard-nav a, .admin-tabs a, .nav-tabs .tab-link { padding: 11px 20px; text-decoration: none; color: var(--muted); font-weight: 500; border-radius: 8px 8px 0 0; transition: all var(--speed); font-size: 0.88rem; position: relative; bottom: -2px; }
.dashboard-nav a:hover, .admin-tabs a:not(.active):hover, .nav-tabs .tab-link:not(.active):hover { background: var(--surface-2); color: var(--primary); }
.dashboard-nav a.active, .admin-tabs a.active, .nav-tabs .tab-link.active { color: var(--accent); border-bottom: 2px solid var(--accent); background: transparent; font-weight: 700; }
.admin-tabs a.active, .nav-tabs .tab-link.active { background: linear-gradient(135deg, #0284c7, #6366f1); color: white; }
.dashboard-nav .badge, .nav-tabs .badge { background: var(--danger); color: white; border-radius: 20px; padding: 2px 8px; font-size: 0.7rem; margin-left: 6px; }
.content-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title h2 { margin: 0; color: var(--primary); font-size: 1.2rem; }
.table-wrapper { overflow-x: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card, .stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; transition: all var(--speed-slow) var(--ease-out-expo); position: relative; overflow: hidden; animation: fadeInUp 0.5s var(--ease-out-expo) both; }
.stat-card::before, .stat-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.stat-card:hover, .stat-box:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,233,0.2); }
.stat-icon { font-size: 28px; margin-bottom: 10px; }
.stat-value { font-family: 'Inter', system-ui, sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.04em; }
.stat-number { font-family: 'Inter', system-ui, sans-serif; font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label, .stat-desc { color: var(--muted); font-size: 0.85rem; margin-top: 4px; font-weight: 500; }
.stat-detail { display: flex; gap: 12px; margin-top: 12px; font-size: 0.78rem; border-top: 1px solid var(--border); padding-top: 12px; color: var(--muted); }
.mini-product-card { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; transition: all var(--speed); }
.mini-product-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.mini-product-card h4 { margin: 0 0 8px 0; font-size: 0.9rem; }
.mini-product-card h4 a { color: var(--text); text-decoration: none; }
.mini-product-card h4 a:hover { color: var(--accent); }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.notification-item { padding: 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; transition: background var(--speed-fast); }
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: var(--accent-lt); border-left: 3px solid var(--accent); }
.notification-icon { font-size: 20px; }
.notification-content { flex: 1; }
.notification-title { font-weight: 700; margin-bottom: 4px; color: var(--text); }
.notification-time { font-size: 0.75rem; color: var(--muted); }
.address-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; position: relative; transition: all var(--speed); background: var(--surface); }
.address-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.address-card.default { border-color: var(--accent); background: var(--accent-lt); }
.address-badge { position: absolute; top: 12px; right: 12px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; padding: 3px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 700; }
.address-card p { color: var(--muted); }
.address-card strong { color: var(--text); }

/* Status pills & badges */
.status-pill, .status-badge, .status-active, .status-inactive, .status-draft, .status-new, .status-processing, .status-shipped, .status-delivered, .status-cancelled, .status-quoted, .status-accepted, .status-pending, .status-paid {
  display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; text-transform: capitalize; letter-spacing: 0.02em;
}
.status-new { background: var(--accent-lt); color: var(--accent); }
.status-processing, .status-pending, .status-draft { background: var(--warning-lt); color: #92400e; }
.status-shipped { background: rgba(6,182,212,0.15); color: #0891b2; }
.status-delivered, .status-accepted, .status-paid, .status-active { background: var(--success-lt); color: #065f46; }
.status-cancelled, .status-inactive { background: var(--danger-lt); color: #991b1b; }
.status-quoted { background: var(--accent2-lt); color: #4338ca; }

/* ═══════════════════════════════════════════════════════════════
   CART & QUOTE
   ═══════════════════════════════════════════════════════════════ */
.cart-container, .quote-container, .order-page { max-width: 1000px; margin: 44px auto; padding: 0 24px; }
.cart-indicator { position: fixed; bottom: 30px; right: 30px; background: linear-gradient(135deg, #0284c7, #6366f1); color: white; padding: 16px 24px; border-radius: 50px; box-shadow: 0 8px 30px rgba(2,132,199,0.35); display: flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; z-index: 100; transition: all var(--speed) var(--ease-out-expo); animation: fadeInUp 0.5s var(--ease-bounce) both; }
.cart-indicator:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 36px rgba(2,132,199,0.45); }
.checkout-section, .order-card, .quote-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; margin-top: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.checkout-btn { background: linear-gradient(135deg, #0284c7, #6366f1); color: white; padding: 16px 32px; border: none; border-radius: var(--radius); font-family: 'Inter', system-ui, sans-serif; font-size: 16px; font-weight: 700; cursor: pointer; width: 100%; transition: all var(--speed) ease; box-shadow: 0 4px 14px rgba(2,132,199,0.28); }
.checkout-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(2,132,199,0.38); }
.quote-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.quote-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; background: var(--surface-2); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--text); }
.admin-section { margin-top: 30px; padding-top: 24px; border-top: 2px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════
   AUTH & SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.auth-main { padding: 80px 20px; min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at top, rgba(14,165,233,0.08) 0%, transparent 50%), radial-gradient(ellipse at bottom, rgba(99,102,241,0.07) 0%, transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: var(--surface-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 36px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: scaleIn 0.5s var(--ease-bounce) both; color: var(--text); }
.auth-card-wide { max-width: 520px; }
.auth-heading { text-align: center; margin-bottom: 28px; }
.auth-heading h2 { color: var(--primary); margin-bottom: 8px; font-size: 1.7rem; }
.auth-heading p, .auth-footer-link { color: var(--muted); font-size: 0.9rem; margin-top: 20px; }

/* Sign-in page info pane — desktop-only marketing context next to the
   auth card (what quick-quote does, why register). Hidden below 900px
   rather than stacked, so the login form itself stays the fast path on
   mobile instead of pushing it below a scroll of marketing copy. */
.auth-shell { display: flex; gap: 56px; align-items: center; max-width: 980px; width: 100%; margin: 0 auto; }
.auth-info-pane { flex: 1; min-width: 0; color: var(--text); }
.auth-info-pane h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: 14px; line-height: 1.25; }
.auth-info-pane > p.auth-info-lead { color: var(--muted); font-size: 1rem; line-height: 1.6; margin-bottom: 24px; max-width: 44ch; }
.auth-info-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 16px; }
.auth-info-list li { display: flex; gap: 12px; align-items: flex-start; }
.auth-info-list .aif-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1.3; }
.auth-info-list b { display: block; margin-bottom: 2px; font-size: 0.94rem; }
.auth-info-list .aif-sub { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.auth-trial-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--success); font-size: 0.85rem; font-weight: 600; padding: 10px 16px; border-radius: 999px; }
@media (max-width: 900px) {
  .auth-info-pane { display: none; }
  .auth-shell { justify-content: center; }
}
.section { padding: 64px 36px; max-width: 1200px; margin: 0 auto; }
.section-title { font-size: 1.9rem; color: var(--primary); margin-bottom: 8px; letter-spacing: -0.03em; }
.section-sub { color: var(--muted); margin-bottom: 32px; max-width: 700px; font-size: 1rem; line-height: 1.7; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER — MODERN DARK
   ═══════════════════════════════════════════════════════════════ */
.site-footer { background: var(--footer-bg); color: #94a3b8; padding: 36px 36px 18px; margin-top: 48px; position: relative; overflow: hidden; }
.site-footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(14,165,233,0.4), rgba(99,102,241,0.4), transparent); }
.site-footer::after { content: ''; position: absolute; top: -60%; right: -20%; width: 50%; height: 100%; background: radial-gradient(ellipse, rgba(14,165,233,0.06) 0%, transparent 60%); pointer-events: none; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px 32px; position: relative; z-index: 1; }
.footer-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; }
.footer-logo-img { width: 30px !important; height: 30px !important; min-width: 30px; min-height: 30px; max-width: 30px !important; max-height: 30px !important; display: inline-block !important; flex-shrink: 0; object-fit: contain; filter: brightness(1.1) drop-shadow(0 0 8px rgba(14,165,233,0.3)); overflow: hidden; }
.footer-logo-text { color: #fff; font-family: 'Inter', system-ui, sans-serif; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; }
.footer-tagline { color: rgba(226,232,240,0.6); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }
.footer-tagline-accent { color: #38bdf8; }
.footer-col { }
.footer-heading { color: #e2e8f0; font-family: 'Inter', system-ui, sans-serif; font-size: 0.84rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 10px; }
.footer-col p { margin: 0 0 6px; font-size: 0.9rem; line-height: 1.5; color: #64748b; }
.footer-col p:last-child { margin-bottom: 0; }
.footer-link { display: block; margin-bottom: 5px; color: #64748b; text-decoration: none; font-size: 0.9rem; line-height: 1.5; transition: all var(--speed-fast); }
.footer-link:hover { color: #94a3b8; padding-left: 6px; }
.footer-email { color: #38bdf8 !important; text-decoration: none; transition: color var(--speed-fast); }
.footer-email:hover { color: #7dd3fc !important; }
.footer-bottom { text-align: center; margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.82rem; color: #334155; position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════════
   MESSAGES, ALERTS & STATES
   ═══════════════════════════════════════════════════════════════ */
.message, .alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 500; }
.message { animation: slideInFromBottom 0.4s var(--ease-out-expo) both; }
.alert { animation: slideDown 0.3s var(--ease-out-expo) both; }
.message-success, .alert-success { background: var(--success-lt); color: #065f46; border: 1px solid #a7f3d0; }
.message-error, .alert-error { background: var(--danger-lt); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-lt); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--accent-lt); color: #075985; border: 1px solid #bae6fd; }
.toast-message { position: fixed; top: 80px; right: 24px; padding: 16px 24px; border-radius: var(--radius); color: white; font-weight: 600; z-index: 9999; animation: slideInFromBottom 0.4s var(--ease-bounce) both; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); }
.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info { background: linear-gradient(135deg, #0284c7, #6366f1); }
.empty-state, .error-state, .loading-state { text-align: center; padding: 70px 24px; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); grid-column: 1 / -1; animation: fadeIn 0.4s ease both; color: var(--muted); }
.empty-state h3 { color: var(--text); }
/* ── Inline spinner: rotating benzene ring (16–24px friendly) ── */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M12 1.5L21.1 6.75L21.1 17.25L12 22.5L2.9 17.25L2.9 6.75ZM12 4.5L5.5 8.25L5.5 15.75L12 19.5L18.5 15.75L18.5 8.25Z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M12 1.5L21.1 6.75L21.1 17.25L12 22.5L2.9 17.25L2.9 6.75ZM12 4.5L5.5 8.25L5.5 15.75L12 19.5L18.5 15.75L18.5 8.25Z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
  animation: spin 1.6s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}
.loading-spinner--sm { width: 16px; height: 16px; margin-right: 6px; }
.loading-spinner--lg { width: 32px; height: 32px; }

/* ── Section/full-page loader: animated HPLC chromatogram trace ── */
.chrom-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 50px 24px; width: 100%; color: var(--muted); }
.chrom-loader__svg { width: min(300px, 70%); height: auto; overflow: visible; }
.chrom-loader__axis { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.7; }
.chrom-loader__trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: chromDraw 2.4s var(--ease-out-expo) infinite;
  filter: drop-shadow(0 1px 4px rgba(2,132,199,0.28));
}
.chrom-loader__label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
@keyframes chromDraw {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  6%   { opacity: 1; }
  72%  { stroke-dashoffset: 0;   opacity: 1; }
  90%  { stroke-dashoffset: 0;   opacity: 0; }
  100% { stroke-dashoffset: 100; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation-duration: 4s; }
  .chrom-loader__trace { animation: none; stroke-dashoffset: 0; opacity: 1; }
}
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: inherit; text-decoration: underline; padding: 0; }

/* ═══════════════════════════════════════════════════════════════
   STRUCTURE SEARCH & MISC
   ═══════════════════════════════════════════════════════════════ */
.search-page-container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.search-header-card { background: var(--accent-lt); padding: 20px 28px; border-radius: var(--radius-lg); margin-bottom: 28px; border: 1px solid var(--border); border-left: 4px solid var(--accent); color: var(--text); }
.search-header-card h1 { margin: 0 0 6px 0; color: var(--primary); font-size: 1.4rem; }
.search-header-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.search-header-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 20px; }
.results-count { margin-bottom: 16px; color: var(--muted); font-size: 0.9rem; }
.structure-search-box { background: var(--accent-lt); padding: 32px; border-radius: var(--radius-xl); margin-bottom: 28px; border: 1px solid var(--border); text-align: center; position: relative; overflow: hidden; color: var(--text); }
.structure-search-box::before { content: ''; position: absolute; top: -50%; left: -20%; width: 60%; height: 200%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); animation: shimmer 3s ease-in-out infinite; background-size: 200% auto; }
.search-options { display: flex; gap: 12px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.search-options label { display: flex; align-items: center; gap: 7px; padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 24px; cursor: pointer; font-size: 0.85rem; color: var(--muted); transition: all var(--speed-fast); background: var(--surface); }
.search-options label:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.search-options label.selected { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); font-weight: 600; box-shadow: 0 4px 12px rgba(2,132,199,0.15); }
.search-options input[type="radio"] { display: none; }
.button-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
#jsme_container { width: 100%; max-width: 560px; height: 380px; margin: 0 auto 20px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); position: relative; overflow: hidden; }
#jsme_loading_overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--surface); color: var(--muted); font-size: 0.9rem; pointer-events: none; z-index: 10; transition: opacity 0.4s; }
#jsme_loading_overlay.hidden { opacity: 0; pointer-events: none; }
#smiles_input { width: 100%; max-width: 560px; padding: 12px 16px; margin: 4px auto 16px; border: 1.5px solid var(--border); border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.875rem; display: block; background: var(--surface); color: var(--text); transition: all var(--speed); }
#smiles_input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2,132,199,0.12); }
.similarity-control { display: none; align-items: center; gap: 10px; justify-content: center; margin-bottom: 14px; font-size: 0.85rem; color: var(--muted); }
.similarity-control.visible { display: flex; }
#threshold_slider { accent-color: var(--accent); width: 140px; }
#threshold_label { font-weight: 700; color: var(--accent); min-width: 36px; }
#search_status { margin: 14px auto 0; font-size: 0.875rem; min-height: 22px; max-width: 560px; text-align: center; color: var(--muted); }
.ss-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: all var(--speed-slow) var(--ease-out-expo); }
.ss-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,233,0.2); }
.ss-card-img { height: 150px; background: var(--image-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ss-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform 0.5s ease; }
.ss-card:hover .ss-card-img img { transform: scale(1.05); }
.ss-card-img img.logo-fallback { opacity: 0.3; filter: grayscale(1); padding: 28px; }
.ss-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; background: transparent; }
.ss-card-title { font-size: 0.9rem; font-weight: 700; line-height: 1.4; margin: 0; }
.ss-card-title a { color: var(--text); text-decoration: none; }
.ss-card-title a:hover { color: var(--accent); }
.ss-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 9px; border-radius: 8px; }
.ss-spec { font-size: 0.75rem; }
.ss-spec strong { display: block; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; }
.ss-spec span { color: var(--text); }
.ss-score-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 2px 0; }
.ss-score-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #38bdf8, var(--accent)); transition: width 0.6s var(--ease-out-expo); }
.ss-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto; }
.ss-type-badge { font-size: 0.7rem; background: var(--accent-lt); color: var(--accent); padding: 3px 9px; border-radius: 14px; font-weight: 600; }
.synonym-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.synonym-wrap .synonym-tag { font-size: 0.68rem; padding: 2px 7px; background: var(--surface-2); border-radius: 12px; color: var(--muted); border: 1px solid var(--border); }
.engine-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; padding: 3px 10px; border-radius: 20px; font-weight: 700; margin-left: 10px; vertical-align: middle; }
.engine-rdkit { background: var(--success-lt); color: #065f46; }
.engine-fallback { background: var(--warning-lt); color: #92400e; }
.engine-keyword { background: var(--accent-lt); color: #075985; }

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════ */
.theme-toggle-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,255,255,0.15); border-radius: 50%; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.25s ease; flex-shrink: 0; position: relative; overflow: hidden; }
.theme-toggle-btn:hover { background: rgba(255,255,255,0.14); color: #fff; transform: rotate(15deg); box-shadow: 0 0 16px rgba(251,191,36,0.3); }
.theme-toggle-btn svg { width: 18px; height: 18px; transition: transform 0.3s ease, opacity 0.2s ease; position: absolute; }
.theme-toggle-btn .icon-sun, .theme-toggle-btn .icon-moon { position: absolute; transition: opacity 0.3s ease, transform 0.3s ease; }
/* Light mode default */
.theme-toggle-btn .icon-moon { opacity: 1; transform: scale(1) rotate(0deg); }
.theme-toggle-btn .icon-sun { opacity: 0; transform: scale(0.5) rotate(90deg); }
/* Dark mode active */
[data-theme="dark"] .theme-toggle-btn .icon-sun { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="dark"] .theme-toggle-btn .icon-moon { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.theme-toggle-btn:active { transform: rotate(30deg) scale(0.92); transition: transform 0.1s ease; }

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted-sm { color: var(--muted); font-size: 0.88rem; }
.text-xs   { font-size: 0.78rem; }
.text-sm   { font-size: 0.85rem; }
.text-muted { color: var(--muted); }
.fw-500    { font-weight: 500; }
.fw-600    { font-weight: 600; }
.fw-400    { font-weight: 400; }
.mb-1      { margin-bottom: 8px; }
.mb-2      { margin-bottom: 16px; }
.mb-3      { margin-bottom: 24px; }
.mt-1      { margin-top: 8px; }
.mt-2      { margin-top: 16px; }
.mt-3      { margin-top: 24px; }
.mt-4      { margin-top: 32px; }
.gap-2     { gap: 16px; }
.d-flex    { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 20px; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.link-accent { color: var(--accent); text-decoration: none; font-weight: 500; }
.link-accent:hover { text-decoration: underline; }
.link-muted { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.img-fallback { object-fit: contain; padding: 8px; opacity: 0.4; filter: grayscale(1); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-active { background: var(--success-lt); color: #065f46; }
.badge-inactive { background: var(--danger-lt); color: #991b1b; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE & TOUCH OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: block !important; }
  /* Collapse the full inline header search bar to a single lens-icon button.
     This is the root fix for "hamburger unreachable on mobile": the full
     search bar (input + search button + advanced-search button + structure
     link) was staying in the same flex row as the hamburger all the way
     down to phone widths, competing for space and — combined with iOS
     auto-zoom on small-font inputs — pushing the hamburger off-screen once
     the field was focused. Removing it from the row entirely guarantees the
     hamburger always has fixed, reachable space. */
  .search-wrapper { display: none; }
  .structure-search-link { display: none !important; }
  /* FEAT-23: catalog goes single-column, sidebar becomes off-screen drawer */
  .catalog-layout { grid-template-columns: 1fr; padding: 16px; }
  .mobile-filter-bar { display: flex; }
  .catalog-sidebar {
    display: none;
    position: static !important;
    width: 100%;
    height: auto;
    max-height: none;
    z-index: 10;
    border-radius: var(--radius-lg);
    margin-top: 10px;
    margin-bottom: 20px;
    transition: none;
    box-shadow: var(--shadow-sm);
    padding-bottom: 0;
  }
  .catalog-sidebar.drawer-open { display: block; animation: slideDown 0.3s var(--ease-out-expo); }
  .drawer-close-row { display: flex; }
  /* Hide the inline sidebar header (sb-head) on mobile — drawer has its own close row */
  .catalog-sidebar.drawer-open .sb-head .sb-title { display: none; }
  /* Footer apply button is at bottom of drawer */
  .sb-footer { position: sticky; bottom: 0; background: var(--surface, #fff); border-top: 1px solid var(--border); padding: 12px 16px; margin: 0 -1px; }
  .order-cols, .seller-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .site-header { padding: 0 12px; }
  .header-container { gap: 8px; height: 58px; }
  .site-header.scrolled .header-container { height: 50px; }
  .mobile-filter-bar { top: 58px; } /* matches mobile header height */
  .logo-text { font-size: 0.98rem; }
  .hero { padding: 70px 24px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .order-parties-grid { grid-template-columns: 1fr; gap: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-nav { gap: 2px; }
  .dashboard-nav a { padding: 8px 12px; font-size: 0.84rem; }
  .results-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 28px 20px 16px; margin-top: 32px; }
}
@media (max-width: 640px) {
  .grid, #product-grid { grid-template-columns: 1fr; gap: 14px; }
  .auth-card { padding: 24px; }
  .product-main { padding: 20px; }
  .hero h1 { font-size: 1.7rem; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .logo-text { display: none; }
  .theme-toggle-btn { width: 34px; height: 34px; }
}
/* Prevent iOS Safari from auto-zooming the page on input focus, which is
   what visually shifted the hamburger off-screen — any text input under
   16px triggers this. Applies to the mobile menu's own search field too. */
@media (max-width: 768px) {
  .search-input { font-size: 16px; }
}
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 44px 30px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p  { font-size: 0.88rem; margin-bottom: 20px; }
  .auth-main { padding: 28px 20px; align-items: flex-start; }
  .auth-card { margin: 0 auto; max-height: 85vh; overflow-y: auto; }
  .site-header { position: relative; }
  .catalog-sidebar { position: static; }
}
@media (hover: none) and (pointer: coarse) {
  .product-card:hover, .stat-card:hover, .btn-primary:hover, .btn-outline:hover, .type-pill:hover, .purity-btn:hover, .pag-btn:hover, .avail-row:hover, .nav-link:hover, .mini-product-card:hover { transform: none !important; }
  .nav-link, .btn, .pag-btn, .type-pill, .purity-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .avail-row, .sb-sec-header { min-height: 48px; }
  .filter-input, .form-input, .form-select, .sort-select, .mw-input { min-height: 44px; font-size: 16px !important; }
  select { font-size: 16px !important; }
  .site-header { backdrop-filter: none; background: rgba(9,18,36,0.98); }
}
@media (hover: hover) and (pointer: fine) {
  .product-card:hover { transform: translateY(-6px); }
  .btn-primary:hover  { transform: translateY(-2px); }
}
@supports (padding: max(0px)) {
  .site-header { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .site-footer { padding-bottom: max(18px, calc(14px + env(safe-area-inset-bottom))); padding-left: max(36px, env(safe-area-inset-left)); padding-right: max(36px, env(safe-area-inset-right)); }
  .cart-indicator { bottom: max(30px, calc(20px + env(safe-area-inset-bottom))); right: max(30px, env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .hero::before, .hero::after, .hero-particles span, .logo-img, .not-found-icon { animation: none !important; }
}
@media print {
  .site-header, .site-footer, .dashboard-nav, .admin-tabs, .cart-indicator, .btn-cart, .btn-save, .sidebar { display: none !important; }
  body  { background: var(--surface) !important; color: #000 !important; font-size: 11pt; }
  a     { color: #000 !important; text-decoration: underline; }
  .product-card, .stat-card, .content-card, .order-card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd !important; }
  .hero { background: #f0f0f0 !important; color: #000 !important; padding: 20pt; }
  h1,h2,h3 { color: #000 !important; }
}
/* ═══════════════════════════════════════════════════════════════
   SEARCH MODE TABS (Keyword / List / Structure)
   ═══════════════════════════════════════════════════════════════ */
.ss-tabs {
  display: flex;
  gap: 28px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto 18px;
  border-bottom: 1px solid var(--border);
}
.ss-tab {
  appearance: none; background: none; border: none; cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem; font-weight: 600; color: var(--muted);
  padding: 10px 4px 12px;
  text-decoration: none;
  position: relative;
  transition: color var(--speed-fast);
}
.ss-tab:hover { color: var(--accent); }
.ss-tab.active { color: var(--accent); }
.ss-tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   ADVANCED SEARCH PANEL
   ═══════════════════════════════════════════════════════════════ */
.adv-search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0 auto 24px;
  max-width: 900px;
  overflow: hidden;
  box-shadow: var(--shadow);
  /* Collapsed by default when a simple search is active */
  display: none;
}
.adv-search-panel.adv-open { display: block; animation: fadeInDown 0.25s var(--ease-out-expo) both; }

.adv-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a6e 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.adv-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.9rem; font-weight: 600;
  color: #fff; letter-spacing: 0.04em;
}
.adv-close-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7); border-radius: 6px; cursor: pointer;
  padding: 3px 9px; font-size: 0.8rem; transition: all var(--speed-fast);
}
.adv-close-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.adv-panel-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }

.adv-row { display: flex; flex-direction: column; gap: 8px; }
.adv-section-label {
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.adv-hint { font-weight: 400; font-size: 0.74rem; color: var(--muted); margin-left: 8px; text-transform: none; letter-spacing: 0; }

.adv-radio-group { display: flex; flex-wrap: wrap; gap: 12px; }
.adv-radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.88rem; color: var(--text); cursor: pointer;
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  transition: all var(--speed-fast); background: var(--bg);
}
.adv-radio-label:has(input:checked) { border-color: var(--accent); background: rgba(14,165,233,0.08); color: var(--accent); }
.adv-radio-label input { accent-color: var(--accent); }

.adv-checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.adv-check-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.84rem; color: var(--text); cursor: pointer;
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border);
  transition: all var(--speed-fast); background: var(--bg);
}
.adv-check-label:has(input:checked) { border-color: var(--accent); background: rgba(14,165,233,0.08); color: var(--accent); }
.adv-check-label input { accent-color: var(--accent); }

.adv-input-row { display: flex; gap: 10px; }
.adv-text-input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 0.92rem; font-family: 'Inter', sans-serif;
  transition: border-color var(--speed-fast);
}
.adv-text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.15); }

.adv-textarea {
  width: 100%; min-height: 120px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font-size: 0.88rem; font-family: 'JetBrains Mono', monospace; line-height: 1.7; resize: vertical;
  transition: border-color var(--speed-fast);
}
.adv-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.15); }

.adv-batch-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.adv-batch-count { font-size: 0.8rem; color: var(--muted); }

/* Search Compounds CTA — two-tone gradient distinct from the flat blue
   .btn-primary used elsewhere, so this page's main action stands out. */
#adv-search-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 4px 14px rgba(99,102,241,0.28);
}
#adv-search-btn:hover {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent2) 100%);
  box-shadow: 0 8px 22px rgba(99,102,241,0.38);
}

.adv-toggle-btn {
  display: block; margin: 0 auto 20px;
  padding: 8px 20px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.88rem; cursor: pointer;
  transition: all var(--speed-fast);
}
.adv-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.adv-toggle-link { color: var(--accent); font-size: 0.84rem; text-decoration: none; }
.adv-toggle-link:hover { text-decoration: underline; }

.adv-empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.adv-empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* Batch results */
.batch-results-summary {
  padding: 12px 0 16px; font-size: 0.9rem; color: var(--muted);
}
.batch-group { margin-bottom: 32px; }
.batch-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; margin-bottom: 14px;
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.batch-term { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: var(--primary); font-weight: 600; }
.batch-count { font-size: 0.8rem; color: var(--muted); background: var(--bg); padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); }

/* Batch coverage summary table — one row per input item, at-a-glance found/not-found (FR-1/FR-2) */
.batch-summary-table-wrap { margin-bottom: 28px; }
.bst-header-line {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.9rem; color: var(--muted); padding: 4px 0 12px;
}
.batch-summary-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.batch-summary-table thead th {
  text-align: left; padding: 10px 14px; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.batch-summary-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.batch-summary-table tbody tr:last-child td { border-bottom: none; }
.bst-idx { color: var(--muted); font-variant-numeric: tabular-nums; width: 2em; }
.bst-term { font-family: 'JetBrains Mono', monospace; color: var(--primary); }
.bst-status--found { color: #16a34a; white-space: nowrap; }
.bst-status--missing { color: var(--muted); white-space: nowrap; }
.bst-status--broad { color: #d97706; white-space: nowrap; } /* FR-5: broad any-match, not a fabricated single match */
.bst-match a { color: var(--accent); text-decoration: none; font-weight: 600; }
.bst-match a:hover { text-decoration: underline; }
.bst-more { font-size: 0.78rem; color: var(--accent); margin-left: 4px; text-decoration: none; }
.bst-more:hover { text-decoration: underline; }
.bst-row--missing .bst-term { opacity: 0.7; }
.bst-row--broad { background: rgba(217, 119, 6, 0.05); }
.bst-supplier { color: var(--primary); font-size: 0.85rem; }
.bst-count-badge { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.batch-summary-table td[rowspan] { vertical-align: top; padding-top: 12px; }
.bst-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#batch-copy-notfound, #batch-export-excel { font-size: 0.8rem; padding: 6px 12px; }
#batch-export-excel:disabled { opacity: 0.6; cursor: wait; }
.batch-group--broad .batch-group-header { border-left-color: #d97706; }

/* Real per-compound stock status — shown to every visitor (not admin-gated
   like the Supplier columns), same three-way bucketing as the catalog card
   avail-ribbon, so "found in the catalog" and "actually available to order
   right now" read as two different things instead of one blanket status. */
.bst-avail {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 0.72rem; font-weight: 600; padding: 2px 9px; border-radius: 20px;
}
.bst-avail--in-stock   { background: var(--success-lt); color: var(--success); }
.bst-avail--backorder  { background: var(--warning-lt); color: var(--warning); }
.bst-avail--on-request { background: var(--accent-lt);  color: var(--accent); }

@media (max-width: 760px) {
  .batch-summary-table { font-size: 0.8rem; }
  .batch-summary-table thead th, .batch-summary-table td { padding: 8px 8px; }
  /* Drop Supplier 2, then Supplier 1 as space runs out — Status, Matched
     Compound, and the (non-admin-gated) Availability column stay. Indices
     are 1-based counting ALL columns including the admin-only Supplier
     ones, so these two rules are no-ops for non-admin visitors (whose
     table only has 5 columns to begin with). */
  .batch-summary-table tbody td:nth-child(7),
  .batch-summary-table thead th:nth-child(7) { display: none; }
}
@media (max-width: 560px) {
  .batch-summary-table tbody td:nth-child(6),
  .batch-summary-table thead th:nth-child(6) { display: none; }
}

/* Catalog number badge in search results */
.cat-num { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--accent); letter-spacing: 0.03em; }

/* ── Advanced search: fields-searched hint row ──────────────── */
.adv-fields-hint {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; background: var(--bg); border-radius: 10px;
  border: 1px solid var(--border);
}
.adv-fields-hint-label {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.adv-fields-pill {
  font-size: 0.76rem; padding: 3px 10px; border-radius: 20px;
  background: var(--accent-lt); color: var(--accent);
  border: 1px solid rgba(14,165,233,0.25); font-weight: 600;
}
/* Each searched field gets its own hue, purely so the row reads as five
   distinct fields at a glance rather than one undifferentiated blue block.
   nth-of-type counts by tag, not class — the hint label before these pills
   is also a <span>, so the first .adv-fields-pill is actually the 2nd span
   sibling; indices below are shifted by 1 to account for that. */
.adv-fields-pill:nth-of-type(2) { background: var(--accent-lt); color: var(--accent); border-color: rgba(2,132,199,0.25); }
.adv-fields-pill:nth-of-type(3) { background: var(--accent2-lt); color: var(--accent2); border-color: rgba(99,102,241,0.25); }
.adv-fields-pill:nth-of-type(4) { background: var(--teal-lt); color: var(--teal); border-color: rgba(13,148,136,0.25); }
.adv-fields-pill:nth-of-type(5) { background: var(--warning-lt); color: var(--warning); border-color: rgba(245,158,11,0.3); }
.adv-fields-pill:nth-of-type(6) { background: var(--success-lt); color: var(--success); border-color: rgba(16,185,129,0.28); }

/* ── Advanced search: match mode toggle row ─────────────────── */
.adv-match-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 8px 0 2px;
}
.adv-match-label {
  font-size: 0.78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.adv-match-pills {
  display: flex; gap: 6px;
}
.adv-match-pill {
  display: inline-flex; align-items: center;
  font-size: 0.80rem; font-weight: 600;
  padding: 4px 13px; border-radius: 20px; cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--muted);
  transition: all 0.15s;
}
.adv-match-pill:hover {
  border-color: var(--accent); color: var(--accent);
}
.adv-match-pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
/* "Any" and "Exact" get distinct colors when active, so the current mode
   reads as a deliberate choice rather than just a generic "on" state. */
.adv-match-pill[data-mode="any"]:hover { border-color: var(--teal); color: var(--teal); }
.adv-match-pill[data-mode="any"].active { background: var(--teal); border-color: var(--teal); color: #fff; }
.adv-match-pill[data-mode="exact"]:hover { border-color: var(--accent2); color: var(--accent2); }
.adv-match-pill[data-mode="exact"].active { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.adv-match-hint {
  font-size: 0.75rem; color: var(--muted); font-style: italic;
}

/* ── Compact card list (batch search results) ───────────────── */
.compact-card-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }

.compact-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.compact-card:hover {
  border-color: var(--accent); background: var(--accent-lt);
  box-shadow: 0 2px 10px rgba(14,165,233,0.08);
}

/* coloured dot — availability indicator */
.cc-avail {
  flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
}
.cc-avail--in-stock   { background: #22c55e; }
.cc-avail--backorder  { background: #f59e0b; }
.cc-avail--on-request { background: var(--accent); }

.cc-body { flex: 1; min-width: 0; }

.cc-name {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}

.cc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }

.cc-cat {
  font-size: 0.72rem; font-weight: 700; padding: 1px 7px;
  border-radius: 20px; background: var(--accent-lt); color: var(--accent);
  border: 1px solid rgba(14,165,233,0.25);
}
.cc-field {
  font-size: 0.74rem; color: var(--muted); font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.cc-lbl {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: 0.05em; margin-right: 3px;
}
.cc-arrow {
  flex-shrink: 0; font-size: 0.85rem; color: var(--accent);
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.compact-card:hover .cc-arrow { opacity: 1; transform: translateX(3px); }

/* ── Batch: zero-result rows ────────────────────────────────── */
.batch-no-results {
  font-size: 0.84rem; color: var(--muted); padding: 8px 16px 4px; margin: 0;
}
.batch-group--miss .batch-group-header { border-left-color: var(--border); opacity: 0.6; }
.batch-count--miss { color: var(--muted); opacity: 0.7; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .adv-panel-body { padding: 16px; }
  .adv-input-row { flex-direction: column; }
  .adv-checkbox-grid { gap: 6px; }
  .adv-check-label, .adv-radio-label { font-size: 0.82rem; padding: 5px 10px; }
  .adv-search-btn { width: 100%; justify-content: center; }
}

html { max-width: 100vw; } /* Do NOT add overflow-x:hidden here — it breaks position:sticky site-wide */
body { overflow-x: hidden; max-width: 100vw; }
/* Keep overflow-x:hidden only on elements that do NOT contain sticky children */
.hero, .site-footer, .dashboard-container, .admin-container { overflow-x: hidden; }
/* .site-header and .catalog-layout intentionally omitted — overflow:hidden on them kills position:sticky */
.table-scroll, .admin-table, .data-table, .order-items-table, .items-table, .cart-table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll thead, .table-scroll tbody, .admin-table thead, .admin-table tbody { display: table; width: 100%; }
.product-card-title a, .product-title, .spec-value, .identifier-item code, .synonym-tag { word-break: break-word; overflow-wrap: anywhere; }
.product-card, .stat-card, .btn, .nav-link, .type-pill, .pag-btn, .footer-link { will-change: transform; }
.product-card:not(:hover), .stat-card:not(:hover) { will-change: auto; }
.hero::before, .hero::after { will-change: transform; }
@media screen and (max-width: 1024px) {
  #mobile-menu:not([hidden]) { display: block !important; width: 100%; padding: 12px 0 16px; background: rgba(9,18,36,0.98); border-top: 1px solid rgba(255,255,255,0.06); animation: slideDown 0.28s var(--ease-out-expo) both; }
  .mobile-search-wrapper .search-form { width: 100%; }
  .mobile-search-wrapper .search-input { border-radius: 8px 0 0 8px; }
  .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hamburger-line { transition: transform 0.25s ease, opacity 0.15s ease; }
}
@media screen and (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], input[type="url"], input[type="date"], textarea, select { font-size: 16px !important; -webkit-text-size-adjust: none; }
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* ── FEAT-23: Mobile filter drawer ──────────────────────────────────────── */
.mobile-filter-bar {
    display: none; /* shown only on mobile via media query below */
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface-1, #fff);
    border-bottom: 1px solid var(--border, #e2e8f0);
    position: sticky;
    top: 64px; /* sits just below the sticky header (header-container height) */
    z-index: 200;
}
.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    background: var(--surface-2, #f8fafc);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text, #0f172a);
    flex-shrink: 0;
}
.mobile-filter-btn:hover { background: var(--surface-3, #f1f5f9); }
.mobile-result-count {
    display: inline-block;
    background: var(--accent, #0284c7);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 1px 7px;
    margin-left: 2px;
    min-width: 20px;
    text-align: center;
}
.mobile-sort-row { flex: 1; }
.mobile-sort-sel {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: .83rem;
    background: var(--surface-2, #f8fafc);
}
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 299;
}
.drawer-overlay.visible { display: block; }
.drawer-close-row {
    display: none; /* shown on mobile only */
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 8px;
}
.drawer-title { font-weight: 600; font-size: 1.05rem; }
.drawer-close-btn {
    background: none; border: none; font-size: 1.2rem;
    cursor: pointer; color: var(--text-muted, #64748b);
    padding: 4px 8px; border-radius: 4px;
}
.drawer-close-btn:hover { background: var(--surface-2, #f1f5f9); }

/* ── FEAT-27: ABChem Catalog Number Badge ────────────────────────────────── */
.abc-catalog-badge {
    display: inline-block;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    margin-bottom: 6px;
    white-space: nowrap;
    user-select: all;
}
.product-card-content .abc-catalog-badge { display: block; margin-bottom: 4px; font-size: 0.68rem; }

/* ── FEAT-26: Image Zoom ──────────────────────────────────────────────────── */
.product-card-image--zoomable { cursor: zoom-in; position: relative; overflow: hidden; }
.product-card-image--zoomable:hover img { transform: scale(1.04); transition: transform 0.25s ease; }
.product-card-image--zoomable .zoom-hint {
    position: absolute; bottom: 6px; right: 8px;
    font-size: 14px; opacity: 0; transition: opacity 0.2s;
    pointer-events: none;
}
.product-card-image--zoomable:hover .zoom-hint { opacity: 0.6; }
.product-image--zoomable { position: relative; }
#img-zoom-modal { display: none; }  /* JS sets flex */