/* ============================================================
   Busybee — "Honeycomb Luxe" design system (dark-only)
   Warm hive-lit gold on deep charcoal. All component styles live
   here (the old inline <style> block was absorbed into this file).
   Rules of the house:
   - chrome stays warm gold-monochrome; blue/purple appear only as data pills
   - structural borders at full strength, interior row hairlines at low alpha
   - Fraunces only for: wordmark, h2, .dval/.card-price, mobile card titles
   - Inter tabular-nums does ALL column alignment
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* core tokens (names are load-bearing — referenced by inline styles) */
  --bg: #0f0b06;
  --surface: #17110a;
  --surface2: #20180e;
  --border: #32271a;
  --text: #f3ecdd;
  --text-dim: #a4937a;
  --accent: #f6a82b;
  --best: #3fd573;
  --best-bg: rgba(63, 213, 115, 0.10);
  --maple: #eb5f55;
  --warn: #f6a82b;
  --tab-active: #ffc861;
  --na: #6e604c;
  /* gold system */
  --gold-hi: #ffce6b;
  --gold-lo: #f0980f;
  --gold-deep: #c47d10;
  --drizzle: linear-gradient(90deg, var(--gold-hi), var(--gold-lo));
  --border-gold: rgba(247, 183, 51, 0.14);
  --border-gold-soft: rgba(247, 183, 51, 0.12);
  --th-border: rgba(247, 183, 51, 0.16);
  --hairline: rgba(243, 186, 90, 0.07);
  --hairline-soft: rgba(243, 186, 90, 0.06);
  --row-hover: rgba(247, 183, 51, 0.045);
  --top-light: rgba(255, 255, 255, 0.04);
  --shadow-slab: inset 0 1px 0 rgba(255,255,255,0.04), 0 16px 40px -20px rgba(0,0,0,0.85);
  --shadow-slab-hover: inset 0 1px 0 rgba(255,255,255,0.05), 0 22px 48px -20px rgba(0,0,0,0.9);
  --glow-gold: 0 2px 12px -2px rgba(246, 168, 43, 0.5);
  --th-color: #b09a76;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
  accent-color: var(--accent);
}

/* ---- page field: hive-lit, three fixed layers ---- */
body {
  background-color: var(--bg);
  background-image: radial-gradient(1200px 480px at max(16%, calc(50% - 380px)) -8%, rgba(246,168,43,0.09), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  min-height: 100vh;
}

/* honeycomb veil — frames the chrome, dies before the dense data */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23f7b733' stroke-opacity='0.045'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50' fill='none' stroke='%23f7b733' stroke-opacity='0.045'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 640px);
  mask-image: linear-gradient(180deg, #000, transparent 640px);
}

/* gold-leaf page edge — the frame, on every tab */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: linear-gradient(90deg, var(--gold-deep), var(--accent) 50%, var(--gold-deep));
  pointer-events: none;
}

::selection { background: var(--accent); color: #1c1206; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a2d1c; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #4a3a24; }

/* ---- header: the hive band ---- */
header {
  position: relative;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23f7b733' stroke-opacity='0.07'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50' fill='none' stroke='%23f7b733' stroke-opacity='0.07'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #1c1409 0%, #140e07 100%);
  background-size: 56px 100px, auto;
  border-bottom: 1px solid var(--border);
  /* full-bleed band, content aligned to the centered 1100px column */
  padding: 18px max(24px, calc(50% - 526px)) 16px;
}
/* honey drizzle echo #1 — under the header */
header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-hi) 35%, var(--gold-lo) 65%, transparent);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-hex {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  background: radial-gradient(circle at 50% 35%, rgba(246,168,43,0.18), rgba(246,168,43,0.04));
}
.logo-hex svg { filter: drop-shadow(0 2px 10px rgba(246,168,43,0.35)); }
.logo-text { display: flex; flex-direction: column; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent);
}
@supports (-webkit-background-clip: text) {
  .wordmark {
    background: linear-gradient(180deg, #ffd98a, var(--gold-lo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.wordmark .dot, .dot {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}
.kicker {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ---- tabs: the sticky spine ---- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 0;
  padding: 0 max(24px, calc(50% - 526px));
  background: rgba(15, 11, 6, 0.96);
  border-bottom: 1px solid var(--border);
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .tabs {
    background: rgba(15, 11, 6, 0.84);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    backdrop-filter: blur(12px) saturate(1.1);
  }
}
.tab-btn {
  position: relative;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 13px 18px;
  transition: color 0.15s;
}
.tab-btn:hover { color: #d9c9a8; }
.tab-btn.active {
  color: var(--tab-active);
  font-weight: 600;
}
/* honey drizzle echo #2 — under the active tab */
.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 3px;
  border-radius: 2px;
  background: var(--drizzle);
  box-shadow: var(--glow-gold);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

/* ---- content shell ---- */
main { padding: 28px 24px; max-width: 1100px; margin: 0 auto; }

.tab-content { display: none; }
.tab-content.active { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .tab-content.active { animation: rise 0.22s ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } }
}

.section-header { margin-bottom: 20px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
}
.subtitle { color: var(--text-dim); font-size: 0.85rem; line-height: 1.55; max-width: 78ch; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.meta-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fx { color: var(--accent) !important; }

.section-sub {
  margin: 24px 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--th-color);
  font-weight: 600;
}
.current { margin: 6px 0 24px; }
.current h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--th-color);
  margin-bottom: 10px;
  font-weight: 600;
}
.usd { color: #60a5fa; }

/* ---- tables: lit slabs, two-tier warm hairlines ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-gold-soft);
  background: var(--surface);
  box-shadow: var(--shadow-slab);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
thead tr { background: linear-gradient(180deg, #241b0f, #1c150d); }
th {
  color: var(--th-color);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 11px 14px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--th-border);
  user-select: none;
}
th.sortable { cursor: pointer; transition: color 0.15s; }
th.sortable:hover { color: var(--tab-active); }
th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sort-icon { opacity: 0.35; margin-left: 4px; font-size: 0.7rem; }
/* honey drizzle echo #3 — under the actively-sorted column header */
th.sortable.sorted {
  color: var(--tab-active);
  background-image: linear-gradient(90deg, var(--gold-hi), var(--gold-lo));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: bottom left;
}
th.sortable.sorted .sort-icon { opacity: 1; }

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--row-hover); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

.muted { color: var(--text-dim); }

.best-val {
  color: var(--best);
  font-weight: 700;
  text-shadow: 0 0 14px rgba(63, 213, 115, 0.35);
}

.best-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Canada rows: maple ledger spine (on td, never tr) */
#tbl-compounds tr.row-ca td { background: rgba(235, 95, 85, 0.05); }
#tbl-compounds tr.row-ca td:first-child { box-shadow: inset 2px 0 0 rgba(235, 95, 85, 0.55); }
#canada td { vertical-align: top; }
#canada thead th { vertical-align: bottom; }

/* table links */
#tbl-screws td a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
}
#tbl-screws td a:hover { color: var(--tab-active); border-bottom-color: var(--tab-active); }
.sup-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
}
.sup-link:hover { color: var(--tab-active); border-bottom-color: var(--tab-active); }

.supplier { font-weight: 600; }
.supplier small { display: block; font-weight: 400; color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.loc { color: var(--text); }
.loc small { display: block; color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.price { font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.price.best { color: var(--best); }
.notes { font-size: 0.82rem; color: var(--text-dim); max-width: 360px; line-height: 1.4; }

/* price trend (vs last week) — injected by apply.mjs */
.trend { display: block; font-weight: 600; font-size: 0.66rem; margin-top: 1px; white-space: nowrap; }
.trend.down { color: var(--best); }
.trend.up { color: var(--maple); }

/* ---- decision cards: glassy honey slabs ---- */
.decision { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 0 22px; }
.dcard, .card {
  position: relative;
  overflow: hidden;
  background-color: var(--surface);
  background-image: linear-gradient(160deg, rgba(255,200,97,0.05) 0%, rgba(255,255,255,0.012) 45%, transparent 100%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-slab);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .dcard:hover, .card:hover { transform: translateY(-1px); box-shadow: var(--shadow-slab-hover); }
}
.dcard.rt, .card.rt { border-top: 3px solid var(--maple); }
.dcard.tz, .card.tz { border-top: 3px solid var(--best); }
.dcard::before, .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 24px;
  pointer-events: none;
}
.dcard.rt::before, .card.rt::before { background: linear-gradient(180deg, rgba(235,95,85,0.06), transparent); }
.dcard.tz::before, .card.tz::before { background: linear-gradient(180deg, rgba(63,213,115,0.06), transparent); }

.dcard h3 { font-family: var(--font-body); font-size: 0.95rem; margin: 0 0 12px; font-weight: 600; color: var(--text); }
.dcard h3 small { font-weight: 400; font-size: 0.76rem; color: var(--text-dim); }
.dgrid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.dgrid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.dcol .dlbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.dcol.cn .dlbl { color: #c084fc; }
.dcol.us .dlbl { color: #60a5fa; }
.dcol.ca .dlbl { color: var(--maple); }
.dcol .dval {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.dcol.cn .dval { color: var(--best); }
.dcol .dsub { font-size: 0.72rem; color: var(--text-dim); margin-top: 3px; }
.dgap { text-align: center; }
.dgap .gnum {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(246, 168, 43, 0.10);
  border: 1px solid rgba(246, 168, 43, 0.25);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dgap .glbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin-top: 2px; }
.dnote {
  font-size: 0.78rem;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  border-left: 2px solid currentColor;
  line-height: 1.4;
}
.dnote.warn { background: rgba(246, 168, 43, 0.08); color: #f0c87e; }
.dnote.info { background: rgba(96, 165, 250, 0.08); color: #9cc7f5; }

/* legacy stat cards (old Canada tab vocabulary — kept for the scraper) */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-prod { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.card-sup { font-size: 1.3rem; font-weight: 700; margin: 5px 0 4px; display: flex; align-items: center; gap: 9px; }
.card-badge {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(246, 168, 43, 0.14); color: var(--accent); border: 1px solid rgba(246, 168, 43, 0.4);
}
.card-price { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.card.rt .card-price { color: var(--maple); }
.card.tz .card-price { color: var(--best); }
.card-note { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; }

/* ---- filter chips: honey pills ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.filter-bar .flabel { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-right: 2px; }
.filter-bar .sep { width: 1px; align-self: stretch; background: rgba(247, 183, 51, 0.15); margin: 2px 6px; }
.chip {
  font-size: 0.8rem;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: #b8a585;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  background: #1a140c;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.chip:hover { border-color: rgba(247, 183, 51, 0.45); color: var(--text); }
/* single-select groups (warehouse/product): molten gold */
.chip.active {
  background: linear-gradient(180deg, var(--tab-active), var(--gold-lo));
  color: #221503;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 200, 97, 0.4), 0 2px 10px -2px rgba(246, 168, 43, 0.55);
}
/* multi-select trust group: ghost amber (3-4 lit at once must not shout) */
.chip[data-group="trust"].active {
  background: rgba(246, 168, 43, 0.12);
  color: var(--accent);
  border-color: rgba(246, 168, 43, 0.45);
  font-weight: 600;
  box-shadow: none;
}
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- badges & pills: one system, borders normalized at 0.4 ---- */
.tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}
.tag.best { background: var(--best-bg); color: var(--best); border: 1px solid rgba(63, 213, 115, 0.4); }
.tag.new { background: var(--best-bg); color: var(--best); border: 1px solid rgba(63, 213, 115, 0.4); }
.tag.oos { background: rgba(235, 95, 85, 0.12); color: var(--maple); border: 1px solid rgba(235, 95, 85, 0.4); }
.tag.ca { background: rgba(235, 95, 85, 0.16); color: var(--maple); border: 1px solid rgba(235, 95, 85, 0.4); }
.tag.us { background: rgba(96, 165, 250, 0.14); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.4); }
.tag.cn { background: rgba(192, 132, 252, 0.16); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.4); }
.tag.adv { background: rgba(246, 168, 43, 0.14); color: var(--accent); border: 1px solid rgba(246, 168, 43, 0.4); }

/* reviews / trust tiers (JS-injected) */
.rep {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
  white-space: nowrap;
}
.rep-trust { background: var(--best-bg); color: var(--best); border: 1px solid rgba(63, 213, 115, 0.4); }
.rep-ok { background: rgba(96, 165, 250, 0.14); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.4); }
.rep-warn { background: rgba(246, 168, 43, 0.14); color: var(--accent); border: 1px solid rgba(246, 168, 43, 0.4); }
.rep-new { background: rgba(164, 147, 122, 0.14); color: var(--text-dim); border: 1px solid rgba(164, 147, 122, 0.4); }
.repnote { display: block; font-size: 0.76rem; color: var(--text-dim); max-width: 300px; line-height: 1.35; }
.repnote a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.repnote a:hover { border-bottom-style: solid; }

/* legit 1-5 score pills (JS-injected) */
.legit {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 7px;
}
.legit small { font-weight: 400; font-size: 0.7rem; opacity: 0.75; }
.legit-5 { background: rgba(63, 213, 115, 0.16); color: #3fd573; border: 1px solid rgba(63, 213, 115, 0.4); }
.legit-4 { background: rgba(132, 204, 22, 0.14); color: #a3e635; border: 1px solid rgba(132, 204, 22, 0.4); }
.legit-3 { background: rgba(246, 168, 43, 0.14); color: var(--accent); border: 1px solid rgba(246, 168, 43, 0.4); }
.legit-2 { background: rgba(249, 115, 22, 0.14); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }
.legit-1 { background: rgba(239, 68, 68, 0.16); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }

/* ---- news: hive-marked wire feed ---- */
.news-group { margin-bottom: 24px; }
.news-group h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
@supports (border-bottom-color: color-mix(in srgb, red 25%, transparent)) {
  .news-group h3 { border-bottom-color: color-mix(in srgb, currentColor 25%, transparent); }
}
/* the hexagon system glyph */
.news-group h3::before {
  content: '';
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  width: 11px;
  height: 12px;
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  background: currentColor;
}
.news-group.rt h3 { color: var(--maple); }
.news-group.tz h3 { color: var(--best); }
.news-group.elo h3 { color: #c084fc; }
.news-group h3 small { font-weight: 400; font-size: 0.74rem; color: var(--text-dim); }
.news-item {
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 8px;
  border-bottom: 1px solid var(--hairline-soft);
  transition: background 0.12s;
}
.news-item:hover { background: rgba(247, 183, 51, 0.03); }
.news-item:last-child { border-bottom: none; }
/* lead-story bump: each group opens like a front page */
.news-group .news-item:first-of-type .news-title { font-size: 1.15rem; }
.news-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 3px; }
.news-src {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
}
.news-src.web { background: rgba(96, 165, 250, 0.14); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.4); }
.news-src.forum { background: rgba(192, 132, 252, 0.14); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.4); }
.news-src.warn { background: rgba(246, 168, 43, 0.14); color: var(--accent); border: 1px solid rgba(246, 168, 43, 0.4); }
.news-date { font-size: 0.72rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.news-title { display: inline-block; color: var(--text); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.news-title:hover {
  color: var(--tab-active);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 200, 97, 0.6);
}
.news-sum { font-size: 0.81rem; color: var(--text-dim); margin-top: 2px; line-height: 1.5; max-width: 680px; }

/* ---- notices, callouts, footnotes ---- */
.notice {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-dim);
  box-shadow: inset 0 1px 0 var(--top-light);
}
.notice strong { color: var(--warn); }

.callout {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0 24px;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 0 var(--top-light);
}
.callout h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}
.callout ul { margin: 0; padding-left: 18px; }
.callout li { margin: 3px 0; }
.callout .hl { color: var(--best); font-weight: 600; }
.callout .reta { color: var(--maple); font-weight: 600; }

.legend { margin-top: 14px; font-size: 0.78rem; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: 6px 18px; }

.footnotes { margin-top: 22px; font-size: 0.78rem; line-height: 1.55; color: var(--text-dim); }
.footnotes h4 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--th-color);
  margin-bottom: 6px;
  font-weight: 600;
}
.footnotes p { margin: 4px 0; }
.footnotes a { color: var(--accent); text-decoration: none; }
.footnotes a:hover { color: var(--tab-active); text-decoration: underline; text-underline-offset: 2px; }

/* ---- bookmark feature (untouched mechanics, warm idle star) ---- */
@keyframes bee-fly {
  0%   { transform: translate(0,0) scale(1) rotate(-10deg); opacity: 1; }
  20%  { transform: translate(20px,-40px) scale(1.2) rotate(12deg); opacity: 1; }
  40%  { transform: translate(-14px,-85px) scale(1.15) rotate(-15deg); opacity: 1; }
  60%  { transform: translate(22px,-135px) scale(1.05) rotate(8deg); opacity: 0.85; }
  80%  { transform: translate(-10px,-185px) scale(0.9) rotate(-6deg); opacity: 0.5; }
  100% { transform: translate(12px,-240px) scale(0.7) rotate(0deg); opacity: 0; }
}
.bee-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: bee-fly 0.9s ease-out forwards;
  line-height: 0;
}
/* reduced motion: collapse the flight to one imperceptible frame —
   animationend must still fire so the script can remove the particle */
@media (prefers-reduced-motion: reduce) {
  .bee-particle { animation-duration: 0.01s; }
}
.bkmk-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #4a3a24;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s, transform 0.15s;
  line-height: 1;
}
.bkmk-btn:hover { color: var(--accent); transform: scale(1.25); }
.bkmk-btn.saved { color: var(--accent); }

/* ---- responsive ---- */
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .notes { max-width: none; }
  .decision { grid-template-columns: 1fr; }
  .dgrid, .dgrid3 { grid-template-columns: 1fr; gap: 8px; text-align: left !important; }
  .dgap { display: none; }
  .dcol.ca { text-align: left !important; }
  .dcol .dval { font-size: 1.6rem; }
}

@media (max-width: 600px) {
  main { padding: 16px 12px; }
  .tabs {
    padding: 0 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .tabs::-webkit-scrollbar { display: none; }
  th, td { padding: 9px 10px; font-size: 0.82rem; }
  .tab-btn { padding: 10px 12px; font-size: 0.82rem; }
  header { padding: 14px 16px 12px; }
}

/* ---- mobile: compound table -> stacked cards ---- */
@media (max-width: 640px) {
  #compounds .table-wrap { border: none; overflow: visible; background: transparent; box-shadow: none; }
  #tbl-compounds thead { display: none; }
  #tbl-compounds, #tbl-compounds tbody { display: block; }
  #tbl-compounds tr {
    /* shadow on a tr is safe ONLY here: display:block makes it a normal box */
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 var(--top-light), 0 10px 24px -16px rgba(0,0,0,0.8);
    margin-bottom: 12px;
    padding: 10px 12px 8px;
  }
  #tbl-compounds tr:hover { background: var(--surface); }
  #tbl-compounds td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    border: none;
    text-align: right;
    font-size: 0.88rem;
  }
  #tbl-compounds td::before {
    color: var(--text-dim);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    font-family: var(--font-body);
    text-align: left;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  #tbl-compounds td:nth-of-type(1) {
    display: block;
    text-align: left;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    padding-right: 36px;
    border-bottom: 1px solid rgba(243, 186, 90, 0.10);
    padding-bottom: 6px;
    margin-bottom: 4px;
  }
  #tbl-compounds td:nth-of-type(1)::before { content: none; }
  #tbl-compounds td:nth-of-type(1) small { font-family: var(--font-body); font-size: 0.78rem; }
  #tbl-compounds td:nth-of-type(2)::before { content: "Product"; }
  #tbl-compounds td:nth-of-type(3)::before { content: "Warehouse"; }
  #tbl-compounds td:nth-of-type(4)::before { content: "Price"; }
  #tbl-compounds td:nth-of-type(4) { align-items: center; }
  #tbl-compounds td:nth-of-type(5)::before { content: "/10000 mg"; }
  #tbl-compounds td:nth-of-type(6)::before { content: "Status"; }
  #tbl-compounds td:nth-of-type(7)::before { content: "Legit"; }
  #tbl-compounds td:nth-of-type(8) {
    display: block;
    text-align: left;
    border-top: 1px solid rgba(243, 186, 90, 0.10);
    margin-top: 5px;
    padding-top: 6px;
  }
  #tbl-compounds td:nth-of-type(8)::before { content: "Reviews / trust"; display: block; margin-bottom: 3px; }
  #tbl-compounds td:nth-of-type(8) .repnote { max-width: none; }
  #tbl-compounds td:nth-of-type(9) { position: absolute; top: 7px; right: 10px; padding: 0; }
  #tbl-compounds td:nth-of-type(9)::before { content: none; }
  #tbl-compounds td .trend { display: inline-block; margin: 0 0 0 6px; }
}
