/* Shikhar Signals website. Colours follow the Android app (ui/theme/Theme.kt). */

:root {
  --brand: #168657;
  --brand-2: #36b880;
  --brand-soft: #ddf5e7;
  --brand-ink: #11744a;
  --on-brand: #ffffff;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --surface-3: #e6eaf0;
  --text: #121821;
  --muted: #5b6676;
  --faint: #636d7d;
  --border: #e1e6ed;
  --up: #0c7a4a;
  --up-bg: #e3f6ec;
  --down: #c4343a;
  --down-bg: #fde8e8;
  --flat: #6a7482;
  --warn: #8a6200;
  --warn-bg: #fdf3dc;
  --info: #3466b8;
  --info-bg: #e5eefb;
  --a-strong-buy: #0b7244;
  --a-buy: #1d7f4c;
  --a-hold: #8a6200;
  --a-sell: #b8382b;
  --a-strong-sell: #a12424;
  --q-leading: #127a4a;
  --q-weakening: #8a6200;
  --q-lagging: #b8382b;
  --q-improving: #2f62b3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 252px;
  --topbar: 60px;
  --bottombar: 64px;
  --content: 1280px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Dark is AMOLED: true black backgrounds (data-theme "black", the Android app's name for it). */
:root[data-theme="black"] {
  --brand: #36b880;
  --brand-2: #3fe394;
  --brand-soft: #0f2a20;
  --brand-ink: #36b880;
  --on-brand: #04140d;
  --bg: #000000;
  --surface: #0b0d10;
  --surface-2: #13161b;
  --surface-3: #1d2128;
  --text: #e6eaf0;
  --muted: #a3acb9;
  --faint: #8a93a1;
  --a-strong-buy: #35d07f;
  --a-buy: #6fdba1;
  --a-hold: #f0b54a;
  --a-sell: #ff7b6e;
  --a-strong-sell: #ff5c5c;
  --q-leading: #35d07f;
  --q-weakening: #f0b54a;
  --q-lagging: #ff6b6f;
  --q-improving: #73a6f0;
  --border: #1d2128;
  --up: #35d07f;
  --up-bg: #0d2617;
  --down: #ff6b6b;
  --down-bg: #2d1012;
  --warn: #f2c14e;
  --warn-bg: #2b2108;
  --info: #7aa7ee;
  --info-bg: #0f1c30;
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.55rem; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .84rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 650; }
.visual-bold { font-weight: bolder; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 8px; }

/* ------------------------------------------------------------------ shell */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--border); padding: 14px 10px 20px; display: flex; flex-direction: column; gap: 4px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.brand b, .brand .visual-bold { font-size: 1.05rem; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand span:not(.visual-bold) { font-size: .75rem; color: var(--muted); display: block; }
.nav-group { margin-top: 10px; }
.nav-group > .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 6px 12px; font-weight: 650; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 520; font-size: .93rem;
}
.nav-link svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-link.active svg { color: var(--brand); }
.nav-link .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 14px 12px 0; font-size: .74rem; color: var(--faint); line-height: 1.45; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.topbar .mobile-brand { display: none; }
.search-box { flex: 1; max-width: 520px; position: relative; }
.search-box input {
  width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 12px 0 38px; outline: none;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search-box > svg { position: absolute; left: 11px; top: 10px; width: 20px; height: 20px; color: var(--faint); pointer-events: none; }
.search-results {
  position: absolute; left: 0; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: min(70vh, 460px); overflow-y: auto; z-index: 60; padding: 6px;
}
.search-results a, .search-results .item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--surface-2); text-decoration: none; }
.search-results .sym { font-weight: 700; min-width: 74px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flat); }
.status-chip.open .dot { background: var(--up); box-shadow: 0 0 0 4px color-mix(in srgb, var(--up) 22%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--up) 0%, transparent); } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--text); position: relative; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot-badge { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--down); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }

.view { width: 100%; max-width: var(--content); margin: 0 auto; padding: 22px 20px 48px; min-width: 0; min-height: calc(100vh - var(--topbar)); }
.view:focus { outline: none; }
/* The server's plain-HTML copy of a page stays on screen while the app draws the page underneath (holdServerCopy in js/app.js). */
.view.ssr-hold { position: relative; }
.ssr-host { position: absolute; top: 0; left: 0; right: 0; padding: inherit; visibility: hidden; pointer-events: none; }
.ssr table.data .name { white-space: normal; max-width: none; min-width: 8em; }
.footer { max-width: var(--content); margin: 0 auto; width: 100%; padding: 8px 20px 30px; color: var(--faint); font-size: .78rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer a { color: var(--muted); }

.bottom-nav { display: none; }
.scrim { display: none; }

/* ------------------------------------------------------------------ page parts */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: .82rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 12px; }
.mt-s { margin-top: 6px; }
.mb { margin-bottom: 12px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; transition: border-color .2s ease, box-shadow .2s ease; }
.card > .card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; min-height: 44px; }
.card > .card-head h2, .card > .card-head h3 { flex: 1; min-width: 0; }
.card > .card-body { padding: 12px 16px 16px; }
.card.pad { padding: 16px; }
.card.flush > .card-body { padding: 8px 0 8px; }
.card.hero {
  background: linear-gradient(135deg, #0c2b47 0%, #0a3a3e 55%, #11553f 100%); color: #f1f6fb; border: none; overflow: hidden; position: relative;
}
.card.hero .muted { color: #b9c9d8; }
.card.hero .up { color: #6ff0ad; }
.card.hero .down { color: #ff9b9b; }
.card-link { font-size: .85rem; font-weight: 600; white-space: nowrap; }
a.sym, a.card-link, .crumb a, .list-item .main-col a, .list-item .end a, .tm-zoom > a.small, .note a { position: relative; }
a.sym::after, a.card-link::after, .crumb a::after, .list-item .main-col a::after, .list-item .end a::after, .tm-zoom > a.small::after, .note a::after { content: ""; position: absolute; inset: -5px -3px; }
.hero-side { text-align: right; }
@media (max-width: 600px) { .hero-side { text-align: left; width: 100%; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; } .hero-side > * { margin: 0 !important; } }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: .9rem; }
.kv > :nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 560; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.stat .label { font-size: .76rem; color: var(--muted); }
.stat .value { font-size: 1.05rem; font-weight: 680; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .note { font-size: .76rem; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: .76rem; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); line-height: 1.6;
}
.pill.solid { color: #fff; }
.pill.up { background: var(--up-bg); color: var(--up); }
.pill.down { background: var(--down-bg); color: var(--down); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--down); color: #fff; font-size: .7rem; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; font-size: .92rem;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.06); background: var(--brand); }
.btn.danger { color: var(--down); }
.btn.danger.primary { background: var(--down); border-color: var(--down); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: .84rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .84rem; font-weight: 560; white-space: nowrap; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); font-weight: 650; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: none; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; font-size: .92rem; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .84rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 560; }
.input, select.input, textarea.input {
  height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0 12px; outline: none; width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 13px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.setting { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.setting:first-child { border-top: none; }
.setting .text { flex: 1; min-width: 0; }
.setting .text b { display: block; font-weight: 600; }
.setting .text small { color: var(--muted); font-size: .82rem; display: block; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data th { text-align: left; font-weight: 650; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background-color .15s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .r, table.data th.r { text-align: right; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data tr.clickable { cursor: pointer; }
table.data .sym { font-weight: 700; color: var(--text); }
table.data .name { color: var(--muted); font-size: .8rem; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
/* Phones: the first column (the share or sector) stays put while the rest scrolls sideways, is narrower so
   price and change fit beside it, and a soft edge on the right says there is more to scroll to. */
@media (max-width: 767px) {
  table.data th:first-child, table.data td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  table.data thead th:first-child { z-index: 2; }
  table.data tbody tr:hover td:first-child { background: var(--surface-2); }
  table.data td:first-child { white-space: normal; max-width: 42vw; }
  table.data .name { max-width: 34vw; white-space: nowrap; }
  .table-wrap {
    background:
      linear-gradient(to left, var(--surface) 45%, transparent) right / 28px 100% no-repeat local,
      radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--text) 22%, transparent), transparent) right / 12px 100% no-repeat scroll;
  }
}

/* lists */
.sebon-sort { border: 0; padding: 5px 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sebon-sort:hover { color: var(--text); }
.sebon-sort:focus-visible { outline: 2px solid var(--accent, #20bf94); outline-offset: 3px; }
table.sebon-table td { white-space: normal; min-width: 110px; vertical-align: top; overflow-wrap: anywhere; }
table.sebon-table td:first-child { min-width: 260px; max-width: 460px; }
table.sebon-company-table td:first-child { min-width: 55px; max-width: 90px; }
table.sebon-company-table td:nth-child(2) { min-width: 240px; }
table.sebon-company-table th { white-space: normal; min-width: 110px; }
.sebon-company-table { min-width: 700px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; color: var(--text); border-top: 1px solid var(--border); min-width: 0; }
.list-item:first-child { border-top: none; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); text-decoration: none; }
button.list-item { width: 100%; border: none; border-top: 1px solid var(--border); background: none; text-align: left; cursor: pointer; }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .main-col b, .list-item .main-col .visual-bold { display: block; font-weight: 680; }
.list-item .main-col small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .end { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.list-item .end b, .list-item .end .visual-bold { display: block; }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-weight: 750; font-size: .75rem; color: var(--muted); flex: none; letter-spacing: -.02em; overflow: hidden; }

/* bars, meters */
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--brand); }
.breadth { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.breadth i { display: block; height: 100%; }
.range-bar { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down), var(--warn), var(--up)); margin: 12px 0 4px; opacity: .85; }
.range-bar b { position: absolute; top: -5px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }
.score-bar { display: grid; grid-template-columns: 1fr 1fr; height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.score-bar > div { position: relative; }
.score-bar > div i { position: absolute; top: 0; bottom: 0; }
.score-bar > div:first-child i { right: 0; background: var(--down); }
.score-bar > div:last-child i { left: 0; background: var(--up); }

.action-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 10px; font-weight: 750; color: #fff; font-size: .9rem; white-space: nowrap; }
:root[data-theme="black"] .action-badge { color: #05110b; }
.action-big { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }

.callout { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); font-size: .9rem; }
.callout.warn { background: var(--warn-bg); color: var(--text); }
.callout.info { background: var(--info-bg); }
.callout.up { background: var(--up-bg); }
.callout.down { background: var(--down-bg); }
.notice { display: flex; gap: 10px; align-items: flex-start; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.reasons { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.reasons li { display: flex; gap: 8px; }
.reasons li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-top: .55em; flex: none; background: var(--faint); }
.reasons.bull li::before { background: var(--up); }
.reasons.bear li::before { background: var(--down); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty > svg { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--faint); }
.empty b, .empty .empty-title { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-3); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--muted); }

/* heat map */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.heat a { border-radius: 12px; padding: 12px; color: #fff; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; }
.heat a:hover { text-decoration: none; filter: brightness(1.08); }
.heat b { font-size: .9rem; line-height: 1.2; }
.heat .v { font-size: 1.15rem; font-weight: 750; }

/* modal + toast */
.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5, 10, 18, .5); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: min(88vh, 900px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 8px 18px 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 18px 18px; flex-wrap: wrap; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 520px); }
.toast { background: #1d232c; color: #f1f4f8; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; pointer-events: auto; animation: rise .2s; display: flex; gap: 12px; align-items: center; }
.toast.error { background: #7d1d22; }
.toast button { border: none; background: none; color: #8ef0bd; font-weight: 700; cursor: pointer; padding: 0; }

/* charts */
.mini-chart { height: 220px; width: 100%; position: relative; }
.chart-frame { width: 100%; border: none; display: block; background: var(--surface); }
.chart-page { display: flex; flex-direction: column; gap: 10px; }
.chart-page .chart-box { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.chart-page.full { position: fixed; inset: 0; z-index: 70; background: var(--bg); padding: 8px; }
.chart-page.full .chart-box { flex: 1; }
.chart-page.full .chart-box iframe { height: 100% !important; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu { position: absolute; z-index: 65; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; min-width: 240px; max-height: 70vh; overflow-y: auto; }
.menu h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 8px 4px; }
.menu label, .menu button.opt { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: .88rem; width: 100%; border: none; background: none; text-align: left; }
.menu label:hover, .menu button.opt:hover { background: var(--surface-2); }
.menu input[type="checkbox"], .menu input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; }
.levels-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.levels-strip .pill { font-variant-numeric: tabular-nums; }
svg.rrg { width: 100%; height: auto; touch-action: manipulation; user-select: none; }
svg.rrg text { font: 600 11px var(--font); }
.spark { width: 100%; height: 40px; }

.index-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 10px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.index-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.index-card b, .index-card .visual-bold { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.index-card .v { font-weight: 720; font-size: 1.02rem; font-variant-numeric: tabular-nums; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .8rem; font-weight: 600; text-align: center; }
.quick a:hover { text-decoration: none; background: var(--surface-2); }
.quick a i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.quick a i svg { width: 22px; height: 22px; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.service { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.service:hover { background: var(--surface-2); text-decoration: none; }
.service i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.service i svg { width: 22px; height: 22px; }
.service b { display: block; font-size: .92rem; }
.service small { color: var(--muted); font-size: .78rem; display: block; line-height: 1.35; }

.lock-screen { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.lock-screen .box { width: min(360px, 100%); text-align: center; }
.lock-screen img { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 14px; }
.privacy-blur { filter: blur(7px); user-select: none; }

/* ------------------------------------------------------------------ NEPSE Fear & Greed gauge */

.hero-row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: stretch; }
.hero-row > div > .card { height: 100%; }
.hero-row:has(> div:last-child:empty) { grid-template-columns: minmax(0, 1fr); }
.fg-gauge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fg-svg { width: 100%; max-width: 230px; height: auto; display: block; color: var(--text); }
.fg-gauge.big .fg-svg { max-width: 320px; }
.fg-score { font-size: 2.3rem; font-weight: 800; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.fg-gauge.big .fg-score { font-size: 3rem; }
/* The zone colours are light for a white page: the score itself is drawn darker so it reads (3:1 for large text). */
:root[data-theme="light"] .fg-score, :root[data-theme="light"] .fg-part-score { filter: brightness(.72); }
.fg-label { font-weight: 700; font-size: 1.05rem; margin-top: 4px; }
/* Holds the home card's place while it loads, so nothing below it jumps. */
.fg-skeleton { height: 298px; border: none; }
@media (max-width: 900px) { .fg-skeleton { height: 380px; } }
.fg-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.fg-compare.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fg-compare.n1 { grid-template-columns: minmax(0, 1fr); }
.fg-compare.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .fg-compare.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* On the home page, beside the market card: the gauge with the earlier readings in a column. */
.hero-row .card.hero { display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 901px) {
  .fg-card > .card-body { display: flex; align-items: center; gap: 14px; }
  .fg-card .fg-gauge { flex: 1 1 0; min-width: 0; }
  .fg-card .fg-svg { max-width: 190px; }
  .fg-card .fg-compare { flex: 0 0 118px; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 0; }
  .fg-card .fg-compare > div { padding: 5px 6px; }
}
.fg-compare > div { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 8px 6px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.fg-compare small { color: var(--muted); font-size: .75rem; }
.fg-compare b { display: inline-flex; align-items: center; gap: 6px; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.fg-compare span { color: var(--muted); font-size: .75rem; }
.fg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.fg-parts { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.fg-part { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fg-part p { margin: 0; }
.fg-part-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fg-part-head b, .fg-part-head small { display: block; }
.fg-part-head small { color: var(--muted); font-size: .78rem; }
.fg-part-score { font-weight: 800; font-size: 1.25rem; line-height: 1.1; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fg-part-score small { display: block; font-size: .75rem; font-weight: 650; }
.fg-scale { position: relative; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #e5484d 0 25%, #f08c3a 25% 45%, #e3b622 45% 55%, #7cc35a 55% 75%, #22b573 75% 100%); }
.fg-scale > i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); transform: translate(-50%, -50%); }
.fg-history { display: grid; grid-template-columns: 28px minmax(0, 1fr); }
.fg-y { position: relative; }
.fg-y span { position: absolute; right: 8px; transform: translateY(-50%); font-size: .75rem; color: var(--muted); }
.fg-plot { position: relative; height: 220px; }
.fg-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fg-last { position: absolute; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); transform: translate(-50%, -50%); }
.fg-x { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .75rem; color: var(--muted); }
@media (max-width: 600px) { .fg-plot { height: 170px; } }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--up); vertical-align: middle; box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); animation: pulse 2s infinite; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .hero-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
    padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 10, 18, .45); z-index: 35; }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); gap: 6px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--text); white-space: nowrap; }
  .topbar .mobile-brand img { width: 30px; height: 30px; border-radius: 50%; }
}

@media (max-width: 767px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.3rem; }
  .view { padding: 14px 16px calc(var(--bottombar) + 28px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(var(--bottombar) + 24px + env(safe-area-inset-bottom)); }
  .search-box { display: none; }
  .search-box.open { display: block; position: fixed; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); max-width: none; z-index: 61; }
  .search-box.open input { height: 46px; box-shadow: var(--shadow-lg); }
  .search-box.open > svg { top: 13px; }
  .search-box.open .search-results { top: 52px; }
  .status-chip .txt { display: none; }
  .status-chip { padding: 5px 8px; }
  .hide-mobile { display: none !important; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottombar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .75rem; font-weight: 600; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a svg { width: 24px; height: 24px; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav a.center i { width: 50px; height: 50px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; margin-top: -14px; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 40%, transparent); }
  .bottom-nav a.center i svg { width: 26px; height: 26px; }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quick a { padding: 10px 2px; font-size: .75rem; }
  .card > .card-head { padding: 12px 14px 0; }
  .card > .card-body { padding: 10px 14px 14px; }
  .list-item { padding: 10px 14px; }
  .modal-root { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  table.data td, table.data th { padding: 8px 10px; }
  .toasts { bottom: calc(var(--bottombar) + 16px + env(safe-area-inset-bottom)); }
  .mini-chart { height: 190px; }
  .page-head { margin-bottom: 14px; }
}

@media (min-width: 768px) {
  .show-mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .footer, .toasts { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ------------------------------------------------------------------ TradingView Chart & Indicators Modal */

.trading-view-page {
  position: relative;
  width: 100%;
  height: calc(100vh - 12px);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
body.chart-workspace .sidebar, body.chart-workspace .topbar, body.chart-workspace #festive-banner-slot, body.chart-workspace #footer, body.chart-workspace #bottom-nav { display: none; }
body.chart-workspace .shell { display: block; }
body.chart-workspace .main { margin-left: 0; width: 100%; }
body.chart-workspace #view { padding: 0; max-width: none; width: 100%; }
body.chart-workspace .trading-view-page { border: 0; border-radius: 0; box-shadow: none; }
body.chart-workspace .tv-header, body.chart-workspace .tv-bottom { flex-shrink: 0; }
body.chart-workspace .tv-bottom { flex-wrap: wrap; gap: 4px; }

.tv-header {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.tv-sidebar {
  border-bottom-left-radius: var(--radius);
}

.tv-tool-btn {
  transition: all .15s ease;
}

.tv-tool-btn:hover {
  background: var(--surface-2) !important;
}

.tv-tool-btn.active {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
}

.ind-cat-btn:hover {
  background: var(--surface-2) !important;
}

.ind-cat-btn.active {
  background: var(--surface-3) !important;
  color: var(--brand) !important;
}

.ind-row:hover {
  background: var(--surface-2) !important;
}

/* ------------------------------------------------------------------ festive greeting, ad slot, footer, sync */

.festive-banner, :root:not([data-festive="off"]) #festive-banner-slot[data-reserve]:empty { background: linear-gradient(90deg, #8f1d1d, #c2410c 55%, #b45309); color: #fff; }
/* The greeting's own height, kept before app.js draws it (index.html marks the slot while it runs). */
:root:not([data-festive="off"]) #festive-banner-slot[data-reserve]:empty { height: 46px; }
.festive-banner-inner { max-width: var(--content); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 20px; font-size: .86rem; line-height: 1.35; }
.festive-badge { font-size: 1.1rem; flex: none; }
.festive-body { flex: 1; min-width: 0; }
.festive-body span { opacity: .92; }
.festive-close-btn { flex: none; width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; cursor: pointer; }
.festive-close-btn:hover { background: rgba(255, 255, 255, .28); }

.footer { display: block; border-top: 1px solid var(--border); padding-top: 24px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-brand .brand { padding: 0 0 8px; }
.footer-brand p { max-width: 420px; }
.footer-col { display: flex; flex-direction: column; gap: 1px; font-size: .86rem; }
.footer-col b, .footer-col .visual-bold { color: var(--text); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.footer-col a { color: var(--muted); padding: 3px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); }
.social-row { display: flex; gap: 8px; margin: 8px 0 10px; }
.social { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.social svg { width: 18px; height: 18px; }
.social:hover { color: #fff; text-decoration: none; }
.social.youtube:hover { background: #ff0033; }
.social.facebook:hover { background: #1877f2; }
.social.tiktok:hover { background: #111; }
.social.instagram:hover { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.social-row.big .social { width: 42px; height: 42px; border-radius: 12px; }
.social-row.big .social svg { width: 22px; height: 22px; }
.quick-toggles { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.quick-toggles .btn { flex: 1; padding: 0 8px; }

.sync-btn { position: relative; }
.sync-btn .sync-dot { position: absolute; right: 7px; bottom: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--up); border: 2px solid var(--bg); display: none; }
.sync-btn.on .sync-dot { display: block; }
.sync-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--muted); font-size: .85rem; }
.sync-or::before, .sync-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sync-code-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.sync-code { flex: 1; min-width: 0; font: 650 1.02rem/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }

/* social and about page */
.follow-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.follow { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; color: #fff; }
.follow:hover { text-decoration: none; filter: brightness(1.08); }
.follow svg { width: 28px; height: 28px; flex: none; }
.follow b { display: block; }
.follow small { display: block; opacity: .85; font-size: .78rem; }
.follow.youtube { background: #e00027; }
.follow.facebook { background: #1877f2; }
.follow.tiktok { background: #111; border: 1px solid #333; }
.follow.instagram { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.prose { max-width: 760px; }
.prose p, .prose ul { margin: 0 0 12px; line-height: 1.65; }
.prose ul { padding-left: 20px; }
.prose h2 { margin: 22px 0 8px; }

/* market heatmap (treemap) */
.tm-card { scroll-margin-top: calc(var(--topbar) + 12px); }
.treemap { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); }
.treemap .tm-sector { position: absolute; background: var(--surface-2); }
.treemap a.tm-head { position: absolute; left: 0; right: 0; top: 0; height: 16px; padding: 0 5px; font-size: .7rem; line-height: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.treemap a.tm-head:hover { color: var(--text); text-decoration: none; }
.treemap a.tm-cell { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; color: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); line-height: 1.1; padding: 2px; }
.treemap a.tm-cell:hover { text-decoration: none; filter: brightness(1.15); z-index: 2; }
.treemap a.tm-cell b { font-weight: 700; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.treemap a.tm-cell small { white-space: nowrap; opacity: .95; font-variant-numeric: tabular-nums; }
.treemap a.tm-more { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 6px, transparent 6px 12px) !important; }
.tm-zoom { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tm-zoom > b { flex: 1; min-width: 0; font-size: 1rem; }
.tm-zoom > .chip { flex: none; text-decoration: none; }
.tm-zoom > .chip svg { width: 16px; height: 16px; }
.tm-zoom > a.small { flex: none; }
.list-item.selected { background: var(--surface-2); }
.list-item .main-col a.visual-bold { color: var(--text); }
.tm-legend { display: flex; align-items: center; gap: 2px; font-size: .75rem; color: var(--muted); min-width: 0; flex: 0 1 auto; }
.tm-legend i { display: block; width: 26px; min-width: 8px; flex: 0 1 26px; height: 12px; }

/* screener */
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.preset-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.preset-row::-webkit-scrollbar { display: none; }

@media (max-width: 1100px) {
  .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .hide-tablet { display: none !important; }
}
@media (max-width: 767px) {
  .festive-banner-inner { padding: 6px 8px 6px 14px; font-size: .8rem; }
  :root:not([data-festive="off"]) #festive-banner-slot[data-reserve]:empty { height: 44px; }
  .festive-body span { display: none; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .footer-col:last-child { grid-column: 1 / -1; }
  .icon-btn { width: 38px; height: 38px; }
  .top-actions { gap: 2px; }
}
@media (max-width: 400px) {
  .hide-mobile-xs { display: none !important; }
}

/* news list */
.news-item { align-items: flex-start; }
.news-item .main-col b.news-title { font-weight: 620; line-height: 1.4; white-space: normal; }
.news-item > svg { width: 18px; height: 18px; color: var(--faint); flex: none; margin-top: 10px; }
.news-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.news-icon.filing { background: var(--brand-soft); color: var(--brand); }
.news-icon svg { width: 18px; height: 18px; }
.tm-swatch { width: 12px; height: 34px; border-radius: 4px; flex: none; }

/* ---------------------------------------------------------------- account (Sign in with Google) */
.account-btn { text-decoration: none; }
.account-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; letter-spacing: .02em; background: color-mix(in srgb, var(--brand) 20%, var(--surface-2)); color: var(--text); }
.account-avatar.big { width: 52px; height: 52px; font-size: 1.15rem; flex: none; }
.account-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.account-id .grow { min-width: 0; flex: 1; }
/* Google's button style: white surface, grey outline, the four-colour "G" on the left. */
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid #747775; background: #fff; color: #1f1f1f; font: 500 .95rem/1.2 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; cursor: pointer; max-width: 100%; }
.google-btn:hover { background: #f8faff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.google-btn:disabled { opacity: .6; cursor: progress; }
.google-btn:focus-visible { outline: 3px solid color-mix(in srgb, #4285f4 55%, transparent); outline-offset: 2px; }
:root[data-theme="black"] .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
.google-logo { display: inline-grid; place-items: center; line-height: 0; }
.google-logo.inline { display: inline-block; vertical-align: -1px; }

/* ---------------------------------------------------------------- Android test sign-up and admin list */
.beta-progress { display: grid; gap: 8px; }
.beta-bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.beta-bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .4s ease; }
.beta-consent { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.beta-consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.beta-trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.beta-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.admin-table td { white-space: normal; vertical-align: top; }
.admin-table .admin-email { font-weight: 600; overflow-wrap: anywhere; margin-right: 6px; }

/* ---------------------------------------------------------------- 1.8.0 */

/* Colours follow the market (Settings → "Colours follow the market"): red brand while NEPSE is down. */
:root[data-market="down"] { --brand: #c8363b; --brand-2: #e5484d; --brand-soft: #fde8e8; --brand-ink: #b52f34; }
:root[data-theme="black"][data-market="down"] { --brand: #ff5c61; --brand-2: #ff7a7e; --brand-soft: #2a0f10; --brand-ink: #ff5c61; --on-brand: #1a0405; }
:root[data-market="down"] .card.hero { background: linear-gradient(135deg, #3a0d16 0%, #4a1018 55%, #6b1a1f 100%); }
.btn, .chip, .pill, .card.hero, .bottom-nav a, .side-nav a { transition: background-color .45s ease, color .45s ease, border-color .45s ease, box-shadow .2s ease, transform .2s ease; }

/* Account menu under the avatar; a sheet from the bottom on phones. */
.pm-scrim { position: fixed; inset: 0; z-index: 70; background: transparent; }
.profile-menu {
  position: fixed; z-index: 71; width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; animation: pm-in .16s ease-out;
}
.profile-menu.closing, .pm-scrim.closing { animation: pm-out .16s ease-in forwards; }
@keyframes pm-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pm-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
.pm-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; }
.pm-head b, .pm-head small { display: block; }
.pm-head small { color: var(--muted); font-size: .8rem; }
.pm-signin { width: calc(100% - 20px); margin: 0 10px 8px; justify-content: center; }
.pm-list { display: flex; flex-direction: column; }
.pm-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text);
  font-weight: 560; text-decoration: none; background: none; border: none; font: inherit; text-align: left; cursor: pointer; width: 100%;
}
.pm-item svg { width: 20px; height: 20px; color: var(--muted); flex: none; transition: transform .2s ease, color .2s ease; }
.pm-item:hover, .pm-item:focus-visible { background: var(--surface-2); outline: none; }
.pm-item:hover svg, .pm-item:focus-visible svg { color: var(--brand); transform: translateX(2px); }
.pm-out { color: var(--down); }
.pm-out svg { color: var(--down); }
.pm-sep { height: 1px; background: var(--border); margin: 6px 4px; }
@media (max-width: 600px) {
  .pm-scrim { background: rgba(0, 0, 0, .45); }
  .profile-menu { top: auto !important; right: 0 !important; left: 0; bottom: 0; width: 100%; max-height: 82vh; border-radius: 18px 18px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); animation-name: pm-up; }
  .profile-menu.closing { animation-name: pm-down; }
  @keyframes pm-up { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes pm-down { to { transform: translateY(100%); } }
}

/* Shares vs bank FD. */
.fd-bars { display: grid; gap: 8px; }
.fd-bar { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .88rem; }
.fd-bar i { display: block; height: 10px; border-radius: 99px; background: var(--flat); transition: width .6s ease; }
.fd-bar i.up { background: var(--up); }
.fd-bar i.down { background: var(--down); }
.fd-bar i.fd { background: var(--info); }
.fd-bar b { font-variant-numeric: tabular-nums; }

/* Dashboard shortcuts, invite link and plans. */
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-align: center; font-size: .86rem; font-weight: 600; }
.shortcut-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); transition: transform .2s ease; }
.shortcut:hover { background: var(--surface-3); }
.shortcut:hover .shortcut-ic { transform: translateY(-2px) scale(1.06); }
.invite-link { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.invite-link code { flex: 1; min-width: 0; font-size: .9rem; }
.plan-name { font-size: 1.1rem; }
.plan-price { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.plan-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; }
.plan-list svg { color: var(--up); flex: none; width: 18px; height: 18px; margin-top: 2px; }

/* The animated emblem: two rings of text turning opposite ways around the logo. */
.emblem { display: block; overflow: visible; color: var(--brand); cursor: default; }
.emblem .ring { transform-origin: 100px 100px; animation: em-spin 28s linear infinite; }
.emblem .ring-b { animation-duration: 20s; animation-direction: reverse; }
.emblem .ring-text { fill: currentColor; font: 700 15px var(--font); letter-spacing: .5px; }
.emblem .ring-text.small { font-size: 12.5px; opacity: .75; }
.emblem .halo { fill: var(--brand-soft); transition: r .3s ease; }
.emblem .logo { transform-origin: 100px 100px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); animation: em-float 4.5s ease-in-out infinite; }
.emblem:hover .ring { animation-duration: 7s; }
.emblem:hover .ring-b { animation-duration: 5s; }
.emblem:hover .logo { transform: scale(1.1) rotate(-4deg); }
.emblem:hover .halo { r: 52px; }
.emblem.watermark { position: absolute; right: -60px; bottom: -70px; color: #ffffff; opacity: .1; pointer-events: none; }
.card.hero > *:not(.emblem) { position: relative; }
@keyframes em-spin { to { transform: rotate(360deg); } }
@keyframes em-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
.page-head.with-emblem { align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 16px; }
.page-head .emblem { flex: none; }
@media (max-width: 600px) { .page-head .emblem { width: 64px; height: 64px; } }

/* Hover and press feedback on things you can tap. */
.quick a, .index-card, .list-item[href], a.list-item, .stat, .shortcut { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
@media (hover: hover) {
  .quick a:hover, .index-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .card:has(> .card-head .card-link):hover { box-shadow: var(--shadow); }
}
.quick a:active, .shortcut:active, .btn:active { transform: scale(.97); }

/* Community broker reviews */
.broker-rating-summary { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: center; padding: 20px; border-radius: 12px; background: var(--surface-2, var(--bg)); }
.broker-rating-score { font-size: clamp(24px, 5vw, 36px); font-weight: 800; }
.broker-rating-summary progress { flex: 1; min-width: 40px; height: 10px; accent-color: var(--brand); }
.broker-category-averages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.broker-category-averages > div { display: flex; flex-direction: column; gap: 4px; }
.broker-review-form { padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.broker-star-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.broker-star-field legend { font-size: 13px; margin-bottom: 6px; }
.broker-stars { display: flex; gap: 6px; flex-wrap: wrap; }
.broker-star-option { position: relative; cursor: pointer; }
.broker-star-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.broker-star-option span { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 700; }
.broker-star-option input:checked + span { color: var(--brand); background: var(--brand-soft, var(--bg)); border-color: var(--brand); }
.broker-star-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 3px; }
.broker-review-stars { color: var(--brand); font-weight: 700; }
.broker-review { border-top: 1px solid var(--border); padding-top: 16px; }
.broker-review-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
.broker-reviews textarea { width: 100%; resize: vertical; min-height: 110px; font: inherit; }
@media (max-width: 480px) {
  .broker-rating-summary { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .broker-review-form { padding: 12px; }
  .broker-star-option span { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .emblem .ring, .emblem .logo { animation: none; }
  .profile-menu, .profile-menu.closing, .pm-scrim.closing { animation-duration: .01s; }
  .quick a:hover, .index-card:hover, .shortcut:hover .shortcut-ic { transform: none; }
}

/* Chart workstation theme is independent of the rest of the website. */
body.chart-workspace {
  --brand: #2962ff; --brand-soft: #e8efff; --on-brand: #fff;
  --up: #089981; --down: #f23645;
  --radius: 4px; --radius-sm: 4px;
}
body.chart-workspace[data-chart-theme="light"] {
  color-scheme: light;
  --bg: #fff; --surface: #fff; --surface-2: #f8f9fd; --surface-3: #eef0f5;
  --text: #131722; --muted: #596579; --border: #e0e3eb;
}
body.chart-workspace[data-chart-theme="dark"] {
  color-scheme: dark;
  --bg: #131722; --surface: #131722; --surface-2: #1e2535; --surface-3: #2a3245;
  --text: #d1d4dc; --muted: #959daf; --border: #2a2e39; --brand: #90b4ff; --brand-soft: #1d305a;
}
body.chart-workspace .tv-header .btn { min-height: 36px; border-radius: 4px; font-weight: 500; }
body.chart-workspace .tv-header .active { color: var(--brand); background: var(--brand-soft); }
body.chart-workspace .tv-sidebar { flex-shrink: 0; }
body.chart-workspace .tv-ticker { padding: 4px 0; }
body.chart-workspace .tv-bottom { min-height: 40px; }

/* ------------------------------------------------------------------ SIP in Nepal (1.10.0) */

.sip-banks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.sip-bank { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface); min-width: 0; scroll-margin-top: calc(var(--topbar) + 12px); }
.sip-bank:target { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.sip-bank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sip-bank-head .row a { font-size: .82rem; }
.sip-bank-funds { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sip-fund-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); min-width: 0; }
.sip-fund-link:hover { text-decoration: none; background: var(--surface-3); }
.sip-fund-link .main { display: flex; flex-direction: column; min-width: 0; }
.sip-fund-link .main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.sip-fund-link .main small, .sip-fund-link .end small { font-size: .75rem; }
.sip-fund-link .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sip-fund-link .end svg { vertical-align: -1px; }
.sip-chart svg { width: 100%; height: auto; display: block; }
.sip-bar-paid { fill: var(--surface-3); }
.sip-bar-value { fill: var(--brand); }
.sip-axis { fill: var(--muted); font-size: 11px; }
.sip-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sip-key.paid { background: var(--surface-3); }
.sip-key.value { background: var(--brand); }
.sip-go { max-width: 640px; margin: 24px auto; }
.sip-go h1 { font-size: 1.4rem; margin: 0 0 10px; }
#sip-funds, #sip-calc, #sip-banks { scroll-margin-top: calc(var(--topbar) + 12px); }

/* ------------------------------------------------------------------ Trader AI (1.10.0) */

.ta-gauge { display: flex; align-items: center; gap: 14px; }
.ta-gauge .ta-meter { flex: 1; }
.ta-big { font-size: 2.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ta-meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.ta-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.ta-meter.up > i { background: var(--up); }
.ta-meter.warn > i { background: var(--warn); }
.ta-meter.down > i { background: var(--down); }
.ta-parts { display: grid; gap: 8px; margin-top: 12px; }
.ta-part { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.2fr) 2.2em; gap: 10px; align-items: center; }
.ta-part b { text-align: right; }
.ta-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ta-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; }
.ta-checks li svg { flex: none; margin-top: 2px; }
.ta-checks li.pass svg { color: var(--up); }
.ta-checks li.fail svg { color: var(--down); }
.ta-checks li.unknown { color: var(--muted); }
.ta-analog { padding: 8px 0; border-top: 1px solid var(--border); }
.ta-analog:first-of-type { border-top: none; }
.ta-chart svg { width: 100%; height: auto; display: block; }
.ta-grid { stroke: var(--border); stroke-width: 1; }
.ta-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ta-bar { stroke-width: 1.4; }
.ta-bar.up { stroke: var(--up); }
.ta-bar.down { stroke: var(--down); }
.ta-vol { opacity: .35; }
.ta-vol.up { fill: var(--up); }
.ta-vol.down { fill: var(--down); }
.ta-ma { fill: none; stroke-width: 1.5; }
.ta-ma.ma50 { stroke: var(--info); }
.ta-ma.ma150 { stroke: var(--warn); }
.ta-ma.ma200 { stroke: var(--q-weakening); stroke-dasharray: 5 3; }
.ta-level { stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.ta-level.support { stroke: var(--up); }
.ta-level.resistance { stroke: var(--down); }
.ta-pivot { stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ta-stop { stroke: var(--down); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ta-tag { font-size: 11px; font-weight: 700; }
.ta-tag.pivot { fill: var(--brand); }
.ta-tag.stop { fill: var(--down); }
.ta-t { fill: var(--text); font-size: 11px; font-weight: 700; }
.ta-low { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.ta-contraction { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ta-fan.outer { fill: color-mix(in srgb, var(--brand) 12%, transparent); }
.ta-fan.inner { fill: color-mix(in srgb, var(--brand) 24%, transparent); }
.ta-key { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: 3px; border-radius: 2px; }
.ta-key.ma50 { background: var(--info); }
.ta-key.ma150 { background: var(--warn); }
.ta-key.ma200 { background: var(--q-weakening); }
.ta-key.pivot { background: var(--brand); }
.ta-key.stop { background: var(--down); }
.ta-key.fan { height: 10px; vertical-align: -1px; background: color-mix(in srgb, var(--brand) 24%, transparent); }
nav.chips a.chip { text-decoration: none; }
nav.chips a.chip[aria-current="page"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
@media (max-width: 600px) {
  .ta-big { font-size: 2rem; }
  .ta-part { grid-template-columns: minmax(0, 1fr) 70px 2em; }
}

/* Research workspace: readable controls on mobile and desktop. */
.research-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.research-fields input { width: 100%; min-width: 0; }
[hidden] { display: none !important; }
