/* Site-wide additions to the mockup styles (the mockup's own inline styles stay untouched). */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
footer a, .tg-link { color: var(--teal); }

/* wide tables scroll sideways on phones instead of squeezing */
.bl table { max-width: 100%; }
.bl div:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* loading / notice line used by the pages */
.tg-note { font-size: 13px; color: var(--muted); padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--card); }
.tg-error { color: var(--clay); border-color: var(--claySoft); }

@media (max-width: 640px) {
  .bl main, .bl header > div { padding-left: 14px !important; padding-right: 14px !important; }
  .bl h2 { font-size: 24px !important; }
  .bl section { padding-top: 28px !important; padding-bottom: 28px !important; }
}

@media print {
  .bl header { position: static !important; }
  .bl button { display: none !important; }
}

/* =====================================================================================================
   Phase 13 looks (docs/THEMES_SPEC.md). <html data-look="classic|pro" data-theme="light|dark"> is set before
   the first paint by the inline head script (master copy js/look-head.min.js); js/shell.js fills the menus.
   Classic = the template above, unchanged. Everything Pro sits under html[data-look="pro"].
   ===================================================================================================== */
.bl { --acc: var(--teal); --accBg: rgba(15,123,108,.12); }
.bl[data-theme="dark"] { --accBg: rgba(61,191,168,.14); }
html[data-theme="dark"] body { background: #111417; }          /* no white flash before the page renders */
.tg-side, .tg-search { display: none; }                         /* Pro only */
html:not([data-look="pro"]) .bl > .tg-side { display: none !important; }

/* settings dialog (both looks) */
.tg-settings { min-height: 0 !important; max-width: 340px; width: calc(100% - 32px); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: 0 12px 32px rgba(0,0,0,.25); font: 14px Inter, system-ui, sans-serif; }
.tg-settings::backdrop { background: rgba(0,0,0,.45); }
.tg-settings h2 { margin: 0 0 10px; font-size: 18px; }
.tg-settings fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; padding: 8px 12px 10px; display: flex; gap: 18px; }
.tg-settings legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.tg-settings label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 32px; }
.tg-settings .tg-set-note { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.tg-settings .tg-set-close { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 13px Inter, sans-serif; cursor: pointer; }

/* ---------- Pro colours (spec section 2) ---------- */
html[data-look="pro"] .bl { --bg:#F3F5F8;--card:#FFFFFF;--ink:#101B2C;--muted:#5A6A80;--line:#E2E7EE;--soft:#EDF1F5;--teal:#12935A;--tealSoft:#BFE6D3;--clay:#D23F38;--claySoft:#F3C6C3;--amber:#B7791F;--amberBg:#FDF0D8;--blue:#2563EB;--blueBg:#DBE7FD;--chip:#EDF1F5;--side:#FFFFFF;--acc:#2563EB;--accBg:rgba(37,99,235,.10); }
/* Pro light text contrast (>= 4.5:1, spec section 3): the text-bearing green / red / amber are one step darker
   than the section 2 swatches (#12935A 3.9:1, #D23F38 4.3:1, #B7791F 3.6:1 on the page background). The spec
   swatches stay for the chart candles (API.chartColors). --accInk: the current page's name in the sidebar
   (#2563EB on the 10% blue highlight is 4.49:1). */
html[data-look="pro"] .bl:not([data-theme="dark"]) { --teal:#0E7C4C;--clay:#C4372F;--amber:#946412;--accInk:#1D4ED8; }
html[data-look="pro"] .bl[data-theme="dark"] { --bg:#0A101C;--card:#101A2B;--ink:#E3EAF3;--muted:#8394AD;--line:#1C2940;--soft:#16223A;--teal:#2BB673;--tealSoft:#1B4D38;--clay:#E5534B;--claySoft:#5A2622;--amber:#F2A93B;--amberBg:#3A2A0E;--blue:#3D8BFD;--blueBg:#13294A;--chip:#15223A;--side:#0D1524;--acc:#3D8BFD;--accBg:rgba(61,139,253,.14); }
html[data-look="pro"] body { background: #F3F5F8; }
html[data-look="pro"][data-theme="dark"] body { background: #0A101C; }
html[data-look="pro"] .bl a { color: var(--acc); }

/* ---------- Pro typography: IBM Plex Sans; IBM Plex Mono with tabular figures for numbers ---------- */
html[data-look="pro"] .bl, html[data-look="pro"] .bl * { font-family: 'IBM Plex Sans', system-ui, sans-serif !important; }
html[data-look="pro"] .bl [style*="JetBrains Mono"], html[data-look="pro"] .bl [style*="monospace"], html[data-look="pro"] .bl .num,
html[data-look="pro"] .bl kbd { font-family: 'IBM Plex Mono', ui-monospace, monospace !important; }
html[data-look="pro"] .bl { font-size: 13.5px; font-variant-numeric: tabular-nums; }
html[data-look="pro"] .bl h1 { font-size: 24px !important; font-weight: 600 !important; letter-spacing: -.01em; line-height: 1.3 !important; }
html[data-look="pro"] .bl h2 { font-size: 17px !important; font-weight: 600 !important; letter-spacing: -.005em; }
html[data-look="pro"] .bl h3 { font-size: 13px !important; font-weight: 600 !important; }
html[data-look="pro"] .bl p { font-size: 13.5px !important; }
html[data-look="pro"] .bl table th { font-size: 10.5px !important; text-transform: uppercase; letter-spacing: .04em; }
html[data-look="pro"] .bl table td { font-size: 12.5px; }

/* ---------- Pro shapes: cards 6px; pills, buttons and chips 4px; no shadows except dropdowns ---------- */
html[data-look="pro"] .bl [style*="border-radius: 16px"], html[data-look="pro"] .bl [style*="border-radius: 14px"],
html[data-look="pro"] .bl [style*="border-radius: 12px"], html[data-look="pro"] .bl .card, html[data-look="pro"] .bl .na { border-radius: 6px !important; }
html[data-look="pro"] .bl [style*="border-radius: 999px"]:not([style*="width: 8px"]):not([style*="width: 10px"]),
html[data-look="pro"] .bl [style*="border-radius: 10px"], html[data-look="pro"] .bl [style*="border-radius: 8px"],
html[data-look="pro"] .bl button, html[data-look="pro"] .bl select, html[data-look="pro"] .bl summary,
html[data-look="pro"] .bl .ib, html[data-look="pro"] .bl .note { border-radius: 4px !important; }
html[data-look="pro"] .bl [style*="box-shadow"]:not(details *) { box-shadow: none !important; }
html[data-look="pro"] .tg-settings { border-radius: 6px; }
html[data-look="pro"] .tg-settings .tg-set-close { border-radius: 4px; }

/* ---------- Pro layout: sidebar 228px + full-width content ---------- */
html[data-look="pro"] .bl:not(dialog) { padding-left: 228px; box-sizing: border-box; }
html[data-look="pro"] .bl > .tg-side { display: flex; flex-direction: column; gap: 10px; position: fixed; z-index: 20; left: 0; top: 0; bottom: 0;
  width: 228px; box-sizing: border-box; padding: 12px 10px; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); }
.tg-side .tg-logo { display: flex; align-items: center; gap: 8px; padding: 2px 6px; text-decoration: none; color: var(--ink) !important; }
.tg-side .tg-logo img { display: block; border-radius: 4px; }
.tg-side .tg-logo-t { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.tg-side .tg-logo-by { font-size: 10.5px; color: var(--muted); margin-left: auto; }
.tg-side .tg-nav { display: flex; flex-direction: column; gap: 1px; }
.tg-side .tg-group { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 10px 10px 4px; }
.tg-side .tg-nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 5px; color: var(--muted) !important; text-decoration: none; font-size: 13px; }
.tg-side .tg-nav a:hover { background: var(--soft); color: var(--ink) !important; }
.tg-side .tg-nav a[aria-current="page"] { background: var(--accBg); color: var(--accInk, var(--acc)) !important; font-weight: 500; }
.tg-side .tg-ic { width: 16px; text-align: center; }
.tg-side .tg-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 10.5px; color: var(--muted); padding: 8px 10px; border-top: 1px solid var(--line); }
.tg-side .tg-set-btn { align-self: flex-start; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 4px; cursor: pointer; }

html[data-look="pro"] .bl > header { background: var(--side) !important; }
html[data-look="pro"] .bl > header > div { max-width: none !important; padding: 8px 20px !important; justify-content: flex-start !important; }
html[data-look="pro"] .bl > header > div > div:last-child { margin-left: auto; }
html[data-look="pro"] .bl .tg-brand, html[data-look="pro"] .bl [data-tg-nav] { display: none !important; }
html[data-look="pro"] .bl > header button, html[data-look="pro"] .bl > header summary { min-height: 30px !important; font-size: 12px !important; }
html[data-look="pro"] .bl > main { max-width: none !important; margin: 0 !important; padding: 6px 20px 40px !important; }
html[data-look="pro"] .bl > main section { padding-top: 20px !important; padding-bottom: 20px !important; }

/* search box */
html[data-look="pro"] .bl .tg-search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 520px; }
.tg-search .tg-sbox { position: relative; flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg);
  border-radius: 6px; padding: 0 10px; color: var(--muted); min-height: 34px; }
.tg-search .tg-s-ic { font-size: 14px; }
.tg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; padding: 7px 0; }
.tg-search input::placeholder { color: var(--muted); opacity: 1; }
.tg-search .tg-kbd { font-size: 10.5px; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; color: var(--muted); }
.tg-search .tg-sr { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; max-height: 60vh; overflow: auto; }
.tg-search .tg-sr[hidden] { display: none; }
.tg-search .tg-sr a { display: flex; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: 4px; color: var(--ink) !important; text-decoration: none; font-size: 13px; }
.tg-search .tg-sr a[aria-selected="true"], .tg-search .tg-sr a:hover { background: var(--accBg); }
.tg-search .tg-sr-k { flex: none; width: 62px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tg-search .tg-burger { display: none; min-height: 34px; min-width: 38px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 4px; font-size: 16px; cursor: pointer; }

/* the one market switch (owner decision 2026-11-29): in the header, left of the search box, both looks, every page.
   Classic has no search box, so its .tg-search holds the switch only. */
html[data-look="classic"] .bl .tg-search, html:not([data-look]) .bl .tg-search { display: flex; align-items: center; gap: 8px; }
html[data-look="classic"] .bl .tg-search .tg-sbox, html:not([data-look]) .bl .tg-search .tg-sbox { display: none; }
.tg-mkw { display: flex; align-items: center; gap: 8px; flex: none; }
.tg-mk { display: inline-flex; gap: 2px; background: var(--chip); border-radius: 999px; padding: 3px; }
.tg-mk-off { display: inline-flex; cursor: not-allowed; }
.tg-mk-b { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 600 12.5px Inter, sans-serif; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tg-mk-b[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tg-mk-b:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.tg-mk-b:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.tg-mk-lock { font-size: 11px; line-height: 1; background: none !important; padding: 0 !important; }
.tg-mk-note, .tg-mk-pagenote { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tg-mk-pagenote { white-space: normal; margin: 0; }
html[data-look="pro"] .bl .tg-mk { border-radius: 6px; padding: 2px; }
html[data-look="pro"] .bl .tg-mk-b { border-radius: 4px; min-height: 28px; font-size: 12px; }
/* small muted IN / US tag after single-market menu items */
.tg-mtag { margin-left: 6px; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; vertical-align: 1px; }
@media (max-width: 560px) {
  .tg-mk-b { padding: 0 9px; font-size: 12px; }
  .tg-mk-note { display: none; }
}

/* focus rings (Pro; Classic keeps the browser's own) */
html[data-look="pro"] .bl :focus-visible, html[data-look="pro"] .tg-settings :focus-visible { outline: 2px solid var(--acc) !important; outline-offset: 2px; }
html[data-look="pro"] .tg-search .tg-sbox:focus-within { outline: 2px solid var(--acc); outline-offset: 1px; }
html[data-look="pro"] .bl .tg-search input:focus-visible { outline: none !important; }

/* below 900px the sidebar becomes a drawer behind the ☰ button */
@media (max-width: 899px) {
  html[data-look="pro"] .bl:not(dialog) { padding-left: 0; }
  html[data-look="pro"] .bl > .tg-side { transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility 0s linear .18s; }
  html[data-look="pro"][data-tg-drawer="open"] .bl > .tg-side { transform: none; visibility: visible; transition: transform .18s ease; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  html[data-look="pro"] .bl .tg-search .tg-burger { display: inline-flex; align-items: center; justify-content: center; }
  html[data-look="pro"] .bl .tg-search .tg-kbd { display: none; }
  html[data-look="pro"] .bl .tg-search { flex-basis: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { html[data-look="pro"] .bl > .tg-side { transition: none; } }
@media print { .tg-side, .tg-search { display: none !important; } html[data-look="pro"] .bl:not(dialog) { padding-left: 0; } }
/* Stock names link to the company page (/stock/<in|us>/<SYMBOL>, API.stockUrl). Same in both looks: the text keeps
   its colour with a dotted underline; hover / focus turns it solid in the accent colour. An <a class="tg-stock">
   without href (index, ETF, fund) is plain text. */
.bl a.tg-stock { color: inherit; text-decoration: none; }
.bl a.tg-stock[href] { text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.bl a.tg-stock[href]:hover, .bl a.tg-stock[href]:focus-visible { color: var(--acc); text-decoration-style: solid; text-decoration-color: currentColor; }

/* ---------- Classic grouped header menu (Phase 13b, js/shell.js fillNav): Markets ▾ · Research ▾ · links ---------- */
.tg-gitem { position: relative; display: inline-flex; }
.tg-gbtn .tg-caret { font-size: 10px; line-height: 1; }
.tg-gbtn[aria-expanded="true"] .tg-caret { transform: rotate(180deg); }
.tg-gmenu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px; max-width: calc(100vw - 16px); box-sizing: border-box;
  margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.tg-gmenu[hidden] { display: none; }
.tg-gmenu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* hover bridge */
.tg-gmenu a { display: flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 8px; color: var(--ink) !important; text-decoration: none; font: 500 14px Inter, sans-serif; white-space: nowrap; }
.tg-gmenu a:hover, .tg-gmenu a:focus-visible { background: var(--soft); }
.tg-gmenu a[aria-current="page"] { background: var(--ink); color: var(--bg) !important; font-weight: 600; }
/* Markets tab bar: scrolls sideways when it does not fit (phones) */
.tg-mtabs [role="tablist"] { scrollbar-width: thin; }

/* ---------- Phase 13c: Daily | Weekly toggle in chart headers, selected industry row, "What it means" cell ---------- */
.tf-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; vertical-align: middle; flex: none; }
.tf-toggle button { font: 500 12px/1 inherit; font-family: inherit; padding: 5px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tf-toggle button.on { background: var(--ink); color: var(--card); }
.tf-toggle button:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
html[data-look="pro"] .tf-toggle { border-radius: 4px; }
.ind-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.ind-link:hover, .ind-link:focus-visible { color: var(--teal); }
.row-selected, .row-selected td { background: color-mix(in srgb, var(--teal) 12%, transparent) !important; }
.bm-note { border-left: 3px solid var(--muted); padding-left: 8px !important; font-size: 12.5px; min-width: 220px; }
.bm-note.up { border-left-color: var(--teal); } .bm-note.down { border-left-color: var(--clay); }

/* Phase 13c: hidden sections stay hidden even with an inline display style */
[hidden] { display: none !important; }

/* Phase 17 OnMark brand: logo and Vishnu tilak switch with the theme (light = navy logo, dark = white logo) */
.bl:not([data-theme="dark"]) .tg-logo-d, .bl[data-theme="dark"] .tg-logo-l { display: none !important; }
.tg-brand img { display: block; height: 40px; width: auto; }
.tg-tilak { display: flex; justify-content: center; padding: 4px 0 0; line-height: 0; pointer-events: none; user-select: none; }
.tg-tilak img { width: 12px; height: 16px; display: block; }
.tg-side .tg-logo img { height: 40px; width: auto; border-radius: 0; }
.tg-credit { margin-top: 10px; font-size: 12px; color: var(--muted); }
.tg-credit:empty { display: none; }
/* master run Phase 2: India data status (Provisional / Final / backup source) */
.tg-data-status { font-weight: 500; }
.tg-ds-provisional { color: #b26a00; }
.tg-prov-tag { margin: 8px 0; padding: 6px 10px; border-radius: 6px; background: #fff4e0; color: #7a4a00; border: 1px solid #f0c27a; font-size: 13px; font-weight: 500; }
html[data-theme="dark"] .tg-prov-tag { background: #3a2a10; color: #ffd28a; border-color: #7a5a20; }
@media (max-width: 560px) { .tg-brand img { height: 32px; } }
