/* ════════════════════════════════════════════════════════════════════
   BHUH.AI GROUP — MASTER DESIGN TOKENS
   Bhuh Prapadye Technologies Pvt. Ltd. · v2.0 · May 2026

   Single canonical token file. Merges all prior CSS versions.
   Architecture: Global base → Brand overrides → Reset + Utilities
   Usage: Import once in shell; each product scopes via [data-brand="X"]

   CDN (production):
   https://cdn.jsdelivr.net/gh/bhuh-ai/bhuh-common-assets@main/org-design-system/tokens.css
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@300;400;500;600;700;800&family=Hind:wght@300;400;500;600;700&family=Tiro+Devanagari+Hindi:ital@0&family=Noto+Sans+Devanagari:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── 1. GLOBAL BASE PALETTE ─────────────────────────────────────── */
:root {
  /* Earth & Sky — shared across all brands */
  --lotus-white:       #FAF7F2;   /* Lotus petal — warmest white */
  --coal-line:         #1C1C1C;   /* Lampblack ink — all outlines */
  --madhubani-gold:    #E8A020;   /* Turmeric / haldi — universal accent */
  --kahalgaon-blue:    #1A3A5C;   /* Indigo neel — primary anchor */
  --kahalgaon-deep:    #0D1F33;   /* Deep navy — dark cards, Mithila Cloud */
  --paddy-green:       #2D6A4F;   /* Rice paddy — sustainability */
  --mithila-vermillion:#C0392B;   /* Sindoor red — energy/alerts */
  --tussar-silk:       #D4A96A;   /* Bhagalpur silk — warm neutral */
  --bihar-saffron:     #F4A500;   /* Marigold — festive/accent */
  --ganges-mist:       #B8D4E8;   /* Ganga at dawn — soft data viz */
  --ash-silver:        #9EA7AD;   /* Fly-ash neutral — disabled */
  --rani-pink:         #C2185B;   /* Gulabi rani — Sakhi accent */
  --shravan-teal:      #38B2AC;   /* Sky listening — Shravan accent */
  --earth-terracotta:  #B7622A;   /* Mitti — Mera Desh accent */
  --deep-navy:         #0D1F33;   /* Night sky — Bhuh Prapadye */
  --indigo-sabal:      #2B3872;   /* Warmer indigo — Sabal accent */

  /* ── 2. SEMANTIC SURFACE TOKENS (light mode default) ── */
  --bg:          var(--lotus-white);
  --surface:     #FFFFFF;
  --surface-alt: #F5F0E8;
  --border:      rgba(28,28,28,0.11);
  --border-mid:  rgba(28,28,28,0.2);
  --text:        var(--coal-line);
  --text-muted:  #4A4A48;
  --text-dim:    #8A8580;
  --text-inv:    var(--lotus-white);
  --primary:     var(--kahalgaon-blue);
  --accent:      var(--madhubani-gold);

  /* ── 3. TYPOGRAPHY ── */
  --font-display: 'Mukta', 'Tiro Devanagari Hindi', system-ui, sans-serif;
  --font-body:    'Hind', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-script:  'Tiro Devanagari Hindi', serif;
  --font-deva:    'Noto Sans Devanagari', sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', monospace;

  /* Shorthand aliases */
  --font-d: var(--font-display);
  --font-b: var(--font-body);
  --font-s: var(--font-script);
  --font-m: var(--font-mono);

  /* Modular scale ×1.333 */
  --text-hero:    clamp(3rem, 6vw, 5rem);      /* 80px */
  --text-h1:      clamp(2.5rem, 4.5vw, 4rem);  /* 64px */
  --text-h2:      clamp(2rem, 3.5vw, 3rem);    /* 48px */
  --text-h3:      clamp(1.5rem, 2.5vw, 2.25rem);/* 36px */
  --text-h4:      1.6875rem;                    /* 27px */
  --text-xl:      1.25rem;                      /* 20px */
  --text-base:    1.125rem;                     /* 18px */
  --text-sm:      1rem;                         /* 16px */
  --text-xs:      0.875rem;                     /* 14px */
  --text-caption: 0.8125rem;                    /* 13px */
  --text-label:   0.75rem;                      /* 12px */

  /* Semantic type role shortcuts */
  --h1:      var(--text-h1);
  --h2:      var(--text-h2);
  --h3:      var(--text-h3);
  --h4:      var(--text-h4);
  --body:    var(--text-base);
  --small:   var(--text-sm);
  --caption: var(--text-caption);
  --label:   var(--text-label);

  /* ── 4. SPACING (4px base) ── */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;  --s-10: 128px; --s-11: 192px; --s-12: 256px;

  /* ── 5. LAYOUT ── */
  --container:        1280px;
  --container-narrow: 960px;
  --container-text:   720px;
  --nav-height:       64px;
  --sidebar-w:        248px;

  /* ── 6. RADII ── */
  --r-xs:   4px;   /* Buttons, badges — crisp */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 9999px;
  --r-card: var(--r-lg);   /* Canonical card radius */

  /* Aliases for compatibility */
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);

  /* ── 7. SHADOWS ── */
  --shadow-xs:   0 1px 2px rgba(28,28,28,0.06);
  --shadow-sm:   0 2px 8px rgba(28,28,28,0.08);
  --shadow-card: 0 4px 24px rgba(26,58,92,0.08);
  --shadow-elev: 0 12px 48px rgba(26,58,92,0.14);
  --shadow-gold: 0 4px 24px rgba(232,160,32,0.22);
  --shadow-glow: 0 0 0 3px rgba(232,160,32,0.18);

  /* ── 8. MOTION ── */
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --ease-organic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --dur-instant:  80ms;
  --dur-micro:    150ms;
  --dur-fast:     220ms;
  --dur-comp:     300ms;
  --dur-page:     520ms;
  --dur-brand:    1400ms;

  /* ── 9. GRADIENTS ── */
  --grad-dawn:     linear-gradient(135deg, #FAF7F2 0%, #D4A96A 100%);
  --grad-indigo:   linear-gradient(180deg, #1A3A5C 0%, #0D1F33 100%);
  --grad-circuit:  linear-gradient(135deg, #2D6A4F 0%, #1A3A5C 100%);
  --grad-saffron:  linear-gradient(135deg, #F4A500 0%, #E8A020 100%);
  --grad-earth:    linear-gradient(135deg, #B7622A 0%, #2D6A4F 100%);
}

/* ── 10. DARK MODE BASE ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #0D0D0B;
  --surface:     #1A1A17;
  --surface-alt: #232320;
  --border:      rgba(250,247,242,0.1);
  --border-mid:  rgba(250,247,242,0.2);
  --text:        #F0F0EB;
  --text-muted:  #8A8A80;
  --text-dim:    #5A5A52;
  --text-inv:    #0D0D0B;
}

/* ════════════════════════════════════════════════════════════════════
   BRAND TOKEN OVERRIDES — [data-brand="X"]
   ════════════════════════════════════════════════════════════════════ */

/* ── BHUHPRAPADYE.COM — Deep consulting, Pichwai devotional ── */
[data-brand="bhuhprapadye"] {
  --primary:       #0D1F33;
  --accent:        #E8A020;
  --bg:            #FAF7F2;
  --surface:       #FFFFFF;
  --folk-primary:  #8B1C1C;   /* Pichwai deep crimson */
  --folk-accent:   #C9A84C;   /* Pichwai gold leaf */
  --folk-style:    "Pichwai";
}
[data-brand="bhuhprapadye"][data-theme="dark"] {
  --bg:      #060C14;
  --surface: #0D1F33;
  --text:    #F0EDE5;
}

/* ── BHUH.AI LABS — Yantra sacred geometry ── */
[data-brand="bhuhai"] {
  --primary:      #1A3A5C;
  --accent:       #E8A020;
  --bg:           #FAF7F2;
  --folk-primary: #1A3A5C;
  --folk-accent:  #E8A020;
  --folk-style:   "Sri Yantra";
}
[data-brand="bhuhai"][data-theme="dark"] {
  --bg:      #0D0D0B;
  --surface: #1A1A17;
}

/* ── SABAL — Platform OS, Warli tribal ── */
[data-brand="sabal"] {
  --primary:      #2B3872;   /* Warmer indigo */
  --accent:       #F4A500;   /* Saffron */
  --bg:           #FFF8F0;   /* Warmer lotus */
  --folk-primary: #2B3872;
  --folk-accent:  #F4A500;
  --folk-style:   "Warli";
}
[data-brand="sabal"][data-theme="dark"] {
  --bg:      #0F0D16;
  --surface: #1A1828;
  --text:    #F0EDE8;
}

/* ── SAKHI — Female companion, Alpana/Kantha ── */
[data-brand="sakhi"] {
  --primary:      #8B1A4A;   /* Rani deep rose */
  --accent:       #D4A96A;   /* Tussar gold */
  --bg:           #FFF5F8;
  --folk-primary: #8B1A4A;
  --folk-accent:  #D4A96A;
  --folk-style:   "Alpana";
}
[data-brand="sakhi"][data-theme="dark"] {
  --bg:      #150B11;
  --surface: #220F1B;
  --text:    #F5EBF0;
}

/* ── SHRAVAN — Male companion, Assam Gamosa ── */
[data-brand="shravan"] {
  --primary:      #1B4D6E;   /* Deep sky-blue */
  --accent:       #38B2AC;   /* Listening teal */
  --bg:           #F0F9FF;
  --folk-primary: #1B4D6E;
  --folk-accent:  #38B2AC;
  --folk-style:   "Assam Gamosa";
}
[data-brand="shravan"][data-theme="dark"] {
  --bg:      #091520;
  --surface: #122030;
  --text:    #E8F4FC;
}

/* ── MERA DESH — Community planning, Kolam geometric ── */
[data-brand="meradesh"] {
  --primary:      #2D6A4F;   /* Paddy green */
  --accent:       #B7622A;   /* Earth terracotta */
  --bg:           #F5F3EC;
  --folk-primary: #2D6A4F;
  --folk-accent:  #B7622A;
  --folk-style:   "Kolam";
}
[data-brand="meradesh"][data-theme="dark"] {
  --bg:      #0B1410;
  --surface: #162218;
  --text:    #EEF5F0;
}

/* ── SAHYOG — Circular economy, Kantha narrative ── */
[data-brand="sahyog"] {
  --primary:      #1A3A5C;
  --accent:       #E8A020;
  --secondary:    #2D6A4F;
  --bg:           #FFF9EC;
  --folk-primary: #1A3A5C;
  --folk-accent:  #E8A020;
  --folk-style:   "Kantha";
}
[data-brand="sahyog"][data-theme="dark"] {
  --bg:      #0D0B07;
  --surface: #1A170F;
  --text:    #F5F0E5;
}

/* ── MITHILA CLOUD — Already in mithila/tokens.css ── */
[data-brand="mithilacloud"] {
  --primary:     #1A3A5C;
  --accent:      #E8A020;
  --bg:          #FAF7F2;
  --folk-style:  "Madhubani";
}

/* ════════════════════════════════════════════════════════════════════
   BASE RESET & TYPOGRAPHY
   ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.65;
  text-wrap: pretty;
  transition: background var(--dur-comp) var(--ease), color var(--dur-comp) var(--ease);
}
h1 { font-family: var(--font-display); font-size: var(--h1); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em;  color: var(--primary); }
h2 { font-family: var(--font-display); font-size: var(--h2); font-weight: 700; line-height: 1.10; letter-spacing: -0.015em; color: var(--primary); }
h3 { font-family: var(--font-display); font-size: var(--h3); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em;  color: var(--primary); }
h4 { font-family: var(--font-display); font-size: var(--h4); font-weight: 600; line-height: 1.2;                             color: var(--primary); }
p  { font-family: var(--font-body);    font-size: var(--body); line-height: 1.65; color: var(--text); }
a  { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
code, pre { font-family: var(--font-mono); }

/* ── UTILITY CLASSES ── */
.devanagari   { font-family: var(--font-script); }
.deva-body    { font-family: var(--font-deva); }
.mono         { font-family: var(--font-mono); }
.eyebrow      { font-size: var(--text-label); letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; color: var(--accent); font-family: var(--font-mono); }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-accent  { color: var(--accent); }
.text-primary { color: var(--primary); }
.text-inv     { color: var(--text-inv); }
.surface-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); }

/* Sleek scrollbar styling for the entire application */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
  transition: background var(--dur-micro) var(--ease);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Chat drag handle hover styles */
.chat-drag-handle:hover, .chat-drag-handle:active {
  background-color: var(--madhubani-gold) !important;
  width: 6px !important;
}

/* LLM Chat response styling to strictly match design theme */
.markdown-body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.markdown-body strong {
  color: var(--primary);
  font-weight: 700;
}
.markdown-body h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--primary);
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 4px;
}
.markdown-body h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
  color: var(--primary);
}
.markdown-body p {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 10px;
  list-style-type: square;
}
.markdown-body li {
  margin-bottom: 4px;
  line-height: 1.5;
}
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.markdown-body code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}
.markdown-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
}
.markdown-body pre code {
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
}

/* Premium responsive overrides to prevent layout breaks on main pane resize */
@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}
@media (max-width: 1200px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
}
@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* Premium discrete range sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-mid);
  border-radius: var(--r-pill);
  outline: none;
  margin: 10px 0;
  transition: background var(--dur-micro) var(--ease);
}
input[type="range"]:hover {
  background: var(--border);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kahalgaon-blue);
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent);
  border-color: var(--kahalgaon-blue);
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kahalgaon-blue);
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
}
input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: var(--accent);
  border-color: var(--kahalgaon-blue);
}

/* Fix flex shrink and wrap on header/content components when resizing */
.content-header {
  flex-wrap: wrap;
  gap: 16px;
}
.content-header > div {
  min-width: 250px;
}

