    /* ==========================================================================
   JyotirVed Engine — Professional Vedic Astrology Software Workstation
   Design System: Deep Cosmic Midnight & Sacred Sandalwood Parchment
   JyotirVed Professional Vedic Astrology Architecture
   ========================================================================== */

    :root {
      /* Cosmic Midnight Palette (Workstation Dark Default) */
      --navy: #050811;
      --navy2: #0a1120;
      --navy3: #101c33;
      --cream: #070c17;
      --paper: #0c1527;
      --paper2: #121f38;
      --paper3: #182a4a;
      --soft: #14223b;
      --gold: #dfb15b;
      --gold2: #f7d88d;
      --gold3: #996d24;
      --gold-glow: rgba(223, 177, 91, 0.35);
      --gold-subtle: rgba(223, 177, 91, 0.12);
      --gold-border: rgba(223, 177, 91, 0.28);
      --ink: #f1f5f9;
      --ink2: #cbd5e1;
      --muted: #8ba0b8;
      --line: rgba(223, 177, 91, 0.22);
      --line-subtle: rgba(139, 160, 184, 0.15);
      --good: #10b981;
      --good-bg: rgba(16, 185, 129, 0.12);
      --bad: #ef4444;
      --bad-bg: rgba(239, 68, 68, 0.12);
      --warn: #f59e0b;
      --warn-bg: rgba(245, 158, 11, 0.12);
      --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 1px rgba(223, 177, 91, 0.25);
      --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 2px rgba(223, 177, 91, 0.4);
      --glass: rgba(12, 21, 39, 0.88);

      /* Astrological Planetary Color Coding (Classical Vedic Palette) */
      --sun: #fe0d16;
      /* Surya: Crimson Red */
      --moon: #070706;
      /* Chandra: Deep Charcoal */
      --mars: #fe0d16;
      /* Mangal: Crimson Red */
      --mercury: #007f00;
      /* Budha: Emerald Green */
      --jupiter: #fe7500;
      /* Guru: Amber Orange */
      --venus: #fe00fe;
      /* Shukra: Magenta Pink */
      --saturn: #0706fe;
      /* Shani: Royal Blue */
      --rahu: #3e5e8f;
      /* Rahu: Slate Blue */
      --ketu: #642b2b;
      /* Ketu: Maroon */
      --ascendant: #8d4d24;
      /* Lagna / Ascendant: Sienna Brown */
      --gulika: #642b2b;
      --mandi: #642b2b;

      /* Typography */
      --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      --font-serif: "Cinzel", Georgia, "Times New Roman", serif;
      --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", monospace;
    }

    /* Light Theme: Sacred Sandalwood & Antique Parchment */
    body:not(.dark) {
      --navy: #1a1612;
      --navy2: #2c251e;
      --navy3: #443a2f;
      --cream: #faf6ee;
      --paper: #ffffff;
      --paper2: #f6f0e4;
      --paper3: #eee6d6;
      --soft: #f4eee2;
      --gold: #b47a24;
      --gold2: #d99b38;
      --gold3: #784e12;
      --gold-glow: rgba(180, 122, 36, 0.25);
      --gold-subtle: rgba(180, 122, 36, 0.09);
      --gold-border: rgba(180, 122, 36, 0.28);
      --ink: #1c1917;
      --ink2: #44403c;
      --muted: #78716c;
      --line: rgba(180, 122, 36, 0.24);
      --line-subtle: rgba(120, 113, 108, 0.16);
      --good: #059669;
      --good-bg: rgba(5, 150, 105, 0.1);
      --bad: #dc2626;
      --bad-bg: rgba(220, 38, 38, 0.1);
      --warn: #d97706;
      --warn-bg: rgba(217, 119, 6, 0.1);
      --shadow: 0 8px 24px rgba(28, 25, 23, 0.08), 0 0 1px rgba(180, 122, 36, 0.2);
      --shadow-lg: 0 16px 36px rgba(28, 25, 23, 0.14), 0 0 2px rgba(180, 122, 36, 0.3);
      --glass: rgba(255, 255, 255, 0.92);
      --moon: #070706;
      --ketu: #642b2b;
      --rahu: #3e5e8f;
    }

    body.dark {
      --moon: #f8fafc;
      --ketu: #b26868;
      --rahu: #638ecb;
    }

    /* Saffron / Kesariya Theme */
    body.theme-saffron {
      --navy: #361603;
      --navy2: #522407;
      --navy3: #75370d;
      --cream: #180a02;
      --paper: #231105;
      --paper2: #341a08;
      --paper3: #48250c;
      --soft: #381c09;
      --gold: #ea580c;
      --gold2: #f97316;
      --gold-glow: rgba(234, 88, 12, 0.35);
      --gold-subtle: rgba(234, 88, 12, 0.12);
      --line: rgba(234, 88, 12, 0.25);
      --shadow: 0 10px 30px rgba(54, 22, 3, 0.5);
    }

    /* Celestial Emerald Theme */
    body.theme-emerald {
      --navy: #022c22;
      --navy2: #064e3b;
      --navy3: #065f46;
      --cream: #031712;
      --paper: #06231b;
      --paper2: #0a352a;
      --paper3: #0f483a;
      --soft: #0c3b2f;
      --gold: #10b981;
      --gold2: #34d399;
      --gold-glow: rgba(16, 185, 129, 0.35);
      --gold-subtle: rgba(16, 185, 129, 0.12);
      --line: rgba(16, 185, 129, 0.25);
      --shadow: 0 10px 30px rgba(2, 44, 34, 0.5);
    }

    /* Cosmic Sky Theme */
    body.theme-sky {
      --navy: #082f49;
      --navy2: #075985;
      --navy3: #0369a1;
      --cream: #041421;
      --paper: #062035;
      --paper2: #0a304e;
      --paper3: #0e426b;
      --soft: #0c3656;
      --gold: #0284c7;
      --gold2: #38bdf8;
      --gold-glow: rgba(2, 132, 199, 0.35);
      --gold-subtle: rgba(2, 132, 199, 0.12);
      --line: rgba(2, 132, 199, 0.25);
      --shadow: 0 10px 30px rgba(8, 47, 73, 0.5);
    }

    /* ==========================================================================
   Base & Reset
   ========================================================================== */
    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
      color-scheme: dark;
    }

    body:not(.dark) {
      color-scheme: light;
    }

    body {
      margin: 0;
      padding: 0;
      background: var(--cream);
      color: var(--ink);
      font-family: var(--font-sans);
      font-size: 13.5px;
      line-height: 1.55;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-x: hidden;
    }

    ::selection {
      background: var(--gold);
      color: #fff;
    }

    ::-webkit-scrollbar {
      width: 1px;
      height: 1px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: var(--line);
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: var(--line);
    }

    body {
      scrollbar-color: var(--line) transparent;
    }

    /* ==========================================================================
   Workstation Shell & Sidebar
   ========================================================================== */
    .shell {
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
      min-height: 100vh;
      position: relative;
    }

    .side {
      background: linear-gradient(180deg, var(--paper) 0%, var(--paper2) 100%);
      border-right: 1px solid var(--line);
      color: var(--ink);
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 16px 14px 20px;
      display: flex;
      flex-direction: column;
      z-index: 100;
      box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .logo-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 4px;
      text-decoration: none;
      user-select: none;
    }

    .brand-logo-icon {
      flex-shrink: 0;
      display: inline-block;
      vertical-align: middle;
      filter: drop-shadow(0 2px 10px var(--gold-glow));
      transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .brand-logo-icon:hover {
      transform: rotate(15deg) scale(1.05);
    }

    .side .brand-logo-icon {
      width: 36px;
      height: 36px;
    }

    .title .brand-logo-icon {
      width: 30px;
      height: 30px;
    }

    .auth-card .brand-logo-icon {
      width: 44px;
      height: 44px;
    }

    .logo {
      font-family: var(--font-serif);
      font-size: 20px;
      font-weight: 700;
      color: var(--ink);
      letter-spacing: 0.02em;
      line-height: 1.2;
    }

    .logo span {
      color: var(--gold2);
      text-shadow: 0 0 12px var(--gold-glow);
    }

    .tag {
      font-size: 10.5px;
      color: var(--muted);
      letter-spacing: 0.04em;
      margin: 2px 0 18px 2px;
      text-transform: uppercase;
      font-weight: 600;
    }

    /* Nav Groups & Section Titles */
    .nav {
      display: flex;
      flex-direction: column;
      gap: 3px;
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: thin;
      contain: paint;
    }

    .nav-section {
      margin-bottom: 12px;
    }

    .nav-section:last-child {
      margin-bottom: 4px;
    }

    .nav .nav-section-title {
      width: 100%;
      box-sizing: border-box;
      border: 0;
      background: transparent;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--gold);
      padding: 6px 8px 6px;
      display: flex;
      align-items: center;
      gap: 6px;
      user-select: none;
      opacity: 0.95;
      cursor: pointer;
      text-align: left;
      font-family: var(--font-sans);
    }

    .nav .nav-section-title:hover {
      color: var(--gold2);
    }

    .nav-section-toggle {
      margin-left: auto;
      font-size: 12px;
      transition: transform 0.18s ease;
    }

    .nav-section-items {
      display: flex;
      flex-direction: column;
      width: 100%;
      overflow: hidden;
    }

    .nav-section.collapsed .nav-section-items {
      display: none;
    }

    .nav-section.collapsed .nav-section-toggle {
      transform: rotate(-90deg);
    }

    .av-guide-lang {
      padding: 3px 9px;
      font-size: 10.5px;
      font-weight: 800;
    }

    .av-guide-lang.active {
      color: #fff;
      background: var(--gold);
      border-color: var(--gold);
    }

    .nav-sec-icon {
      font-size: 11px;
    }

    .nav button {
      display: flex;
      align-items: center;
      width: 100%;
      box-sizing: border-box;
      text-align: left;
      border: 1px solid transparent;
      background: transparent;
      color: var(--ink);
      padding: 8px 12px;
      border-radius: 8px;
      margin: 1px 0;
      cursor: pointer;
      font-family: var(--font-sans);
      font-size: 12.5px;
      font-weight: 600;
      gap: 10px;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transform: none !important;
      backface-visibility: hidden;
      -webkit-font-smoothing: subpixel-antialiased;
    }

    .nav-btn-icon {
      font-size: 14px;
      flex-shrink: 0;
      opacity: 0.9;
      pointer-events: none;
    }

    .nav-btn-text {
      flex: 1 1 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      pointer-events: none;
    }

    .nav button:hover {
      background: var(--gold-subtle);
      color: var(--ink);
      border-color: rgba(223, 177, 91, 0.35);
      transform: none !important;
    }

    .nav button.active {
      background: linear-gradient(90deg, rgba(223, 177, 91, 0.22) 0%, rgba(223, 177, 91, 0.05) 100%);
      color: var(--ink);
      border-color: rgba(223, 177, 91, 0.45);
      box-shadow: inset 3.5px 0 0 var(--gold2), 0 2px 8px rgba(0, 0, 0, 0.15);
      font-weight: 700;
    }

    body.dark .nav button.active {
      color: #fff;
    }

    /* Light Theme Sidebar Contrast */
    body:not(.dark) .side {
      background: linear-gradient(180deg, #ffffff 0%, #f6f0e4 100%);
      box-shadow: 4px 0 20px rgba(0, 0, 0, 0.06);
    }

    body:not(.dark) .nav button {
      color: #292524;
    }

    body:not(.dark) .nav button:hover {
      color: #000000;
      background: rgba(180, 122, 36, 0.12);
    }

    body:not(.dark) .nav button.active {
      color: #784e12;
      background: linear-gradient(90deg, rgba(180, 122, 36, 0.2) 0%, rgba(180, 122, 36, 0.05) 100%);
    }

    body:not(.dark) .nav-section-title {
      color: #a86c18;
    }

    /* Theme Sky Sidebar Contrast */
    body.theme-sky .side {
      background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%);
      box-shadow: 4px 0 20px rgba(2, 132, 199, 0.1);
    }

    body.theme-sky .nav button {
      color: #0f2744;
    }

    body.theme-sky .nav button:hover {
      color: #0284c7;
      background: rgba(2, 132, 199, 0.1);
    }

    body.theme-sky .nav button.active {
      color: #0369a1;
      background: linear-gradient(90deg, rgba(2, 132, 199, 0.18) 0%, rgba(2, 132, 199, 0.04) 100%);
      box-shadow: inset 3.5px 0 0 #0284c7;
    }

    body.theme-sky .nav-section-title {
      color: #0284c7;
    }

    /* Theme Saffron Sidebar Contrast */
    body.theme-saffron .side {
      background: linear-gradient(180deg, #fffaf0 0%, #f4e4c7 100%);
      box-shadow: 4px 0 20px rgba(168, 94, 20, 0.1);
    }

    body.theme-saffron .nav button {
      color: #3c2816;
    }

    body.theme-saffron .nav button:hover {
      color: #000000;
      background: rgba(168, 94, 20, 0.12);
    }

    body.theme-saffron .nav button.active {
      color: #6b3406;
      background: linear-gradient(90deg, rgba(168, 94, 20, 0.2) 0%, rgba(168, 94, 20, 0.05) 100%);
      box-shadow: inset 3.5px 0 0 #ea580c;
    }

    body.theme-saffron .nav-section-title {
      color: #a85e14;
    }

    /* Theme Emerald Sidebar Contrast */
    body.theme-emerald .side {
      background: linear-gradient(180deg, #fbfffc 0%, #e4f1e9 100%);
      box-shadow: 4px 0 20px rgba(6, 61, 56, 0.1);
    }

    body.theme-emerald .nav button {
      color: #163a34;
    }

    body.theme-emerald .nav button:hover {
      color: #000000;
      background: rgba(22, 114, 100, 0.12);
    }

    body.theme-emerald .nav button.active {
      color: #064e3b;
      background: linear-gradient(90deg, rgba(22, 114, 100, 0.2) 0%, rgba(22, 114, 100, 0.05) 100%);
      box-shadow: inset 3.5px 0 0 #10b981;
    }

    body.theme-emerald .nav-section-title {
      color: #167264;
    }


    .side-meta-bottom {
      margin-top: auto;
      padding-top: 12px;
      border-top: 1px solid var(--line-subtle);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .ephe-mini {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 5px 8px;
      border-radius: 6px;
      background: var(--paper2);
      border: 1px solid var(--line-subtle);
      font-size: 10.5px;
    }

    .ephe-mini span {
      color: var(--muted);
      text-transform: uppercase;
      font-size: 9px;
      letter-spacing: 0.05em;
      font-weight: 700;
    }

    .ephe-mini b {
      color: var(--gold2);
      font-weight: 600;
    }

    .account-user {
      font-size: 11px;
      color: var(--muted);
      text-align: center;
    }

    .sidefoot {
      font-size: 9.5px;
      line-height: 1.5;
      color: var(--muted);
      opacity: 0.7;
      padding: 6px 2px 0;
      text-align: center;
      letter-spacing: 0.03em;
    }

    /* ==========================================================================
   Main Content Area & Topbar
   ========================================================================== */
    .main {
      padding: 20px 28px 70px;
      min-width: 0;
      background: radial-gradient(circle at 80% -10%, rgba(223, 177, 91, 0.06), transparent 50%),
        radial-gradient(circle at 10% 20%, rgba(96, 165, 250, 0.04), transparent 40%);
    }

    .topbar {
      display: flex;
      gap: 16px;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0;
      flex-wrap: wrap;
    }

    .topbar>.title {
      display: none;
    }

    .title h1 {
      margin: 0;
      font-family: var(--font-serif);
      font-size: 26px;
      font-weight: 700;
      letter-spacing: 0.02em;
      color: var(--ink);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .title p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 12.5px;
      font-weight: 500;
    }

    .top-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .quick-access-dock {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      width: 100%;
      margin-top: 10px;
    }

    .quick-access-dock .settings-dock {
      width: auto;
      margin: 0;
      padding: 0;
      border: 0;
    }

    .quick-access-dock .settings-toggle {
      min-height: 42px;
      padding: 5px 7px;
      gap: 6px;
      border-radius: 10px;
    }

    .quick-access-dock .settings-toggle-icon,
    .birth-profile-icon {
      width: 24px;
      height: 24px;
      border-radius: 7px;
      font-size: 12px;
    }

    .quick-access-dock .settings-toggle-copy { gap: 3px; }
    .quick-access-dock .settings-toggle-copy > span { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .quick-access-dock .settings-toggle-copy small { max-width: 100%; font-size: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .quick-access-dock .settings-panel { width: min(320px, calc(100vw - 28px)); }

    .birth-profile-dock { min-width: 0; }
    .birth-profile-button {
      display: flex;
      align-items: center;
      width: 100%;
      min-height: 42px;
      gap: 6px;
      padding: 5px 7px;
      border: 1px solid var(--gold2);
      border-radius: 10px;
      background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 48%), linear-gradient(135deg, var(--gold2) 0%, var(--gold) 100%);
      color: #fff;
      box-shadow: 0 7px 16px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.22);
      cursor: pointer;
      text-align: left;
      transition: transform .18s ease, filter .18s ease;
    }

    .birth-profile-button:hover,
    .birth-profile-button:focus-visible { filter: brightness(1.08); outline: none; transform: translateY(-2px); }
    .birth-profile-icon { display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 12px rgba(0,0,0,.13); }
    .birth-profile-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; line-height: 1.1; }
    .birth-profile-copy strong { max-width: 100%; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .birth-profile-copy small { max-width: 100%; color: rgba(255,255,255,.82); font-size: 7px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


    .settings-dock {
      position: relative;
      left: auto;
      bottom: auto;
      z-index: 1100;
      flex: 0 0 auto;
      width: 100%;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--line-subtle);
    }

    .settings-toggle {
      width: 100%;
      min-height: 56px;
      gap: 11px;
      padding: 8px 10px;
      justify-content: flex-start;
      border: 1px solid var(--gold2);
      border-radius: 12px;
      background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 48%), linear-gradient(135deg, var(--gold2) 0%, var(--gold) 100%);
      color: #fff;
      box-shadow: 0 7px 16px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.18);
      font-weight: 700;
      transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    }

    .settings-toggle-icon {
      display: grid;
      place-items: center;
      width: 30px;
      height: 30px;
      flex: 0 0 auto;
      border: 1px solid rgba(255,255,255,.3);
      border-radius: 8px;
      background: rgba(255,255,255,.18);
      color: #fff;
      font-size: 15px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 12px rgba(0,0,0,.13);
    }

    .settings-toggle-copy {
      display: flex;
      min-width: 0;
      flex: 1 1 auto;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      line-height: 1.1;
    }

    .settings-toggle-copy>span {
      font-size: 11px;
      font-weight: 800;
      letter-spacing: -.01em;
    }

    .settings-toggle-copy small {
      color: rgba(255,255,255,.86);
      font-size: 8px;
      font-weight: 650;
    }

    .settings-toggle:hover {
      filter: brightness(1.07) saturate(1.03);
      transform: translateY(-2px);
      box-shadow: 0 10px 20px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.25);
    }

    .settings-panel {
      position: absolute;
      left: 0;
      right: 0;
      bottom: calc(100% + 8px);
      display: flex;
      flex-direction: column;
      width: 100%;
      box-sizing: border-box;
      max-height: calc(100vh - 90px);
      overflow: hidden !important;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      padding: 9px 10px 7px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper);
      box-shadow: 0 16px 44px rgba(8, 47, 73, 0.22), 0 2px 8px rgba(8, 47, 73, 0.08);
      animation: settingsPanelIn 0.16s ease-out;
      z-index: 1000;
    }

    .settings-panel::-webkit-scrollbar {
      display: none !important;
      width: 0 !important;
      height: 0 !important;
    }

    .settings-panel[hidden] {
      display: none;
    }

    .settings-panel-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 2px 6px;
      border-bottom: 1px solid var(--line-subtle, var(--line));
    }

    .settings-panel-title {
      flex: 1;
      margin: 0;
      color: var(--ink);
      font-size: 11.5px;
      font-weight: 700;
      letter-spacing: 0.01em;
    }

    .settings-panel-mark {
      display: grid;
      place-items: center;
      width: 24px;
      height: 24px;
      border-radius: 6px;
      background: var(--gold-subtle);
      color: var(--gold);
      font-size: 13px;
    }

    .settings-close {
      display: grid;
      place-items: center;
      width: 24px;
      height: 24px;
      padding: 0;
      border: 1px solid transparent;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font: inherit;
      font-size: 16px;
      line-height: 1;
      transition: all 0.15s ease;
    }

    .settings-close:hover {
      background: var(--gold-subtle);
      color: var(--ink);
    }

    /* Section 1: Workstation Switcher (Segmented Control) */
    .ws-switcher-seg {
      display: flex;
      background: var(--paper2);
      border: 1px solid var(--line);
      border-radius: 9px;
      padding: 3px;
      gap: 4px;
      margin: 8px 0;
    }

    .ws-seg-tab {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 6px 8px;
      font-size: 11.5px;
      font-weight: 600;
      border: 1px solid transparent;
      border-radius: 7px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
    }

    .ws-seg-tab:hover:not(.active) {
      color: var(--ink);
      background: color-mix(in srgb, var(--paper) 55%, transparent);
    }

    .ws-seg-tab.active {
      background: var(--paper) !important;
      color: var(--gold) !important;
      border-color: color-mix(in srgb, var(--gold) 35%, var(--line)) !important;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      font-weight: 700;
    }

    .ws-seg-icon {
      font-size: 13px;
      line-height: 1;
    }

    .ws-seg-name {
      line-height: 1;
    }

    .ws-seg-badge {
      font-size: 9px;
      font-weight: 700;
      padding: 1px 5px;
      border-radius: 6px;
      background: color-mix(in srgb, var(--good) 15%, transparent);
      color: var(--good);
      line-height: 1.2;
    }

    /* Section 2: Core Actions Card */
    .settings-actions-card {
      background: var(--paper2);
      border: 1px solid var(--line);
      border-radius: 9px;
      overflow: hidden;
      margin-bottom: 8px;
    }

    .settings-action-wrap {
      width: 100%;
    }

    .settings-action-btn,
    #settingsProfileGroup .birth-details-btn {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      width: 100% !important;
      padding: 7px 10px !important;
      min-height: 32px !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      color: var(--ink) !important;
      font-size: 11.5px !important;
      font-weight: 600 !important;
      cursor: pointer !important;
      text-align: left !important;
      transition: background 0.15s ease, color 0.15s ease !important;
    }

    #sampleDbTopBtn {
      border-top: 1px solid var(--line-subtle, var(--line)) !important;
    }

    #settingsProfileGroup .birth-details-btn::before {
      content: "👤";
      font-size: 13px;
      margin-right: 7px;
    }

    #settingsProfileGroup .birth-details-btn::after {
      content: "›";
      font-size: 15px;
      font-weight: 700;
      color: var(--muted);
      margin-left: auto;
    }

    .sab-left {
      display: flex;
      align-items: center;
      gap: 7px;
    }

    .sab-icon {
      font-size: 13px;
      line-height: 1;
    }

    .sab-arrow {
      color: var(--muted);
      font-size: 15px;
      font-weight: 700;
    }

    .settings-action-btn:hover,
    #settingsProfileGroup .birth-details-btn:hover {
      background: var(--gold-subtle) !important;
      color: var(--gold) !important;
    }

    /* Section 3: Quick Preferences Tiles (2x2 Grid) */
    .settings-tiles-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
      margin-bottom: 7px;
    }

    .setting-tile-btn {
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 4px !important;
      padding: 4px 4px !important;
      min-height: 28px !important;
      height: 28px !important;
      font-size: 10.5px !important;
      font-weight: 600 !important;
      border: 1px solid var(--line) !important;
      border-radius: 7px !important;
      background: var(--paper2) !important;
      color: var(--ink) !important;
      cursor: pointer !important;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
      transition: all 0.15s ease !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }

    .setting-tile-btn:hover {
      background: var(--gold-subtle) !important;
      border-color: color-mix(in srgb, var(--gold) 45%, var(--line)) !important;
      color: var(--gold) !important;
    }

    #themePickerBtn::before {
      content: "🎨";
      font-size: 11.5px;
      margin-right: 2px;
    }

    .network-mode-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      display: inline-block;
      margin-right: 2px;
      flex-shrink: 0;
    }

    .network-mode-dot.online {
      background: var(--good, #10b981);
      box-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
    }

    .network-mode-dot.offline {
      background: #f59e0b;
      box-shadow: 0 0 5px rgba(245, 158, 11, 0.6);
    }

    .stb-icon {
      font-size: 11.5px;
      line-height: 1;
    }

    .stb-text {
      line-height: 1;
    }

    /* Section 4: Mini Footer Links */
    .settings-mini-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 3px;
      padding-top: 5px;
      border-top: 1px solid var(--line-subtle, var(--line));
    }

    .smf-link {
      background: none !important;
      border: none !important;
      color: var(--muted) !important;
      font-size: 9.5px !important;
      font-weight: 600 !important;
      cursor: pointer !important;
      padding: 2px 4px !important;
      border-radius: 4px !important;
      transition: color 0.15s ease, background 0.15s ease !important;
      white-space: nowrap !important;
    }

    .smf-link:hover {
      color: var(--gold) !important;
      background: var(--gold-subtle) !important;
    }

    @keyframes settingsPanelIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: 1px solid var(--line);
      background: var(--paper);
      color: var(--ink);
      padding: 8px 14px;
      border-radius: 8px;
      cursor: pointer;
      font-family: var(--font-sans);
      font-size: 12.5px;
      font-weight: 600;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      outline: none;
      user-select: none;
    }

    .btn:hover {
      background: var(--paper2);
      border-color: var(--gold);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 1px var(--gold);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn.gold {
      background: linear-gradient(135deg, var(--gold2) 0%, var(--gold) 50%, var(--gold3) 100%);
      border-color: var(--gold);
      color: #1a1612;
      font-weight: 700;
      text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
      box-shadow: 0 4px 14px var(--gold-glow);
    }

    .btn.gold:hover {
      filter: brightness(1.08);
      box-shadow: 0 6px 20px var(--gold-glow);
      transform: translateY(-1.5px);
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      background: var(--gold-subtle);
      border: 1px solid rgba(223, 177, 91, 0.35);
      color: var(--gold2);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.04em;
      white-space: nowrap;
    }

    .why {
      border: 0;
      background: transparent;
      color: var(--gold);
      font-weight: 800;
      cursor: pointer;
      padding: 4px 0;
      font-size: 11.5px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .why:hover {
      text-decoration: underline;
      color: var(--gold2);
    }

    /* ==========================================================================
   Cards, Panes & Sections
   ========================================================================== */
    .card {
      background: var(--glass);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: var(--shadow);
      padding: 18px;
      margin-bottom: 18px;
      position: relative;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .card:hover {
      border-color: rgba(223, 177, 91, 0.38);
    }

    .pane {
      display: none !important;
      animation: paneFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pane.active {
      display: block !important;
    }

    @keyframes paneFadeIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .section {
      font-family: var(--font-serif);
      font-size: 19px;
      font-weight: 700;
      color: var(--ink);
      letter-spacing: 0.02em;
      margin: 0 0 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .sub {
      color: var(--gold);
      font-weight: 700;
    }

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

    /* Jaimini foundation dashboard */
    .jm-root { display:grid; gap:12px; }
    .jm-card { background:var(--glass); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
    .jm-title { font:700 19px var(--font-serif); color:var(--ink); margin:0; display:flex; align-items:center; gap:9px; }
    .jm-title-icon { width:34px; height:34px; border-radius:11px; display:grid; place-items:center; background:var(--gold-subtle); color:var(--gold); font-family:inherit; }
    .jm-hero { padding:14px 16px; }
    .jm-hero p { margin:4px 0 0 43px; font-size:12px; line-height:1.45; }
    .jm-top { display:grid; grid-template-columns:minmax(0,1.08fr) minmax(500px,1fr); gap:12px; align-items:start; }
    .jm-left { display:grid; gap:12px; }
    .jm-section { padding:13px; }
    .jm-section-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
    .jm-section-head h3 { margin:0; font:700 16px var(--font-serif); color:var(--ink); }
    .jm-count { padding:4px 10px; border-radius:999px; background:var(--gold-subtle); color:var(--gold); font-size:10px; font-weight:800; white-space:nowrap; }
    .jm-padas { display:grid; grid-template-columns:repeat(auto-fit,minmax(65px,1fr)); gap:7px; }
    .jm-pada { min-width:0; text-align:center; padding:8px 4px; border:1px solid var(--line); border-radius:10px; background:var(--paper); line-height:1.25; }
    .jm-pada b { display:block; color:var(--ink); font-size:12px; }
    .jm-pada span { display:block; margin-top:2px; font-size:11px; color:var(--ink2); }
    .jm-pada small { display:block; margin-top:2px; font-size:9px; color:var(--muted); }
    .jm-yogas { list-style:none; padding:0; margin:0; display:grid; gap:5px; }
    .jm-yogas li { display:grid; grid-template-columns:22px 1fr; gap:7px; align-items:start; padding:8px 9px; border:1px solid var(--line); border-radius:8px; background:var(--paper2); color:var(--ink); font-size:12px; line-height:1.35; }
    .jm-yoga-num { display:grid; place-items:center; width:21px; height:21px; border-radius:50%; background:var(--gold-subtle); color:var(--gold); font-weight:800; font-size:10px; }
    .jm-charts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .jm-chart { padding:12px; min-width:0; }
    .jm-chart .chart-title { margin-bottom:6px; }
    .jm-chart .chart-svg-box { max-width:290px; margin:auto; }
    .jm-chart .chart-note { text-align:center; margin-top:6px; font-size:11px; }
    .jm-argala { padding:13px; }
    .jm-argala-head { display:flex; justify-content:space-between; align-items:center; gap:10px; padding-bottom:9px; margin-bottom:10px; border-bottom:1px solid var(--line); }
    .jm-argala-head h3 { margin:0; font:700 17px var(--font-serif); }
    .jm-help { border:0; background:transparent; color:var(--gold); font-weight:800; font-size:11px; cursor:pointer; }
    .jm-argala-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
    .jm-argala-col { min-width:0; }
    .jm-argala-col + .jm-argala-col { border-left:1px solid var(--line); padding-left:10px; }
    .jm-argala-col h4 { margin:0 0 8px; font:700 14px var(--font-serif); color:var(--ink); }
    .jm-argala-item { padding:8px 9px; margin-top:6px; border:1px solid var(--line); border-radius:9px; background:var(--paper); }
    .jm-argala-item:first-of-type { margin-top:0; }
    .jm-argala-item b { display:block; font-size:12px; color:var(--ink); }
    .jm-argala-line { margin-top:3px; font-size:10.5px; line-height:1.35; color:var(--ink2); }
    .jm-primary { color:var(--good); font-weight:700; }.jm-block { color:var(--bad); font-weight:700; }.jm-secondary { color:var(--gold); font-weight:700; }
    .jm-drishti { padding:11px 13px; }
    .jm-drishti .table { margin:0; font-size:11px; }
    .jm-drishti .table td { padding:5px 8px; }
    @media (max-width:1050px) { .jm-top { grid-template-columns:1fr; }.jm-charts { max-width:740px; }.jm-argala-grid { grid-template-columns:1fr; }.jm-argala-col + .jm-argala-col { border-left:0; border-top:1px solid var(--line); padding:10px 0 0; } }
    @media (max-width:600px) { .jm-charts { grid-template-columns:1fr; }.jm-padas { grid-template-columns:repeat(4,minmax(0,1fr)); }.jm-hero p { margin-left:0; } }

    .warn {
      padding: 12px 14px;
      border-radius: 10px;
      background: var(--warn-bg);
      border: 1px solid rgba(245, 158, 11, 0.3);
      color: var(--warn);
      font-size: 12.5px;
      margin: 10px 0;
    }

    .bad {
      color: var(--bad);
    }

    .good {
      color: var(--good);
    }

    /* ==========================================================================
   Birth Details & Analysis Settings Form
   ========================================================================== */
    .collapsible-card summary {
      cursor: pointer;
      font-family: var(--font-serif);
      font-size: 16px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 0;
      user-select: none;
      outline: none;
    }

    .collapsible-card summary::-webkit-details-marker {
      display: none;
    }

    .collapsible-card summary::before {
      content: "✦";
      color: var(--gold);
      margin-right: 8px;
      font-size: 14px;
      transition: transform 0.25s ease;
    }

    .collapsible-card[open] summary::before {
      transform: rotate(45deg);
    }

    .birth-summary {
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 600;
      color: var(--gold2);
      background: var(--gold-subtle);
      border: 1px solid rgba(223, 177, 91, 0.3);
      padding: 3px 10px;
      border-radius: 999px;
      letter-spacing: 0.02em;
    }

    .collapsible-body {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid var(--line-subtle);
    }

    .saved-profiles-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
      padding: 10px 14px;
      background: var(--paper2);
      border: 1px solid var(--line);
      border-radius: 10px;
      flex-wrap: wrap;
    }

    .saved-profiles-bar.file-menu-bar {
      position: relative;
      display: flex !important;
      min-height: 48px;
      padding: 7px 12px !important;
      border-radius: 10px !important;
      justify-content: space-between;
    }

    .file-menu-wrap {
      position: relative;
    }

    .file-menu-trigger {
      min-width: 72px;
    }

    .file-menu-panel {
      position: absolute;
      z-index: 1100;
      top: calc(100% + 8px);
      left: 0;
      width: 270px;
      padding: 6px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 16px 38px rgba(7, 27, 48, .22);
    }

    .file-menu-panel[hidden] {
      display: none;
    }

    .file-menu-item {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 9px 10px;
      border: 0;
      border-radius: 6px;
      color: var(--ink);
      background: transparent;
      font: inherit;
      font-size: 13px;
      text-align: left;
      cursor: pointer;
    }

    .file-menu-item:hover,
    .file-menu-item:focus-visible {
      background: var(--gold-subtle);
      outline: none;
    }

    .file-menu-item .file-menu-hint {
      color: var(--muted);
      font-size: 11px;
    }

    .file-menu-divider {
      height: 1px;
      margin: 5px 4px;
      background: var(--line-subtle);
    }

    .file-menu-section {
      padding: 7px 10px 4px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .file-menu-recent {
      max-height: 190px;
      overflow-y: auto;
    }

    .file-menu-save-to {
      position: relative;
    }

    .file-menu-submenu {
      position: absolute;
      top: -6px;
      left: calc(100% + 6px);
      width: 230px;
      padding: 6px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 16px 38px rgba(7, 27, 48, .22);
    }

    .file-menu-submenu[hidden] {
      display: none;
    }

    .file-menu-bar .file-menu-state {
      display: none;
    }

    .file-menu-bar #profileStatus {
      margin-left: auto !important;
      min-height: 14px;
    }

    @media (max-width: 620px) {
      .file-menu-submenu {
        left: 0;
        top: calc(100% + 4px);
      }
    }

    .inputs {
      display: grid;
      grid-template-columns: 1.35fr 1.6fr 0.9fr 2fr 0.9fr 0.9fr 1.2fr;
      gap: 12px;
      align-items: start;
    }

    .prediction-date-field {
      display: none;
    }

    .field {
      position: relative;
    }

    .field label {
      display: block;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin-bottom: 6px;
    }

    .field-label-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }

    .field-label-row label {
      margin-bottom: 0;
    }

    .now-badge-btn {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 1px 6px;
      background: var(--paper2);
      border: 1px solid var(--line);
      border-radius: 4px;
      font-size: 10px;
      font-weight: 700;
      color: var(--gold);
      cursor: pointer;
      text-transform: none;
      letter-spacing: 0.02em;
      line-height: 1.35;
      font-family: inherit;
      transition: all 0.15s ease;
    }

    .now-badge-btn:hover {
      background: var(--gold-glow);
      border-color: var(--gold);
      color: var(--ink);
    }

    .file-menu-now-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-weight: 700 !important;
      font-size: 12px !important;
      padding: 5px 12px !important;
      border: 1px solid var(--line) !important;
      background: var(--paper) !important;
      color: var(--ink) !important;
      border-radius: 6px !important;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .file-menu-now-btn:hover {
      background: var(--gold-glow) !important;
      border-color: var(--gold) !important;
      color: var(--gold) !important;
    }

    .field input,
    .field select {
      width: 100%;
      padding: 9px 11px;
      border: 1px solid var(--line);
      background: var(--paper);
      color: var(--ink);
      border-radius: 8px;
      font-family: var(--font-sans);
      font-size: 13px;
      outline: none;
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .field input:focus,
    .field select:focus {
      border-color: var(--gold);
      box-shadow: 0 0 0 3px var(--gold-glow);
    }

    .smart-input-wrap {
      position: relative;
      display: flex;
      align-items: center;
      width: 100%;
    }

    .smart-input-wrap input[type="text"] {
      width: 100%;
      padding-right: 32px;
    }

    .smart-picker-btn {
      position: absolute;
      right: 6px;
      top: 50%;
      transform: translateY(-50%);
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 5px;
      cursor: pointer;
      user-select: none;
      transition: background-color 0.15s ease;
      overflow: hidden;
    }

    .smart-picker-btn:hover {
      background: rgba(212, 175, 55, 0.18);
    }

    .smart-picker-icon {
      font-size: 13px;
      line-height: 1;
      pointer-events: none;
      opacity: 0.85;
    }

    .smart-hidden-picker {
      position: absolute !important;
      inset: 0 !important;
      width: 100% !important;
      height: 100% !important;
      opacity: 0 !important;
      cursor: pointer !important;
      z-index: 2 !important;
      border: none !important;
      padding: 0 !important;
      margin: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
      min-width: 0 !important;
    }

    .smart-hidden-picker::-webkit-calendar-picker-indicator {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }

    .location-search {
      position: relative;
    }

    .location-results {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--paper2);
      border: 1px solid var(--gold);
      border-radius: 8px;
      box-shadow: var(--shadow-lg);
      max-height: 220px;
      overflow-y: auto;
      z-index: 1000;
      margin-top: 4px;
    }

    .location-results.open {
      display: block;
    }

    .location-option {
      padding: 8px 12px;
      cursor: pointer;
      font-size: 12.5px;
      border-bottom: 1px solid var(--line-subtle);
      transition: background 0.15s ease;
    }

    .location-option:hover {
      background: var(--gold-subtle);
      color: var(--gold2);
    }

    .location-hint {
      font-size: 10px;
      color: var(--muted);
      margin-top: 4px;
    }

    .location-meta {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-top: 12px;
    }

    .location-meta input {
      opacity: 0.85;
      background: var(--paper2);
    }

    .compact-toolbar {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 14px;
      flex-wrap: wrap;
    }

    .compact-toolbar .btn,
    .compact-toolbar select.btn {
      padding: 7px 11px;
      font-size: 12px;
      white-space: nowrap;
    }

    .compact-toolbar .status {
      flex-basis: 100%;
      width: 100%;
    }

    .status {
      margin-top: 8px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 500;
    }

    /* ==========================================================================
   KPIs & Overview Metrics
   ========================================================================== */
    .kpis {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 18px;
    }

    .kpi {
      background: linear-gradient(180deg, var(--paper) 0%, var(--paper2) 100%);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px 14px;
      min-width: 0;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
      position: relative;
      overflow: hidden;
      transition: transform 0.18s ease, border-color 0.18s ease;
    }

    .kpi:hover {
      transform: translateY(-2px);
      border-color: var(--gold);
    }

    .kpi small {
      display: block;
      color: var(--muted);
      text-transform: uppercase;
      font-size: 9.5px;
      letter-spacing: 0.08em;
      font-weight: 800;
    }

    .kpi b {
      font-size: 15px;
      display: block;
      margin-top: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--ink);
    }

    .kpi-compact-line {
      margin-top: 4px;
      font-size: 10.5px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ==========================================================================
   Vedic Panchang Strip (Sacred Ribbon)
   ========================================================================== */
    .panchang-strip {
      display: flex;
      align-items: stretch;
      gap: 0;
      margin: 16px 0;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper);
      box-shadow: var(--shadow);
      overflow-x: auto;
      max-width: 100%;
    }

    .panchang-strip>strong,
    .panchang-strip>span {
      flex: 0 0 auto;
      padding: 8px 14px;
      border-right: 1px solid var(--line);
      min-width: 0;
    }

    .panchang-strip>strong {
      display: flex;
      align-items: center;
      color: var(--gold2);
      font-family: var(--font-serif);
      font-size: 14px;
      font-weight: 700;
      background: linear-gradient(135deg, var(--paper2) 0%, rgba(223, 177, 91, 0.12) 100%);
      letter-spacing: 0.04em;
      gap: 6px;
    }

    .panchang-strip>strong::before {
      content: "✦";
      font-size: 12px;
    }

    .panchang-strip small {
      display: block;
      color: var(--muted);
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 800;
    }

    .panchang-strip b {
      font-size: 12.5px;
      display: block;
      color: var(--ink);
      white-space: nowrap;
    }

    .panchang-strip em {
      display: block;
      color: var(--gold);
      font-size: 9.5px;
      font-style: normal;
      font-weight: 600;
    }

    .panchang-strip .panchang-sun {
      margin-left: auto;
      border-right: 0;
      background: var(--gold-subtle);
    }

    /* ==========================================================================
   North Indian & South Indian Charts
   ========================================================================== */
    .overview-charts {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      margin-top: 14px;
    }

    .chart-card {
      padding: 14px;
      border-radius: 14px;
      display: flex;
      flex-direction: column;
    }

    .chart-title {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      margin-bottom: 10px;
      border-bottom: 1px solid var(--line);
      padding-bottom: 8px;
    }

    .chart-title b {
      font-family: var(--font-serif);
      font-size: 15px;
      font-weight: 700;
      color: var(--ink);
    }

    .chart-title span {
      font-size: 11px;
      color: var(--gold);
      font-weight: 600;
    }

    /* D10 Dashamsha career story ------------------------------------------------
       This view intentionally uses only the application palette tokens so that it
       follows every selected light/dark/accent theme without a second theme map. */
    .d10-story {
      --d10-accent: var(--gold);
      --d10-accent-soft: var(--gold-subtle);
      color: var(--ink);
    }
    .d10-story.cip-container { padding: 24px; margin-bottom: 24px; }

    .d10-story .d10-hero {
      display: grid;
      grid-template-columns: minmax(0, 1.55fr) minmax(390px, 1fr);
      gap: 18px;
      align-items: stretch;
      padding: 18px 20px;
      border: 1px solid var(--line);
      border-radius: 15px;
      background: linear-gradient(125deg, var(--paper) 0%, var(--paper2) 100%);
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
      margin-bottom: 20px;
    }

    .d10-story .d10-kicker {
      display: block;
      color: var(--gold2);
      font-size: 11px;
      font-weight: 850;
      letter-spacing: .055em;
      text-transform: uppercase;
    }

    .d10-story h1,
    .d10-story h2,
    .d10-story h3 { font-family: var(--font-serif); color: var(--ink); }
    .d10-story .d10-hero h1 { margin: 4px 0 3px; font-size: clamp(25px, 2.5vw, 38px); line-height: 1.14; }
    .d10-story .d10-hero p { margin: 0; color: var(--ink2); }
    .d10-story .d10-hero-copy { max-width: 820px; }

    .d10-periods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .d10-period {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      min-width: 0;
      padding: 11px;
      border: 1px solid var(--line-subtle);
      border-radius: 12px;
      background: var(--paper);
    }
    .d10-period-symbol {
      width: 48px; height: 48px; display: grid; place-items: center;
      border-radius: 50%; background: var(--d10-accent-soft); border: 1px solid var(--line);
      font-size: 29px; font-weight: 700;
    }
    .d10-period small { display: block; color: var(--muted); font-weight: 750; }
    .d10-period b { display: block; font-size: 17px; line-height: 1.2; }
    .d10-period span { display: block; color: var(--ink2); font-size: 11px; margin-top: 3px; white-space: nowrap; }

    .d10-story-grid {
      display: grid;
      grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) minmax(255px, .72fr);
      gap: 14px;
      margin-top: 14px;
      align-items: stretch;
    }
    .d10-story .d10-chart-card,
    .d10-story .d10-insight,
    .d10-story .d10-reading,
    .d10-story .d10-timeline {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--paper);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    }
    .d10-story .d10-chart-card { margin: 0; min-width: 0; }
    .d10-story .d10-chart-card .chart-title { margin-bottom: 7px; }
    .d10-story .d10-chart-card .northchart,
    .d10-story .d10-chart-card .southchart { max-width: 100%; border-color: var(--line); }
    .d10-story .d10-chart-card .chart-action-bar { max-width: 100%; }

    .d10-insights { display: grid; gap: 12px; }
    .d10-insight { padding: 15px 16px; }
    .d10-insight-title { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
    .d10-insight-title i { font-style: normal; color: var(--gold2); font-size: 21px; }
    .d10-insight-title h2 { margin: 0; font-size: 17px; line-height: 1.2; }
    .d10-facts { margin: 0; }
    .d10-facts div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-subtle); }
    .d10-facts dt { color: var(--ink); font-weight: 800; }
    .d10-facts dd { margin: 0; color: var(--ink2); }
    .d10-insight p { margin: 8px 0 0; color: var(--ink2); font-size: 12.5px; }

    .d10-story .d10-reading-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
    .d10-reading { padding: 15px 18px; }
    .d10-reading header { display: flex; gap: 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line-subtle); }
    .d10-reading header i { font-style: normal; color: var(--gold2); font-size: 22px; }
    .d10-reading h2 { margin: 0; font-size: 18px; }
    .d10-reading .d10-facts div { grid-template-columns: 96px minmax(0, 1fr); }
    .d10-reading p { margin: 9px 0 0; color: var(--ink2); }

    .d10-timeline { margin-top: 14px; padding: 15px 18px 7px; overflow: hidden; }
    .d10-timeline-heading { display: flex; gap: 10px; align-items: start; margin-bottom: 7px; }
    .d10-timeline-heading i { font-style: normal; color: var(--gold2); font-size: 22px; }
    .d10-timeline h2 { margin: 0; font-size: 19px; }
    .d10-timeline-heading p { margin: 1px 0 0; color: var(--muted); }
    .d10-timeline .table { margin: 8px 0; }
    .d10-timeline .table th { background: var(--d10-accent-soft); color: var(--gold2); }
    .d10-timeline .d10-planet-cell { display: flex; align-items: center; gap: 9px; }
    .d10-timeline .d10-planet-cell i { font-style: normal; font-size: 24px; line-height: 1; }

    @media (max-width: 1180px) {
      .d10-story .d10-hero { grid-template-columns: 1fr; }
      .d10-story-grid { grid-template-columns: 1fr 1fr; }
      .d10-insights { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 760px) {
      .d10-story .d10-hero { padding: 15px; }
      .d10-periods, .d10-story-grid, .d10-story .d10-reading-grid, .d10-insights { grid-template-columns: 1fr; }
      .d10-insights { grid-column: auto; }
      .d10-story .d10-hero h1 { font-size: 27px; }
      .d10-facts div, .d10-reading .d10-facts div { grid-template-columns: 1fr; gap: 2px; }
      .d10-timeline { padding: 14px 12px 6px; }
    }

    .northchart,
    .southchart {
      width: 100%;
      max-width: 290px;
      aspect-ratio: 1;
      display: block;
      margin: auto;
      background: radial-gradient(circle at 50% 50%, var(--paper2) 0%, var(--paper) 100%);
      border-radius: 12px;
      filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
      border: 1px solid var(--line);
    }

    .astro-chart-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
    }

    .chart-action-bar {
      display: flex;
      justify-content: flex-end;
      gap: 5px;
      width: 100%;
      max-width: 290px;
      margin: 0 auto 5px auto;
    }

    .btn-chart-action {
      font-size: 10px;
      font-weight: 700;
      padding: 2px 7px;
      height: 22px;
      line-height: 16px;
      border-radius: 4px;
      background: var(--paper2);
      border: 1px solid var(--line);
      color: var(--muted);
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    .btn-chart-action:hover {
      background: var(--paper);
      color: var(--gold);
      border-color: var(--gold-border);
    }

    .btn-chart-action.btn-chart-active {
      background: var(--gold-subtle, rgba(212, 175, 55, 0.18));
      border-color: var(--gold);
      color: var(--gold2);
    }

    .chart-svg-box {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .chart-note {
      margin-top: 10px;
      text-align: center;
      font-size: 11.5px;
      color: var(--muted);
      font-weight: 500;
    }

    .legend {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--line-subtle);
      font-size: 11px;
    }

    .planet {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 6px;
      background: var(--paper2);
      border: 1px solid var(--line-subtle);
      font-weight: 700;
      font-size: 10.5px;
    }

    .planet-Sun {
      color: var(--sun);
      border-color: rgba(254, 13, 22, 0.3);
    }

    .planet-Moon {
      color: var(--moon);
      border-color: rgba(7, 7, 6, 0.3);
    }

    .planet-Mars {
      color: var(--mars);
      border-color: rgba(254, 13, 22, 0.3);
    }

    .planet-Mercury {
      color: var(--mercury);
      border-color: rgba(0, 127, 0, 0.3);
    }

    .planet-Jupiter {
      color: var(--jupiter);
      border-color: rgba(254, 117, 0, 0.3);
    }

    .planet-Venus {
      color: var(--venus);
      border-color: rgba(254, 0, 254, 0.3);
    }

    .planet-Saturn {
      color: var(--saturn);
      border-color: rgba(7, 6, 254, 0.3);
    }

    .planet-Rahu {
      color: var(--rahu);
      border-color: rgba(62, 94, 143, 0.3);
    }

    .planet-Ketu {
      color: var(--ketu);
      border-color: rgba(100, 43, 43, 0.3);
    }

    /* ==========================================================================
   Data Tables & Grids
   ========================================================================== */
    .table {
      width: 100%;
      border-collapse: collapse;
      margin: 10px 0;
      font-size: 12.5px;
    }

    .table th,
    .table td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line-subtle);
      text-align: left;
    }

    .table th {
      color: var(--gold2);
      font-size: 10.5px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 800;
      background: var(--paper2);
      border-bottom: 1px solid var(--line);
    }

    .table tbody tr:hover {
      background: var(--gold-subtle);
    }

    .grid2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    .grid3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
    }

    .meta {
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      margin: 8px 0;
    }

    /* Varga Charts Grid & Rotator */
    .varga-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 16px;
    }

    .varga .northchart,
    .varga .southchart {
      max-width: 280px;
    }

    .varga-rotator-card .northchart,
    .varga-rotator-card .southchart {
      max-width: 280px;
    }

    .varga-rotator-card .chart-note {
      margin-top: 4px;
      font-size: 11px;
    }

    .varga-grid [draggable="true"] {
      cursor: grab;
    }

    .varga-grid [draggable="true"]:active {
      cursor: grabbing;
    }

    .varga-grid .varga-dragging {
      opacity: 0.45;
    }

    .varga-grid .varga-drag-over {
      outline: 2px dashed var(--gold);
      outline-offset: 3px;
    }

    .rot-btn {
      padding: 4px 8px;
      font-size: 11px;
    }

    /* ==========================================================================
   Dasha Systems & Hierarchical Trees
   ========================================================================== */
    .dasha-accordion {
      padding: 0;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 12px;
      margin-bottom: 12px;
      background: var(--paper);
    }

    .dasha-accordion>summary {
      list-style: none;
      cursor: pointer;
      padding: 14px 18px;
      font-family: var(--font-serif);
      font-size: 17px;
      font-weight: 700;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      background: linear-gradient(180deg, var(--paper), var(--paper2));
      user-select: none;
    }

    .dasha-accordion>summary::-webkit-details-marker {
      display: none;
    }

    .dasha-accordion>summary:after {
      content: "+";
      color: var(--gold);
      font: 800 20px Arial;
    }

    .dasha-accordion[open]>summary:after {
      content: "−";
    }

    .dasha-body {
      padding: 0 16px 16px;
    }

    .dasha-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 12px 0 8px;
      flex-wrap: wrap;
    }

    .depth-badge {
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 6px;
      background: var(--paper2);
      border: 1px solid var(--line);
      color: var(--muted);
    }

    .depth-btn {
      padding: 5px 10px;
      font-size: 11.5px;
    }

    .dasha-tree details {
      margin: 5px 0 5px 14px;
    }

    .dasha-tree summary {
      cursor: pointer;
      color: var(--ink);
      font-weight: 700;
      padding: 3px 0;
    }

    .dasha-tree .period-row {
      padding: 6px 10px;
      border-left: 2px solid var(--line);
      font-size: 12px;
      margin: 3px 0;
    }

    .period-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 9px 12px;
      border-radius: 8px;
      background: var(--paper2);
      border: 1px solid var(--line-subtle);
      font-size: 12.5px;
      transition: all 0.15s ease;
    }

    .period-row:hover {
      border-color: var(--gold);
      background: var(--gold-subtle);
    }

    .group-accordion {
      border: 1px solid var(--line);
      border-radius: 10px;
      margin-bottom: 8px;
      overflow: hidden;
    }

    .group-body {
      padding: 10px 14px;
    }

    /* ==========================================================================
   Shadbala Dashboard (Classical Parashari)
   ========================================================================== */
    .shad-hero {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
      margin-bottom: 16px;
    }

    .shad-hero h2 {
      margin: 0 0 4px;
    }

    .shad-badge {
      padding: 6px 12px;
      border-radius: 999px;
      background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, transparent), color-mix(in srgb, var(--gold) 4%, transparent));
      border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
      color: var(--gold);
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .shad-dashboard {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .shad-panel {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: linear-gradient(180deg, var(--paper), var(--paper2));
      padding: 14px;
      min-width: 0;
    }

    .shad-panel h3 {
      margin: 0 0 10px;
      text-align: center;
      font-family: var(--font-serif);
      font-size: 17px;
      font-weight: 700;
      color: var(--ink);
    }

    .shad-bars {
      height: 170px;
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      align-items: end;
      border-bottom: 1px solid var(--line);
      padding: 12px 4px 0;
    }

    .shad-col {
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      min-width: 0;
    }

    .shad-val {
      font-size: 10px;
      font-weight: 800;
      color: var(--muted);
      line-height: 1.1;
      min-height: 15px;
    }

    .shad-bar-wrap {
      height: 125px;
      width: 100%;
      display: flex;
      align-items: flex-end;
      justify-content: center;
    }

    .shad-bar {
      width: min(28px, 80%);
      border-radius: 5px 5px 2px 2px;
      background: linear-gradient(180deg, var(--gold2), var(--gold));
      min-height: 2px;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    }

    .shad-bar.neg {
      align-self: flex-start;
      background: linear-gradient(180deg, #d87b80, var(--bad));
      border-radius: 2px 2px 5px 5px;
    }

    .shad-drik-panel .shad-bar-wrap {
      position: relative;
      display: block;
    }

    .shad-drik-panel .shad-bar {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      bottom: 50%;
    }

    .shad-drik-panel .shad-bar.neg {
      top: 50%;
      bottom: auto;
    }

    .shad-drik-panel .shad-bar-wrap:after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 50%;
      border-top: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
    }

    .shad-pname {
      font-size: 10px;
      font-weight: 900;
      margin-top: 6px;
      white-space: nowrap;
    }

    .shad-total-panel .shad-bar {
      background: linear-gradient(180deg, var(--gold2), var(--gold3));
    }

    .shad-compare {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin: 16px 0;
    }

    .shad-kpi {
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper2);
    }

    .shad-kpi small {
      display: block;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      font-size: 9.5px;
      color: var(--muted);
      font-weight: 800;
    }

    .shad-kpi b {
      display: block;
      font-size: 18px;
      margin-top: 4px;
      color: var(--ink);
    }

    .shad-detail-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }

    .shad-detail {
      border-left: 4px solid var(--gold);
    }

    .shad-method-note {
      margin-top: 14px;
      padding: 12px 14px;
      border-radius: 10px;
      border: 1px solid rgba(79, 134, 198, 0.3);
      background: rgba(79, 134, 198, 0.08);
      color: var(--muted);
      font-size: 12px;
    }

    .shad-ref {
      font-size: 10px;
      color: var(--muted);
      text-align: center;
      margin: -2px 0 8px;
      font-weight: 700;
    }

    .shad-col.above .shad-val,
    .shad-col.supportive .shad-val {
      color: var(--good);
    }

    .shad-col.below .shad-val,
    .shad-col.reducing .shad-val {
      color: var(--warn);
    }

    .shad-legend {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 10px 0 4px;
    }

    .shad-legend span {
      font-size: 10.5px;
      font-weight: 800;
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--paper2);
    }

    .shad-legend .stronger {
      color: var(--good);
      border-color: rgba(16, 185, 129, 0.3);
    }

    .shad-legend .weaker {
      color: var(--warn);
      border-color: rgba(245, 158, 11, 0.3);
    }

    .shad-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin: 12px 0;
    }

    .shad-summary div {
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--paper);
    }

    .shad-summary small {
      display: block;
      color: var(--muted);
      font-size: 9.5px;
      text-transform: uppercase;
      font-weight: 700;
    }

    .shad-summary b {
      font-size: 16px;
      display: block;
      margin-top: 3px;
    }

    /* ===== Classical Bhava Bala Dashboard ===== */
    .shad-subtab-nav {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .bb-main-table th {
      white-space: nowrap;
      font-size: 11px;
    }

    .bb-main-table td {
      font-size: 13px;
      vertical-align: middle;
    }

    .bb-row-top {
      background: color-mix(in srgb, var(--gold) 6%, transparent);
    }

    .bb-mini-bar-wrap {
      width: 100%;
      height: 5px;
      background: var(--line);
      border-radius: 3px;
      overflow: hidden;
      margin-top: 3px;
    }

    .bb-mini-bar {
      height: 100%;
      border-radius: 3px;
      transition: width 0.3s ease;
    }

    .bb-mini-bar.stronger {
      background: linear-gradient(90deg, var(--gold2), var(--gold));
    }

    .bb-mini-bar.weaker {
      background: linear-gradient(90deg, #64748b, #94a3b8);
    }

    .bb-house-card {
      padding: 14px;
      border-radius: 10px;
      background: var(--paper);
      border: 1px solid var(--line);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    }

    .bb-top-card {
      border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
    }

    .bb-component-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 6px;
      margin: 6px 0;
      text-align: center;
    }

    .bb-comp-box {
      padding: 6px 8px;
      background: var(--paper2);
      border-radius: 6px;
      border: 1px solid var(--line);
    }

    .bb-comp-box small {
      display: block;
      font-size: 10px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .bb-comp-box b {
      font-size: 12px;
      display: block;
      margin-top: 2px;
    }


    /* ==========================================================================
   Prediction Command Center & Framework
   ========================================================================== */
    .cmd-hero {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 24px;
      padding: 22px;
      background: linear-gradient(135deg, var(--paper), var(--paper2));
      border-left: 5px solid var(--gold);
      border-radius: 14px;
      border: 1px solid var(--line);
      border-left-width: 5px;
      box-shadow: var(--shadow);
      margin-bottom: 18px;
    }

    .cmd-hero h2 {
      margin: 2px 0 6px;
      font-family: var(--font-serif);
      font-size: 26px;
      font-weight: 700;
    }

    .cmd-hero p {
      margin: 0;
      max-width: 850px;
      color: var(--muted);
      font-size: 13.5px;
    }

    .cmd-kicker,
    .cmd-eyebrow {
      display: block;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 9.5px;
      font-weight: 900;
      color: var(--gold);
    }

    .cmd-hero-badge {
      min-width: 120px;
      text-align: center;
      padding: 14px 18px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--paper2);
    }

    .cmd-hero-badge b {
      display: block;
      font-size: 28px;
      color: var(--gold2);
    }

    .cmd-hero-badge span {
      font-size: 10px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 700;
    }

    .cmd-section {
      margin-top: 22px;
    }

    .cmd-section-title {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      margin: 0 2px 10px;
    }

    .cmd-section-title>div {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .cmd-section-title small {
      font-weight: 900;
      color: var(--gold);
    }

    .cmd-section-title h2 {
      margin: 0;
      font-family: var(--font-serif);
      font-size: 20px;
      font-weight: 700;
    }

    .cmd-section-title>span {
      font-size: 10.5px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .cmd-pred-list {
      display: grid;
      gap: 14px;
    }

    .cmd-pred {
      display: grid;
      grid-template-columns: 46px 1fr;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--paper);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .cmd-pred.risk {
      border-left: 4px solid var(--bad);
    }

    .cmd-rank {
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding-top: 18px;
      background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, transparent), transparent);
      font-family: var(--font-serif);
      font-size: 22px;
      font-weight: 700;
      color: var(--gold);
    }

    .cmd-pred-body {
      padding: 16px 18px;
    }

    .cmd-pred-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .cmd-pred-head h3 {
      margin: 2px 0 8px;
      font-family: var(--font-serif);
      font-size: 19px;
      font-weight: 700;
    }

    .cmd-source-count {
      font-size: 10px;
      font-weight: 800;
      color: var(--muted);
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 4px 8px;
      white-space: nowrap;
    }

    .cmd-practical {
      padding: 12px 14px;
      border-radius: 10px;
      background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, transparent), color-mix(in srgb, var(--navy2) 8%, transparent));
      margin: 8px 0 12px;
    }

    .cmd-practical>b {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--gold);
      font-weight: 800;
    }

    .cmd-practical p {
      margin: 5px 0 0;
      font-size: 14px;
      line-height: 1.65;
    }

    .cmd-metrics {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin: 12px 0;
    }

    .cmd-score>div:first-child {
      display: flex;
      justify-content: space-between;
      font-size: 10.5px;
      color: var(--muted);
      font-weight: 800;
    }

    .cmd-scorebar,
    .cmd-domain-bar {
      height: 7px;
      background: var(--paper2);
      border-radius: 999px;
      overflow: hidden;
      margin-top: 5px;
      border: 1px solid var(--line-subtle);
    }

    .cmd-scorebar i,
    .cmd-domain-bar i {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, var(--gold), var(--gold2));
      border-radius: 999px;
    }

    .cmd-proof {
      margin-top: 12px;
      border-top: 1px dashed var(--line);
      padding-top: 10px;
    }

    .cmd-proof summary {
      cursor: pointer;
      font-weight: 800;
      color: var(--muted);
    }

    .cmd-proof-line {
      font-size: 12px;
      color: var(--muted);
      padding: 4px 0;
    }

    .cmd-formulas {
      display: grid;
      gap: 6px;
      margin-top: 8px;
    }

    .cmd-formulas code,
    .cmd-mini code {
      padding: 6px 8px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--paper2);
      font-size: 11px;
      font-family: var(--font-mono);
      overflow-wrap: anywhere;
    }

    .cmd-focus-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .cmd-mini {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper);
    }

    .cmd-mini>span,
    .cmd-timing>span {
      font-size: 9.5px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--gold);
      font-weight: 900;
    }

    .cmd-mini h3 {
      margin: 5px 0;
      font-size: 15px;
    }

    .cmd-mini p {
      margin: 5px 0 10px;
      color: var(--muted);
      font-size: 12px;
    }

    .cmd-domain-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .cmd-domain {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper);
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 6px 10px;
    }

    .cmd-domain>div:first-child b {
      display: block;
      font-size: 14px;
    }

    .cmd-domain>div:first-child span {
      font-size: 10.5px;
      color: var(--muted);
    }

    .cmd-domain>strong {
      font-size: 22px;
      color: var(--gold);
      font-family: var(--font-serif);
    }

    .cmd-domain-bar {
      grid-column: 1/-1;
    }

    .cmd-empty {
      padding: 20px;
      border: 1px dashed var(--line);
      border-radius: 12px;
      color: var(--muted);
      background: var(--paper);
      text-align: center;
    }

    .cmd-timing-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .cmd-timing {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper);
    }

    .cmd-timing b {
      display: block;
      margin: 6px 0;
      font-size: 14px;
    }

    .cmd-timing small {
      color: var(--muted);
      font-size: 11px;
    }

    .cmd-conv {
      padding: 10px 0;
      border-bottom: 1px solid var(--line);
    }

    .cmd-conv:last-child {
      border-bottom: 0;
    }

    .cmd-conv>b {
      display: inline-block;
      margin-right: 8px;
    }

    .cmd-conv>span {
      font-size: 10px;
      color: var(--gold);
      font-weight: 800;
    }

    .cmd-conv p {
      margin: 5px 0;
      color: var(--muted);
      font-size: 12px;
    }

    .cmd-conv.risk {
      border-left: 3.5px solid var(--bad);
      padding-left: 10px;
    }

    .cmd-collapsible {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: linear-gradient(180deg, var(--paper), var(--paper2));
      overflow: hidden;
      box-shadow: var(--shadow);
      margin-bottom: 14px;
    }

    .cmd-collapsible>summary {
      list-style: none;
      cursor: pointer;
      padding: 14px 18px;
      margin: 0;
      user-select: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .cmd-collapsible>summary::-webkit-details-marker {
      display: none;
    }

    .cmd-collapsible>summary:after {
      content: "+";
      font-size: 22px;
      font-weight: 800;
      color: var(--gold);
      margin-left: 12px;
    }

    .cmd-collapsible[open]>summary:after {
      content: "−";
    }

    .cmd-section-body {
      padding: 0 18px 18px;
    }

    .cmd-current-card {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper);
    }

    .cmd-current-card h3 {
      margin: 4px 0 8px;
      font-family: var(--font-serif);
      font-size: 17px;
      font-weight: 700;
    }

    .cmd-current-card p {
      margin: 0 0 10px;
      line-height: 1.6;
    }

    .cmd-current-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    /* Prediction Framework (PF) */
    .pf-prediction {
      padding: 16px 18px;
      border-radius: 14px;
      background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, transparent), color-mix(in srgb, var(--gold) 2.5%, transparent));
      border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
      margin: 14px 0;
    }

    .pf-prediction-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      font-weight: 900;
      color: var(--gold);
      margin-bottom: 6px;
    }

    .pf-prediction-text {
      font-size: 15.5px;
      line-height: 1.72;
      font-weight: 650;
    }

    .pf-key-title {
      font-family: var(--font-serif);
      font-size: 15px;
      font-weight: 700;
      margin: 16px 0 8px;
    }

    .pf-key-grid {
      display: grid;
      gap: 8px;
    }

    .pf-key {
      padding: 12px 14px;
      border-radius: 11px;
      border: 1px solid var(--line);
      background: var(--paper2);
    }

    .pf-key b {
      display: block;
      font-size: 11px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }

    .pf-key.opportunity {
      border-left: 4px solid var(--good);
      background: linear-gradient(90deg, rgba(36, 128, 98, 0.07), transparent);
    }

    .pf-key.theme {
      border-left: 4px solid var(--gold);
      background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent);
    }

    .pf-key.risk {
      border-left: 4px solid var(--bad);
      background: linear-gradient(90deg, rgba(178, 78, 85, 0.07), transparent);
    }

    .pf-key.opportunity b {
      color: var(--good);
    }

    .pf-key.theme b {
      color: var(--gold);
    }

    .pf-key.risk b {
      color: var(--bad);
    }

    .pf-explain {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px dashed var(--line);
    }

    .pf-scope {
      margin-top: 12px;
      padding: 8px 12px;
      border-radius: 8px;
      background: rgba(113, 128, 150, 0.1);
      color: var(--muted);
      font-size: 11.5px;
    }

    .pf-health-rule {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      margin: 12px 0;
      padding: 12px 14px;
      border-radius: 10px;
      border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
      background: color-mix(in srgb, var(--gold) 8%, transparent);
    }

    .pf-health-rule b {
      color: var(--gold);
      white-space: nowrap;
    }

    .pf-health-rule span {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .pf-varga-grid {
      display: grid;
      gap: 8px;
    }

    .pf-varga-row {
      display: grid;
      grid-template-columns: minmax(130px, 0.7fr) auto minmax(180px, 1.8fr);
      gap: 12px;
      align-items: center;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--paper2);
    }

    .pf-varga-row small {
      display: block;
      color: var(--muted);
      margin-top: 2px;
    }

    .pf-formula {
      margin: 10px 0 8px;
      padding: 9px 12px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--soft);
      font-size: 13px;
      line-height: 1.45;
    }

    .pf-card,
    .active-pred-card {
      position: relative;
      overflow: hidden;
    }

    .pf-card:before,
    .active-pred-card:before {
      content: "";
      position: absolute;
      inset: 0 0 auto 0;
      height: 3px;
      background: linear-gradient(90deg, var(--gold), var(--gold2), transparent);
    }

    /* 12-House Static Promises */
    .promise-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 14px;
    }

    .promise-card {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--paper2);
      padding: 14px;
    }

    .promise-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .promise-title {
      font-family: var(--font-serif);
      font-size: 15px;
      font-weight: 700;
    }

    /* ==========================================================================
   Nadi Astrology
   ========================================================================== */
    .nadi-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 16px;
    }

    .nadi-discipline {
      margin-bottom: 14px;
      border-left: 4px solid var(--gold);
      padding-left: 14px;
    }

    .nadi-formula {
      font-family: var(--font-serif);
      font-size: 17px;
      font-weight: 700;
      line-height: 1.6;
      letter-spacing: 0.02em;
    }

    .nadi-directions {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .nadi-dir {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 11px;
      background: var(--paper2);
    }

    .nadi-dir b,
    .nadi-dir span {
      display: block;
    }

    .nadi-dir span {
      font-size: 11.5px;
      color: var(--muted);
      margin-top: 3px;
    }

    .nadi-circuits {
      display: grid;
      gap: 14px;
      margin-top: 14px;
    }

    .nadi-circuit {
      margin: 0;
    }

    .nadi-hero {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .nadi-hero>div {
      border: 1px solid var(--line);
      background: var(--paper2);
      border-radius: 10px;
      padding: 12px;
    }

    .nadi-hero small,
    .nadi-hero b,
    .nadi-hero span {
      display: block;
    }

    .nadi-hero small {
      color: var(--muted);
      text-transform: uppercase;
      font-size: 9px;
      font-weight: 800;
    }

    .nadi-hero b {
      font-size: 15px;
      margin: 4px 0;
    }

    .nadi-hero span {
      font-size: 11.5px;
      color: var(--muted);
    }

    .nadi-subtitle {
      font-family: var(--font-serif);
      font-size: 16px;
      font-weight: 700;
      margin: 16px 0 8px;
    }

    .nadi-link,
    .nadi-transit {
      border-left: 4px solid var(--gold);
      background: var(--paper2);
      border-radius: 10px;
      padding: 11px 14px;
      margin: 8px 0;
    }

    .nadi-link small {
      display: block;
      color: var(--muted);
      margin-top: 5px;
    }

    .nadi-transit {
      border-left-color: var(--good);
    }

    /* ==========================================================================
   Age Activation & Life Events Timeline
   ========================================================================== */
    .timeline {
      display: grid;
      gap: 14px;
    }

    .event {
      border-left: 3.5px solid var(--gold);
      padding: 13px 16px;
      background: var(--gold-subtle);
      border-radius: 0 10px 10px 0;
    }

    .event h4 {
      margin: 0 0 5px;
      font-family: var(--font-serif);
      font-size: 16px;
    }

    .past-major {
      border-left: 5px solid var(--bad);
      background: var(--bad-bg);
      padding: 14px;
      border-radius: 10px;
    }

    .past-important {
      border-left: 4px solid var(--gold);
      background: var(--gold-subtle);
      padding: 14px;
      border-radius: 10px;
    }

    .past-normal {
      opacity: 0.75;
    }

    .importance-major {
      background: var(--bad-bg);
      border-color: rgba(239, 68, 68, 0.4);
      color: var(--bad);
    }

    .importance-important {
      background: var(--gold-subtle);
      border-color: rgba(223, 177, 91, 0.4);
      color: var(--gold);
    }

    .event .manifest {
      font-weight: 750;
      font-size: 15px;
    }

    .evidence {
      padding: 10px 0;
      border-bottom: 1px dashed var(--line);
    }

    .age-house-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid var(--gold);
      font-weight: 800;
      margin: 2px 3px 2px 0;
      white-space: nowrap;
      font-size: 11px;
    }

    .age-map-current {
      outline: 2px solid var(--gold);
      outline-offset: -2px;
      background: color-mix(in srgb, var(--gold) 12%, transparent);
    }

    .age-map-row td {
      vertical-align: top;
      line-height: 1.5;
    }

    .age-chain {
      display: block;
      margin: 3px 0;
    }

    .age-native-hit {
      font-weight: 700;
    }

    .age-map-detail {
      min-width: 290px;
    }

    .age-map-detail summary {
      cursor: pointer;
      font-weight: 800;
    }

    .age-life-area {
      font-size: 0.88rem;
      opacity: 0.85;
    }

    /* Drik Aspect Audit */
    .drik-audit {
      margin-top: 14px;
    }

    .drik-audit-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .drik-audit-target {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 11px;
      background: var(--paper2);
    }

    .drik-audit-target h4 {
      margin: 0 0 7px;
      font-size: 13px;
    }

    .drik-audit-list {
      margin: 0;
      padding-left: 18px;
      font-size: 12px;
      line-height: 1.6;
    }

    .drik-positive {
      color: var(--good);
    }

    .drik-negative {
      color: var(--bad);
    }

    /* ==========================================================================
   Birth Time Rectification
   ========================================================================== */
    .rect-grid {
      display: grid;
      grid-template-columns: 1.1fr 0.9fr;
      gap: 16px;
    }

    .rect-table-wrap {
      border: 1px solid var(--line);
      border-radius: 13px;
      overflow: auto;
    }

    .rect-table input,
    .rect-table select {
      width: 100%;
      min-width: 110px;
      padding: 7px 9px;
      border: 1px solid var(--line);
      background: var(--paper);
      color: var(--ink);
      border-radius: 7px;
    }

    .rect-table .label-input {
      min-width: 180px;
    }

    .rect-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 14px 0;
    }

    .rect-result-hero {
      display: grid;
      grid-template-columns: 1.2fr repeat(3, 0.7fr);
      gap: 12px;
      margin-bottom: 16px;
    }

    .rect-hero-main {
      background: linear-gradient(135deg, var(--navy2), var(--navy3));
      color: #fff;
      border-color: rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 14px;
    }

    .rect-hero-main small {
      color: #bfd0e0;
    }

    .rect-time {
      font-family: var(--font-serif);
      font-size: 34px;
      font-weight: 700;
      color: var(--gold2);
      margin-top: 3px;
    }

    .rect-help {
      font-size: 12px;
      color: var(--muted);
      margin-top: 8px;
    }

    .rect-empty {
      padding: 28px;
      text-align: center;
      border: 1px dashed var(--line);
      border-radius: 12px;
      color: var(--muted);
    }

    /* ==========================================================================
   Modals & Overlays (Auth, AI Settings, Account)
   ========================================================================== */
    .auth-overlay {
      position: fixed;
      inset: 0;
      background: rgba(4, 7, 15, 0.88);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      padding: 16px;
    }

    .auth-overlay.hidden {
      display: none !important;
    }

    .account-modal {
      position: fixed;
      inset: 0;
      background: rgba(4, 7, 15, 0.88);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10002;
      padding: 16px;
    }

    .account-modal.open {
      display: flex !important;
    }


    .auth-card,
    .account-card {
      background: var(--paper);
      border: 1px solid var(--gold);
      border-radius: 16px;
      box-shadow: var(--shadow-lg);
      padding: 28px;
      width: 100%;
      max-width: 440px;
      position: relative;
      animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Account administration can grow after listing users or a sync result. Keep
   the dialog inside the viewport so its Close button is never pushed offscreen. */
    .account-card {
      max-height: calc(100dvh - 32px);
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .account-card .account-modal-header {
      position: sticky;
      top: -28px;
      z-index: 1;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: -28px -28px 16px;
      padding: 28px 28px 10px;
      background: var(--paper);
      border-bottom: 1px solid var(--line);
    }

    /* AI settings contains runner guidance and several model choices; keep the
   dialog inside the visible viewport instead of clipping it on short screens. */
    .ai-settings-card {
      max-height: calc(100dvh - 32px);
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    @media (max-height: 760px) {
      .ai-settings-card {
        padding: 18px;
      }

      .account-card .account-modal-header {
        top: -18px;
        margin: -18px -18px 14px;
        padding: 18px 18px 8px;
      }
    }

    @keyframes modalScaleUp {
      from {
        opacity: 0;
        transform: scale(0.95);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .auth-card h2,
    .account-card h2 {
      font-family: var(--font-serif);
      font-size: 22px;
      font-weight: 700;
      margin: 0 0 6px;
      color: var(--ink);
    }

    .auth-card p,
    .account-card p {
      color: var(--muted);
      font-size: 13px;
      margin: 0 0 18px;
    }

    .auth-card label,
    .account-card label {
      display: block;
      font-size: 10.5px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin: 10px 0 4px;
    }

    .auth-card input,
    .account-card input {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--line);
      background: var(--paper2);
      color: var(--ink);
      border-radius: 8px;
      font-size: 13.5px;
      outline: none;
      margin-bottom: 8px;
    }

    .auth-card input:focus,
    .account-card input:focus {
      border-color: var(--gold);
      box-shadow: 0 0 0 3px var(--gold-glow);
    }

    .auth-card select,
    .account-card select,
    .plan-select {
      padding: 7px 10px;
      border: 1px solid var(--line);
      background: var(--paper) !important;
      color: var(--ink) !important;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      outline: none;
      cursor: pointer;
    }

    .auth-card select option,
    .account-card select option,
    .plan-select option {
      background: var(--paper) !important;
      color: var(--ink) !important;
      padding: 6px 10px;
    }

    .auth-card select:focus,
    .account-card select:focus,
    .plan-select:focus {
      border-color: var(--gold);
      box-shadow: 0 0 0 2px var(--gold-glow);
    }

    .btn-direct-assign {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 6px 14px;
      font-size: 12px;
      font-weight: 700;
      border-radius: 6px;
      cursor: pointer;
      border: 1px solid var(--gold);
      background: var(--gold);
      color: #ffffff;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
      transition: all 0.18s ease;
    }

    body.dark .btn-direct-assign {
      color: #0c1527;
      font-weight: 800;
    }

    .btn-direct-assign:hover {
      filter: brightness(1.12);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px var(--gold-glow, rgba(0, 0, 0, 0.2));
    }

    .auth-error {
      color: var(--bad);
      font-size: 12px;
      font-weight: 600;
      margin: 8px 0;
      min-height: 16px;
    }

    .auth-error.status-info,
    .auth-error.status-success {
      color: var(--good);
    }

    .security-note {
      font-size: 11px;
      color: var(--muted);
      line-height: 1.5;
      margin-top: 14px;
      text-align: center;
    }

    /* ==========================================================================
   Mobile & Responsive Adaptations
   ========================================================================== */
    .mobile-nav-btn {
      display: none;
    }

    .mobile-scrim {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(4px);
      z-index: 95;
    }

    @media (max-width: 1200px) {
      .inputs {
        grid-template-columns: repeat(4, 1fr);
      }

      .overview-charts {
        grid-template-columns: 1fr;
      }

      .kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      .shad-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 860px) {
      .shell {
        grid-template-columns: 1fr;
      }

      .side {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.7);
      }

      .side.mobile-open {
        transform: translateX(0);
      }

      .mobile-scrim.show {
        display: block;
      }

      .mobile-nav-btn {
        display: inline-flex;
      }

      .main {
        padding: 16px 14px 60px;
      }

      .inputs {
        grid-template-columns: 1fr 1fr;
      }

      .location-meta {
        grid-template-columns: 1fr 1fr;
      }

      .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .grid2,
      .grid3,
      .shad-dashboard,
      .shad-compare,
      .shad-detail-grid,
      .rect-grid,
      .rect-result-hero {
        grid-template-columns: 1fr !important;
      }
    }

    @media (max-width: 520px) {
      .inputs {
        grid-template-columns: 1fr;
      }

      .location-meta {
        grid-template-columns: 1fr;
      }

      .kpis {
        grid-template-columns: 1fr;
      }
    }


    /* ==========================================================================
   JyotirVed Vedic Multi-Chart Workstation Layout
   ========================================================================== */
    .astro-ribbon {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px 18px;
      padding: 12px 18px;
      background: linear-gradient(135deg, var(--paper2) 0%, var(--paper) 100%);
      border: 1px solid var(--gold);
      border-radius: 12px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
      margin-bottom: 16px;
    }

    .astro-ribbon-item {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 12.5px;
    }

    .astro-ribbon-item small {
      color: var(--muted);
      text-transform: uppercase;
      font-size: 9.5px;
      font-weight: 800;
      letter-spacing: 0.05em;
    }

    .astro-ribbon-item b {
      color: var(--ink);
      font-weight: 700;
    }

    .vedic-charts-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      margin-top: 14px;
    }

    .overview-planets-section {
      margin-top: 16px;
      width: 100%;
    }

    .overview-planets-card {
      padding: 16px;
      border-radius: 14px;
      width: 100%;
    }

    .table-wrap {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .overview-planets-table {
      width: 100%;
      border-collapse: collapse;
    }

    .overview-planets-table th,
    .overview-planets-table td {
      padding: 10px 14px;
      text-align: left;
      white-space: nowrap;
    }

    .overview-planets-table th {
      font-size: 10.5px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .overview-planets-table td {
      font-size: 12.5px;
    }

    .transit-rot-ctrls {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .transit-rot-ctrls select {
      font-size: 12px;
      font-weight: 600;
      padding: 3px 8px;
      height: 28px;
      background: var(--paper);
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 6px;
      cursor: pointer;
      outline: none;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
      transition: all 0.15s ease;
    }

    .transit-rot-ctrls select:hover,
    .transit-rot-ctrls select:focus {
      border-color: var(--gold);
      background: var(--paper2);
      box-shadow: 0 0 0 2px var(--gold-glow);
    }

    .transit-rot-ctrls select option {
      background: var(--paper);
      color: var(--ink);
      padding: 6px 10px;
    }

    .transit-rot-ctrls .rot-btn {
      padding: 3px 8px;
      height: 28px;
      min-width: 28px;
      font-size: 13px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      background: var(--paper);
      color: var(--ink);
      border: 1px solid var(--line);
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
      transition: all 0.15s ease;
    }

    .transit-rot-ctrls .rot-btn:hover {
      background: var(--gold-subtle);
      border-color: var(--gold);
      color: var(--gold);
      transform: translateY(-1px);
    }

    @media (max-width: 1100px) {

      .vedic-charts-row,
      .overview-charts {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 768px) {
      .astro-ribbon {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }
    }


    /* ==========================================================================
   Overview Workstation Sub-Tabs (Vedic vs KP)
   ========================================================================== */
    .overview-subnav {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
      padding-bottom: 10px;
      border-bottom: 2px solid var(--line);
    }

    .overview-subnav-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 18px;
      font-size: 13.5px;
      font-weight: 700;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--paper);
      color: var(--muted);
      cursor: pointer;
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .overview-subnav-btn:hover {
      color: var(--ink);
      background: var(--gold-subtle);
      border-color: var(--gold);
    }

    .overview-subnav-btn.active {
      color: var(--ink);
      background: linear-gradient(135deg, var(--gold-subtle) 0%, var(--paper) 100%);
      border-color: var(--gold);
      box-shadow: 0 2px 10px var(--gold-glow);
      border-bottom: 3px solid var(--gold);
    }

    /* KP Workstation Layout */
    .kp-workstation {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .kp-charts-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
    }

    .kp-rp-card {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .kp-rp-table {
      width: 100%;
      border-collapse: collapse;
    }

    .kp-rp-table td {
      padding: 6px 8px;
      font-size: 12px;
      border-bottom: 1px solid var(--line-subtle);
    }

    .kp-rp-table td:first-child {
      font-weight: 700;
      color: var(--muted);
      width: 38%;
    }

    .kp-horary-box {
      margin-top: 10px;
      padding: 12px;
      background: var(--paper2);
      border: 1px solid var(--line);
      border-radius: 10px;
    }

    .kp-horary-input-group {
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 8px 0;
    }

    .kp-horary-input-group input {
      width: 75px;
      padding: 4px 8px;
      height: 28px;
      font-size: 13px;
      font-weight: 700;
      text-align: center;
      background: var(--paper);
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 6px;
    }

    .kp-horary-result {
      font-size: 11.5px;
      padding: 8px 10px;
      background: var(--paper);
      border-radius: 6px;
      border: 1px solid var(--line-subtle);
      line-height: 1.5;
    }

    .kp-tables-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    .kp-data-table {
      width: 100%;
      border-collapse: collapse;
    }

    .kp-data-table th,
    .kp-data-table td {
      padding: 7px 9px;
      text-align: left;
      font-size: 12px;
      white-space: nowrap;
    }

    .kp-data-table th {
      font-size: 10.5px;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--muted);
      background: var(--paper2);
      position: sticky;
      top: 0;
      z-index: 2;
    }

    .kp-data-table tr:hover {
      background: var(--gold-subtle);
    }

    .kp-significators-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    .kp-csl-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .kp-csl-card {
      padding: 12px 14px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .kp-csl-card b {
      font-size: 13px;
      color: var(--ink);
    }

    .kp-csl-card .csl-sub {
      font-size: 11.5px;
      color: var(--gold);
      font-weight: 700;
    }

    @media (max-width: 1200px) {
      .kp-charts-row {
        grid-template-columns: 1fr;
      }

      .kp-tables-grid {
        grid-template-columns: 1fr;
      }

      .kp-significators-grid {
        grid-template-columns: 1fr;
      }

      .kp-csl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 600px) {
      .kp-csl-grid {
        grid-template-columns: 1fr;
      }
    }


    .kp-num-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 22px;
      height: 22px;
      padding: 0 5px;
      border-radius: 5px;
      font-size: 11px;
      font-weight: 800;
      font-family: var(--font-mono);
      background: var(--paper2);
      color: var(--ink);
      border: 1px solid var(--line);
      margin: 1px 2px;
    }

    .kp-num-badge.kp-fav {
      background: rgba(16, 185, 129, 0.15);
      color: var(--good);
      border-color: rgba(16, 185, 129, 0.35);
    }

    .kp-num-badge.kp-diff {
      background: rgba(239, 68, 68, 0.15);
      color: var(--bad);
      border-color: rgba(239, 68, 68, 0.35);
    }

    .kp-num-badge.kp-hidden {
      background: rgba(168, 85, 247, 0.15);
      color: #a855f7;
      border: 1px dashed rgba(168, 85, 247, 0.6);
      font-weight: 800;
      cursor: help;
      position: relative;
      transition: all 0.15s ease;
    }

    body.dark .kp-num-badge.kp-hidden {
      background: rgba(192, 132, 252, 0.18);
      color: #c084fc;
      border-color: rgba(192, 132, 252, 0.7);
    }

    .kp-num-badge.kp-hidden:hover {
      transform: scale(1.15);
      box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
    }

    .kp-num-badge.kp-negated {
      background: rgba(239, 68, 68, 0.08);
      color: var(--bad);
      border: 1px dotted rgba(239, 68, 68, 0.5);
      text-decoration: line-through;
      opacity: 0.8;
      cursor: help;
    }

    /* KP Hidden Rules Deck */
    .kp-hidden-deck {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    .kp-hidden-rule-card {
      padding: 12px 14px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .kp-hidden-rule-card b {
      font-size: 13px;
      color: var(--ink);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .kp-hidden-rule-card .rule-sub {
      font-size: 11.5px;
      color: var(--gold);
      font-weight: 700;
    }

    @media (max-width: 1200px) {
      .kp-hidden-deck {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 600px) {
      .kp-hidden-deck {
        grid-template-columns: 1fr;
      }
    }

    /* ==========================================================================
   JyotirVed KP Vimshottari Dasha Workstation
   ========================================================================== */
    .kp-dasha-card {
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 420px;
      padding: 12px 14px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    }

    .kp-dasha-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--line);
    }

    .kp-dasha-title {
      display: flex;
      align-items: center;
      gap: 6px;
      font-family: var(--font-serif);
      font-size: 14px;
      font-weight: 800;
      color: var(--ink);
      letter-spacing: 0.01em;
    }

    .kp-dasha-current-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 10px;
      font-size: 11px;
      font-weight: 700;
      border-radius: 6px;
      background: var(--paper2);
      color: var(--gold);
      border: 1px solid var(--gold-border);
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .kp-dasha-current-btn:hover {
      background: var(--gold-subtle);
      border-color: var(--gold);
      transform: translateY(-1px);
    }

    .kp-current-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--gold);
      box-shadow: 0 0 6px var(--gold-glow);
    }

    .kp-dasha-subnav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 7px 2px;
      border-bottom: 1px solid var(--line-subtle);
      gap: 8px;
    }

    .kp-dasha-breadcrumb {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 13px;
      font-weight: 800;
    }

    .kp-dasha-breadcrumb .crumb {
      color: var(--ink);
      cursor: pointer;
      padding: 1px 5px;
      border-radius: 4px;
      transition: all 0.15s ease;
    }

    .kp-dasha-breadcrumb .crumb:hover {
      background: var(--gold-subtle);
      color: var(--gold);
    }

    .kp-dasha-breadcrumb .crumb.active {
      color: var(--gold);
      background: rgba(223, 177, 91, 0.12);
    }

    .kp-dasha-breadcrumb .sep {
      color: var(--muted);
      font-size: 11px;
    }

    .kp-dasha-level-ctrls {
      display: flex;
      align-items: center;
      gap: 3px;
    }

    .kp-lvl-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 2px 7px;
      height: 23px;
      min-width: 23px;
      font-size: 11px;
      font-weight: 800;
      font-family: var(--font-mono);
      border-radius: 4px;
      background: var(--paper2);
      color: var(--ink);
      border: 1px solid var(--line);
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
    }

    .kp-lvl-btn:hover {
      border-color: var(--gold);
      color: var(--gold);
    }

    .kp-lvl-btn.active {
      background: var(--gold);
      color: #fff;
      border-color: var(--gold);
      box-shadow: 0 2px 5px var(--gold-glow);
    }

    .kp-lvl-btn.kp-step-btn {
      font-weight: 900;
      font-size: 12px;
      color: var(--muted);
    }

    .kp-lvl-btn.kp-step-btn:hover {
      color: var(--gold);
      background: var(--gold-subtle);
    }

    .kp-dasha-body {
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 5px 0;
      flex: 1;
    }

    .kp-dasha-row {
      display: flex;
      flex-direction: column;
      gap: 3px;
      padding: 5px 8px;
      border-radius: 7px;
      cursor: pointer;
      transition: all 0.12s ease;
      font-size: 11.5px;
      border: 1px solid transparent;
      user-select: none;
    }

    .kp-dasha-row:hover {
      background: var(--gold-subtle);
      border-color: rgba(223, 177, 91, 0.25);
    }

    .kp-dasha-row.selected-row {
      background: rgba(2, 132, 199, 0.12);
      border-color: rgba(2, 132, 199, 0.4);
      font-weight: 700;
    }

    body.dark .kp-dasha-row.selected-row {
      background: rgba(56, 189, 248, 0.15);
      border-color: rgba(56, 189, 248, 0.45);
    }

    .kp-dasha-row.running-row {
      position: relative;
      border-left: 3.5px solid var(--good);
    }

    .kp-dasha-row-top {
      display: flex;
      align-items: center;
      gap: 7px;
      width: 100%;
    }

    .kp-dasha-planet-name {
      width: 28px;
      font-weight: 800;
      font-size: 12px;
      flex-shrink: 0;
    }

    .kp-dasha-dates {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--ink);
      letter-spacing: -0.02em;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }

    .kp-dasha-row-bottom {
      display: flex;
      align-items: center;
      gap: 5px;
      padding-left: 26px;
      flex-wrap: wrap;
    }

    .kp-row-badge-label {
      font-size: 9.5px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-weight: 700;
      color: var(--muted);
      flex-shrink: 0;
    }

    .kp-dasha-row-badges {
      display: flex;
      align-items: center;
      gap: 3px;
      flex-wrap: wrap;
    }

    .kp-dasha-card .kp-num-badge {
      min-width: 18px;
      height: 18px;
      padding: 0 4px;
      font-size: 10px;
      margin: 1px;
    }

    .kp-radio-dot {
      display: inline-block;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 1.5px solid var(--muted);
      position: relative;
      flex-shrink: 0;
    }

    .kp-radio-dot.checked {
      border-color: var(--gold);
    }

    .kp-radio-dot.checked::after {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--gold);
    }

    .kp-dasha-footer {
      padding: 8px 10px;
      background: var(--paper2);
      border: 1px solid var(--line-subtle);
      border-radius: 8px;
      font-size: 11.5px;
      margin-top: auto;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .kp-dasha-footer-summary {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .kp-dasha-footer-badges {
      display: flex;
      align-items: center;
      gap: 2px;
    }

    .kp-dasha-triggers {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 2px;
    }

    .kp-hidden-pill {
      border: 1px dashed rgba(168, 85, 247, 0.6) !important;
      background: rgba(168, 85, 247, 0.12) !important;
      color: #a855f7 !important;
    }

    body.dark .kp-hidden-pill {
      border-color: rgba(192, 132, 252, 0.7) !important;
      background: rgba(192, 132, 252, 0.15) !important;
      color: #c084fc !important;
    }

    .kp-dasha-hints {
      margin-top: 4px;
      padding-top: 4px;
      border-top: 1px dashed var(--line-subtle);
      font-size: 10px;
      line-height: 1.4;
    }

    details.kp-dasha-practical-card {
      margin-top: 8px;
      padding: 10px 14px;
      background: rgba(31, 56, 100, 0.03);
      border: 1px solid rgba(197, 155, 39, 0.3);
      border-left: 4px solid var(--gold, #c59b27);
      border-radius: 6px;
      text-align: left;
    }

    body.dark details.kp-dasha-practical-card {
      background: rgba(223, 177, 91, 0.04);
      border-color: rgba(223, 177, 91, 0.3);
    }

    details.kp-dasha-practical-card summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      list-style: none;
      user-select: none;
      outline: none;
    }

    details.kp-dasha-practical-card summary::-webkit-details-marker {
      display: none;
    }

    details.kp-dasha-practical-card .kp-synth-arrow {
      display: inline-block;
      font-size: 10px;
      color: var(--gold, #c59b27);
      transition: transform 0.2s ease;
    }

    details.kp-dasha-practical-card:not([open]) .kp-synth-arrow {
      transform: rotate(-90deg);
    }

    .kp-synth-hidden-box {
      margin: 6px 0;
      padding: 7px 10px;
      background: rgba(168, 85, 247, 0.08);
      border-left: 3px solid #a855f7;
      border-radius: 4px;
      font-size: 10.5px;
    }

    body.dark .kp-synth-hidden-box {
      background: rgba(192, 132, 252, 0.1);
      border-left-color: #c084fc;
    }

    /* ===========================================================================
   KP Workstation — space-efficient desktop layout
   The dasha browser is naturally taller than either chart. Do not stretch the
   chart cards to match it: that creates unusable blank space below legends.
   =========================================================================== */
    .kp-charts-row {
      align-items: stretch;
      grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(390px, 1.14fr);
      gap: 18px;
    }

    .kp-charts-row>.chart-card:not(.kp-dasha-card) {
      align-self: stretch;
      height: 100%;
      margin-bottom: 0;
    }

    .kp-charts-row>.chart-card:not(.kp-dasha-card) .northchart,
    .kp-charts-row>.chart-card:not(.kp-dasha-card) .southchart {
      /* Keep a chart readable without turning the whole workstation into charts. */
      max-width: min(100%, 390px);
    }

    .kp-charts-row>.chart-card:not(.kp-dasha-card) .chart-action-bar {
      max-width: min(100%, 390px);
    }

    .kp-charts-row>.chart-card:not(.kp-dasha-card) .legend {
      justify-content: center;
    }

    .kp-charts-row>.chart-card:not(.kp-dasha-card) .chart-title {
      /* Reserve the two-line title band for both cards so the charts align. */
      height: 96px;
      box-sizing: border-box;
      align-items: flex-start;
      margin-bottom: 6px;
      padding-bottom: 6px;
      border-bottom-color: var(--line-subtle);
    }

    .kp-charts-row>.chart-card:not(.kp-dasha-card) .chart-action-bar {
      margin: 0 auto 3px;
    }

    .kp-dasha-card {
      height: auto;
      min-height: 0;
      max-height: none;
      box-sizing: border-box;
      align-self: stretch;
      overflow: visible;
      /* Match the chart cards' visible edge inside the shared grid row. */
      margin-bottom: 0;
    }

    .kp-dasha-body {
      min-height: auto;
      overflow: visible;
      overscroll-behavior: contain;
      scrollbar-width: thin;
    }

    @media (max-width: 1320px) {
      .kp-charts-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .kp-charts-row>.kp-dasha-card {
        grid-column: 1 / -1;
        max-height: none;
      }
    }

    @media (max-width: 860px) {
      .kp-charts-row {
        grid-template-columns: 1fr;
      }

      .kp-charts-row>.kp-dasha-card {
        grid-column: auto;
      }

      .kp-charts-row>.chart-card:not(.kp-dasha-card) .northchart,
      .kp-charts-row>.chart-card:not(.kp-dasha-card) .southchart {
        max-width: min(100%, 360px);
      }
    }

    /* ==========================================================================
   Astrodatabank Research Explorer & Active Native Dossier Design System
   ========================================================================== */

    .astrodatabank-modal-card {
      max-width: 1240px !important;
      width: 95vw !important;
      height: 90vh !important;
      max-height: 92vh !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
      padding: 24px !important;
      gap: 14px !important;
      background: var(--paper) !important;
      border: 1.5px solid var(--gold) !important;
      border-radius: 16px !important;
      box-shadow: 0 25px 65px rgba(0, 0, 0, 0.65), 0 0 2px var(--gold) !important;
    }

    .sample-db-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
      border-bottom: 1px solid var(--line);
      padding-bottom: 14px;
    }

    .sample-db-title-wrap {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .sample-db-title-wrap h2 {
      margin: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 19px;
      color: var(--ink);
      font-family: var(--font-serif);
    }

    .sample-db-datatypes {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding: 2px 0;
      scrollbar-width: thin;
    }

    .sample-dt-tab {
      background: var(--paper2);
      border: 1px solid var(--line);
      color: var(--ink);
      border-radius: 24px;
      padding: 8px 16px;
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      transition: all 0.22s ease;
    }

    .sample-dt-tab:hover {
      border-color: var(--gold);
      background: var(--paper3);
      transform: translateY(-1px);
    }

    .sample-dt-tab.active {
      background: linear-gradient(135deg, var(--gold), var(--gold2));
      color: #1a1612;
      border-color: var(--gold2);
      box-shadow: 0 2px 12px var(--gold-glow);
      font-weight: 700;
    }

    .sample-dt-tab .tab-count {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 12px;
      padding: 1px 8px;
      font-size: 11px;
      font-weight: 700;
    }

    body.dark .sample-dt-tab:not(.active) .tab-count {
      background: rgba(255, 255, 255, 0.12);
      color: var(--gold2);
    }

    /* Quick Category Preset Chips */
    .sample-presets-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
      padding: 2px 0 6px;
      scrollbar-width: thin;
    }

    .sample-preset-chip {
      background: var(--paper2);
      border: 1px solid var(--line-subtle);
      border-radius: 16px;
      padding: 4px 11px;
      font-size: 11px;
      font-weight: 500;
      color: var(--ink2);
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.18s ease;
    }

    .sample-preset-chip:hover {
      border-color: var(--gold);
      background: var(--gold-subtle);
      color: var(--ink);
      transform: translateY(-1px);
    }

    .sample-preset-chip.active {
      background: var(--gold-glow);
      border-color: var(--gold);
      color: var(--ink);
      font-weight: 700;
    }

    /* Multi-Filter Bar */
    .sample-db-filters {
      display: grid;
      grid-template-columns: 1.1fr 1.1fr 150px 1.6fr;
      gap: 12px;
      align-items: flex-end;
      background: var(--paper2);
      padding: 12px 16px;
      border-radius: 12px;
      border: 1px solid var(--line);
    }

    @media (max-width: 900px) {
      .sample-db-filters {
        grid-template-columns: 1fr 1fr;
      }
    }

    .sample-db-filters .filter-item {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .sample-db-filters .filter-item label {
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.6px;
    }

    .sample-db-filters select,
    .sample-db-filters input {
      padding: 8px 12px;
      font-size: 12.5px;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--ink);
      outline: none;
      transition: border-color 0.2s;
    }

    .sample-db-filters select:focus,
    .sample-db-filters input:focus {
      border-color: var(--gold);
      box-shadow: 0 0 8px var(--gold-glow);
    }

    .sample-db-statusbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
      padding: 0 4px;
      color: var(--muted);
    }

    /* Native Cards Grid */
    .sample-db-grid {
      flex: 1;
      overflow-y: auto;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
      gap: 14px;
      padding: 4px;
      scrollbar-width: thin;
    }

    .sample-native-card {
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 15px 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      position: relative;
    }

    .sample-native-card:hover {
      border-color: var(--gold);
      transform: translateY(-3px);
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2), 0 0 10px var(--gold-glow);
    }

    .sample-card-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
    }

    .sample-card-name {
      font-weight: 700;
      font-size: 14.5px;
      color: var(--ink);
      line-height: 1.35;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .sample-card-badges {
      display: flex;
      gap: 5px;
      align-items: center;
      margin-top: 3px;
      flex-wrap: wrap;
    }

    .rodden-pill {
      font-size: 10px;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: 4px;
      text-transform: uppercase;
      letter-spacing: 0.4px;
    }

    .rodden-AA {
      background: rgba(16, 185, 129, 0.18);
      color: #059669;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }

    .rodden-A {
      background: rgba(59, 130, 246, 0.18);
      color: #2563eb;
      border: 1px solid rgba(59, 130, 246, 0.4);
    }

    .rodden-B {
      background: rgba(234, 179, 8, 0.18);
      color: #b45309;
      border: 1px solid rgba(234, 179, 8, 0.4);
    }

    .rodden-C {
      background: rgba(249, 115, 22, 0.18);
      color: #c2410c;
      border: 1px solid rgba(249, 115, 22, 0.4);
    }

    .rodden-DD {
      background: rgba(239, 68, 68, 0.18);
      color: #dc2626;
      border: 1px solid rgba(239, 68, 68, 0.4);
    }

    .rodden-X {
      background: rgba(148, 163, 184, 0.18);
      color: #64748b;
      border: 1px solid rgba(148, 163, 184, 0.4);
    }

    body.dark .rodden-AA {
      color: #34d399;
    }

    body.dark .rodden-A {
      color: #60a5fa;
    }

    body.dark .rodden-B {
      color: #facc15;
    }

    body.dark .rodden-C {
      color: #fb923c;
    }

    body.dark .rodden-DD {
      color: #f87171;
    }

    body.dark .rodden-X {
      color: #94a3b8;
    }

    .sample-card-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 11.5px;
      color: var(--muted);
      background: var(--paper2);
      padding: 8px 10px;
      border-radius: 6px;
      border: 1px solid var(--line-subtle);
    }

    .sample-card-meta div {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .sample-card-cats {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .sample-cat-tag {
      background: var(--paper2);
      border: 1px solid var(--line);
      border-radius: 4px;
      padding: 2px 7px;
      font-size: 10px;
      color: var(--ink2);
      line-height: 1.3;
    }

    .sample-card-bio {
      font-size: 11.5px;
      color: var(--muted);
      line-height: 1.4;
      font-style: italic;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .sample-card-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: auto;
      padding-top: 8px;
      border-top: 1px solid var(--line-subtle);
    }

    .sample-db-pagination {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 4px 0;
      border-top: 1px solid var(--line);
    }

    /* ==========================================================================
   Active Astrological Case Dossier (Main Workstation Banner)
   ========================================================================== */

    .active-sample-banner {
      background: linear-gradient(135deg, var(--paper), var(--paper2));
      border: 1.5px solid var(--gold);
      border-radius: 12px;
      padding: 16px 20px;
      margin: 14px 0 18px 0;
      box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12), 0 0 1px var(--gold);
      display: flex;
      flex-direction: column;
      gap: 10px;
      animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    body.dark .active-sample-banner {
      background: linear-gradient(135deg, rgba(16, 28, 51, 0.98), rgba(12, 21, 39, 0.95));
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 2px var(--gold);
    }

    .active-sample-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 10px;
      border-bottom: 1px solid var(--line-subtle);
      padding-bottom: 10px;
    }

    .active-sample-title {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .active-sample-badge {
      background: linear-gradient(135deg, var(--gold), var(--gold2));
      color: #1a1612;
      font-weight: 800;
      font-size: 11px;
      padding: 4px 10px;
      border-radius: 6px;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .active-sample-name {
      font-weight: 800;
      font-size: 18px;
      color: var(--ink);
      font-family: var(--font-serif);
    }

    .active-sample-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .active-sample-meta-row {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
      font-size: 12px;
      color: var(--ink2);
    }

    .active-sample-meta-item {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .active-sample-bio {
      font-size: 12px;
      color: var(--ink2);
      line-height: 1.45;
      background: var(--paper2);
      border-left: 3px solid var(--gold);
      border-radius: 0 6px 6px 0;
      padding: 8px 12px;
      font-style: italic;
    }

    .active-sample-cats {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .active-sample-events-panel {
      margin-top: 4px;
      padding: 12px 16px;
      background: var(--paper2);
      border-radius: 8px;
      border: 1px solid var(--line);
      font-size: 11.5px;
      animation: modalScaleUp 0.25s ease;
    }

    /* Bottom quick access: a two-card dock with a popover that exactly spans it. */
    #settingsToggle.settings-toggle {
      background: linear-gradient(135deg, var(--navy3) 0%, var(--navy2) 100%);
      border-color: var(--gold2);
      color: #fff;
    }

    #settingsToggle.settings-toggle .settings-toggle-icon {
      background: rgba(255,255,255,.16);
      border-color: rgba(255,255,255,.3);
      color: #fff;
    }

    .quick-access-dock .settings-panel {
      left: 0;
      right: auto;
      width: calc(200% + 10px);
      max-width: calc(100vw - 28px);
    }
