/* Swastika Search Prototype Styles */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #e6eaf2;
  --line-2: #eef1f7;
  --text: #0f1729;
  --text-2: #5b6478;
  --text-3: #8c95a8;
  --primary: #2752ff;
  --primary-soft: #e8eeff;
  --primary-tint: #f1f4ff;
  --up: #16a34a;
  --up-soft: #e8f6ed;
  --down: #dc2626;
  --down-soft: #fdecec;
  --warn: #b8860b;
  --warn-soft: #fff8e6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(15,23,41,0.04), 0 4px 16px rgba(15,23,41,0.04);
  --shadow-pop: 0 8px 32px rgba(15,23,41,0.10);
  --font: "Fira Sans", -apple-system, "Helvetica Neue", system-ui, sans-serif;
  --mono: "Fira Code", "SF Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); }

/* ==== Search shell ==== */
.search-app {
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  overflow: hidden;
}

/* Top bar */
.topbar {
  padding: 10px 14px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-row {
  display: flex; align-items: center; gap: 10px;
}
.back-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: none; color: var(--text);
  flex-shrink: 0;
}
.search-box {
  flex: 1; position: relative;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 0 10px 0 38px;
  height: 42px;
  transition: all .15s;
}
.search-box.focused {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
.search-box .icon {
  position: absolute; left: 12px;
  width: 18px; height: 18px; color: var(--text-3);
}
.search-box input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 15px; color: var(--text);
  font-family: var(--font);
  height: 100%;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box .clear {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--text-3); color: white;
  display: flex; align-items: center; justify-content: center;
  border: none; font-size: 11px; cursor: pointer;
  flex-shrink: 0;
}
.search-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.adv-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 6px;
  border-radius: 6px;
  margin-right: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Filter chips */
.chips-row {
  display: flex; gap: 6px;
  padding: 10px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  font-family: var(--font);
}
.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
}
.chip .ic {
  font-size: 12px;
  opacity: 0.9;
}
.chip-divider {
  width: 1px; align-self: stretch;
  background: var(--line);
  margin: 4px 2px;
  flex-shrink: 0;
}

/* Sub-filter chips row — shown when FNO/Commodity/MCX/NCDEX/NCOM active */
.sub-chips-row {
  display: flex; gap: 6px;
  padding: 6px 14px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sub-chips-row::-webkit-scrollbar { display: none; }
.sub-chip {
  font-size: 12px;
  padding: 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-3);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
  font-family: var(--font);
}
.sub-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
}

/* Body scroll */
.body-scroll {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

/* Section */
.section { padding: 14px 14px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 8px;
}
.section-title {
  font-size: 12px; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.section-link {
  font-size: 12px; color: var(--primary); font-weight: 500;
  text-decoration: none;
}

/* Card list */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Result row — screener format */
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background .12s;
  min-width: 0;
}
.row:last-child { border-bottom: none; }
.row:active { background: var(--surface-2); }

.row .glyph {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--primary-tint);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
  font-family: var(--font);
  letter-spacing: -0.2px;
}
.row .glyph.idx { background: #fff4e6; color: #b8650b; }
.row .glyph.com { background: #fef3e2; color: #92580a; }
.row .glyph.cur { background: #ecf6ee; color: #1a7a36; }
.row .glyph.deb { background: #efeaff; color: #5a3fd6; }
.row .glyph.opt { background: #fdecec; color: #b91c1c; }
.row .glyph.fut { background: #e8eeff; color: #2752ff; }

.row .info {
  flex: 1; min-width: 0;
  overflow: hidden;
}
.row .l1 {
  font-weight: 600; font-size: 14px; color: var(--text);
  margin-bottom: 3px;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .l1 .sym {
  font-weight: 700;
}
.row .l2 {
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; gap: 5px;
  min-width: 0;
}
.row .l2 .nm {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
.row .tag {
  font-size: 9px; font-weight: 600;
  padding: 2px 4px; border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-3);
  letter-spacing: 0.3px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  line-height: 1.3;
}
.row .tag.fno { background: var(--primary-tint); color: var(--primary); border-color: transparent; }
.row .tag.eq { background: #ecf6ee; color: #1a7a36; border-color: transparent; }
.row .price {
  text-align: right; flex-shrink: 0;
  min-width: 60px;
  margin-left: 4px;
}
.row .ltp { font-weight: 600; font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.row .chg {
  font-size: 11.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.row .chg.up { color: var(--up); }
.row .chg.down { color: var(--down); }

.row-actions {
  display: flex; gap: 3px;
  margin-left: 2px;
  flex-shrink: 0;
}
.icon-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:active { background: var(--line); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.active { background: var(--primary-soft); color: var(--primary); }

/* Highlight match */
.match { background: var(--warn-soft); color: #6b4f0a; padding: 0 2px; border-radius: 3px; font-weight: 700; }

/* Section group label inside results */
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px;
}
.group-head .gt {
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.group-head .gc {
  font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Trending pills */
.trend-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 0 4px;
}
.trend-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px 7px 10px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.trend-pill .rk {
  width: 18px; height: 18px;
  background: var(--primary-tint); color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  font-family: var(--mono);
}

/* Browse grid */
.browse-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.browse-tile {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.browse-tile .bi {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.browse-tile .bt { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 1px; }
.browse-tile .bs { font-size: 11.5px; color: var(--text-3); }

/* Recents list */
.recent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.recent-row:last-child { border-bottom: none; }
.recent-row .ri {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.recent-row .rt { flex: 1; min-width: 0; }
.recent-row .rs { font-size: 14px; font-weight: 600; color: var(--text); }
.recent-row .rn { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.recent-row .rx {
  font-size: 9.5px; padding: 2px 5px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-3);
  border: 1px solid var(--line);
  letter-spacing: 0.3px; font-weight: 600;
  flex-shrink: 0;
}

/* Hint card (advanced syntax / tips) */
.hint-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  border: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
}
.hint-card .ht { font-weight: 600; color: var(--text); margin-bottom: 4px; font-size: 12.5px; }
.hint-card code {
  font-family: var(--mono);
  background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px;
  color: var(--primary);
  font-size: 11.5px;
}

/* Advanced parser feedback panel */
.adv-panel {
  margin: 12px 14px 0;
  background: linear-gradient(180deg, #f1f4ff 0%, #ffffff 100%);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius);
  padding: 14px;
}
.adv-panel .head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.adv-panel .head .lbl {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
  background: var(--primary); color: white;
  padding: 3px 7px; border-radius: 5px;
}
.adv-panel .head .what { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.adv-panel .grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 10px;
}
.adv-panel .cell {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}
.adv-panel .ck { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.adv-panel .cv { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--mono); }
.adv-panel .cv.up { color: var(--up); }
.adv-panel .cv.down { color: var(--down); }

/* Option chain modal */
.chain-sheet {
  position: absolute; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  z-index: 10;
}
.chain-head {
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.chain-head .ttl { flex: 1; }
.chain-head .ttl-sym { font-weight: 700; font-size: 15px; color: var(--text); }
.chain-head .ttl-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.expiry-row {
  display: flex; gap: 6px; padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.expiry-row::-webkit-scrollbar { display: none; }
.expiry-pill {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: var(--font);
  min-width: 56px;
}
.expiry-pill.active {
  background: var(--primary); border-color: var(--primary); color: white;
}
.expiry-pill .ed { font-weight: 600; font-size: 12px; }
.expiry-pill .em { font-size: 9.5px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.4px; }

.chain-table {
  flex: 1; overflow-y: auto;
}
.chain-row {
  display: grid;
  grid-template-columns: 1fr 88px 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.chain-side {
  padding: 10px 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.chain-side:active { background: var(--surface-2); }
.chain-side .cs-ltp { font-size: 14px; font-weight: 600; color: var(--text); }
.chain-side .cs-chg { font-size: 11px; }
.chain-side .cs-oi { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.chain-side.ce { text-align: left; }
.chain-side.pe { text-align: right; }
.chain-side.itm { background: #fef9ee; }
.chain-strike {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2);
  font-weight: 700; font-size: 14px;
  color: var(--text);
  border-left: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}
.chain-strike.atm { background: var(--primary); color: white; }
.chain-strike .sl { font-size: 9px; opacity: 0.7; font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.chain-header {
  display: grid;
  grid-template-columns: 1fr 88px 1fr;
  background: var(--surface-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.chain-header .h-ce { text-align: left; }
.chain-header .h-st { text-align: center; }
.chain-header .h-pe { text-align: right; }

/* Bottom hint bar */
.kbd-bar {
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex; gap: 14px;
  font-size: 11px; color: var(--text-3);
  align-items: center;
}
.kbd-bar .k {
  font-family: var(--mono); font-size: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 2px 5px;
  color: var(--text-2);
}

/* More filters sheet */
.more-sheet {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 12px;
  animation: fadedown .12s ease-out;
}
@keyframes fadedown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.more-sheet-title {
  font-size: 10px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.more-sheet-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.more-sheet-chip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.more-sheet-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
}

/* Empty pad */
.pad-bottom { height: 24px; }

/* Toast / tip */
.tip {
  margin: 10px 14px 0;
  background: var(--warn-soft);
  border: 1px solid #f1e2b8;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: #6b4f0a;
  display: flex; gap: 8px; align-items: flex-start;
}

/* Suggestions for "did you mean" */
.dym {
  margin: 8px 14px 0;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--line);
}
.dym b { color: var(--primary); }

/* Dark mode overrides */
.dark {
  --bg: #0a0e1a;
  --surface: #131826;
  --surface-2: #1a2030;
  --line: #232a3d;
  --line-2: #1d2336;
  --text: #e7ecf5;
  --text-2: #9aa3b8;
  --text-3: #6b748a;
  --primary: #6b8aff;
  --primary-soft: #1c2447;
  --primary-tint: #161c33;
  --up: #4ade80;
  --up-soft: #14321c;
  --down: #f87171;
  --down-soft: #341818;
  --warn: #fcd34d;
  --warn-soft: #2e2614;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.18);
}

/* === Screener row format === */
.s-row {
  display: flex; align-items: center; gap: 0;
  padding: 11px 4px 11px 14px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background .12s;
  min-width: 0;
}
.s-row:last-child { border-bottom: none; }
.s-row:active { background: var(--surface-2); }

.s-row .s-info { flex: 1; min-width: 0; }
.s-row .s-l1 {
  display: flex; align-items: baseline; gap: 5px;
  margin-bottom: 3px;
  min-width: 0;
}
.s-row .s-sym {
  font-weight: 500; font-size: 14px; color: var(--text);
  letter-spacing: -0.05px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.s-row .s-ex {
  font-size: 9px; font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: 3px;
  border: 1px solid var(--line);
}
.s-row .s-typetag {
  font-size: 9px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  background: var(--primary-tint); color: var(--primary);
  letter-spacing: 0.4px;
  flex-shrink: 0;
  line-height: 1.3;
}
.s-row .s-typetag.ce { background: var(--up-soft); color: var(--up); }
.s-row .s-typetag.pe { background: var(--down-soft); color: var(--down); }
.s-row .s-typetag.fut { background: var(--primary-soft); color: var(--primary); }
.s-row .s-typetag.idx { background: #fff4e6; color: #b8650b; }
.s-row .s-typetag.com { background: #fef3e2; color: #92580a; }
.s-row .s-typetag.cur { background: #ecf6ee; color: #1a7a36; }
.s-row .s-strike {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  letter-spacing: -0.1px; flex-shrink: 0;
}
.s-row .s-meta-dot {
  font-size: 11px; color: var(--text-3); opacity: 0.5; flex-shrink: 0;
}
.s-row .s-l2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-3);  min-width: 0;
}
.s-row .s-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto; min-width: 0;
}


/* Floating action icons on right of search row */
.s-acts {
  display: flex; align-items: center; gap: 0;
  flex-shrink: 0;
  margin-left: 2px;
}
.s-act {
  width: 30px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text-3);
  cursor: pointer;
  transition: color .12s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.s-act:active { opacity: 0.5; }
.s-act--on { color: var(--primary); }
.s-act--chart { color: var(--text-3); }
/* Divider between info/price and actions */
.s-acts::before {
  content: "";
  display: block;
  width: 1px; height: 24px;
  background: var(--line);
  margin-right: 1px;
  flex-shrink: 0;
}

/* Section banner inside results — gives asset-class context */
.context-bar {
  margin: 10px 14px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.context-bar .ci {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.context-bar .ct { flex: 1; }
.context-bar .ct b { color: var(--text); font-weight: 600; }
.context-bar .cx {
  font-size: 11px; color: var(--primary); font-weight: 600;
  cursor: pointer;
}

/* === Sub-screen / detail screens === */
.subscreen {
  position: absolute; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  z-index: 9;
  animation: slidein 0.18s ease-out;
}
@keyframes slidein {
  from { transform: translateX(8%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.sub-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 8px;
}
.sub-head-row {
  display: flex; align-items: center; gap: 10px;
}
.sub-head .h-ttl {
  font-weight: 700; font-size: 16px; color: var(--text);
  letter-spacing: -0.1px;
}
.sub-head .h-sub {
  font-size: 11.5px; color: var(--text-3);
  margin-top: 1px;
}
.sub-search {
  flex: 1; position: relative;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 0 10px 0 32px;
  height: 36px;
}
.sub-search.focused { border-color: var(--primary); background: var(--surface); }
.sub-search .ic {
  position: absolute; left: 10px;
  width: 16px; height: 16px; color: var(--text-3);
}
.sub-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 13.5px; color: var(--text);
  font-family: var(--font);
  height: 100%;
}

/* Sub tabs */
.sub-tabs {
  display: flex; gap: 2px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
  padding: 10px 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.sub-tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Body of sub-screen */
.sub-body { flex: 1; overflow-y: auto; }

/* Commodity grid (compact tiles) */
.com-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
}
.com-tile {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
}
.com-tile .ct-cat {
  font-size: 9.5px; font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.com-tile .ct-name {
  font-size: 14.5px; font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}
.com-tile .ct-unit {
  font-size: 10.5px; color: var(--text-3);
  margin-top: 1px;
}
.com-tile .ct-price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 8px;
}
.com-tile .ct-ltp {
  font-size: 15px; font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.com-tile .ct-chg {
  font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.com-tile .ct-chg.up { color: var(--up); }
.com-tile .ct-chg.down { color: var(--down); }
.com-tile .ct-spark {
  margin-top: 6px;
  height: 24px;
}

/* Index dashboard */
.idx-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.idx-row .il-name { font-weight: 700; font-size: 15px; color: var(--text); }
.idx-row .il-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.idx-row .il-info { flex: 1; min-width: 0; }
.idx-row .il-spark { width: 80px; height: 32px; flex-shrink: 0; }
.idx-row .il-right { text-align: right; flex-shrink: 0; min-width: 78px; }
.idx-row .il-ltp { font-weight: 700; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.idx-row .il-chg { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.idx-row .il-chg.up { color: var(--up); }
.idx-row .il-chg.down { color: var(--down); }

/* Stock dashboard sector chips (already chip styles work) */

/* Options drill-down filter bar */
.optfilter {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}
.optfilter-row {
  display: flex; gap: 8px;
  align-items: center;
}
.cp-toggle {
  display: flex; background: var(--surface-2); border-radius: 9px;
  padding: 3px; border: 1px solid var(--line);
}
.cp-toggle .cp {
  padding: 6px 14px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-2);
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
}
.cp-toggle .cp.active.ce {
  background: var(--up); color: white;
}
.cp-toggle .cp.active.pe {
  background: var(--down); color: white;
}
.cp-toggle .cp.active.both {
  background: var(--text); color: white;
}

.exp-scroller {
  display: flex; gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.exp-scroller::-webkit-scrollbar { display: none; }

.strike-bar {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px;
  font-size: 12px; color: var(--text-2);
}
.strike-bar .lbl { flex-shrink: 0; }
.strike-bar input[type=range] {
  flex: 1; -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--line);
  outline: none;
}
.strike-bar input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(15,23,41,0.2);
}
.strike-val {
  font-family: var(--mono);
  font-size: 12px; font-weight: 700;
  color: var(--text);
  background: var(--primary-tint);
  padding: 3px 8px; border-radius: 6px;
  flex-shrink: 0; min-width: 56px;
  text-align: center;
}

/* Futures: simple expiry pills + list */
.fut-spot {
  background: linear-gradient(180deg, var(--primary-tint) 0%, transparent 100%);
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.fut-spot .fs-sym { font-weight: 700; font-size: 15px; color: var(--text); }
.fut-spot .fs-spot { font-size: 12px; color: var(--text-3); }
.fut-spot .fs-info { flex: 1; }
.fut-spot .fs-ltp { font-weight: 700; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.fut-spot .fs-chg { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fut-spot .fs-chg.up { color: var(--up); }
.fut-spot .fs-chg.down { color: var(--down); }

/* Sector chips */
.sector-row {
  display: flex; gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.sector-row::-webkit-scrollbar { display: none; }

/* Spark line */
.spark { width: 100%; height: 100%; display: block; }
.spark path.line { fill: none; stroke-width: 1.6; }
.spark path.area { fill-opacity: 0.12; stroke: none; }

/* === F&O dashboard underlying picker === */
.fno-picker {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.fno-pickrow {
  display: flex; gap: 6px;
  padding: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.fno-pickrow::-webkit-scrollbar { display: none; }
.fno-pill {
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  min-width: 110px;
  transition: all .15s;
}
.fno-pill.active {
  background: var(--primary-tint);
  border-color: var(--primary);
}
.fno-pill .fp-sym {
  font-size: 12.5px; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.05px;
}
.fno-pill .fp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
  gap: 8px;
}
.fno-pill .fp-ltp {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05px;
}
.fno-pill .fp-chg {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.fno-pill .fp-chg.up { color: var(--up); }
.fno-pill .fp-chg.down { color: var(--down); }

/* Refined CP toggle — only Calls/Puts now */
.cp-toggle .cp { padding: 7px 18px; font-size: 13px; }

