/* Conventional Weapons Regime Explorer: tool styles on top of shared/css/tsm.css tokens
   (and shared/css/deterrence-site.css on the deterrence build). Tokens only, no hard-coded colours. */
:root {
  --wr-line: var(--rule-strong, var(--rule));
  --wr-soft: color-mix(in srgb, var(--brand-ink) 10%, var(--panel));
  --wr-mid: color-mix(in srgb, var(--brand-ink) 35%, var(--panel));
  --wr-warn-bg: color-mix(in srgb, var(--warn) 11%, var(--panel));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wr { margin-top: 16px; }
.wr h2, .wr h3 { line-height: 1.2; }
.notice {
  margin: 0; padding: 9px 12px; border-radius: 4px; border: 1px solid var(--warn); border-left-width: 3px;
  background: var(--wr-warn-bg); color: var(--ink); font-size: 13px; max-width: 80ch;
}
.notice strong { color: var(--warn); }

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--wr-line); margin: 18px 0 16px; }
.tabs [role="tab"] {
  font: 600 13.5px var(--body); color: var(--muted); background: none; border: 0;
  border-bottom: 3px solid transparent; padding: 9px 12px; cursor: pointer; margin-bottom: -1px;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs [role="tab"]:hover { color: var(--ink); }

.wr-view { padding-bottom: 24px; }
.wr .card { padding: 14px 16px; }
.lede { color: var(--muted); margin: 0 0 14px; max-width: 75ch; }

/* item finder */
.finder { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.wr .item-list { padding: 8px; position: sticky; top: 12px; }
.item-group { font: 600 11px var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--brand-ink); margin: 10px 8px 4px; }
.item-group:first-child { margin-top: 2px; }
.item-btn {
  display: block; width: 100%; text-align: left; font: 13.5px var(--body); color: var(--ink);
  background: none; border: 0; border-radius: 3px; padding: 6px 9px; cursor: pointer;
}
.item-btn:hover { background: var(--chip); }
.item-btn[aria-pressed="true"] { background: var(--wr-soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.item-select { display: none; width: 100%; font: 14px var(--body); padding: 8px 10px; border-radius: 4px; border: 1px solid var(--wr-line); background: var(--panel); color: var(--ink); }

.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.result-head h2 { margin: 0; font-size: 22px; }
.result-head .count { color: var(--muted); font: 12px var(--mono); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.hits { display: grid; gap: 10px; }
.wr .hit { padding: 12px 14px; }
.hit-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hit-top h3 { font-family: var(--display); font-size: 16px; margin: 0; color: var(--ink); }
.badge {
  font: 600 11px var(--body); padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--wr-line); color: var(--muted); white-space: nowrap;
}
.badge.direct { background: var(--brand-ink); border-color: var(--brand-ink); color: var(--panel); }
.badge.conditional { background: var(--wr-soft); border-color: var(--wr-mid); color: var(--brand-ink); }
.prov { font-family: var(--mono); font-size: 12px; color: var(--brand-ink); margin: 6px 0 2px; }
.hit p { margin: 4px 0 8px; }
.hit-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.linkbtn { font: inherit; font-size: 13px; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.regime-detail { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--wr-line); font-size: 13.5px; }
.regime-detail dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0 0 8px; }
.regime-detail dt { color: var(--muted); font-size: 12.5px; }
.regime-detail dd { margin: 0; }
.regime-detail ul { margin: 4px 0 8px; padding-left: 18px; }
.regime-detail li { margin: 3px 0; }
.regime-detail h4 { font: 600 11.5px var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 10px 0 2px; }
.verified { font-size: 12px; color: var(--muted); }
.absent { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* info view */
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.info-grid .card h3 { margin-top: 0; font-size: 19px; }
.info-grid .card p, .info-grid .card li { font-size: 14px; }
.info-wide { grid-column: 1 / -1; }
.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px dotted var(--wr-line); }
.compare th { font: 600 12px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--wr-line); }
.compare td:first-child { font-weight: 600; color: var(--brand-ink); width: 22%; }
.wr .analysis { border-left: 3px solid var(--warn); }
.analysis .tag { display: inline-block; font: 700 11px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--warn); background: var(--wr-warn-bg); padding: 2px 8px; border-radius: 3px; margin-bottom: 6px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 0 0 12px 22px; }
.steps li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.steps li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--wr-line); }
.steps li:last-child::after { display: none; }
.steps time { font: 500 12.5px var(--mono); color: var(--brand-ink); display: block; }
.cite { font-size: 12.5px; }

/* map */
.map-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--wr-line); border-radius: 999px; overflow: hidden; }
.seg button { font: 600 12.5px var(--body); background: transparent; color: var(--muted); border: 0; padding: 6px 13px; cursor: pointer; border-right: 1px solid var(--wr-line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand, var(--panel)); }
.scroll-x { overflow-x: auto; border: 1px solid var(--wr-line); border-radius: 4px; background: var(--panel); }
table.matrix { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.matrix th, .matrix td { border-bottom: 1px dotted var(--wr-line); padding: 0; text-align: center; }
.matrix thead th { font: 600 11.5px var(--body); color: var(--muted); padding: 8px 2px; vertical-align: bottom; width: 40px; min-width: 40px; line-height: 1.2; border-bottom: 1px solid var(--wr-line); }
.matrix thead th .vh { display: inline-block; writing-mode: vertical-rl; text-orientation: sideways; transform: rotate(180deg); white-space: nowrap; text-align: left; }
.matrix thead th .vh .jur { margin: 0 0 0 2px; }
.scroll-hint { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); text-align: right; }
.matrix tbody th { text-align: left; font-weight: 500; padding: 8px 12px; white-space: nowrap; position: sticky; left: 0; background: var(--panel); z-index: 1; border-right: 1px solid var(--wr-line); }
.matrix .jur { display: block; font: 400 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.cellbtn { width: 100%; min-height: 36px; background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cellbtn:hover { background: var(--chip); }
.cellbtn[aria-pressed="true"] { background: var(--wr-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.dot.direct { background: var(--brand-ink); }
.dot.conditional { background: linear-gradient(90deg, var(--brand-ink) 50%, transparent 50%); border: 1.5px solid var(--brand-ink); }
.dot.none { width: 6px; height: 6px; background: var(--wr-line); }
.wr .cell-info { margin: 12px 0 0; min-height: 48px; font-size: 13.5px; }
.timeline { margin-top: 28px; }
.timeline h2 { font-size: 22px; margin: 0 0 4px; }
.tl-year { font: 700 17px var(--display); color: var(--brand-ink); margin: 16px 0 6px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--wr-line); font-size: 13.5px; }
.tl time { color: var(--muted); font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.tl .rg { font: 600 11px var(--body); color: var(--brand-ink); background: var(--wr-soft); border-radius: 3px; padding: 1px 6px; margin-right: 6px; white-space: nowrap; }

/* method */
.method h3 { font-size: 19px; }
.method p, .method li { max-width: 80ch; }
.src-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.src-table th, .src-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px dotted var(--wr-line); }
.src-table th { font: 600 12px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--wr-line); }
.src-table ul { margin: 0; padding-left: 16px; }

@media (max-width: 820px) {
  .finder { grid-template-columns: minmax(0, 1fr); }
  .wr .item-list { display: none; }
  .item-select { display: block; margin-bottom: 14px; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .tabs [role="tab"] { padding: 8px 8px; font-size: 13px; }
  .regime-detail dl { grid-template-columns: 1fr; }
  .tl li { grid-template-columns: 1fr; gap: 2px; }
  .compare td:first-child { width: auto; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; }
  .compare thead { display: none; }
  .compare td { border-bottom: 0; padding: 4px 0; }
  .compare tr { border-bottom: 1px dotted var(--wr-line); padding: 8px 0; }
  .compare td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; color: var(--brand-ink); }
}
