/* Rhetoric Trends views. Uses only the shared tokens of tsm-strait-layers shared/css/tsm.css (the private page defines
   the same tokens). Shared verbatim by the private and public pages; keep the copies identical. */
.tr-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.tr-tabs button { border: 1px solid var(--rule); border-bottom: 0; background: transparent; padding: 7px 12px; border-radius: 3px 3px 0 0; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.tr-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.tr-caveat { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; padding: 7px 10px; border: 1px dashed var(--warn); border-radius: 4px; }
.tr-caveat b { color: var(--warn); }
.tr-view { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tr-view h3 { font-size: 17px; margin: 0 0 4px; }
.tr-view h4 { font-size: 14px; margin: 10px 0 4px; font-family: var(--display); }
.tr-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.tr-controls .pick { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.tr-controls select { font: 13.5px var(--body); padding: 5px 7px; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel); color: var(--ink); max-width: min(300px, calc(100vw - 40px)); }
.chk { font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; margin-right: 8px; }
.tr-card { padding: 10px 12px; }
.tr-card > p { margin: 0 0 6px; }
.chart { position: relative; min-width: 0; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .ref { stroke: var(--faint); stroke-dasharray: 3 3; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .ln.dash { stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .band { opacity: .18; }
.chart .nbar { fill: var(--chip); }
.chart .hot { fill: var(--panel); stroke-width: 2; }
.chart .xhair { stroke: var(--faint); stroke-width: 1; }
.chart .flag line { stroke: var(--warn); stroke-dasharray: 2 3; }
.chart .flag path { fill: var(--warn); }
.chart .dlab { font: 11px var(--mono); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.chart .tooltip { width: 280px; }
.smalls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 10px; }
.small { padding: 8px 10px; }
.sh { margin: 0 0 4px; font-size: 12.5px; overflow-wrap: anywhere; }
.evbox { padding: 10px 12px; }
.evbox h3 { margin-top: 0; }
.err { color: var(--bad); }
.count { margin: 0; font: 600 19px/1.2 var(--display); }
code { font-family: var(--mono); font-size: 11.5px; background: var(--chip); padding: 0 3px; border-radius: 3px; overflow-wrap: anywhere; }
.o-official { color: var(--good); font: 11px var(--mono); }
.o-state_media, .o-media { color: var(--warn); font: 11px var(--mono); }
/* Alerts */
.alerts, .clusters, .ev, .tp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert { background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--muted); border-radius: 4px; padding: 9px 12px; }
.alert.t-strong { border-left-color: var(--bad); }
.alert.t-moderate { border-left-color: var(--warn); }
.alert.t-weak { border-left-style: dashed; }
.ah { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 11px var(--mono); color: var(--muted); }
.ah .tier { text-transform: uppercase; font-weight: 600; color: var(--ink); letter-spacing: .06em; }
.ah .lead { border: 1px dashed var(--warn); color: var(--warn); border-radius: 3px; padding: 0 5px; }
.hd { margin: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
details > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--blue); margin: 4px 0; }
.btn.sm { font-size: 12px; padding: 4px 9px; margin: 4px 6px 0 0; }
/* Evidence */
.ev li { border-left: 2px solid var(--rule); padding: 2px 0 2px 9px; }
.ev li.withheld { border-left-style: dashed; }
.ev .m { display: flex; flex-wrap: wrap; gap: 2px 10px; font: 11.5px var(--mono); color: var(--muted); }
.ev .m b { color: var(--ink); font-weight: 500; }
.ev .s { margin: 3px 0; font-size: 14px; line-height: 1.5; }
.ev .mt { margin: 3px 0; font-weight: 600; overflow-wrap: anywhere; }
.ev .t { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
/* Heat grids */
.hgrid-wrap { overflow-x: auto; max-width: 100%; }
.hgrid { display: grid; gap: 1px; align-items: stretch; min-width: min-content; }
.hgrid .hr { font-size: 11.5px; padding-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.hgrid .hc { font: 10px var(--mono); color: var(--muted); white-space: nowrap; overflow: visible; height: 14px; }
.hgrid .hc.rot { writing-mode: vertical-rl; transform: rotate(180deg); height: auto; min-height: 70px; text-align: left; font-size: 10.5px; }
.hgrid .hx { min-height: 16px; border: 0; padding: 0; border-radius: 1px; background: transparent; }
.hgrid button.hx { cursor: pointer; }
.hgrid button.hx:hover { outline: 2px solid var(--accent); outline-offset: -1px; }
.hgrid .lown { background-image: repeating-linear-gradient(45deg, transparent 0 3px, color-mix(in oklab, var(--muted) 45%, transparent) 3px 4px) !important; }
.hlegend { display: inline-flex; flex-wrap: wrap; gap: 8px; font: 11px var(--mono); color: var(--muted); vertical-align: middle; }
.hlegend span { display: inline-flex; gap: 3px; align-items: center; }
.hlegend i { display: inline-block; width: 16px; height: 11px; border: 1px solid var(--rule); border-radius: 2px; }
/* Topics */
.tp-wrap { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 860px) { .tp-wrap { grid-template-columns: minmax(0, 1fr); } .tp-list { max-height: 240px; } }
.tp-list { max-height: 900px; overflow-y: auto; gap: 2px; }
.tp-list button { width: 100%; text-align: left; border: 1px solid var(--rule); background: transparent; border-radius: 3px; padding: 5px 8px; cursor: pointer; font-size: 12.5px; }
.tp-list button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.tp-detail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Echoes */
.cluster { padding: 9px 12px; }
.etl circle.off { fill: var(--c1); }
.etl circle.med { fill: var(--panel); stroke: var(--c2); stroke-width: 2; }
.etl { max-width: 100%; height: auto; }
/* Method */
.callout { border: 1px solid var(--warn); border-left: 4px solid var(--warn); background: var(--panel); border-radius: 4px; padding: 10px 12px; font-size: 13.5px; }
.tr-view section.tr-card p { max-width: 80ch; margin: 0 0 8px; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.lown-t { color: var(--faint); }
pre.fine { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) { .tr-tabs button { padding: 6px 8px; font-size: 12px; } .hd { font-size: 13px; } }
