// RESEARCH PLATFORM — shared styles (indigo accent)
const T = window.ArbiterTokens;

const rs = {
  // Palette accents
  indigo: '#4338CA',
  indigoDeep: '#3730A3',
  indigoLight: '#6366F1',
  indigoBg: 'rgba(67,56,202,0.06)',
  indigoBorder: 'rgba(67,56,202,0.2)',
  teal: '#0D9488',
  tealBg: 'rgba(13,148,136,0.06)',
  amber: '#B45309',
  amberBg: 'rgba(180,83,9,0.06)',
  crimson: '#B91C1C',
  crimsonBg: 'rgba(185,28,28,0.06)',
  violet: '#7C3AED',
  violetBg: 'rgba(124,58,237,0.06)',

  container: { flex: 1, overflow: 'auto', background: T.color.bg.primary },
  header: {
    padding: '16px 24px', borderBottom: `1px solid ${T.color.border.light}`,
    background: T.color.bg.card, display: 'flex', alignItems: 'center', justifyContent: 'space-between',
  },
  headerTitle: { display: 'flex', alignItems: 'center', gap: '12px' },
  rsIcon: {
    width: '32px', height: '32px', borderRadius: '6px',
    background: 'linear-gradient(135deg, #4338CA 0%, #3730A3 100%)',
    display: 'flex', alignItems: 'center', justifyContent: 'center',
    fontSize: '14px', fontWeight: 700, color: '#fff',
  },
  title: { fontSize: '18px', fontWeight: 700, color: T.color.text.primary, letterSpacing: '-0.02em' },
  subtitle: { fontSize: '12px', color: T.color.text.tertiary, marginTop: '1px' },
  tabs: {
    display: 'flex', gap: '0', borderBottom: `1px solid ${T.color.border.light}`,
    background: T.color.bg.card, padding: '0 24px',
  },
  tab: {
    padding: '10px 16px', fontSize: '12px', fontWeight: 500,
    color: T.color.text.tertiary, cursor: 'pointer', border: 'none', background: 'none',
    borderBottom: '2px solid transparent', fontFamily: T.font.family,
    transition: 'all 0.15s', marginBottom: '-1px', whiteSpace: 'nowrap',
  },
  tabActive: { color: '#4338CA', borderBottom: '2px solid #4338CA', fontWeight: 600 },
  body: { padding: '20px 24px' },

  // Reusable primitives
  card: { background: T.color.bg.card, border: `1px solid ${T.color.border.light}`, borderRadius: T.radius.lg, overflow: 'hidden', marginBottom: '16px' },
  cardH: { padding: '10px 16px', borderBottom: `1px solid ${T.color.border.light}`, fontSize: '12px', fontWeight: 600, color: T.color.text.primary, display: 'flex', alignItems: 'center', justifyContent: 'space-between' },
  cardB: { padding: '14px 16px' },

  stat: { display: 'flex', flexDirection: 'column', gap: '2px', padding: '12px 16px', background: T.color.bg.secondary, borderRadius: '6px', border: `1px solid ${T.color.border.light}` },
  statLabel: { fontSize: '10px', fontWeight: 600, color: T.color.text.tertiary, textTransform: 'uppercase', letterSpacing: '0.08em' },
  statValue: { fontSize: '22px', fontWeight: 700, letterSpacing: '-0.02em', lineHeight: 1.1, color: T.color.text.primary },
  statDelta: { fontSize: '10px', fontWeight: 500, marginTop: '2px' },

  tag: { display: 'inline-flex', alignItems: 'center', padding: '2px 8px', borderRadius: '10px', fontSize: '10px', fontWeight: 600 },
  pill: { display: 'inline-flex', alignItems: 'center', padding: '3px 10px', borderRadius: '12px', fontSize: '11px', fontWeight: 500, gap: '4px' },

  th: { fontSize: '10px', fontWeight: 600, color: T.color.text.tertiary, textTransform: 'uppercase', letterSpacing: '0.08em', padding: '8px 12px', textAlign: 'left', background: T.color.bg.secondary, borderBottom: `1px solid ${T.color.border.light}` },
  td: { fontSize: '12px', color: T.color.text.primary, padding: '10px 12px', borderBottom: `1px solid ${T.color.border.light}`, verticalAlign: 'middle' },

  btnPrimary: { padding: '6px 14px', borderRadius: '6px', background: '#4338CA', border: 'none', color: '#fff', fontSize: '12px', fontWeight: 700, cursor: 'pointer', fontFamily: T.font.family },
  btnSecondary: { padding: '5px 12px', borderRadius: '6px', border: `1px solid ${T.color.border.light}`, background: T.color.bg.card, fontSize: '11px', fontWeight: 500, color: T.color.text.secondary, cursor: 'pointer', fontFamily: T.font.family },
  btnGhost: { padding: '4px 10px', borderRadius: '5px', border: 'none', background: 'transparent', fontSize: '11px', fontWeight: 500, color: '#4338CA', cursor: 'pointer', fontFamily: T.font.family },

  // Treatment-signal chips used in citator + case views
  signalPositive: { background: 'rgba(27,122,74,0.1)', color: '#1B7A4A' },
  signalNeutral: { background: 'rgba(110,125,158,0.1)', color: '#6E7D9E' },
  signalCaution: { background: 'rgba(180,83,9,0.12)', color: '#B45309' },
  signalNegative: { background: 'rgba(194,48,48,0.1)', color: '#C23030' },
  signalOverruled: { background: 'rgba(124,58,237,0.12)', color: '#7C3AED' },
};

window.__rs = rs;
