/* =========================================================================
   TopBetting — Operator design system. Mobile-first.
   Base = phone (single column). Min-width queries scale up.
   Consumes locked-engine output; pure presentation.
   ========================================================================= */

:root{
  --tb-bg:#0f1720;
  --tb-surface:#ffffff;
  --tb-ink:#16202b;
  --tb-ink-soft:#5b6b7b;
  --tb-line:#e6ebf0;
  --tb-brand:#0a7d4d;          /* trust green */
  --tb-brand-ink:#075a37;
  --tb-radius:14px;
  --tb-radius-sm:9px;
  --tb-shadow:0 1px 2px rgba(16,32,44,.06),0 8px 24px rgba(16,32,44,.06);
  /* freshness */
  --tb-fresh:#1ba35e;
  --tb-aging:#e0a912;
  --tb-stale:#d8473a;
  --tb-untested:#b4bfca;
  /* tiers */
  --tb-tier-high:#0a7d4d;
  --tb-tier-trusted:#2f8f5b;
  --tb-tier-mixed:#b9870c;
  --tb-tier-caution:#cf7a1c;
  --tb-tier-risk:#c5362b;
}

.tb-operator{
  max-width:1080px;
  margin:0 auto;
  padding:16px 16px 56px;
  color:var(--tb-ink);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.tb-operator *{box-sizing:border-box;}

/* ---------- Header ---------- */
.tb-op-header{
  display:flex;flex-direction:column;gap:12px;
  padding:4px 0 16px;
}
.tb-op-header__id{display:flex;align-items:center;gap:14px;}
.tb-op-logo{
  flex:0 0 auto;width:52px;height:52px;border-radius:13px;
  display:grid;place-items:center;
  background:linear-gradient(150deg,var(--tb-brand),var(--tb-brand-ink));
  color:#fff;font-weight:800;font-size:24px;
}
.tb-op-title{margin:0;font-size:1.6rem;line-height:1.15;font-weight:800;letter-spacing:-.01em;}
.tb-op-entity{margin:2px 0 0;color:var(--tb-ink-soft);font-size:.86rem;}

/* tier chip */
.tb-tier-chip{
  align-self:flex-start;
  display:inline-flex;align-items:center;
  padding:5px 12px;border-radius:999px;
  font-size:.8rem;font-weight:700;color:#fff;background:var(--tb-untested);
  letter-spacing:.01em;
}
.tier-high{background:var(--tb-tier-high);}
.tier-trusted{background:var(--tb-tier-trusted);}
.tier-mixed{background:var(--tb-tier-mixed);}
.tier-caution{background:var(--tb-tier-caution);}
.tier-risk{background:var(--tb-tier-risk);}
.tier-none{background:#6b7886;}

/* ---------- Layout grid ---------- */
.tb-grid{display:flex;flex-direction:column;gap:16px;}
.tb-col-main,.tb-col-side{display:flex;flex-direction:column;gap:16px;min-width:0;}

/* ---------- Panel shell ---------- */
.tb-panel{
  background:var(--tb-surface);
  border:1px solid var(--tb-line);
  border-radius:var(--tb-radius);
  box-shadow:var(--tb-shadow);
  padding:18px;
}
.tb-panel__title{margin:0 0 10px;font-size:1.02rem;font-weight:800;letter-spacing:-.01em;}
.tb-panel__sub{margin:-4px 0 14px;color:var(--tb-ink-soft);font-size:.86rem;}

/* ---------- Trust panel ---------- */
.tb-trust__headline{display:flex;align-items:center;gap:18px;margin-bottom:10px;}
.tb-score{display:flex;align-items:baseline;gap:2px;line-height:1;}
.tb-score__num{font-size:4rem;font-weight:850;letter-spacing:-.03em;color:var(--tb-brand-ink);}
.tb-score__den{font-size:1.1rem;color:var(--tb-ink-soft);font-weight:700;}
.tb-trust__meta{display:flex;flex-direction:column;gap:8px;}
.tb-axislabels{margin:0;display:flex;gap:8px;flex-wrap:wrap;color:var(--tb-ink-soft);font-size:.9rem;}
.tb-axislabels strong{color:var(--tb-ink);}
.tb-axisnote{margin:6px 0 14px;font-size:.84rem;color:var(--tb-ink-soft);border-left:3px solid var(--tb-line);padding-left:10px;}
.tb-axisnote strong{color:var(--tb-ink);}
.tb-riskflag{margin:0 0 12px;color:var(--tb-stale);font-weight:700;font-size:.9rem;}

/* under review */
.tb-trust__underreview{display:flex;flex-direction:column;gap:8px;margin-bottom:12px;}
.tb-underreview-badge{align-self:flex-start;background:#eef2f6;color:#48586a;font-weight:800;padding:8px 14px;border-radius:10px;font-size:.95rem;}
.tb-trust__underreview p{margin:0;color:var(--tb-ink-soft);font-size:.9rem;}

/* category bars */
.tb-cats{display:flex;flex-direction:column;gap:12px;margin-top:6px;}
.tb-cat__head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:5px;}
.tb-cat__label{font-size:.9rem;font-weight:600;}
.tb-cat__label small{color:var(--tb-ink-soft);font-weight:500;}
.tb-cat__val{font-size:.95rem;font-weight:800;display:inline-flex;align-items:center;gap:7px;white-space:nowrap;}
.tb-bar{height:9px;border-radius:6px;background:#eef2f6;overflow:hidden;}
.tb-bar__fill{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--tb-brand),var(--tb-tier-trusted));transition:width .5s ease;}
.tb-cat--untested .tb-bar__fill{background:var(--tb-untested);}
.tb-cat--stale .tb-bar__fill{background:var(--tb-stale);}

/* freshness dot */
.tb-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--tb-untested);}
.tb-dot--fresh{background:var(--tb-fresh);}
.tb-dot--aging{background:var(--tb-aging);}
.tb-dot--stale{background:var(--tb-stale);}
.tb-dot--untested{background:var(--tb-untested);}

/* explain toggle */
.tb-explain-toggle{
  margin-top:14px;background:none;border:1px solid var(--tb-line);
  color:var(--tb-brand-ink);font-weight:700;font-size:.86rem;
  padding:9px 14px;border-radius:10px;cursor:pointer;min-height:40px;
}
.tb-explain-toggle:hover{background:#f4f8f5;}
.tb-explain{margin-top:10px;font-size:.86rem;color:var(--tb-ink-soft);}
.tb-explain p{margin:.4rem 0;}
.tb-stamp{font-size:.76rem;color:#93a1ae;margin-top:8px;}

/* ---------- Verification panel ---------- */
.tb-verify__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;}
.tb-verify__item{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--tb-line);}
.tb-verify__item:last-child{border-bottom:0;}
.tb-verify__icon{flex:0 0 auto;color:var(--tb-ink-soft);}
.tb-icon{width:22px;height:22px;display:block;}
.tb-verify__label{flex:1 1 auto;font-weight:600;font-size:.92rem;}
.tb-statepill{flex:0 0 auto;font-size:.74rem;font-weight:700;padding:4px 9px;border-radius:999px;background:#eef2f6;color:#5b6b7b;}
.tb-statepill--fresh{background:#e6f6ec;color:var(--tb-brand-ink);}
.tb-statepill--aging{background:#fdf3da;color:#8a6608;}
.tb-statepill--stale{background:#fbe6e3;color:#9a2a21;}
.tb-verify__legend{margin:14px 0 0;display:flex;flex-wrap:wrap;gap:14px;font-size:.78rem;color:var(--tb-ink-soft);align-items:center;}
.tb-verify__legend .tb-dot{margin-right:5px;}

/* ---------- Badges ---------- */
.tb-badges__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px;}
.tb-badge{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:10px;background:#f3f8f5;border:1px solid #dcebe2;}
.tb-badge--due_recheck{background:#fdf8ec;border-color:#f0e2c2;}
.tb-badge__check{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--tb-brand);color:#fff;flex:0 0 auto;}
.tb-badge--due_recheck .tb-badge__check{background:var(--tb-aging);}
.tb-badge__check .tb-icon{width:14px;height:14px;}
.tb-badge__label{font-weight:700;font-size:.88rem;}
.tb-badge__note{margin-left:auto;font-size:.72rem;color:#8a6608;font-weight:700;}
.tb-badges__empty{margin:0;color:var(--tb-ink-soft);font-size:.86rem;}

/* ---------- Key facts ---------- */
.tb-facts__list{margin:0;display:flex;flex-direction:column;}
.tb-fact{display:flex;justify-content:space-between;gap:14px;padding:10px 0;border-bottom:1px solid var(--tb-line);}
.tb-fact:last-child{border-bottom:0;}
.tb-fact dt{margin:0;color:var(--tb-ink-soft);font-size:.84rem;}
.tb-fact dd{margin:0;text-align:right;font-weight:700;font-size:.88rem;}
.tb-fact--regime{font-weight:800;}
.tb-regime--unclear,.tb-regime--none_established{color:var(--tb-tier-caution);}
.tb-regime--state_urc{color:var(--tb-brand-ink);}
.tb-extlink{color:var(--tb-brand-ink);text-decoration:none;border-bottom:1px solid #cfe5d9;}
.tb-facts__note{margin:12px 0 0;font-size:.78rem;color:var(--tb-ink-soft);}

/* ---------- Evidence ---------- */
.tb-evidence__empty{display:flex;gap:14px;align-items:flex-start;}
.tb-evidence__grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;flex:0 0 auto;}
.tb-evidence__grid span{width:34px;height:34px;border-radius:7px;background:repeating-linear-gradient(45deg,#eef2f6,#eef2f6 6px,#e3e9ef 6px,#e3e9ef 12px);}
.tb-evidence__empty p{margin:0;color:var(--tb-ink-soft);font-size:.86rem;}
.tb-evidence__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.tb-evidence__item{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border:1px solid var(--tb-line);border-radius:10px;font-size:.84rem;}
.tb-evidence__type{font-weight:800;color:var(--tb-brand-ink);}
.tb-evidence__test{color:var(--tb-ink-soft);}
.tb-evidence__date{margin-left:auto;color:#93a1ae;font-size:.78rem;}
.tb-evidence__redacted{font-size:.7rem;font-weight:700;color:#8a6608;background:#fdf3da;padding:2px 7px;border-radius:999px;}

/* ---------- Methodology ---------- */
.tb-method p{margin:0 0 10px;font-size:.9rem;color:var(--tb-ink-soft);}
.tb-method__points{margin:0 0 12px;padding-left:18px;font-size:.86rem;color:var(--tb-ink-soft);}
.tb-method__points li{margin:5px 0;}
.tb-method__points strong{color:var(--tb-ink);}
.tb-method__link{display:inline-block;font-weight:800;color:var(--tb-brand-ink);text-decoration:none;}

/* ---------- Editorial ---------- */
.tb-prose{font-size:.95rem;color:#2c3a48;}
.tb-prose p{margin:0 0 .8em;}

/* =========================================================================
   Responsive — tablet/desktop
   ========================================================================= */
@media (min-width:680px){
  .tb-operator{padding:24px 24px 64px;}
  .tb-op-header{flex-direction:row;align-items:center;justify-content:space-between;}
  .tb-op-title{font-size:2rem;}
  .tb-score__num{font-size:4.6rem;}
}

@media (min-width:920px){
  .tb-grid{display:grid;grid-template-columns:1.55fr 1fr;align-items:start;}
  .tb-col-side{position:sticky;top:20px;}
}

/* reduced motion */
@media (prefers-reduced-motion:reduce){
  .tb-bar__fill{transition:none;}
}
