/* ==========================================================================
   premium.css — global design system layer (2026-10-03)
   Loaded LAST in index.html. Purely additive: delete the <link> to revert.
   Goals: one brand palette (navy + blue, matching the wordmark/landing page),
   Inter everywhere with tabular numerals, layered surfaces, hairline borders,
   soft shadows, consistent radii, visible focus, calm motion.
   Semantic colours (--up / --down) are intentionally kept green / red.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root{
  --font-ui:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;

  /* brand */
  --navy:#0b1f3a; --blue:#2563eb; --blue-d:#1d4ed8; --blue-soft:#e8efff;

  /* surfaces (light) */
  --bg:#f6f8fb; --panel:#ffffff; --panel2:#f1f4f9; --line:#e3e8f0;
  --ink:#0f1b2d; --muted:#5d6b80; --chip:#eaf0f9; --input:#ffffff;
  --line-strong:#cfd8e6;

  /* accent — the app historically calls it "teal"; every existing rule follows the token */
  --teal:#2563eb; --teal-d:#1d4ed8;
  --up:#0f8a54; --down:#c8372d;

  --info-bg:#e8efff; --info-fg:#1d4ed8;

  /* elevation */
  --sh-1:0 1px 2px rgba(15,27,45,.04),0 1px 1px rgba(15,27,45,.03);
  --sh-2:0 4px 14px rgba(15,27,45,.07),0 1px 3px rgba(15,27,45,.05);
  --sh-3:0 18px 48px rgba(15,27,45,.14),0 4px 12px rgba(15,27,45,.06);
  --ring:0 0 0 3px rgba(37,99,235,.28);

  /* radii: slightly rounder, one family */
  --radius-sm:8px; --radius-md:10px; --radius-lg:14px;

  --ease:cubic-bezier(.2,.7,.2,1);
}
:root[data-theme="dark"]{
  --bg:#0a1220; --panel:#101a2c; --panel2:#0d1626; --line:#1f2c44;
  --line-strong:#2b3b58;
  --ink:#e8eef8; --muted:#8fa1bb; --chip:#18253d; --input:#0d1626;
  --teal:#6ea8ff; --teal-d:#4f8df0; --blue:#6ea8ff; --blue-d:#4f8df0; --blue-soft:#14233f;
  --up:#3dd68c; --down:#f0716a;

  --good-bg:#10301f; --good-fg:#3dd68c; --bad-bg:#3a1b1e; --bad-fg:#f0716a;
  --warn-bg:#35290f; --warn-fg:#e6b04a; --neutral-bg:#1a2740; --neutral-fg:#a3b3cc;
  --info-bg:#14233f; --info-fg:#6ea8ff; --special-bg:#271d3d; --special-fg:#c5a0f0;

  --sh-1:0 1px 2px rgba(0,0,0,.35);
  --sh-2:0 6px 18px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3);
  --sh-3:0 22px 56px rgba(0,0,0,.55),0 4px 12px rgba(0,0,0,.35);
  --ring:0 0 0 3px rgba(110,168,255,.35);
}

/* ---------- 2. Typography ---------- */
html{-webkit-text-size-adjust:100%}
body{
  font-family:var(--font-ui);
  font-feature-settings:"cv11","ss01","tnum" 0;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  line-height:1.5;
}
button,input,select,textarea{font-family:inherit}
/* numbers align in columns everywhere data lives */
td,th,.icard .p,.icard .c,.tk,.clock,.n52-tile b,.pnlcal-total,.r,[class*="kpi"] b,[class*="tile"] b,
.sc-grade,code,.num{font-variant-numeric:tabular-nums lining-nums}
h1,h2,h3{letter-spacing:-.018em;font-weight:700}
.panel-head h2,.lg-head h2{font-weight:700;letter-spacing:-.016em}
::selection{background:rgba(37,99,235,.22)}

/* ---------- 3. Surfaces ---------- */
.panel,.icard,.auth-card{
  border-color:var(--line);
  box-shadow:var(--sh-1);
}
.panel{border-radius:var(--radius-lg)}
.icard{border-radius:var(--radius-lg);transition:box-shadow .2s var(--ease),transform .2s var(--ease),border-color .2s}
.icard:hover{box-shadow:var(--sh-2);border-color:var(--line-strong)}
.panel-head{border-bottom-color:var(--line);background:linear-gradient(to bottom,var(--panel),var(--panel))}
.n52-tile{border-radius:var(--radius-md);box-shadow:var(--sh-1)}
.auth-card{box-shadow:var(--sh-3);border-radius:20px}
.auth-wrap{background:radial-gradient(1100px 560px at 70% -10%,rgba(37,99,235,.14),transparent),var(--bg)}

/* ---------- 4. Top bar & navigation ---------- */
.topbar{
  background:color-mix(in srgb,var(--panel) 86%,transparent);
  -webkit-backdrop-filter:saturate(1.4) blur(14px);backdrop-filter:saturate(1.4) blur(14px);
  border-bottom:1px solid var(--line);
  box-shadow:0 1px 0 rgba(15,27,45,.02);
}
.navbtn{
  border-color:transparent;background:transparent;color:var(--muted);
  border-radius:999px;padding:7px 13px;font-size:13px;
  transition:background-color .15s var(--ease),color .15s,box-shadow .15s;
}
.navbtn:hover{color:var(--ink);background:var(--chip);border-color:transparent}
.navbtn.active{
  background:var(--navy);color:#fff;border-color:var(--navy);
  box-shadow:0 1px 2px rgba(11,31,58,.25);
}
:root[data-theme="dark"] .navbtn.active{background:var(--blue-soft);color:var(--teal);border-color:var(--line-strong)}
.theme-toggle{border-color:var(--line)}

/* ---------- 5. Buttons ---------- */
.primary{
  background:var(--navy);color:#fff;border-radius:var(--radius-md);
  box-shadow:0 1px 2px rgba(11,31,58,.25),inset 0 1px 0 rgba(255,255,255,.08);
  transition:background-color .15s,transform .12s var(--ease),box-shadow .15s;
}
.primary:not(:disabled):hover,.up-btn:hover{background:var(--blue);box-shadow:0 4px 14px rgba(37,99,235,.32)}
.primary:not(:disabled):active{transform:translateY(1px);box-shadow:none}
:root[data-theme="dark"] .primary{background:var(--blue);color:#06101f}
:root[data-theme="dark"] .primary:not(:disabled):hover{background:#8cbcff}
.ghost,.ghost-btn,.pp-btn{
  border-color:var(--line-strong);border-radius:var(--radius-md);
  transition:border-color .15s,background-color .15s,color .15s;
}
.ghost:hover,.ghost-btn:hover,.pp-btn:hover{border-color:var(--teal);background:var(--blue-soft);color:var(--ink)}
button:disabled{opacity:.55;cursor:not-allowed}

/* chips / folder pills / direction toggles */
.chip,.folder,.dir,.mini{border-radius:999px;transition:background-color .15s,border-color .15s,color .15s}
.chip:hover,.folder:hover,.dir:hover{border-color:var(--teal)}
.chip.on,.folder.active,.folder.on,.dir.active,.dir.on{
  background:var(--blue-soft);border-color:var(--teal);color:var(--teal-d);
}
:root[data-theme="dark"] .chip.on,:root[data-theme="dark"] .folder.active,
:root[data-theme="dark"] .folder.on,:root[data-theme="dark"] .dir.active,
:root[data-theme="dark"] .dir.on{color:var(--teal)}

/* ---------- 6. Forms ---------- */
input,select,textarea{
  border-radius:var(--radius-md);border-color:var(--line-strong);
  transition:border-color .15s,box-shadow .15s,background-color .15s;
}
input:focus,select:focus,textarea:focus{border-color:var(--teal);box-shadow:var(--ring);outline:none}
.gsearch input:focus{box-shadow:var(--ring)}
input::placeholder{color:color-mix(in srgb,var(--muted) 70%,transparent)}

/* keyboard focus everywhere (mouse clicks stay clean) */
:where(a,button,[role="button"],summary,select,input,textarea,[tabindex]):focus-visible{
  outline:none;box-shadow:var(--ring);
}

/* ---------- 7. Tables ---------- */
table.quotes,.quotes{border-collapse:separate;border-spacing:0}
.quotes th{
  position:sticky;top:0;z-index:1;
  background:var(--panel2);color:var(--muted);
  font-size:11px;font-weight:650;letter-spacing:.05em;text-transform:uppercase;
  border-bottom:1px solid var(--line);padding:10px 18px;
}
.quotes td{border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent);padding:11px 18px}
.quotes tbody tr{transition:background-color .12s}
.quotes tbody tr:hover{background:color-mix(in srgb,var(--blue-soft) 70%,transparent)}
.quotes tbody tr:last-child td{border-bottom:none}

/* ---------- 8. Badges / grades keep semantics, get calmer geometry ---------- */
.sc-grade{border-radius:7px;font-weight:750}

/* ---------- 9. Overlays ---------- */
.results{border-radius:var(--radius-lg);box-shadow:var(--sh-3)}
:root[data-theme="dark"] .ag-drawer{background:var(--panel);border-color:var(--line)}
:root[data-theme="dark"] .ag-drawer .ag-a{background:var(--input);border-color:var(--line);color:var(--ink)}

/* ---------- 10. Ticker tape ---------- */
.ticker{background:var(--panel2);border-bottom-color:var(--line)}
.tk{border-right-color:var(--line)}

/* ---------- 11. Scrollbars ---------- */
*{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:999px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:var(--muted);background-clip:content-box;border:2px solid transparent}
::-webkit-scrollbar-track{background:transparent}

/* ---------- 12. Motion: calm, and off when asked ---------- */
@keyframes sos-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
[id^="view-"]:not(.hidden){animation:sos-rise .28s var(--ease) both}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
  .ticker-track{animation:none!important}
}

/* ---------- 13. Mobile ---------- */
@media(max-width:700px){
  .panel{margin-left:12px;margin-right:12px;border-radius:12px}
  .quotes th,.quotes td{padding-left:12px;padding-right:12px}
}

/* ---------- 14. Top bar: logo fills the whole left box, search moved under the navigation (2026-10-03) ----------
   Left: the logo spans both rows (emblem stretches to the full height). Right of it: row 1 = navigation + account,
   row 2 = stock search (+ market status at the far right). Navigation keeps its place beside the logo. */
.topbar{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;
  grid-template-areas:"logo nav nav nav" "logo search status user";
  align-items:center;column-gap:16px;row-gap:10px;padding:12px 22px;
}
.topbar>.logo{grid-area:logo;align-self:stretch;display:flex;align-items:stretch;gap:16px;margin:0;padding-right:8px;border-right:0}
.topbar .logo-mark{width:96px;height:auto;min-height:92px;align-self:stretch;border-radius:22px}
.topbar .logo-emblem{transform:scale(1.35)}
.topbar .logo-words{align-self:center;gap:8px}
.topbar .logo-name{font-size:22px;letter-spacing:.06em}
.topbar .logo-sub{font-size:11px;letter-spacing:.28em}
.topbar>.nav{grid-area:nav;margin:0;min-width:0;align-self:end;gap:4px}
.topbar>.nav .navbtn{padding:7px 10px}
.topbar>.user{grid-area:user;align-self:start}
.topbar>.gsearch{grid-area:search;justify-self:start;align-self:start;width:340px;max-width:100%;min-width:0;flex:none;margin:0}
.topbar>.gsearch input{padding:9px 16px}
.topbar>.status{grid-area:status;justify-self:end;align-self:center}
.ticker{top:var(--topbar-h,57px)}                    /* ticker tape + sticky tab bars follow the bar's real height */
@media(max-width:1100px){
  .topbar .logo-mark{width:80px;min-height:72px}
  .topbar .logo-name{font-size:19px}
  .topbar .logo-sub{font-size:10px}
}
@media(max-width:900px){
  .topbar{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"logo logo user" "nav nav nav" "search search search"}
  .topbar>.logo{align-self:center}
  .topbar .logo-mark{width:60px;min-height:60px;height:60px;border-radius:15px}
  .topbar .logo-name{font-size:17px}
  .topbar>.status{display:none}
  .topbar>.gsearch{justify-self:stretch;width:auto}
  .topbar>.user,.topbar>.nav{align-self:center}
}
@media(max-width:620px){
  .topbar{padding:10px 12px}
  .topbar .logo-sub{display:none}
}

/* ---------- 15. Dhan data feed lives in the top bar (popover on the feed badge) ---------- */
.topbar>.status{position:relative}
#feed-badge[data-dhan]{cursor:pointer;transition:box-shadow .15s,transform .12s}
#feed-badge[data-dhan]::after{content:" ▾";font-size:10px;opacity:.7}
#feed-badge[data-dhan]:hover{box-shadow:0 0 0 2px color-mix(in srgb,var(--teal) 35%,transparent)}
.dhan-pop{position:absolute;right:0;top:calc(100% + 12px);z-index:60;width:min(440px,92vw);padding:4px 4px 6px;
  border:1px solid var(--line);border-top:3px solid #b8892b;border-radius:16px;background:var(--panel);box-shadow:var(--sh-3)}
.dhan-pop.hidden{display:none}
.dhan-pop .panel{margin:0;border:0;border-radius:12px;box-shadow:none;background:transparent;overflow:visible}
.dhan-pop .panel-head{padding:12px 44px 8px 14px;border-bottom:0}
.dhan-pop .panel-head h2{font-size:15px;font-weight:750}
.dhan-pop .panel>:not(.panel-head){margin-left:14px;margin-right:14px}
.dhan-pop .panel>:last-child{margin-bottom:12px}
.dhan-pop-x{position:absolute;right:10px;top:10px;z-index:2;width:28px;height:28px;border-radius:50%;border:1px solid var(--line-strong);background:var(--panel);color:var(--muted);font-size:12px;line-height:1;padding:0}
.dhan-pop-x:hover{color:var(--ink);border-color:var(--teal)}
@media(max-width:900px){.topbar>.status{display:none}}

/* ---------- 16. Top bar polish: one shared control height, grouped status, vertically centred rows (2026-10-03) ---------- */
.topbar{--ctl:38px}
.topbar>.nav{align-self:center}
.topbar>.gsearch,.topbar>.status,.topbar>.user{align-self:center}
/* search */
.topbar>.gsearch{width:320px}
.topbar>.gsearch input{height:var(--ctl);padding:0 18px;font-size:13.5px;box-shadow:none;border:1px solid var(--line-strong);background:var(--panel)}
.topbar>.gsearch input:focus{box-shadow:var(--ring);border-color:var(--teal)}
/* market status: one tidy capsule — dot + state | feed badge | clock */
.topbar>.status{display:inline-flex;align-items:center;gap:0;height:var(--ctl);padding:0;border:1px solid var(--line);border-radius:999px;background:var(--panel2);font-size:12.5px;color:var(--ink);white-space:nowrap}
.topbar>.status>*{display:inline-flex;align-items:center;height:100%;padding:0 12px;margin:0}
.topbar>.status>*+*{border-left:1px solid var(--line)}
.topbar>.status #mkt-dot{width:auto;height:100%;padding:0 0 0 14px;border:0;background:none;box-shadow:none}
.topbar>.status #mkt-dot::before{content:"";width:9px;height:9px;border-radius:50%;background:currentColor}
.topbar>.status #mkt-dot.open{color:var(--up)}.topbar>.status #mkt-dot.closed{color:var(--down)}
.topbar>.status #mkt-dot:not(.open):not(.closed){color:var(--muted)}
.topbar>.status #mkt-dot.open::before{box-shadow:0 0 8px var(--up)}
.topbar>.status #mkt-dot+#mkt-txt{border-left:0;padding-left:8px;font-weight:650}
.topbar>.status #feed-badge{border-radius:0;padding:0 12px;font-size:12px;background:transparent}
.topbar>.status #feed-badge.fb-live{color:var(--good-fg)}
.topbar>.status #feed-badge.fb-mixed{color:var(--warn-fg)}
.topbar>.status #feed-badge.fb-yf{color:var(--neutral-fg)}
.topbar>.status .clock{margin:0;font-variant-numeric:tabular-nums;font-weight:650;color:var(--muted)}
/* account: theme · email · log out, all one height */
.topbar>.user{display:inline-flex;align-items:center;gap:12px;height:var(--ctl)}
.topbar>.user .theme-toggle{width:var(--ctl);height:var(--ctl);min-width:var(--ctl);border-radius:50%;font-size:16px;line-height:1;padding:0}
.topbar>.user #who{display:inline-flex;align-items:center;justify-content:center;width:var(--ctl);height:var(--ctl);flex:0 0 auto;border-radius:50%;overflow:hidden;
  font-size:0;color:transparent;background:linear-gradient(135deg,#2563eb,#6366f1);box-shadow:0 1px 3px rgba(37,99,235,.35)}
.topbar>.user #who::before{content:attr(data-initial);font-size:15px;font-weight:750;color:#fff;letter-spacing:0}
.topbar>.user #who:empty,.topbar>.user #who:not([data-initial]){display:none}
.topbar>.user #logout{height:var(--ctl);padding:0 18px;display:inline-flex;align-items:center;font-size:13px;font-weight:650;border-radius:999px}
@media(max-width:900px){.topbar>.gsearch{width:auto}}
/* room management for the second row: search flexes, long labels truncate, extras drop out on tighter screens */
.topbar>.gsearch{width:100%;max-width:340px;min-width:200px}
.topbar>.status #feed-badge{max-width:200px;overflow:hidden;text-overflow:ellipsis}
@media(max-width:1280px){.topbar>.status .clock{display:none}}
@media(max-width:1120px){.topbar>.status #mkt-txt{display:none}.topbar>.status #mkt-dot{padding-right:14px}}

/* ---------- 17. Top bar — final polish (2026-10-03) ---------- */
/* brand accent line + a scroll shadow that appears once the page moves */
.topbar::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;pointer-events:none;
  background:linear-gradient(90deg,#0b1f3a 0%,#1d4ed8 45%,#63b3ed 100%)}
:root[data-theme="dark"] .topbar::before{background:linear-gradient(90deg,#1e3a8a 0%,#b8892b 50%,#93c5fd 100%)}
.topbar{transition:box-shadow .2s var(--ease)}
.topbar.is-scrolled{box-shadow:0 8px 28px rgba(15,27,45,.12),0 1px 0 var(--line)}
:root[data-theme="dark"] .topbar.is-scrolled{box-shadow:0 10px 30px rgba(0,0,0,.45),0 1px 0 var(--line)}

/* logo: a touch of life */
.topbar>.logo .logo-mark{transition:transform .25s var(--ease),box-shadow .25s}
.topbar>.logo:hover .logo-mark{transform:translateY(-1px) scale(1.02);box-shadow:0 8px 22px rgba(37,99,235,.35)}

/* navigation */
.topbar>.nav .navbtn{font-size:13px;font-weight:650;letter-spacing:-.01em;color:var(--muted);padding:7px 9px}
.topbar>.nav .navbtn:hover{color:var(--ink)}
.topbar>.nav .navbtn.active{color:#fff;background:linear-gradient(180deg,#17356a 0%,#0b1f3a 100%);
  box-shadow:0 2px 8px rgba(11,31,58,.35),inset 0 1px 0 rgba(255,255,255,.14)}
:root[data-theme="dark"] .topbar>.nav .navbtn.active{color:var(--teal);background:var(--blue-soft);box-shadow:inset 0 0 0 1px var(--line-strong)}
.nav-caret{font-size:9px;opacity:.7;margin-left:4px}
.nav-dropdown{padding:6px;border-radius:16px;border:1px solid var(--line);box-shadow:var(--sh-3);gap:2px;min-width:200px;
  background:color-mix(in srgb,var(--panel) 96%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
.nav-dropdown .navbtn{border-radius:10px;padding:10px 14px;font-size:13.5px;font-weight:600;color:var(--ink);width:100%}
.nav-dropdown .navbtn:hover{background:var(--blue-soft);color:var(--ink)}
.nav-dropdown .navbtn.active{background:var(--navy);color:#fff;box-shadow:none}
:root[data-theme="dark"] .nav-dropdown .navbtn.active{background:var(--blue-soft);color:var(--teal)}

/* search: crisp icon on the left, shortcut hint on the right */
.topbar>.gsearch{position:relative}
.topbar>.gsearch input{padding-left:42px;padding-right:18px;border-radius:999px;font-weight:500;
  background:var(--panel) no-repeat 16px center/17px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a99ad' stroke-width='2.3' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")}
.topbar>.gsearch input::placeholder{color:#8a99ad}
.gsearch-kbd{position:absolute;right:14px;top:50%;transform:translateY(-50%);min-width:22px;height:22px;padding:0 7px;display:inline-flex;align-items:center;justify-content:center;
  font:600 11px/1 Inter,system-ui,sans-serif;color:var(--muted);background:var(--chip);border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:6px;pointer-events:none;transition:opacity .15s}
.topbar>.gsearch:focus-within .gsearch-kbd,.topbar>.gsearch.has-value .gsearch-kbd{opacity:0}
.gsearch .results{border-radius:14px;box-shadow:var(--sh-3);overflow:hidden;border:1px solid var(--line);background:var(--panel)}
.gsearch .results div{padding:10px 14px}
.gsearch .results div:hover{background:var(--blue-soft)}

/* market status: gentle pulse while the market is open */
.topbar>.status #mkt-dot.open::before{animation:tbPulse 2.2s infinite}
@keyframes tbPulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--up) 55%,transparent)}70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}
@media(prefers-reduced-motion:reduce){.topbar>.status #mkt-dot.open::before{animation:none}}

/* theme toggle: real icons instead of emoji (moon on light, sun on dark) */
.topbar>.user .theme-toggle{font-size:0;color:var(--ink);position:relative}
.topbar>.user .theme-toggle::before{content:"";width:18px;height:18px;background:currentColor;display:block;
  -webkit-mask:var(--ico) center/contain no-repeat;mask:var(--ico) center/contain no-repeat;
  --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E")}
:root[data-theme="dark"] .topbar>.user .theme-toggle::before{
  --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4' fill='black'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E")}
.topbar>.user .theme-toggle:hover{color:var(--teal);border-color:var(--teal)}
/* avatar + sign out */
.topbar>.user #who{box-shadow:0 0 0 2px var(--panel),0 0 0 3px color-mix(in srgb,var(--blue) 45%,transparent)}
.topbar>.user #logout{color:var(--muted);border-color:var(--line-strong)}
.topbar>.user #logout:hover{color:var(--down);border-color:var(--down);background:color-mix(in srgb,var(--down) 6%,transparent)}

/* search input must fill its box (a generic `.search input{width:260px}` rule was leaving the "/" badge floating outside it) */
.topbar>.gsearch{min-width:0}
.topbar>.gsearch input{width:100%;min-width:0}

/* ---------- 18. A header chip that stands alone reads "LABEL  value" on ONE line (e.g. "STOCKS 34") ----------
   Multi-chip groups keep the stacked label-over-number layout so their columns stay aligned.
   (!important: the per-page chip rules are id-scoped, e.g. #view-live .hcard-kpis .sk.) */
:is(.hcard-kpis,.rcard-kpis,.kc-kpis,.pcard-kpis,.sdesk-kpis) .sk:only-child{
  flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;height:38px!important;padding-top:0!important;padding-bottom:0!important;min-height:0!important}
:is(.hcard-kpis,.rcard-kpis,.kc-kpis,.pcard-kpis,.sdesk-kpis) .sk:only-child small{margin:0!important;line-height:1!important}
:is(.hcard-kpis,.rcard-kpis,.kc-kpis,.pcard-kpis,.sdesk-kpis) .sk:only-child b{margin:0!important;line-height:1!important;font-size:16px}
/* a single chip must not be forced into one of four fixed grid columns */
:is(.kc-kpis,.pcard-kpis,.sdesk-kpis):has(.sk:only-child){display:flex!important}

/* ---------- 19. Hero banners: midnight ink + champagne gold (replaces the bright blue gradient) ----------
   Deep, low-saturation navy so the gold accents used across the app sit on a palette they belong to.
   Applies to every .sui-hero (Strategies, Screeners, Paper, Recommendations, Deep Dive, F&O, Journal, Settings...).
   Selectors are prefixed with "body" so they out-rank the later-loaded strategies-ui.css base rules. */
body .sui-hero{
  background:
    radial-gradient(820px 300px at 90% -35%,rgba(222,182,92,.30),transparent 62%),
    radial-gradient(560px 240px at -4% 125%,rgba(222,182,92,.10),transparent 62%),
    linear-gradient(135deg,#050a18 0%,#0b1630 46%,#152448 100%);
  color:#e9edf6;border:1px solid rgba(226,197,126,.22);
  box-shadow:0 10px 30px rgba(5,10,24,.28),inset 0 1px 0 rgba(255,236,190,.10)}
body .sui-hero::before{background:radial-gradient(circle at 1px 1px,rgba(232,204,140,.20) 1px,transparent 1.5px) 0 0/18px 18px}
body .sui-eyebrow{color:#e6cb85}
body .sui-eyebrow::before{background:linear-gradient(90deg,#e6cb85,transparent)}
body .sui-hero h1{color:#fff}
body .sui-hero p{color:#b9c3d8}
body .sui-kpi{background:rgba(255,255,255,.05);border:1px solid rgba(226,197,126,.28);box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
body .sui-kpi span{color:#e6cb85}
/* line-art in the hero SVGs was drawn in light blue — recolour to gold (candles keep their green/red) */
body .sui-hero-art svg [stroke="#9cc0ff"]{stroke:#e6cb85}
body .sui-hero-art svg [fill="#9cc0ff"]{fill:#e6cb85}
body .sui-hero-art svg stop[stop-color="#63b3ed"]{stop-color:#e6cb85}
body .sui-hero-art svg [fill="#63b3ed"]{fill:#e6cb85}
body .sui-hero-art svg [stroke="#63b3ed"]{stroke:#e6cb85}
body .sui-hero-art svg circle[fill="#0b1f3a"]{fill:#050a18}
body .mx-switch,body .dd-hero-search #dd-sym{border-color:rgba(226,197,126,.35)}
body .mx-switch label{color:#e6cb85}
body .dd-hero-search #dd-sym:focus{border-color:#e6cb85;box-shadow:0 0 0 3px rgba(230,203,133,.28)}
body .dd-hero-stock{border-color:rgba(226,197,126,.4);color:#f1e2b8}
/* Ask drawer header + button follow the same palette */
#ag-drawer .ag-dhead{background:linear-gradient(110deg,#050a18 0%,#152448 100%);border-bottom:2px solid #c9a24b}
#ag-drawer .ag-dhead::after{background:radial-gradient(circle at 1px 1px,rgba(232,204,140,.30) 1px,transparent 1.5px) 0 0/14px 14px}
.ag-fab:hover{background:linear-gradient(180deg,#e2c57e,#b8892b)!important;color:#0b1630;box-shadow:0 12px 28px rgba(184,137,43,.4)}

/* ---------- 20. Top bar in midnight ink + champagne gold (matches the hero banners) ----------
   Delete this whole section to return to the light bar. Prefixed with "body"/ids to out-rank the earlier top-bar rules. */
body .topbar{
  background:linear-gradient(120deg,#050a18 0%,#0b1630 52%,#152448 100%);
  border-bottom:1px solid rgba(226,197,126,.28);color:#e9edf6;
  -webkit-backdrop-filter:none;backdrop-filter:none}
body .topbar::before{background:linear-gradient(90deg,#8a6516 0%,#e6cb85 50%,#b8892b 100%)}
body .topbar.is-scrolled{box-shadow:0 10px 30px rgba(5,10,24,.45),0 1px 0 rgba(226,197,126,.28)}
/* logo */
body .topbar .logo-mark{box-shadow:0 0 0 1px rgba(226,197,126,.6),0 6px 18px rgba(0,0,0,.45)}
body .topbar>.logo:hover .logo-mark{box-shadow:0 0 0 1px #e6cb85,0 10px 26px rgba(184,137,43,.4)}
body .topbar .logo-name{background:none!important;-webkit-text-fill-color:#fff!important;color:#fff!important}
body .topbar .logo-name em{-webkit-text-fill-color:#e6cb85!important;color:#e6cb85!important;opacity:1}
body .topbar .logo-sub{color:#cdb780!important}
body .topbar .logo-sub::before,body .topbar .logo-sub i{background:linear-gradient(90deg,#e6cb85,transparent)!important}
/* navigation (bar-level buttons only — the dropdown panels keep their own light/dark theme) */
body .topbar>.nav>.navbtn,body .topbar>.nav>.nav-group>.nav-group-toggle{color:#b9c4da;background:transparent;box-shadow:none}
body .topbar>.nav>.navbtn:hover,body .topbar>.nav>.nav-group>.nav-group-toggle:hover{color:#fff;background:rgba(255,255,255,.08)}
body .topbar>.nav>.navbtn.active,body .topbar>.nav>.nav-group>.nav-group-toggle.active{
  color:#0b1630;background:linear-gradient(180deg,#eed48e 0%,#c9a24b 100%);box-shadow:0 2px 10px rgba(201,162,75,.38),inset 0 1px 0 rgba(255,255,255,.45)}
body .topbar .nav-dropdown .navbtn{color:var(--ink)}
body .topbar .nav-dropdown .navbtn.active{background:var(--navy);color:#fff}
:root[data-theme="dark"] body .topbar .nav-dropdown .navbtn.active,body :root[data-theme="dark"] .topbar .nav-dropdown .navbtn.active{background:var(--blue-soft);color:var(--teal)}
/* search */
body .topbar>.gsearch input{background-color:rgba(255,255,255,.07);border:1px solid rgba(226,197,126,.32);color:#fff}
body .topbar>.gsearch input::placeholder{color:#97a5c0}
body .topbar>.gsearch input:focus{border-color:#e6cb85;box-shadow:0 0 0 3px rgba(230,203,133,.25);background-color:rgba(255,255,255,.1)}
/* market status capsule */
body .topbar>.status{background:rgba(255,255,255,.06);border:1px solid rgba(226,197,126,.3);color:#e9edf6}
body .topbar>.status>*+*{border-left-color:rgba(226,197,126,.25)}
body .topbar>.status #mkt-txt{color:#e9edf6}
body .topbar>.status .clock{color:#c9d3e6}
body .topbar>.status #feed-badge.fb-live{color:#86e6b0}
body .topbar>.status #feed-badge.fb-mixed{color:#f2cc72}
body .topbar>.status #feed-badge.fb-yf{color:#b4c0d6}
body .topbar>.status #mkt-dot:not(.open):not(.closed){color:#97a5c0}
body .topbar>.status #mkt-dot.open{color:#4ade80}
body .topbar>.status #mkt-dot.closed{color:#fb7185}
/* theme toggle · avatar · log out */
body .topbar>.user .theme-toggle{background:rgba(255,255,255,.06);border:1px solid rgba(226,197,126,.35);color:#e6cb85}
body .topbar>.user .theme-toggle:hover{background:rgba(226,197,126,.15);border-color:#e6cb85;color:#fff}
body .topbar>.user #who{background:linear-gradient(135deg,#eed48e,#b8892b);box-shadow:0 0 0 2px #0b1630,0 0 0 3px rgba(226,197,126,.6)}
body .topbar>.user #who::before{color:#0b1630}
body .topbar>.user #logout{background:transparent;color:#e9edf6;border:1px solid rgba(226,197,126,.38)}
body .topbar>.user #logout:hover{color:#fff;border-color:#fb7185;background:rgba(251,113,133,.14)}
