/* Bloomberg-terminal dense theme - single dark scheme, monospace, no rounded corners. */
:root {
  --bg: #050505; --bg-2: #0b0b0b; --bg-3: #111;
  --rule: #262626; --rule-2: #1a1a1a;
  --amber: #ffb000; --amber-dim: #d19a2f;
  --text: #e6e6e6; --text-dim: #b4b4b4; --text-faint: #8a8a8a;   /* brightened 2026-09-22: old #8a8a8a/#555 were hard to read */
  --green: #00d26a; --red: #ff3b3b; --blue: #4aa3ff; --cyan: #2fd4d4; --violet: #b88cff;
  --sym-nifty: #4aa3ff; --sym-sensex: #b88cff; --sym-midcpnifty: #2fd4d4;
  --input-bg: #000; --row-alt: #080808; --row-hover: #161616;
  --tag-long-bg: #001a0d; --tag-short-bg: #1a0000; --btn-active-fg: #000;
  --chart-bg: #0b0b0b; --chart-grid: #1c1c1c; --chart-text: #b4b4b4; --chart-border: #333;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
/* Light palette: same terminal layout, paper-white surfaces, darker accents for contrast. */
[data-theme="light"] {
  --bg: #eeede8; --bg-2: #ffffff; --bg-3: #f3f2ec;
  --rule: #cfcdc4; --rule-2: #e3e1d9;
  --amber: #a85f00; --amber-dim: #7d4700;
  --text: #1c1c1c; --text-dim: #5c5c5c; --text-faint: #9a9a9a;
  --green: #0b8a45; --red: #c92a2a; --blue: #1f6fd6; --cyan: #0b8a8a; --violet: #6f45c9;
  --sym-nifty: #1f6fd6; --sym-sensex: #6f45c9; --sym-midcpnifty: #0b8a8a;
  --input-bg: #ffffff; --row-alt: #f8f7f3; --row-hover: #ebe9e0;
  --tag-long-bg: #e6f6ec; --tag-short-bg: #fbe9e9; --btn-active-fg: #fff;
  --chart-bg: #ffffff; --chart-grid: #ebe9e0; --chart-text: #5c5c5c; --chart-border: #cfcdc4;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 12px; line-height: 1.35; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top ticker ---- */
.ticker {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch; background: var(--bg-2); border-bottom: 1px solid var(--rule);
  height: 34px; font-size: 12px; overflow: hidden;
}
.ticker .brand { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-right: 1px solid var(--rule); color: var(--amber); font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.ticker .brand .ver { color: var(--text-faint); font-weight: 400; letter-spacing: 0; }
.ticker .items { display: flex; align-items: center; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ticker .items::-webkit-scrollbar { display: none; }
.tk { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-right: 1px solid var(--rule-2); white-space: nowrap; height: 100%; }
.tk .sym { color: var(--text-dim); font-weight: 600; }
.tk .val { font-weight: 600; }
.tk .sub { color: var(--text-faint); font-size: 11px; }
.tk .sub.pos { color: var(--green); }
.tk .sub.neg { color: var(--red); }
.ticker .right { display: flex; align-items: center; gap: 14px; padding: 0 14px; border-left: 1px solid var(--rule); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .06em; }
.status .dot { width: 7px; height: 7px; background: var(--text-faint); }
.status.live .dot { background: var(--green); box-shadow: 0 0 6px var(--green); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.clock { color: var(--amber); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- nav bar ---- */
.navbar { display: flex; align-items: center; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--rule); height: 28px; padding: 0 6px; font-size: 11px; }
.navbar a { color: var(--text-dim); padding: 0 12px; height: 100%; display: flex; align-items: center; letter-spacing: .08em; text-transform: uppercase; border-right: 1px solid var(--rule-2); }
.navbar a:hover { color: var(--text); text-decoration: none; background: var(--bg-3); }
.navbar a.active { color: var(--amber); background: var(--bg-3); box-shadow: inset 0 -2px 0 var(--amber); }
.navbar .theme-btn { margin-left: auto; margin-right: 4px; }
.navbar a.logout { border-left: 1px solid var(--rule-2); border-right: 0; }

.content { padding: 10px 12px 40px; max-width: 1600px; margin: 0 auto; }

/* ---- generic terminal blocks ---- */
.blk { border: 1px solid var(--rule); background: var(--bg-2); margin-bottom: 10px; }
.blk-h { display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 10px; border-bottom: 1px solid var(--rule); background: var(--bg-3); }
.blk-h .t { color: var(--amber); font-weight: 700; letter-spacing: .1em; font-size: 11px; text-transform: uppercase; }
.blk-h .r { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 11px; }
.blk-b { padding: 8px 10px; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.lbl { color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.k { color: var(--amber-dim); }
.pos { color: var(--green); } .neg { color: var(--red); } .flat { color: var(--text-dim); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.dim { color: var(--text-dim); } .faint { color: var(--text-faint); }
.sym-NIFTY { color: var(--sym-nifty); } .sym-SENSEX { color: var(--sym-sensex); } .sym-MIDCPNIFTY { color: var(--sym-midcpnifty); }
.sym-SSB-POSITIONAL { color: var(--amber); font-weight: 600; }

/* ---- range / command line ---- */
.cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 10px; border: 1px solid var(--rule); background: var(--bg-2); margin-bottom: 10px; }
.cmd .seg { display: flex; align-items: center; gap: 6px; }
.kbtn {
  font-family: var(--mono); font-size: 11px; background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--rule);
  padding: 3px 8px; cursor: pointer; letter-spacing: .04em; text-transform: uppercase;
}
.kbtn:hover { color: var(--text); border-color: var(--text-faint); }
.kbtn.active { color: var(--btn-active-fg); background: var(--amber); border-color: var(--amber); font-weight: 700; }
.kbtn u { text-decoration: underline; text-decoration-color: var(--amber); }
.kbtn.active u { text-decoration-color: var(--btn-active-fg); }
.kin {
  font-family: var(--mono); font-size: 11px; background: var(--input-bg); color: var(--text); border: 1px solid var(--rule); padding: 3px 6px;
}
.kin:focus { outline: none; border-color: var(--amber); }
.cmd .range-text { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.cmd .range-text .err { color: var(--red); }

/* ---- stats grid ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--rule); background: var(--bg-2); margin-bottom: 10px; }
.stat { padding: 8px 10px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.stat .lbl { display: block; margin-bottom: 3px; }
.stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .s { color: var(--text-dim); font-size: 11px; margin-top: 2px; }

/* ---- grids ---- */
.g2 { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }
.g2b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 960px) { .g2, .g2b { grid-template-columns: 1fr; } }

/* ---- chart ---- */
.chart { height: 260px; width: 100%; position: relative; }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-dim); padding: 4px 10px 0; }
.chart-legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 5px; }

/* ---- ascii-ish bars ---- */
.bars { display: grid; grid-template-columns: max-content 1fr max-content max-content; gap: 4px 10px; align-items: center; font-size: 11.5px; }
.bars .name { cursor: pointer; font-weight: 600; }
.bars .name:hover { text-decoration: underline; }
.bars .track { height: 9px; background: var(--input-bg); border: 1px solid var(--rule-2); position: relative; }
.bars .fill { position: absolute; top: 0; bottom: 0; }
.bars .fill.pos { background: var(--green); } .bars .fill.neg { background: var(--red); }
.bars .n { color: var(--text-dim); }

/* ---- tables ---- */
table.tt { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tt th, .tt td { padding: 3px 8px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; text-align: left; }
.tt th { color: var(--amber-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; background: var(--bg-3); position: sticky; top: 62px; cursor: pointer; user-select: none; }
.tt th.sort-active { color: var(--amber); }
.tt th.sort-active::after { content: attr(data-arrow); margin-left: 4px; }
.tt tbody tr { cursor: pointer; }
.tt tbody tr:nth-child(even) td { background: var(--row-alt); }
.tt tbody tr:hover td { background: var(--row-hover); }
.tt tfoot td { border-top: 1px solid var(--rule); border-bottom: 0; font-weight: 700; background: var(--bg-3); }
.tt td.num, .tt th.num { text-align: right; }
.tag { display: inline-block; padding: 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .06em; border: 1px solid; }
.tag-win { color: var(--green); border-color: var(--green); } .tag-loss { color: var(--red); border-color: var(--red); } .tag-flat { color: var(--text-dim); border-color: var(--text-dim); }
.tag-long { color: var(--green); border-color: var(--rule); background: var(--tag-long-bg); } .tag-short { color: var(--red); border-color: var(--rule); background: var(--tag-short-bg); }
.empty { color: var(--text-faint); padding: 14px 10px; text-align: center; letter-spacing: .06em; }

/* ---- live strip ---- */
.live-row td { background: var(--tag-long-bg) !important; }

/* ---- detail page ---- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; font-size: 12px; }
.kv .lbl { align-self: center; }
.legbox { border: 1px solid var(--rule); background: var(--bg-3); padding: 8px 10px; }

/* ---- footer status bar ---- */
.statusbar { position: fixed; bottom: 0; left: 0; right: 0; height: 22px; background: var(--bg-2); border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 18px; padding: 0 12px; font-size: 10.5px; color: var(--text-dim); z-index: 20; }
.statusbar b { color: var(--text); font-weight: 600; }
.statusbar .right { margin-left: auto; }

/* ---- theme toggle ---- */
.theme-btn { font-family: var(--mono); font-size: 10.5px; background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--rule); padding: 2px 8px; cursor: pointer; letter-spacing: .06em; text-transform: uppercase; }
.theme-btn:hover { color: var(--amber); border-color: var(--amber); }

/* ---- trade type tags (Spot Buying / Spot Selling) ---- */
.tag-spot_buy { color: var(--blue); border-color: var(--rule); background: var(--tag-long-bg); }
.tag-spot_sell { color: var(--amber); border-color: var(--rule); background: var(--tag-short-bg); }
.tag-straddle { color: var(--violet); border-color: var(--rule); background: var(--bg-3); }
.tag-itm_otm { color: var(--cyan); border-color: var(--rule); background: var(--bg-3); }

/* ---- checkbox dropdowns (Symbol / Type) ---- */
.dd { position: relative; }
.dd-btn { min-width: 150px; text-align: left; display: inline-flex; justify-content: space-between; gap: 8px; text-transform: none; }
.dd-caret { color: var(--text-faint); }
.dd-menu { position: absolute; top: calc(100% + 2px); left: 0; z-index: 30; min-width: 200px; background: var(--bg-2); border: 1px solid var(--amber); padding: 4px 0; box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.dd-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; font-size: 11.5px; white-space: nowrap; }
.dd-item:hover { background: var(--row-hover); }
.dd-item input { accent-color: var(--amber); margin: 0; }
.dd-item:first-child { border-bottom: 1px solid var(--rule-2); margin-bottom: 3px; padding-bottom: 6px; }

/* ---- site frame (2026-09-23): bordered frame that GROWS with the content; the
   PAGE scrolls, nothing scrolls inside (user decision - replaced the fixed-height
   layout of 2026-09-19). Ticker + navbar stay pinned via sticky. ---- */
body { height: auto; min-height: 100vh; overflow-y: auto; padding: 10px; background: #000; }
[data-theme="light"] body { background: #d9d7cc; }
.frame { min-height: calc(100vh - 20px); display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 10px; overflow: clip; background: var(--bg); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.frame .ticker { position: sticky; top: 0; z-index: 20; }
.frame .navbar { position: sticky; top: 34px; z-index: 20; }
.frame .content { flex: 1; width: 100%; max-width: none; padding: 10px 12px 12px; display: block; }
.frame .content > .blk, .frame .content > .cmd, .frame .content > .stats, .frame .content > .two-col { margin-bottom: 10px; }
.frame .content > :last-child { margin-bottom: 0; }
.frame .statusbar { position: static; margin-top: auto; }
.frame .tt th { top: 62px; }   /* stays under the sticky ticker + navbar while the page scrolls */
/* two-column body (2026-09-23): wide left = positions tables, narrow right = widget stack */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 10px; align-items: start; }
.col-main, .col-side { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.col-main .blk, .col-side .blk, .col-main .cmd, .col-main .stats { margin-bottom: 0; }
.col-main .stats { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.col-main .tt { table-layout: auto; width: 100%; }
.col-main .tt td.wrap { white-space: normal; max-width: 260px; line-height: 1.3; }   /* long exit reasons wrap instead of forcing a horizontal scrollbar */
.col-main .tt th, .col-main .tt td { padding: 3px 6px; }
.col-main .tt td.dt { white-space: nowrap; }   /* dates stay on one line while there is room */
.col-side .tt tbody tr { cursor: default; }
.col-side .bars { font-size: 11px; }
.chip { display: inline-block; padding: 0 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; border: 1px solid var(--rule); color: var(--text-dim); background: var(--bg-2); }
.chip.amber { color: var(--amber); border-color: var(--amber); }
.legline { display: grid; grid-template-columns: max-content 1fr max-content; gap: 8px; align-items: baseline; padding: 4px 10px; border-top: 1px solid var(--rule-2); font-size: 11px; }
.legline .opt { font-weight: 700; }
@media (max-width: 1500px) { .two-col { grid-template-columns: minmax(0, 1fr) 330px; } .col-main .tt { font-size: 10.5px; } .col-main .tt th, .col-main .tt td { padding: 3px 4px; } .col-main .tt td.wrap { max-width: 180px; } .col-main .tt td.dt { white-space: normal; } }
@media (max-width: 1250px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 960px) { body { padding: 6px; } .frame { min-height: calc(100vh - 12px); } }
/* reports page inside the frame: natural flow, table grows with rows */
.frame .content.reports-ws > .rep-grid { align-items: start; }

/* key-value rows (used by the AI page Scope box; originally defined in pro.css) */
.kvl { padding: 6px 10px; }
.kvl .row { display: flex; justify-content: space-between; gap: 10px; padding: 2.5px 0; font-size: 11px; }
.kvl .row .k2 { color: var(--text-dim); }
.kvl .row b { font-weight: 600; }
