/* World Stock Screen: page styles on top of shared/css/base.css (tokens only) */
main.vs-wide { max-width: 1120px; }
.vs-meta { color: var(--muted); font-size: .92rem; margin: 6px 0 4px; }
.vs-conflict { font-size: .9rem; background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border)); border-radius: var(--radius-sm); padding: 8px 12px; margin: 8px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* stats */
.vs-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; }
.vs-stats .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.vs-stats .n { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vs-stats .l { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; line-height: 1.3; }
@media (max-width: 719px) { .vs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vs-stats .kpi:last-child { grid-column: 1 / -1; } }

/* sticky unlock bar */
.vs-lockbar { position: sticky; top: var(--vs-sticky-top, 60px); z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 14px; padding: 10px 14px; margin: 12px 0; box-shadow: var(--shadow); }
.vs-lockbar[hidden] { display: none; }
.vs-lockbar-txt { display: flex; flex-direction: column; min-width: 0; font-size: .9rem; }
.vs-lockbar-txt span { color: var(--muted); font-size: .84rem; }
.vs-lockbar button { flex: none; padding: 10px 16px; font-size: .95rem; }
@media (max-width: 719px) { .vs-lockbar { padding: 8px 10px; } .vs-lockbar-txt span { display: none; } .vs-lockbar button { padding: 9px 12px; font-size: .86rem; white-space: normal; max-width: 62%; } }
.vs-top3 { padding-left: 1.4em; } .vs-top3 li { margin: 6px 0; font-weight: 650; } .vs-top3 .small { font-weight: 400; }

/* settings */
.vs-settings { margin: 6px 0 16px; }
.vs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; padding-bottom: 6px; }
.vs-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vs-reset { display: flex; align-items: flex-end; padding-top: 12px; } .vs-reset button { width: 100%; min-height: 46px; }
@media (max-width: 900px) { .vs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .vs-grid, .vs-grid-3 { grid-template-columns: 1fr; } }

/* tables → cards under 720px */
.vs-tbl { width: 100%; font-size: .88rem; table-layout: auto; }
.vs-tbl th, .vs-tbl td { padding: 8px 6px; vertical-align: middle; }
.vs-tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vs-tbl tfoot td { font-weight: 700; border-bottom: 0; }
.vs-tbl th button { background: none; border: 0; box-shadow: none; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.vs-tbl th button:hover { transform: none; color: var(--accent); }
.vs-co { font-weight: 650; }
.vs-sub { color: var(--muted); font-size: .78rem; }
.vs-namebtn { display: inline; width: auto; min-height: 0; background: none; border: 0; box-shadow: none; padding: 0; font: inherit; font-weight: 650; color: var(--text); text-align: left; border-bottom: 1px dashed var(--muted); border-radius: 0; }
.vs-namebtn:hover { transform: none; color: var(--accent); border-bottom-color: var(--accent); }
tr.vs-row { cursor: pointer; }
tr.vs-row.open td { background: var(--accent-soft); }
tr.vs-det > td { background: var(--surface-2); padding: 0; }
.vs-wbar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 50px; }
.vs-wbar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.vs-tag { display: inline-block; font-size: .74rem; font-weight: 650; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.vs-tag.good { background: var(--positive-soft); color: var(--positive); border-color: color-mix(in srgb, var(--positive) 35%, var(--border)); }
.vs-tag.mid { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.vs-tag.bad { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
.vs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--muted); }
.vs-dot.good { background: var(--positive); } .vs-dot.mid { background: var(--warn); } .vs-dot.bad { background: var(--err); }
.vs-red { color: var(--err); font-weight: 650; } .vs-green { color: var(--positive); }
.vs-blur { filter: blur(5px); user-select: none; color: var(--muted); }
.vs-lock { display: inline-block; font-size: .74rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
tr.vs-locked { cursor: pointer; }
.vs-empty { text-align: center; color: var(--muted); padding: 20px; }
@media (max-width: 719px) {
  .vs-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vs-tbl, .vs-tbl tbody, .vs-tbl tfoot, .vs-tbl tr, .vs-tbl td { display: block; width: 100%; }
  .vs-tbl tr { border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; padding: 8px 12px; background: var(--surface); }
  .vs-tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .vs-tbl td.num { text-align: right; }
  .vs-tbl td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: .8rem; text-align: left; flex: none; max-width: 55%; }
  .vs-tbl td.vs-first { display: block; text-align: left; font-size: 1rem; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
  .vs-tbl td.vs-first .vs-chk { float: right; }
  .vs-tbl tr.vs-det { padding: 0; } .vs-tbl tr.vs-det > td { display: block; }
  .vs-tbl td .vs-wbar { flex: 1 1 auto; max-width: 50%; margin-left: auto; align-self: center; }
}

/* builder blocks */
.vs-dropped { font-size: .86rem; color: var(--muted); margin: 12px 0; }
.vs-conc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
@media (max-width: 719px) { .vs-conc { grid-template-columns: 1fr; } }
.vs-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: .86rem; }
.vs-box .t { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.vs-box .l { display: flex; justify-content: space-between; gap: 10px; }
.vs-meth { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: .84rem; color: var(--muted); margin: 12px 0; }
.vs-meth b { color: var(--text); }
.vs-h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 14px 0 4px; }
.vs-caveat { background: var(--err-bg); border: 1px solid color-mix(in srgb, var(--err) 25%, var(--border)); border-radius: 12px; padding: 10px 14px; font-size: .86rem; margin: 14px 0 0; }

/* simulation */
.vs-sim { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 6px; }
.vs-badge { font-family: var(--font-body); font-size: .72rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 2px 8px; vertical-align: middle; letter-spacing: 0; }
.vs-scen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
@media (max-width: 719px) { .vs-scen { grid-template-columns: 1fr; } }
.vs-sc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; border-top-width: 4px; }
.vs-sc.bear { border-top-color: var(--err); } .vs-sc.base { border-top-color: var(--accent); } .vs-sc.bull { border-top-color: var(--positive); }
.vs-sc .t { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.vs-sc .v { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.vs-sc .d { font-size: .78rem; color: var(--muted); }
.vs-chart { margin: 0 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.vs-chart svg { display: block; width: 100%; height: auto; }
.vs-chart .ax { stroke: var(--border); } .vs-chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.vs-chart .bear { stroke: var(--err); fill: var(--err); } .vs-chart .base { stroke: var(--accent); fill: var(--accent); } .vs-chart .bull { stroke: var(--positive); fill: var(--positive); }
.vs-legend { display: flex; gap: 16px; justify-content: center; font-size: .82rem; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.vs-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.vs-legend .bear i { background: var(--err); } .vs-legend .base i { background: var(--accent); } .vs-legend .bull i { background: var(--positive); }

/* folds */
.vs-fold { background: var(--surface); margin: 18px 0; }
.vs-fold > summary { flex-wrap: wrap; align-items: baseline; }
.vs-fold > summary > span:first-child { font-family: var(--font-head); font-size: 1.1rem; }
.vs-fold > summary .small { font-weight: 400; margin-left: auto; padding-right: 8px; }
.vs-fold[open] { padding-bottom: 14px; }
.vs-filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; }
/* ESG filter toggle (settings + table filters) and the neutral flag badge */
.vs-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; cursor: pointer; margin: 0; }
.vs-check input { margin: 0; }
.vs-filters .vs-check { grid-column: 1 / -1; }
.vs-grid .vs-check { grid-column: 1 / -1; }
.vs-esgflag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 0 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: 1px; margin-left: 4px; }
.vs-fold[hidden] { display: none; }
@media (max-width: 719px) { .vs-filters { grid-template-columns: 1fr 1fr; } .vs-filters input { grid-column: 1 / -1; } }

/* detail panel */
.vs-panel { padding: 14px 16px; text-align: left; }
.vs-pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 719px) { .vs-pgrid { grid-template-columns: 1fr; gap: 6px; } }
.vs-kv { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; padding: 2px 0; }
.vs-kv b { font-variant-numeric: tabular-nums; text-align: right; }
.vs-rbar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin: 1px 0 5px; }
.vs-rbar span { display: block; height: 100%; }
.vs-rbar .good { background: var(--positive); } .vs-rbar .mid { background: var(--warn); } .vs-rbar .bad { background: var(--err); }

/* dialog */
.vs-case { border: 1px solid var(--border); border-radius: 18px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: 88vh; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.vs-case::backdrop { background: rgba(8, 15, 30, .55); }
.vs-case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.vs-case-name { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; }
.vs-case-head button { padding: 4px 12px; font-size: 1.2rem; line-height: 1; }

.vs-notice h3 { margin: 18px 0 4px; }
.vs-notice ul { padding-left: 1.2em; } .vs-notice li { margin: 4px 0; font-size: .92rem; }

/* 5 languages: header on two rows on phones (same pattern as other multi-language tools) */
@media (max-width: 600px) {
  header.site .wrap { flex-wrap: wrap; row-gap: 4px; position: relative; }
  header.site .brand { padding-right: 96px; }
  header.site .site-nav { flex: 1 1 100%; flex-direction: row; justify-content: flex-start; }
  header.site .other-link { position: absolute; top: 8px; right: 16px; }
  header.site .langs { flex-wrap: wrap; max-width: 100%; }
  header.site .langs a { padding: 5px 7px; font-size: .8rem; }
}
@media print { .vs-lockbar, .vs-filters, .vs-settings { display: none !important; } }
@media (min-width: 720px) {
  .vs-tbl td.vs-first { min-width: 210px; }
  .vs-tbl td.vs-first .vs-chk { margin-right: 6px; vertical-align: -1px; }
  .vs-tbl td .vs-sub:only-child { white-space: nowrap; }
}
.vs-chart svg polyline { fill: none !important; }
.vs-chart svg { max-height: 300px; }
.vs-more { text-align: center; margin: 12px 0; }
.vs-cov { margin: -4px 0 12px; }
