/* Stock workspace (Nifty 50 and Next Nifty): list on the left, one stock on the right with the shared header and tabs. */
.ws-ov { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ws-ov > div { min-width: 0; }
.ws-ov > div > .card:first-child, .ws-ov > div > .blk:first-child, .ws-ov > div > .sg:first-child { margin-top: 0; }
.ds-panel > .card:first-child, .ds-panel > .blk:first-child, .ds-panel > .cpx:first-child > .blk:first-child { margin-top: 0; }
.ws-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ws-pair > * { min-width: 0; }
.ws-side .ds-list { overflow-y: auto; flex: 1; }
.ws-rk { font: 500 12.5px var(--ds-mono); color: var(--ds-violet-ink); min-width: 14px; }
.ws-note { margin: 0; font-size: 13.5px; color: var(--ds-muted); line-height: 1.45; }
.ws-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; color: var(--ds-muted); margin: -4px 0 12px; }
.ws-meta b { color: var(--ds-ink); font-weight: 600; }
.ws-reports { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-levels table { width: 100%; }
.ds-levels td { padding: 6px 3px !important; font-size: 14px !important; white-space: nowrap; }
.ds-levels td:first-child { white-space: normal; }
.ws-meta span + span::before { content: "·"; margin-right: 14px; color: var(--ds-line2); }
.ds-levels tr.now td { font-weight: 700; background: var(--ds-lav); }
.ds-levels .lead { margin-bottom: 6px !important; }
.cpx .blk .lead { color: var(--ds-muted); }
.cpx .card { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 14px; padding: 16px 18px; box-shadow: none; }
.cpx .blk h2 { font: 600 16.5px var(--ds-sans); letter-spacing: 0; }
.cpx .tile { background: var(--ds-surface); }
.cpx .tile .v { font: 500 20px var(--ds-mono); letter-spacing: -.02em; }
.cpx table.t td { font-variant-numeric: tabular-nums; }

/* Next Nifty: the shared rows inside the existing side panel */
.cpx .side.ws-side { border-color: var(--ds-line); }

/* Nifty 50 page: its generated layout restyled to the shared system */
html[data-cp-auto] body { background: var(--ds-band-aqua); }
html[data-cp-auto][data-theme="dark"] body { background: var(--ds-bg); }
@media (min-width: 761px) { html[data-cp-auto] .layout { grid-template-columns: 300px minmax(0, 1fr); } }
html[data-cp-auto] aside { background: var(--ds-band-purple); border-right: 1px solid var(--ds-line); top: 60px; max-height: calc(100vh - 60px); }
html[data-cp-auto] aside > .controls { display: none; }
html[data-cp-auto] #list { overflow-y: auto; flex: 1; }
html[data-cp-auto] main { padding: 18px 22px; }
html[data-cp-auto] #detail .card { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 14px; box-shadow: none; }
html[data-cp-auto] #detail .card h2, html[data-cp-auto] details.tech > summary { font: 600 16.5px var(--ds-sans); letter-spacing: 0; }
html[data-cp-auto] #detail .sg { margin: 0 0 16px; }
html[data-cp-auto] #detail .sg-badge { display: none; }
html[data-cp-auto] #detail .sg-head { padding: 12px 16px; }
html[data-cp-auto] #detail details.tech { margin-top: 0; }
html[data-cp-auto] .tabbar a.on { color: var(--ds-violet-ink); }
.ws-loading { padding: 40px; text-align: center; color: var(--ds-muted); }
.ws-sk { display: block; height: 14px; border-radius: 6px; background: var(--ds-soft); margin: 8px 0; }

@media (max-width: 1180px) { .ws-ov { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .ws-pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  html[data-cp-auto] main { padding: 12px 14px; }
  html[data-cp-auto] .mobile-pick select { height: 42px; border: 1px solid var(--ds-line2); border-radius: 10px; background: var(--ds-surface); color: var(--ds-ink); font: 600 15px var(--ds-sans); }
  .ds-acts .ds-btn { flex: 1; }
}
.cpx .tile { border: 1px solid var(--ds-line) !important; box-shadow: none !important; background: var(--ds-surface) !important; }
.cpx .tile .lab::before { content: none !important; }
body:has(.ws-side) main .wrap { max-width: none; padding: 0 32px; }
body:has(.ws-side) main { padding-top: 28px; }
/* report buttons under Filings: one outlined style, like every other secondary action */
.ws-reports button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px !important; border: 1px solid var(--ds-line2) !important;
  background: var(--ds-surface) !important; color: var(--ds-ink) !important; font: 600 14.5px var(--ds-sans) !important; box-shadow: none !important; }
.ws-reports button:hover { border-color: var(--ds-ink2) !important; }
.ws-reports button small { font: 500 12.5px var(--ds-mono) !important; color: var(--ds-muted) !important; background: none !important; }
.ws-reports button .spark { color: var(--ds-violet) !important; }
.ws-reports button[disabled] { opacity: .45; }

/* Next Nifty laid out exactly like Nifty 50: list flush down the left edge, stock name in the sans header style */
html .ds-head h1 { font: 600 28px/1.1 var(--ds-sans); letter-spacing: -.01em; }
body:has(.ws-side) main { padding: 0 0 64px; }
body:has(.ws-side) main .wrap { max-width: none; padding: 0; }
body:has(.ws-side) .cpx .sp { grid-template-columns: 300px minmax(0, 1fr); gap: 0; }
body:has(.ws-side) .cpx .side.ws-side { position: sticky; top: 60px; max-height: calc(100vh - 60px); height: calc(100vh - 60px); border: 0; border-right: 1px solid var(--ds-line); border-radius: 0; }
body:has(.ws-side) #detail { padding: 28px 36px; min-width: 0; }
@media (max-width: 900px) {
  body:has(.ws-side) .cpx .sp { grid-template-columns: minmax(0, 1fr); }
  body:has(.ws-side) .cpx .side.ws-side { position: static; height: auto; max-height: 340px; border-right: 0; border-bottom: 1px solid var(--ds-line); }
  body:has(.ws-side) #detail { padding: 16px; }
}

/* Next Nifty: why a candidate */
.cand-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--ds-line); border-radius: 12px; margin-top: 12px; overflow: hidden; }
.cand-stats > div { padding: 14px 16px; } .cand-stats > div + div { border-left: 1px solid var(--ds-line); }
.cand-stats span { display: block; font: 500 11.5px var(--ds-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ds-muted); }
.cand-stats b { display: block; font-size: 20px; margin: 6px 0 2px; } .cand-stats small { color: var(--ds-muted); font-size: 13.5px; }
@media (max-width: 900px) { .cand-stats { grid-template-columns: 1fr 1fr; } .cand-stats > div:nth-child(3) { border-left: 0; } .cand-stats > div:nth-child(n+3) { border-top: 1px solid var(--ds-line); } }

/* Next Nifty list controls: the same compact sizes as the Nifty 50 list (older .cpx rules made them large) */
.ws-side .ds-search input { height: 34px !important; margin: 0 !important; padding: 0 10px !important; border-radius: 9px !important; font: 500 15px var(--ds-sans) !important; }
.ws-side .ds-lctl select { height: 30px !important; padding: 0 6px !important; border-radius: 8px !important; font: 500 14px var(--ds-sans) !important; width: auto; flex: 1; min-width: 0; }
.ws .sg { margin: 0 0 22px; } .ws .sg-head { padding: 16px 20px; }
