/* Who Represents Me? (Texas) — Texans for Terms styling */
.wrmtx {
  /* Palette (matches texansforterms.com) */
  --wrmtx-hero: #002868;
  --wrmtx-hero-deep: #001B47;
  --wrmtx-primary: #BF0A30;
  --wrmtx-primary-c: #FFFFFF;
  --wrmtx-ink: #14181F;
  --wrmtx-text: #333A45;
  --wrmtx-muted: #6B7280;
  --wrmtx-surface: #F6F4EF;
  --wrmtx-sand: #EDE7DA;
  --wrmtx-card: #FFFFFF;
  --wrmtx-line: #DCDFE5;
  --wrmtx-ussenate: #002868;
  --wrmtx-ushouse: #BF0A30;
  --wrmtx-txsenate: #0A3A8B;
  --wrmtx-txhouse: #8E0722;
  --wrmtx-sboe: #4A6FA5;

  --wrmtx-display: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --wrmtx-radius: 4px;
  --wrmtx-gap: 18px;
  --wrmtx-cols: 3;
  --wrmtx-map-h: 380px;
  --wrmtx-shadow: 0 2px 10px rgba(0, 40, 104, .08);
  --wrmtx-shadow-lg: 0 14px 40px rgba(0, 40, 104, .14);

  max-width: 1120px;
  margin-inline: auto;
  color: var(--wrmtx-text);
  font-size: 16px;
  line-height: 1.6;
  box-sizing: border-box;
}
.wrmtx *, .wrmtx *::before, .wrmtx *::after { box-sizing: inherit; }
.wrmtx [hidden] { display: none !important; }

/* ------------------------------------------------------------------ */
/* Hero: navy banner with heading + white search card                 */
/* ------------------------------------------------------------------ */
.wrmtx-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: center;
  padding: 44px 44px 48px;
  border-radius: var(--wrmtx-radius);
  background:
    linear-gradient(135deg, var(--wrmtx-hero) 0%, var(--wrmtx-hero) 55%, var(--wrmtx-hero-deep) 100%);
  color: #fff;
  box-shadow: var(--wrmtx-shadow-lg);
}
/* Flag stripe along the bottom edge */
.wrmtx-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 1;
  background: var(--wrmtx-primary);
}
.wrmtx-hero-star {
  position: absolute; z-index: -1; width: 420px; height: 400px; left: -90px; top: -70px;
  color: rgba(255, 255, 255, .045); pointer-events: none;
}
.wrmtx-hero:not(:has(.wrmtx-header)) { grid-template-columns: 1fr; }

.wrmtx-header { margin: 0; }
.wrmtx-kicker {
  display: inline-block; margin-bottom: 16px; padding: 5px 12px; border-radius: 999px;
  background: var(--wrmtx-primary); color: var(--wrmtx-primary-c);
  font-family: var(--wrmtx-display); font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; line-height: 1.3;
}
.wrmtx .wrmtx-title {
  margin: 0 0 14px; color: #fff; font-family: var(--wrmtx-display);
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); line-height: 1.08; font-weight: 700; letter-spacing: .005em; text-transform: none;
}
.wrmtx .wrmtx-intro { margin: 0; max-width: 46ch; color: rgba(255, 255, 255, .84); font-size: 1.02rem; }

.wrmtx-search {
  background: var(--wrmtx-card); color: var(--wrmtx-text);
  border-radius: var(--wrmtx-radius); padding: 22px 24px 24px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
  border-top: 5px solid var(--wrmtx-primary);
}

/* Underline tabs */
.wrmtx-tabs { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 2px solid var(--wrmtx-line); }
.wrmtx .wrmtx-tab {
  appearance: none; border: 0; background: transparent; color: var(--wrmtx-muted); box-shadow: none; min-height: 0;
  font-family: var(--wrmtx-display); font-weight: 600; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 12px 11px; margin-bottom: -2px; border-bottom: 3px solid transparent; border-radius: 0;
  cursor: pointer; transition: color .15s, border-color .15s; line-height: 1.2; flex: 1 1 auto; white-space: nowrap;
}
.wrmtx .wrmtx-tab:hover { color: var(--wrmtx-hero); background: transparent; }
.wrmtx .wrmtx-tab[aria-selected="true"] { color: var(--wrmtx-hero); border-bottom-color: var(--wrmtx-primary); background: transparent; }
.wrmtx .wrmtx-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--wrmtx-hero) 35%, transparent); outline-offset: 2px; }

.wrmtx-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.wrmtx-span-2 { grid-column: 1 / -1; }
.wrmtx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wrmtx .wrmtx-field label { font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--wrmtx-hero); margin: 0; }
.wrmtx .wrmtx-field input, .wrmtx .wrmtx-field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--wrmtx-ink); background: var(--wrmtx-surface);
  border: 1.5px solid transparent; border-radius: var(--wrmtx-radius); padding: 12px 14px; min-height: 48px; margin: 0;
  transition: border-color .15s, box-shadow .15s, background .15s; box-shadow: none;
}
.wrmtx .wrmtx-field input::placeholder { color: #9AA1AC; }
.wrmtx .wrmtx-field input:focus, .wrmtx .wrmtx-field select:focus {
  outline: none; background: #fff; border-color: var(--wrmtx-hero); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wrmtx-hero) 14%, transparent);
}
.wrmtx-hint { font-size: .84rem; color: var(--wrmtx-muted); margin: 0; }
.wrmtx-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.wrmtx .wrmtx-btn {
  appearance: none; font-family: var(--wrmtx-display); font-weight: 600; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.2; cursor: pointer; border-radius: var(--wrmtx-radius); padding: 14px 26px; border: 0; min-height: 0;
  transition: transform .1s, background .15s, box-shadow .15s, color .15s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.wrmtx .wrmtx-btn-primary { background: var(--wrmtx-primary); color: var(--wrmtx-primary-c); width: 100%; }
.wrmtx .wrmtx-btn-primary:hover { background: color-mix(in srgb, var(--wrmtx-primary) 78%, #000); color: var(--wrmtx-primary-c); }
.wrmtx .wrmtx-btn-primary:active { transform: translateY(1px); }
.wrmtx .wrmtx-btn:disabled { opacity: .75; cursor: progress; }
.wrmtx .wrmtx-btn.is-busy::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: wrmtx-spin .7s linear infinite;
}
@keyframes wrmtx-spin { to { transform: rotate(360deg); } }
.wrmtx .wrmtx-btn-ghost {
  background: transparent; color: var(--wrmtx-hero); padding: 9px 14px; font-size: .8rem;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--wrmtx-hero) 35%, transparent);
}
.wrmtx .wrmtx-btn-ghost:hover { background: var(--wrmtx-hero); color: #fff; box-shadow: inset 0 0 0 1.5px var(--wrmtx-hero); }
.wrmtx .wrmtx-btn:focus-visible, .wrmtx .wrmtx-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--wrmtx-hero) 40%, transparent); outline-offset: 2px; }

.wrmtx-error { margin-top: 14px; padding: 12px 16px; border-radius: var(--wrmtx-radius); background: #FCE8EC; color: var(--wrmtx-txhouse, #8E0722); font-weight: 600; font-size: .95rem; border-left: 4px solid var(--wrmtx-primary); }

/* ------------------------------------------------------------------ */
/* Results                                                            */
/* ------------------------------------------------------------------ */
.wrmtx-results { margin-top: 32px; outline: none; }

.wrmtx-summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: var(--wrmtx-radius); background: var(--wrmtx-surface);
  border-left: 6px solid var(--wrmtx-primary);
}
.wrmtx-summary-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wrmtx-where { font-family: var(--wrmtx-display); font-size: 1.45rem; line-height: 1.2; font-weight: 600; color: var(--wrmtx-hero); overflow-wrap: anywhere; letter-spacing: .01em; }
.wrmtx-sub { color: var(--wrmtx-muted); font-size: .92rem; }
.wrmtx-summary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wrmtx-eyebrow { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--wrmtx-primary); }

.wrmtx-notice { margin-top: 12px; padding: 12px 16px; border-radius: var(--wrmtx-radius); background: color-mix(in srgb, var(--wrmtx-hero) 6%, #fff); color: var(--wrmtx-ink); font-size: .95rem; border-left: 4px solid var(--wrmtx-hero); }
.wrmtx-notice-warn { background: #FFF6E0; border-left-color: #D99A00; }

.wrmtx-map-wrap { margin-top: 18px; border-radius: var(--wrmtx-radius); overflow: hidden; background: var(--wrmtx-surface); box-shadow: var(--wrmtx-shadow); }
.wrmtx-map { height: var(--wrmtx-map-h); width: 100%; z-index: 0; }
.wrmtx-map-legend { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: .88rem; font-weight: 600; color: var(--wrmtx-hero); min-height: 40px; }

.wrmtx-offices { display: flex; flex-direction: column; gap: 30px; margin-top: 28px; }
.wrmtx-office-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wrmtx .wrmtx-office-title {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--wrmtx-display); font-size: 1.35rem; line-height: 1.2; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--wrmtx-hero);
}
.wrmtx-star { color: var(--wrmtx-oc, var(--wrmtx-primary)); font-size: .95em; line-height: 1; }
.wrmtx-office-count {
  font-family: var(--wrmtx-display); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: #fff; background: var(--wrmtx-oc, var(--wrmtx-primary)); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

.wrmtx-cards { display: grid; grid-template-columns: repeat(var(--wrmtx-cols), minmax(0, 1fr)); gap: var(--wrmtx-gap); }
.wrmtx-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--wrmtx-card); border-radius: var(--wrmtx-radius); padding: 20px 20px 18px 22px; overflow: hidden;
  box-shadow: var(--wrmtx-shadow); border: 1px solid color-mix(in srgb, var(--wrmtx-line) 70%, transparent);
  transition: box-shadow .2s, transform .2s;
}
.wrmtx-card:hover { box-shadow: var(--wrmtx-shadow-lg); transform: translateY(-2px); }
.wrmtx-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--wrmtx-oc); }
.wrmtx-card-top { display: flex; gap: 14px; align-items: center; }
.wrmtx-photo { width: 66px; height: 80px; object-fit: cover; border-radius: var(--wrmtx-radius); flex: none; background: var(--wrmtx-surface); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--wrmtx-line); }
.wrmtx-initials {
  width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--wrmtx-display); font-weight: 600; font-size: 1.2rem; letter-spacing: .04em; color: #fff; background: var(--wrmtx-oc);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px color-mix(in srgb, var(--wrmtx-oc) 35%, transparent);
}
.wrmtx-initials.is-vacant { background: var(--wrmtx-sand); color: var(--wrmtx-muted); box-shadow: none; }
.wrmtx-ident { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wrmtx-nowrap { white-space: nowrap; }
.wrmtx-role { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wrmtx-oc); }
.wrmtx .wrmtx-name { margin: 0; font-family: var(--wrmtx-display); font-size: 1.35rem; line-height: 1.15; font-weight: 600; color: var(--wrmtx-ink); overflow-wrap: anywhere; letter-spacing: .005em; text-transform: none; }
.wrmtx .wrmtx-name.is-vacant { color: var(--wrmtx-muted); }
.wrmtx-note { margin: 0; font-size: .9rem; color: var(--wrmtx-text); }

.wrmtx-contacts { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--wrmtx-surface); border-radius: var(--wrmtx-radius); }
.wrmtx-contact { display: flex; flex-direction: column; gap: 1px; font-size: .9rem; }
.wrmtx-contact-label { font-size: .7rem; font-weight: 700; color: var(--wrmtx-muted); text-transform: uppercase; letter-spacing: .1em; }
.wrmtx-contact address { font-style: normal; white-space: pre-line; color: var(--wrmtx-text); margin: 0; }
.wrmtx .wrmtx-phone { color: var(--wrmtx-hero); font-weight: 700; text-decoration: none; }
.wrmtx .wrmtx-phone:hover { color: var(--wrmtx-primary); text-decoration: underline; }

.wrmtx-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.wrmtx .wrmtx-link {
  appearance: none; font-family: var(--wrmtx-display); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.2; cursor: pointer; text-decoration: none; padding: 9px 14px; border-radius: var(--wrmtx-radius); border: 0;
  background: transparent; color: var(--wrmtx-hero); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--wrmtx-hero) 30%, transparent);
  transition: background .15s, color .15s, box-shadow .15s; min-height: 0;
}
.wrmtx .wrmtx-link:hover { background: var(--wrmtx-hero); color: #fff; box-shadow: inset 0 0 0 1.5px var(--wrmtx-hero); }
.wrmtx .wrmtx-link-primary { background: var(--wrmtx-primary); color: var(--wrmtx-primary-c); box-shadow: none; }
.wrmtx .wrmtx-link-primary:hover { background: color-mix(in srgb, var(--wrmtx-primary) 78%, #000); color: var(--wrmtx-primary-c); box-shadow: none; }
.wrmtx .wrmtx-link-call::before { content: "\260E"; margin-right: 6px; font-family: system-ui, sans-serif; letter-spacing: 0; }
.wrmtx .wrmtx-link.is-active { background: var(--wrmtx-hero); color: #fff; box-shadow: none; }

/* Office color mapping */
.wrmtx .wrmtx-o-ussenate { --wrmtx-oc: var(--wrmtx-ussenate); }
.wrmtx .wrmtx-o-ushouse { --wrmtx-oc: var(--wrmtx-ushouse); }
.wrmtx .wrmtx-o-txsenate { --wrmtx-oc: var(--wrmtx-txsenate); }
.wrmtx .wrmtx-o-txhouse { --wrmtx-oc: var(--wrmtx-txhouse); }
.wrmtx .wrmtx-o-sboe { --wrmtx-oc: var(--wrmtx-sboe); }
.wrmtx-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--wrmtx-oc, var(--wrmtx-primary)); margin-right: 8px; flex: none; }

/* Upcoming districts */
.wrmtx-future { margin-top: 34px; padding: 26px; border-radius: var(--wrmtx-radius); background: var(--wrmtx-surface); border-top: 5px solid var(--wrmtx-hero); }
.wrmtx-future .wrmtx-eyebrow { margin-bottom: 6px; }
.wrmtx-future-intro { margin: 8px 0 16px; font-size: .95rem; max-width: 72ch; }
.wrmtx-table-wrap { overflow-x: auto; border-radius: var(--wrmtx-radius); background: var(--wrmtx-card); box-shadow: var(--wrmtx-shadow); }
.wrmtx .wrmtx-table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 0; border: 0; }
.wrmtx .wrmtx-table th, .wrmtx .wrmtx-table td { text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--wrmtx-line); background: transparent; vertical-align: middle; }
.wrmtx .wrmtx-table thead th { background: var(--wrmtx-hero); color: #fff; font-family: var(--wrmtx-display); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.wrmtx .wrmtx-table tbody tr:last-child th, .wrmtx .wrmtx-table tbody tr:last-child td { border-bottom: 0; }
.wrmtx .wrmtx-table tbody th { color: var(--wrmtx-ink); font-weight: 700; white-space: nowrap; }
.wrmtx .wrmtx-table td { font-family: var(--wrmtx-display); font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--wrmtx-hero); font-weight: 600; }
.wrmtx .wrmtx-table tr.is-changed td:last-child { color: var(--wrmtx-primary); }
.wrmtx .wrmtx-badge {
  appearance: none; border: 0; cursor: help; display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-family: var(--wrmtx-display); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; line-height: 1.2;
  padding: 4px 6px 4px 9px; border-radius: 999px; white-space: nowrap; background: var(--wrmtx-primary); color: #fff; vertical-align: 2px; min-height: 0; box-shadow: none;
}
.wrmtx .wrmtx-badge:hover { background: color-mix(in srgb, var(--wrmtx-primary) 80%, #000); color: #fff; }
.wrmtx .wrmtx-badge:focus-visible { outline: 3px solid color-mix(in srgb, var(--wrmtx-primary) 40%, transparent); outline-offset: 2px; }
.wrmtx-badge-i {
  display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: .7rem; letter-spacing: 0; text-transform: none;
}
.wrmtx-tip[hidden] { display: none !important; }
.wrmtx-tip {
  position: fixed; z-index: 99999; max-width: min(320px, calc(100vw - 16px)); padding: 12px 14px; border-radius: var(--wrmtx-radius, 4px); box-sizing: border-box;
  background: var(--wrmtx-hero-deep, #001B47); color: #fff; font-size: .86rem; line-height: 1.5; font-weight: 400; text-transform: none; letter-spacing: 0;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .4); pointer-events: none;
}
.wrmtx-tip::after {
  content: ""; position: absolute; left: var(--wrmtx-tip-x, 50%); top: 100%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--wrmtx-hero-deep, #001B47);
}
.wrmtx-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--wrmtx-hero-deep, #001B47); }

.wrmtx .wrmtx-badge.is-same { background: var(--wrmtx-sand); color: var(--wrmtx-muted); }
.wrmtx .wrmtx-badge.is-same:hover { background: color-mix(in srgb, var(--wrmtx-sand) 85%, #000); color: var(--wrmtx-ink); }
.wrmtx .wrmtx-badge.is-same .wrmtx-badge-i { background: rgba(0, 0, 0, .1); }
.wrmtx .wrmtx-table tr:not(.is-changed) td:last-child { color: var(--wrmtx-hero); }
.wrmtx-future-note { margin: 14px 0 0; font-size: .92rem; color: var(--wrmtx-text); }

.wrmtx-footnote { margin: 26px 0 0; font-size: .84rem; color: var(--wrmtx-muted); max-width: 80ch; }

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .wrmtx { --wrmtx-cols: 2; }
  .wrmtx-hero { grid-template-columns: 1fr; gap: 26px; padding: 36px 30px 40px; }
  .wrmtx .wrmtx-intro { max-width: 64ch; }
}
@media (max-width: 640px) {
  .wrmtx { --wrmtx-cols: 1; }
  .wrmtx-hero { padding: 28px 18px 32px; }
  .wrmtx-search { padding: 16px 16px 20px; }
  .wrmtx-panel { grid-template-columns: 1fr; }
  .wrmtx .wrmtx-tab { padding: 10px 6px 11px; font-size: .8rem; letter-spacing: .05em; }
  .wrmtx-summary { padding: 16px; }
  .wrmtx-future { padding: 18px; }
  .wrmtx .wrmtx-table th, .wrmtx .wrmtx-table td { padding: 10px 10px; }
  .wrmtx .wrmtx-table td .wrmtx-badge { margin: 6px 0 0; display: flex; width: fit-content; }
}

@media (prefers-reduced-motion: reduce) { .wrmtx * { transition: none !important; animation-duration: 0s !important; } }

@media print {
  .wrmtx-tip, .wrmtx-badge-i,
  .wrmtx-hero, .wrmtx-summary-actions, .wrmtx-links, .wrmtx-map-wrap { display: none !important; }
  .wrmtx-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .wrmtx-cards { grid-template-columns: repeat(2, 1fr); }
}
