/* U.S. state & local tax system — map, ranking, per-state detail */

#usTaxMap, #usTaxRanking, #usTaxDetail { font-family: var(--font-sans, system-ui, sans-serif); }

.tx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.tx-title { font-family: var(--font-serif); font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.tx-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tx-head .tx-toggle { margin: 0; }

.tx-toggle { display: inline-flex; margin: 12px 0 8px; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.tx-toggle button {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  padding: 7px 16px; background: var(--bg); color: var(--text-dim); border: none; cursor: pointer;
  transition: background .18s, color .18s;
}
.tx-toggle button + button { border-left: 1px solid var(--border-light); }
.tx-toggle button.on { background: var(--gold); color: #1a1205; font-weight: 700; }
.tx-toggle button:not(.on):hover { color: var(--text); }

.tx-levelrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 4px; }
.tx-levellbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dimmer); }

.tx-sub { font-size: 11.5px; color: var(--text-dimmer); line-height: 1.55; margin: 6px 0 10px; max-width: 760px; }

.tx-svg-wrap { position: relative; width: 100%; }
.tx-svg-wrap svg { width: 100%; height: auto; display: block; }

.tx-geo { stroke: var(--bg); stroke-width: 0.6px; cursor: pointer; transition: fill .25s, opacity .15s; }
.tx-geo:hover { opacity: 0.85; }
.tx-geo.sel { stroke: var(--gold-bright, #f0b54a); stroke-width: 1.6px; }
.tx-sphere { fill: #11151b; stroke: var(--border); stroke-width: 0.5px; }
.tx-best { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--gold-bright, #f0b54a); border: 1px solid var(--gold-dim, #7a5a1e); border-radius: 4px; padding: 1px 5px; margin-left: 6px; white-space: nowrap; }

.tx-tooltip {
  position: absolute; pointer-events: none; opacity: 0; z-index: 10;
  background: var(--bg2); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 9px 12px; font-size: 12.5px; color: var(--text); line-height: 1.5;
  box-shadow: 0 14px 40px -16px rgba(0,0,0,0.7); transition: opacity .12s; max-width: 240px;
}
.tx-tooltip strong { font-family: var(--font-serif); font-size: 14px; }
.tx-tooltip .tt-dim { color: var(--text-dimmer); font-size: 11.5px; }
.tx-tooltip .tt-hot { color: var(--gold-bright, #f0b54a); font-weight: 700; }

.tx-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.tx-legend-bar { flex: 0 0 200px; height: 10px; border-radius: 5px; }
.tx-legend-nd { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; }
.tx-legend-nd i { width: 12px; height: 12px; border-radius: 3px; background: #222831; display: inline-block; }

/* ── Ranking ── */
.tx-rank-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: nowrap; }
.tx-rank-head > span:first-child { font-family: var(--font-serif); font-size: 16px; font-weight: 800; color: var(--text); white-space: nowrap; }
.tx-rank-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dimmer); letter-spacing: 0.02em; white-space: nowrap; }
.tx-rank-list { display: flex; flex-direction: column; gap: 2px; }
.tx-rank-row {
  display: grid; grid-template-columns: 28px 1fr 120px 56px; align-items: center; gap: 12px;
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 7px 10px; border-radius: 7px; color: var(--text); transition: background .15s;
}
.tx-rank-row:hover { background: var(--bg2); }
.tx-rank-row.sel { background: rgba(200,146,42,0.14); }
.tx-rank-n { font-family: var(--font-mono); font-size: 12px; color: var(--text-dimmer); text-align: right; }
.tx-rank-name { font-size: 14px; }
.tx-rank-barwrap { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.tx-rank-bar { display: block; height: 100%; background: linear-gradient(90deg, #c8922a, #e8703f); border-radius: 4px; }
.tx-rank-val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text); text-align: right; }

/* ── Detail panel ── */
.tx-detail-empty { color: var(--text-dim); font-size: 14px; line-height: 1.65; padding: 28px 4px; }
.tx-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.tx-detail-name { font-family: var(--font-serif); font-size: 26px; font-weight: 900; color: var(--text); letter-spacing: -0.02em; }
.tx-detail-burden { font-family: var(--font-mono); font-size: 15px; color: var(--gold-bright, #f0b54a); font-weight: 700; margin-top: 2px; }
.tx-detail-burden span { color: var(--text-dimmer); font-weight: 400; }
.tx-detail-tot { text-align: right; }
.tx-detail-tot-big { font-family: var(--font-serif); font-size: 22px; font-weight: 800; color: var(--text); }
.tx-detail-tot-lbl { font-size: 11px; color: var(--text-dimmer); font-family: var(--font-mono); letter-spacing: 0.03em; }
.tx-detail-tot-split { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

.tx-detail-levelrow { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.tx-detail-toggle { margin: 0; }

.tx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-table th, .tx-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tx-table thead th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dimmer); font-weight: 600; text-align: left; vertical-align: bottom; }
.tx-table th.shr { white-space: normal; max-width: 78px; line-height: 1.25; }
.tx-table td.shr { color: var(--text-dimmer); font-variant-numeric: tabular-nums; }
.tx-table th.num, .tx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tx-table tr.lvl0 td { color: var(--text); font-weight: 600; }
.tx-table tr.lvl1 td { color: var(--text-dim); font-weight: 400; }
.tx-table tr.lvl2 td { color: var(--text-dimmer); font-size: 12.5px; }
.tx-table td.num { color: var(--text-dim); }
.tx-table td.act, .tx-table th.act { color: var(--gold-bright, #f0b54a); font-weight: 700; }
.tx-table tfoot td { font-family: var(--font-serif); font-weight: 800; color: var(--text); border-top: 2px solid var(--border-light); border-bottom: none; padding-top: 10px; }
.tx-detail-src { font-size: 11px; color: var(--text-dimmer); margin-top: 14px; line-height: 1.5; }

@media (max-width: 600px) {
  .tx-table { font-size: 12px; }
  .tx-table th.num:nth-child(3), .tx-table td.num:nth-child(3),
  .tx-table th.num:nth-child(4), .tx-table td.num:nth-child(4) { display: none; }
  .tx-rank-row { grid-template-columns: 24px 1fr 70px 48px; }
}
