/* Every Nuclear Test: tool styles on top of shared/css/tsm.css tokens. */
.nt-card { padding: 12px 14px 12px; }
.nt-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.nt-head h2 { margin: 0; font-size: 20px; }
.nt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-chart { position: relative; margin-top: 6px; }
.nt-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.nt-chart .grid line { stroke: var(--rule); stroke-width: 1; }
.nt-chart .bar { stroke: none; }
.nt-chart .empty { fill: var(--muted); font-size: 13px; paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; }
.nt-chart .after { fill: var(--panel); opacity: .55; pointer-events: none; }
.nt-chart .cursor { stroke: var(--ink); stroke-width: 1.2; }
.nt-chart .cursor-lab { font: 600 12px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.nt-chart .ms-line { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 3; }
.nt-chart .ms { cursor: pointer; outline: none; }
.nt-chart .ms rect { fill: var(--panel); stroke: var(--brand-ink); stroke-width: 1.5; }
.nt-chart .ms text { font: 600 10.5px var(--mono); fill: var(--brand-ink); }
.nt-chart .ms.on rect { fill: var(--brand-ink); }
.nt-chart .ms.on text { fill: var(--panel); }
.nt-chart .ms:focus-visible rect { stroke: var(--focus); stroke-width: 3; }
.tsm-axis text { font: var(--axis-font); fill: var(--axis-ink); }
.nt-scrub { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; margin-top: 6px; }
.nt-scrub input[type=range] { width: 100%; accent-color: var(--brand-ink); }
.nt-scrub .btn { min-width: 64px; }
.nt-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.nt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; vertical-align: -1px; }

/* Panel */
.nt-year { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; margin: 0; }
.nt-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nt-kpi { border: 1px solid var(--rule); border-radius: 4px; padding: 8px 10px; }
.nt-kpi b { display: block; font: 600 20px var(--mono); font-variant-numeric: tabular-nums; }
.nt-kpi span { font-size: 11.5px; color: var(--muted); }
.nt-two { grid-template-columns: 1fr 1fr; }
.nt-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-quick .btn { font-size: 12px; padding: 4px 9px; }
.nt-clist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nt-clist li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 3px; }
.nt-clist li:hover { background: var(--chip); }
.nt-clist input { margin: 0; width: 16px; height: 16px; accent-color: var(--brand-ink); }
.nt-clist label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; min-width: 0; }
.nt-clist .v { font: 12px var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.nt-clist li.off label { color: var(--faint); }
.nt-ylist { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.nt-ylist label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.nt-ylist input { accent-color: var(--brand-ink); width: 16px; height: 16px; margin: 0; }
.nt-ylist .num, .tg .num { margin-left: auto; }
.tg .t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nt-ms-card { border-left: 3px solid var(--brand-ink); padding: 2px 0 2px 10px; }
.nt-ms-card h3 { margin: 0 0 2px; font-size: 16px; }
.nt-ms-card p { margin: 0 0 4px; font-size: 13px; }
.nt-ms-card .d { font: 11.5px var(--mono); color: var(--muted); }
.nt-ms-card q { font-style: italic; }

/* Map and lower cards */
.nt-more { max-width: 1400px; margin: 16px auto 0; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1020px) { .nt-more { grid-template-columns: minmax(0, 1fr); } }
.nt-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.nt-sub h2 { margin: 0; font-size: 20px; }
.nt-map { margin-top: 8px; }
.nt-map svg { touch-action: manipulation; }
.nt-site { cursor: pointer; outline: none; }
.nt-site .dot { fill-opacity: .72; stroke: var(--panel); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.nt-site .ring { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.nt-site.on .dot { stroke: var(--ink); stroke-width: 2.5; fill-opacity: .9; }
.nt-site:focus-visible .dot { stroke: var(--focus); stroke-width: 3; }
.nt-site .lab { font: 600 17px var(--body); fill: var(--ink); paint-order: stroke; stroke: var(--sea); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.nt-offsite-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.nt-offsite { font-size: 12px; padding: 4px 9px; }
.nt-site-card { margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 10px; }
.nt-site-card h3 { margin: 0 0 2px; font-size: 18px; }
.nt-site-card .readout { margin-top: 6px; }
.nt-big { margin-top: 6px; }
.nt-recon table td.num, .nt-recon table th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nt-recon .tablewrap { margin-top: 8px; }
.nt-recon .nt-scrollhint { margin: 8px 0 -2px; text-align: right; }
.nt-recon tr.hl td { background: var(--chip); font-weight: 600; }
.nt-recon ul { margin: 8px 0 0; padding-left: 1.1em; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.nt-steward { max-width: 1400px; margin: 16px auto 0; padding: 14px 16px; }
.nt-steward h2 { margin: 0 0 6px; font-size: 20px; }
.nt-steward blockquote { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); font-size: 13.5px; }
.nt-steward blockquote cite { display: block; font: 11.5px var(--mono); color: var(--muted); font-style: normal; margin-top: 3px; }
.nt-steward .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 24px; }

/* Walkthrough */
.nt-tour { position: fixed; right: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 4px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); z-index: 30; }
.nt-tour[hidden] { display: none; }
.nt-tour .th { display: flex; justify-content: space-between; align-items: center; font: 600 11.5px var(--mono); color: var(--muted); }
.nt-tour .x { border: 0; background: transparent; color: var(--ink); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.nt-tour h3 { margin: 6px 0 4px; font-size: 18px; }
.nt-tour p { margin: 0 0 10px; font-size: 13.5px; }
.nt-tour .tn { display: flex; justify-content: space-between; gap: 8px; }
.below h3 { font-family: var(--display); font-size: 17px; margin: 14px 0 4px; }
.below .src li { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .nt-year { font-size: 36px; }
  .nt-tour { right: 8px; left: 8px; bottom: 8px; width: auto; }
  .nt-card, .nt-steward { padding: 10px; }
}
.nt-recon { grid-column: 1 / -1; }
.nt-recon td.diff { color: var(--warn); font-weight: 600; }
.nt-recon table td:first-child { min-width: 220px; }
.nt-steward p { margin: 0 0 8px; font-size: 13.5px; }

/* Desktop: the side panel is never taller than the main column (or the window) and scrolls inside itself, so it no
   longer runs below the chart and leaves an empty band beside it; it stays in view while a long main column scrolls.
   Same rule in nuclear-arsenals, nuclear-tests, declaratory-policy and proliferation-paths. */
@media (min-width: 1021px) {
  .layout > .panel { position: sticky; top: 12px; height: 0; min-height: min(100%, calc(100vh - 24px)); overflow-y: auto; overscroll-behavior: contain; }
}
