@font-face {
  font-family: "Noto Sans CJK TC";
  src: url("./fonts/NotoSansCJKtc-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans CJK TC";
  src: url("./fonts/NotoSansCJKtc-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif CJK TC";
  src: local("Noto Serif CJK TC"), local("Noto Serif CJK TC Bold");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif CJK TC";
  src: local("Noto Serif CJK TC");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #e9e9e6;
  --record-sink: #e9e9e6;
  --ink: #161410;
  --muted: #4a4a47;
  --line: #c9c9c5;
  --line-strong: #161410;
  --red: #b01020;
  --red-soft: #f4e8e2;
  --stamp: #8b1e1e;
  --tag-crime: #8a1515;
  --tag-void: #2f3f8f;
  --tag-family: #1b5e45;
  --tag-dui: #8a4b00;
  --tag-sex: #8a1540;
  --map-idle: #e2e2de;
  --map-hover: #d5d5d0;
  --radius: 4px;
  --radius-photo: 6px;
  --shadow: none;
  --font-sans: "Noto Sans CJK TC", "Noto Sans CJK", "PingFang TC", system-ui, sans-serif;
  --font-serif: "Noto Serif CJK TC", "Noto Serif CJK", "Source Han Serif TC", "Songti TC", serif;
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { font-size: 18px; }
body {
  color: var(--ink);
  background-color: var(--bg);
  background-image: none;
  background-blend-mode: normal;
  background-repeat: repeat;
  background-size: 220px 220px;
  min-height: 100vh;
  font-size: 18px;
  line-height: 1.6;
}
.wrap { position: relative; z-index: 1; }

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--red); }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* —— Hero / 報頭 —— */
.hero {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 0 18px;
  box-shadow: none;
}
.mast {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 3px solid var(--line-strong);
}
.brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
}
.brand em {
  color: var(--red);
  font-style: normal;
  font-size: 15px;
  letter-spacing: 0.06em;
  margin-left: 8px;
}
.hero-meta {
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(36px, 7vw, 48px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--ink);
}
.hero h1 span { color: var(--red); }
.lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 40em;
}
.search-wrap {
  position: relative;
  display: block;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink);
  display: flex;
  pointer-events: none;
}
.search {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border-radius: var(--radius);
  border: 2px solid var(--line-strong);
  font-size: 18px;
  font-family: inherit;
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  color: var(--ink);
  box-shadow: none;
}
.search::placeholder { color: var(--muted); }
.search:focus {
  outline: none;
  border-color: var(--red);
}

/* —— Disclaimer —— */
.disclaimer {
  margin-top: 14px;
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--red);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.55;
  box-shadow: none;
}

/* —— Panels —— */
.panel {
  margin-top: 18px;
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: none;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line-strong);
}
.section-label {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 4px;
}
.panel h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
}
.district-view h2,
#districtViewTitle {
  font-size: 32px;
  line-height: 1.15;
}
.panel-hint {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  text-align: right;
  max-width: 16em;
  line-height: 1.45;
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ghost-btn {
  appearance: none;
  border: 1.5px solid var(--line);
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  color: var(--muted);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ghost-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.solid-btn {
  appearance: none;
  border: 2px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.solid-btn:hover { background: #ead0d3; }
.result-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--red-soft);
  border: 1.5px solid var(--red);
  white-space: nowrap;
}

/* —— Themes —— */
.theme-copy {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 18px;
}
.theme-row { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-btn {
  appearance: none;
  border: 1.5px solid var(--line);
  background-color: var(--surface-2);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  color: var(--ink);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  box-shadow: none;
}
.theme-btn .theme-hint {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.theme-btn:hover { border-color: var(--line-strong); box-shadow: none; }
.theme-btn.active {
  border: 2px solid var(--red);
  background-color: var(--red-soft);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  color: var(--red);
  box-shadow: none;
}
.theme-btn.active .theme-hint { color: var(--stamp); }

/* —— Map —— */
.map-layout {
  display: grid;
  gap: 16px;
}
.map-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  padding: 10px 8px 6px;
  border-radius: var(--radius);
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 2px solid var(--line-strong);
}
.taiwan-map {
  width: min(100%, 360px);
  height: auto;
}
.map-nation path {
  fill: var(--map-idle);
  stroke: none;
  pointer-events: none;
}
.map-insets path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.1;
  stroke-dasharray: 3 2;
  pointer-events: none;
}
.region {
  fill: var(--map-idle);
  stroke: var(--ink);
  stroke-width: 1.15;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill .12s, stroke .12s, opacity .12s;
}
.region.has-people { fill: #e2e2de; }
.region.sync-hover,
.region:hover,
.region:focus-visible {
  fill: var(--map-hover);
  stroke: var(--ink);
  stroke-width: 1.8;
  outline: none;
}
.region.active {
  fill: var(--red-soft);
  stroke: var(--red);
  stroke-width: 2;
  opacity: 1;
}
.taiwan-map.has-selection .region:not(.active) { opacity: 0.55; }
.taiwan-map.has-selection .map-label:not(.hot) { opacity: 0.5; }
.map-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
  text-anchor: middle;
  font-family: var(--font-sans);
}
.map-label.small { font-size: 12px; }
.map-label.hot { fill: var(--red); font-weight: 700; }
.map-caption {
  margin: 4px 0 2px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.city-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.rail-title {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.city-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}
.city-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}
.city-btn:hover,
.city-btn.sync-hover {
  border-color: var(--line-strong);
  background-color: var(--surface-2);
  background-image: none;
  box-shadow: none;
}
.city-btn.active {
  border: 2px solid var(--red);
  background-color: var(--red-soft);
  background-image: none;
  color: var(--red);
  box-shadow: none;
}
.city-swatch {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  flex: none;
  background: var(--line);
  border: 1px solid var(--ink);
}
.city-btn.has-people .city-swatch { background: var(--ink); }
.city-btn.active .city-swatch { background: var(--red); border-color: var(--red); }
.city-btn .sub {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.city-btn.active .sub { color: var(--stamp); }

/* —— Chips —— */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none;
  border: 1.5px solid var(--line);
  background-color: var(--surface-2);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  color: var(--ink);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: none;
}
.chip:hover { border-color: var(--line-strong); box-shadow: none; }
.chip:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.chip.active {
  border: 2px solid var(--red);
  background-color: var(--red-soft);
  background-image: none;
  color: var(--red);
  box-shadow: none;
}

/* —— District view C 分段 —— */
.area-note,
#districtAreaNote {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.55;
}
.district-view .section-label {
  margin-top: 16px;
}
.district-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: baseline;
  padding: 12px 14px;
  margin: 0 0 10px;
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
}
.district-summary .title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.district-summary .area {
  font-size: 15px;
  color: var(--muted);
}
.district-summary .counts {
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}
.district-summary .counts strong {
  color: var(--ink);
  font-weight: 700;
}
.district-summary .count-note {
  color: var(--red);
  font-weight: 700;
}
.district-summary .count-note.incomplete {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border: 1.5px solid var(--red);
  border-radius: 2px;
  background: color-mix(in srgb, var(--red) 12%, transparent);
  letter-spacing: 0.04em;
}
.district-census {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}
.tag-break {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.id-meta,
.meta-line {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.party-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  color: var(--muted);
}
.party-mark img {
  width: 20px;
  height: 20px;
  flex: none;
  object-fit: contain;
  /* 人卡 20–22px；roster 覆寫 16–18px。黨色僅小圖，不染 UI。 */
  filter: none;
}
.id-meta .party-mark img {
  width: 22px;
  height: 22px;
}
.party-mark.none { /* 無黨籍：無 img */ }
.party-name { vertical-align: middle; }
.roster-block { margin-top: 8px; }
.roster-hint {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.roster-incomplete {
  margin: 0 0 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--red-soft);
  border: 1.5px solid var(--red);
  border-radius: 4px;
  line-height: 1.5;
}
.roster-incomplete .roster-gap-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--red);
  border-radius: 2px;
  vertical-align: baseline;
}
.roster-incomplete .roster-gap-badge.warn {
  background: var(--ink);
}
.roster-strip {
  --roster-grid-columns: minmax(0, 1.1fr) 135px minmax(0, 1.4fr) minmax(0, 1fr);
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}
.roster-head,
.roster-row {
  display: grid;
  grid-template-columns: var(--roster-grid-columns);
  gap: 10px 14px;
  align-items: center;
  padding: 12px 14px;
}
.roster-head > *,
.roster-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.roster-head {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 2px solid var(--line-strong);
}
.roster-head .name,
.roster-head .incumbent,
.roster-head .party,
.roster-head .flag {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.roster-head .name { line-height: 1.6; }
.roster-row {
  font-size: 15px;
  border-bottom: 1px dashed var(--line);
}
.roster-row:nth-child(even) { background: var(--surface-2); } /* 斑马 */
.roster-row:last-child { border-bottom: 0; }
.roster-row .name {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}
.roster-row .incumbent,
.roster-row .flag {
  font-size: 15px;
  color: var(--muted);
}
.roster-row .party {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}
.roster-row .party-mark {
  font-size: 15px;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.roster-row .party-name {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.roster-row .party-mark img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.roster-disclaimer {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .map-panel > .panel-head,
  .district-view > .panel-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .map-panel > .panel-head > :first-child,
  .district-view > .panel-head > :first-child {
    flex: 0 0 100%;
    min-width: 0;
  }
  .map-panel > .panel-head > .panel-hint,
  .district-view > .panel-head > .head-actions {
    flex: 0 0 100%;
    min-width: 0;
  }
  .map-panel > .panel-head > .panel-hint {
    max-width: none;
    text-align: left;
  }
  .district-view > .panel-head > .head-actions {
    justify-content: flex-start;
  }

  .district-summary .counts { margin-left: 0; }
  .roster-head,
  .roster-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    align-items: start;
  }
  .roster-head > :nth-child(1),
  .roster-row > :nth-child(1) { grid-area: 1 / 1; }
  .roster-head > :nth-child(2),
  .roster-row > :nth-child(2) {
    grid-area: 1 / 2;
    justify-self: start;
  }
  .roster-head > :nth-child(3),
  .roster-row > :nth-child(3) { grid-area: 2 / 1; }
  .roster-head > :nth-child(4),
  .roster-row > :nth-child(4) { grid-area: 2 / 2; }
  .roster-head .incumbent,
  .roster-head .party,
  .roster-head .flag,
  .roster-row .incumbent,
  .roster-row .party,
  .roster-row .flag {
    justify-self: start;
  }
}

/* —— Legend —— */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot {
  width: 9px;
  height: 9px;
  border-radius: 1px;
  display: inline-block;
}
.dot.前科, .dot.刑事犯罪 { background: var(--tag-crime); }
.dot.當選無效 { background: var(--tag-void); }
.dot.家屬接棒 { background: var(--tag-family); }
.dot.酒駕 { background: var(--tag-dui); }
.dot.性犯罪 { background: var(--tag-sex); }

/* —— Person cards v2 / share tile（4:5 直卡） —— */
.grid,
.person-cards {
  display: grid;
  grid-template-columns: 1fr; /* mobile 1 col */
  gap: 14px;
}
.card,
.card-v2 {
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}

/* Shareable ~4:5 — 雙線框＋中性刊頭；案件區逐案分色 */
.person-card--share,
.card-v2.person-card--share {
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
  height: max-content;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 200px 200px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0;
  position: relative;
  box-shadow: none;
}
.person-card--share:has(.more-recs[open]) {
  aspect-ratio: auto;
}

/* Legacy horizontal body unused by share markup; keep for stubs */
.card-v2-body {
  display: contents;
}

/* Share photo: 使用者定稿 cover 滿寬 — absolute 鋪滿 */
.person-card--share .avatar,
.person-card--share .photo {
  width: 100%;
  flex: 0 0 auto;
  flex-basis: auto;
  aspect-ratio: 4 / 5;
  height: auto;
  max-height: none;
  min-height: 0; /* yield to text+foot so 審級·連結可見 */
  overflow: hidden;
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--record-sink);
  background-image: none;
  border-radius: 0;
  padding: 0;
  display: block;
  box-sizing: border-box;
  box-shadow: none;
}
.person-card--share .avatar img,
.person-card--share .photo img,
.avatar img,
.person-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: none;
  display: block;
}
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  background-color: var(--record-sink);
  font-family: var(--font-serif);
}
.ballot-overlay {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: var(--surface);
  color: var(--red);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-serif);
  display: grid;
  place-items: center;
  line-height: 1;
  z-index: 2;
}
.avatar-status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 2px;
  background-color: var(--surface);
  color: var(--muted);
  border: 1px solid var(--ink);
  line-height: 1.35;
  z-index: 2;
}

.card-main,
.person-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  padding: 12px 14px 14px;
  min-height: 0;
}
.person-card--share .card-main,
.person-card--share .person-card__body {
  display: block;
  padding: 22px;
  gap: 0;
  justify-content: initial;
  background: var(--surface);
  border-left: 3px solid #b01020;
  box-shadow: none;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}
/* R2: keep the result stack intrinsic so the offense cannot flex to zero. */
.person-card--share .card-main,
.person-card--share .person-card__body {
  flex: 0 0 auto;
  min-height: auto;
}
.card-head,
.name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
}
.name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink);
  flex: 0 1 auto;
  min-width: 0;
}
/* Keep identity on two stable rows; scope to share cards used by the lists. */
.person-card--share .name-row {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  flex-shrink: 0;
  min-width: 0;
  container-type: inline-size;
}
.person-card--share .name {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
  flex: none;
  min-width: 0;
  white-space: normal;
}
.person-card--share .name-row .meta-inline,
.person-card--share .meta-inline {
  font-size: 15px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  margin: 8px 0 12px;
}
.person-card--share .name-row .meta-row {
  display: flex;
  flex: none;
  white-space: nowrap;
}
.person-card--share .card-foot { display: none; }
.person-card--share .meta-inline .party-mark img,
.person-card--share .meta-inline img {
  width: 24px; /* 22–28 */
  height: 24px;
  object-fit: contain;
}

.pill {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--surface);
  border: 1.5px solid var(--ink);
}
.pill.off {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.rec-primary { margin-top: 2px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; }
.outcome {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: #b01020;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  font-family: var(--font-serif);
  margin: 0;
}
.offense {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}
.person-card--share .foot-row,
.foot-row {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
  margin-top: auto;
  line-height: 1.35;
}
.person-card--share .foot-row .dot { margin: 0 2px; }
.person-card--share .foot-row a,
.person-card--share .foot-row .rec-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.person-card--share .foot-row .rec-link.ghost {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.person-card--share .outcome {
  margin-top: 0;
  font-size: 20px;
  font-weight: 700;
}
.person-card--share .offense {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  display: block;
  overflow: visible;
}
.person-card--share .foot-row {
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: auto;
}
@media (min-width: 768px) {
  .person-card--share .name { font-size: 36px; font-weight: 700; }
  .person-card--share .outcome { font-size: 20px; }
  .person-card--share .offense { font-size: 18px; }
  .person-card--share .foot-row { font-size: 12px; }
}
@media (min-width: 980px) {
  .person-card--share .name { font-size: 36px; font-weight: 700; }
  .person-card--share .outcome { font-size: 20px; }
  .person-card--share .offense { font-size: 18px; }
  .person-card--share .foot-row { font-size: 12px; }
}
.case-meta {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.case-meta a { color: var(--red); font-weight: 700; }
.rec-links,
.person-card--share .links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 700;
}
.rec-link-pair {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.rec-links .sep {
  color: var(--muted);
  margin: 0 6px;
  font-weight: 400;
}
.rec-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  border: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.rec-link.ghost {
  color: var(--muted);
  opacity: 0.7;
  text-decoration: none;
  font-weight: 500;
  border: none;
  pointer-events: none;
}
.rec-empty {
  color: var(--muted);
  font-size: 15px;
  padding: 4px 0;
}

.more-recs {
  margin-top: 6px;
  border: none;
  padding: 0;
  background: transparent;
}
.more-recs > summary, .family-cases > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.more-recs > summary::-webkit-details-marker, .family-cases > summary::-webkit-details-marker { display: none; }
.more-recs > summary::after, .family-cases > summary::after { content: "▼"; font-size: 11px; }
.more-recs[open] > summary::after, .family-cases[open] > summary::after { content: "▲"; }
.more-recs-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.more-recs-body .rec-primary { margin-bottom: 10px; }
.more-recs-body .outcome { font-size: 22px; }

.card-foot {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.person-card--share .card-foot .tag { font-size: 12px; padding: 2px 6px; }
.person-card--share .case-meta.foot-row,
.person-card--share .foot-row {
  font-size: 12px;
  display: flex;
  -webkit-line-clamp: unset;
  overflow: visible;
  flex-wrap: wrap;
  max-height: none;
}
.person-card--share .more-recs {
  display: none; /* lean share：四行資訊流，另有 N 筆不進分享卡 */
}
.person-card--share .more-recs { margin-top: 4px; }
.person-card--share .rec-primary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
.person-card--share .offense {
  flex: 0 0 auto;
  min-height: 1.35em;
  max-height: 2.7em;
}
.person-card--share .foot-row {
  flex-shrink: 0;
  min-height: 1.4em;
  visibility: visible;
  opacity: 1;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 14px;
  padding: 3px 8px;
  border-radius: 2px;
  color: #fff;
  font-weight: 700;
}
.tag.前科, .tag.刑事犯罪 { background: var(--tag-crime); }
.tag.當選無效 { background: var(--tag-void); }
.tag.家屬接棒 { background: var(--tag-family); }
.tag.酒駕 { background: var(--tag-dui); }
.tag.性犯罪, .tag.性騷行政 { background: var(--tag-sex); }
.geo-meta {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.85;
  line-height: 1.4;
}

/* legacy stubs (unused by v2 markup) */
.card-top, .card-cols, .card-records, .num-col, .id-block, .ballot, .block, .doc { }
.meta { color: var(--muted); font-size: 15px; }


.empty {
  color: var(--muted);
  padding: 32px 12px;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  font-size: 17px;
}

/* —— Pending / report（克制、與定稿分開） —— */
.pending-panel {
  border-style: dashed;
  border-color: var(--stamp);
  background-color: var(--surface);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
}
.pending-lead, .form-disclaimer {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}
.subhead {
  margin: 18px 0 10px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.pending-list { display: grid; gap: 10px; }
.pending-card {
  border: 1.5px dashed var(--line);
  background-color: var(--surface-2);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  border-radius: var(--radius);
  padding: 12px 14px;
}
.pending-card h4 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 20px;
}
.pending-card .meta { margin-top: 0; font-size: 16px; }
.stamp {
  display: inline-block;
  border: 1.5px solid var(--stamp);
  color: var(--stamp);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: 8px;
  transform: rotate(-6deg);
  vertical-align: middle;
  letter-spacing: 0.08em;
}
.pending-flag {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--stamp);
  border: 1.5px solid var(--stamp);
  border-radius: 2px;
  padding: 2px 7px;
}

.report-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.report-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.report-form label.wide { grid-column: 1 / -1; }
.report-form input,
.report-form textarea {
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--record-sink);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: none;
}
.report-form input:focus,
.report-form textarea:focus {
  outline: none;
  border-color: var(--red);
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.form-status { font-size: 15px; color: var(--tag-family); }
.report-log { margin-top: 14px; display: grid; gap: 8px; }
.report-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
  color: var(--muted);
  background-color: var(--surface-2);
  background-image: none;
  background-repeat: repeat;
  background-size: 160px 160px;
}
.report-item strong { color: var(--ink); }

.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

@media (min-width: 780px) {
  .wrap { padding: 28px 20px 88px; }
  .hero { padding: 4px 0 20px; }
  .panel { padding: 22px 22px 18px; }
  .map-layout {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: stretch;
  }
  .map-stage { min-height: 520px; }
  .taiwan-map { width: min(100%, 400px); }
}
@media (min-width: 768px) {
  .grid,
  .person-cards,
  #districtPeople.grid,
  #people.grid {
    grid-template-columns: 1fr 1fr; /* desktop 2-col share tiles */
    gap: 14px;
  }
}
@media (min-width: 1100px) {
  /* optional 3-col on very wide — keep 2 for district density */
  .grid,
  .person-cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .report-form { grid-template-columns: 1fr; }
  .grid, .person-cards { container-type: inline-size; }
  .card-v2.person-card--share {
    aspect-ratio: auto;
    height: max-content;
    min-height: 125cqi;
  }
  .person-card--share { aspect-ratio: auto; }
  .person-card--share .avatar, .person-card--share .photo {
    flex: 0 0 auto;
    flex-basis: auto;
    aspect-ratio: 4 / 5;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0;
  }
  .name { font-size: 22px; }
  .outcome { font-size: 18px; }
  .offense { font-size: 14px; }
  .mast { flex-direction: column; align-items: flex-start; }
  .hero-meta { text-align: left; white-space: normal; }
  .brand em { display: block; margin-left: 0; margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none;
    transition: none;
  }
}


/* Alias per VISUAL-TOKENS .person-photo */
.person-photo {
  border: 0;
  border-radius: 0;
}
.person-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; filter: none; transform: none; }


/* share lean — hide list-only extras on share tiles */
.person-card--share .more-recs,
.person-card--share .tags,
.person-card--share .geo-meta,
.person-card--share .card-foot {
  display: none !important;
}

/* F2 formal-data presentation */
.data-boundary {
  margin-top: 10px;
  padding: 10px 14px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.load-error {
  margin-top: 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--red-soft);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  font-weight: 700;
  line-height: 1.5;
}
.load-error[hidden] { display: none; }

.dot.起訴中, .dot.起訴 { background: #626260; }
.dot.非前科對照 { background: var(--tag-family); }
.dot.有利未確定 { background: #626260; }
.tag[data-theme="前科"], .tag[data-theme="刑事犯罪"] { background: var(--tag-crime); }
.tag[data-theme="當選無效"] { background: var(--tag-void); }
.tag[data-theme="家屬接棒"] { background: var(--tag-family); }
.tag[data-theme="酒駕"] { background: var(--tag-dui); }
.tag[data-theme="性犯罪"] { background: var(--tag-sex); }
.tag[data-theme="起訴中"], .tag[data-theme="起訴"] { background: #626260; }
.tag[data-theme="非前科對照"] { background: var(--tag-family); }
.tag[data-theme="有利未確定"] { background: #626260; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 5px;
}
.card-tags .tag {
  font-size: 12px;
  line-height: 1.35;
  padding: 2px 6px;
}
.record-block {
  margin-top: 8px;
  padding: 9px 10px 8px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  background: var(--surface-2);
  overflow: hidden;
}
.records-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.record-type-guilty { border-left-color: var(--red); }
.record-type-indicted { border-left-color: #626260; }
.record-type-favorable-final { border-left-color: var(--tag-family); }
.record-type-favorable-pending { border-left-color: #626260; }
.record-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-bottom: 4px;
}
.record-type-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.record-type-guilty .record-type-label { color: var(--red); }
.record-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.record-original {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.record-offense { font-weight: 700; }
.record-sentence {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}
.record-summary {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dotted var(--line);
}
.record-summary-field {
  display: grid;
  grid-template-columns: minmax(4.5em, 5.5em) minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
.record-summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.record-summary-value {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.record-summary-status .record-summary-value {
  font-size: 14px;
  line-height: 1.45;
}
.record-label-inline {
  display: inline-block;
  margin-right: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.record-links-row {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}
.record-full {
  margin-top: 7px;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
}
.record-full > summary {
  cursor: pointer;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.record-full > summary::-webkit-details-marker { display: none; }
.record-full > summary::before { content: "+ "; }
.record-full[open] > summary::before { content: "− "; }
.record-fields {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dotted var(--line);
}
.record-field {
  display: grid;
  grid-template-columns: minmax(6.5em, 9em) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.record-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.record-value {
  min-width: 0;
  max-width: 100%;
  inline-size: 100%;
  box-sizing: border-box;
  padding-inline-end: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  /* Preserve source newlines while collapsing source padding spaces that can
     create a visual glyph range past the grid track at narrow widths. */
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.record-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
}
.record-source-link {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.record-link-empty {
  display: inline;
  color: var(--muted);
  font-weight: 700;
}
.election-invalidity {
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid var(--tag-void);
  border-left: 4px solid var(--tag-void);
  background: rgba(47, 63, 143, 0.07);
}
.election-invalidity-title {
  color: var(--tag-void);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}
.election-invalidity-record + .election-invalidity-record {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}
.election-invalidity-raw {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.election-invalidity-source {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.card-disclaimer {
  margin: 10px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* F2 must expose all cases; earlier share-card compact rules stay for other legacy extras. */
.person-card--share .more-recs {
  display: block !important;
}
.person-card--share .more-recs-body {
  display: grid;
  gap: 8px;
}
.person-card--share .name {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: normal;
  line-height: 1.05;
}
.person-card--share .record-full .record-value {
  max-height: none;
  overflow: visible;
  display: block;
}
@media (max-width: 640px) {
  .record-field { grid-template-columns: minmax(5.5em, 7em) minmax(0, 1fr); }
  .data-boundary { font-size: 14px; }
  .person-card--share .name { font-size: 36px; }
}

/* F3v2 flow and share controls.  Card photo, red spine, type scale and
   palette remain the frozen person-card treatment above. */
.district-picker-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 15px;
}
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 12.5em;
  text-align: left;
}
.chip-title {
  font-size: 17px;
  line-height: 1.3;
}
.chip-counts {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}
.chip.active .chip-counts { color: var(--stamp); }
.card-location {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
}
.person-permalink,
.card-share {
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.card-share {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.person-permalink:hover,
.card-share:hover { color: var(--red); }
.share-feedback {
  color: var(--tag-family);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.record-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 3px;
}
.record-type-label {
  font-size: 14px;
  font-weight: 800;
}
.record-status-chip {
  display: inline-block;
  max-width: 100%;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.record-type-indicted .record-type-label,
.record-type-indicted .record-status-chip { color: var(--muted); }
.person-card--share .record-offense { color: var(--red); }
.record-sentence { color: var(--red); }
.record-link-sep { color: var(--muted); margin: 0 5px; }
.record-full { margin-top: 7px; }
.record-full .record-fields { margin-bottom: 0; }
.family-context, .family-case {
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid var(--tag-family);
  border-left: 4px solid var(--tag-family);
  background: rgba(27, 94, 69, 0.07);
}
.family-context-title {
  color: var(--tag-family);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}
.family-fields, .family-case-fields {
  display: grid;
  gap: 4px;
  margin: 5px 0 0;
}
.family-field {
  display: grid;
  grid-template-columns: minmax(5.2em, 6.6em) minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
}
.family-field dt {
  color: var(--muted);
  font-weight: 700;
}
.family-field dd { margin: 0; overflow-wrap: anywhere; word-break: break-word; }
.family-disclaimer {
  margin: 7px 0 0;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--tag-family);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.roster-details {
  margin-top: 18px;
  border-top: 2px solid var(--line-strong);
  padding-top: 10px;
}
.roster-details > summary {
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  list-style: none;
}
.roster-details > summary::-webkit-details-marker { display: none; }
.roster-details > summary::before { content: "+ "; color: var(--red); }
.roster-details[open] > summary::before { content: "− "; }
.roster-details .roster-block { margin-top: 9px; }
.roster-strip { overflow-x: auto; }

@media (max-width: 640px) {
  .chip { min-width: min(100%, 19em); width: 100%; }
  .chip-counts { white-space: normal; }
  .family-field { grid-template-columns: minmax(4.7em, 5.8em) minmax(0, 1fr); }
  .map-stage { min-height: 330px; }
  .city-list { max-height: 330px; }
}

/* A2-b final card tokens.  This section intentionally normalizes the old
   share-card rules above, including mobile, pseudo-element, and card-type
   overrides, so the visual treatment has one unambiguous source of truth. */
body,
.search,
.panel,
.map-stage,
.city-btn,
.chip,
.theme-btn,
.district-summary,
.roster-strip,
.data-boundary {
  background-image: none;
}

.card-v2.person-card--share {
  height: max-content;
  min-height: 0;
  background-color: var(--surface);
  background-image: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
}
.card-v2.person-card--share::before,
.card-v2.person-card--share::after {
  content: none;
  display: none;
}
.card-v2.person-card--share .avatar,
.card-v2.person-card--share .photo,
.card-v2.person-card--share .person-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  background-color: var(--record-sink);
  background-image: none;
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
  box-shadow: none;
  mask: none;
  backdrop-filter: none;
}
.card-v2.person-card--share .person-photo::before,
.card-v2.person-card--share .person-photo::after,
.card-v2.person-card--share .avatar::before,
.card-v2.person-card--share .avatar::after {
  content: none;
  display: none;
}
.card-v2.person-card--share .person-photo img,
.card-v2.person-card--share .avatar img,
.card-v2.person-card--share .photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  background-image: none;
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
  transform: none;
  box-shadow: none;
  mask: none;
  backdrop-filter: none;
}
.card-v2.person-card--share .avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background-color: var(--record-sink);
  background-image: none;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
.card-v2.person-card--share .card-main,
.card-v2.person-card--share .person-card__body {
  display: block;
  flex: 0 0 auto;
  min-height: 0;
  min-width: 0;
  padding: 22px;
  background-color: var(--surface);
  background-image: none;
  border-left: 3px solid #b01020;
  box-shadow: none;
  overflow: visible;
}
.card-v2.person-card--share.card-neutral .person-card__body,
.card-v2.person-card--share.card-has-guilty .person-card__body {
  border-left: 3px solid #b01020;
  box-shadow: none;
}
.card-v2.person-card--share .name-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
}
.card-v2.person-card--share .name {
  margin: 0;
  color: var(--ink);
  font: 700 36px/1.15 var(--font-serif);
  letter-spacing: normal;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-v2.person-card--share .meta-inline {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  margin: 8px 0 12px;
  color: var(--muted);
  font: 400 15px/1.5 var(--font-sans);
  letter-spacing: normal;
  white-space: nowrap;
}
.card-v2.person-card--share .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
  overflow: visible;
}
.card-v2.person-card--share .card-tags .tag,
.card-v2.person-card--share .record-status-chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: 400 13px/1.5 var(--font-sans);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-v2.person-card--share .record-status-chip {
  color: var(--red);
  border-color: var(--red);
}
.card-v2.person-card--share .record-block {
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.card-v2.person-card--share .record-block + .record-block { margin-top: 18px; }
.card-v2.person-card--share .records-stack {
  display: block;
  min-width: 0;
}
.card-v2.person-card--share .record-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 10px;
}
.card-v2.person-card--share .record-offense,
.card-v2.person-card--share .record-offense.offense {
  display: block;
  max-height: none;
  margin: 0 0 14px;
  color: var(--ink);
  background: transparent;
  font: 700 18px/1.35 var(--font-sans);
  letter-spacing: normal;
  text-decoration: none;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}
.card-v2.person-card--share .record-sentence,
.card-v2.person-card--share .record-sentence.outcome,
.card-v2.person-card--share .record-outcome {
  color: var(--ink);
  font: 400 16px/1.65 var(--font-sans);
  text-decoration: none;
}
.card-v2.person-card--share .record-compact-fields {
  display: grid;
  grid-template-columns: 3em minmax(0, 1fr);
  gap: 14px 12px;
  margin: 0;
  color: var(--ink);
  font: 400 16px/1.65 var(--font-sans);
}
.card-v2.person-card--share .record-compact-fields > dt,
.card-v2.person-card--share .record-compact-fields > dd {
  min-width: 0;
  margin: 0;
  font-weight: 400;
}
.card-v2.person-card--share .record-compact-fields > dt { color: var(--muted); }
.card-v2.person-card--share .record-compact-fields > dd {
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-v2.person-card--share .record-full {
  margin: 0;
  border: 0;
  padding: 0;
}
.card-v2.person-card--share .record-full > summary {
  cursor: pointer;
  color: var(--ink);
  font: 400 13px/1.65 var(--font-sans);
  list-style: none;
  white-space: normal;
}
.card-v2.person-card--share .record-full > summary::-webkit-details-marker { display: none; }
.card-v2.person-card--share .record-full > summary::before,
.card-v2.person-card--share .record-full > summary::after { content: none; }
.card-v2.person-card--share .record-full .record-fields {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px dotted var(--line);
}
.card-v2.person-card--share .record-full .record-field {
  display: grid;
  grid-template-columns: minmax(5em, 6em) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.card-v2.person-card--share .record-full .record-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
.card-v2.person-card--share .record-full .record-value {
  min-width: 0;
  max-width: none;
  inline-size: auto;
  padding-inline-end: 0;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-line;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-v2.person-card--share .record-full a,
.card-v2.person-card--share .record-full .record-link {
  color: var(--ink);
  font-weight: 400;
}
.card-v2.person-card--share .record-full a:hover { color: var(--ink); }
.card-v2.person-card--share .card-disclaimer {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 12px/1.5 var(--font-sans);
  white-space: nowrap;
}
.card-v2.person-card--share .card-actions a:hover,
.card-v2.person-card--share .card-actions button:hover,
.card-v2.person-card--share .person-permalink:hover,
.card-v2.person-card--share .card-share:hover { color: var(--ink); }

@media (max-width: 500px) {
  .card-v2.person-card--share .person-card__body,
  .card-v2.person-card--share .card-main { padding: 20px; }
  .card-v2.person-card--share .name { font-size: 36px; }
}

@media (min-width: 1100px) {
  .grid,
  .person-cards,
  #districtPeople.grid,
  #people.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* F3v2 return #1: keep the first decision surface in the first viewport.
   These flow rules are deliberately after the legacy responsive rules. */
.hero {
  display: flex;
  flex-direction: column;
}
.hero .search-wrap {
  order: -1;
  margin-bottom: 14px;
}

@media (max-width: 779px) {
  .data-boundary { margin-top: 0; padding: 8px 10px; font-size: 13px; line-height: 1.35; }
  .panel { margin-top: 10px; padding: 12px 10px 10px; }
  #cityStep.map-panel { margin-top: 8px; }
  #cityStep .map-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }
  #cityStep .map-stage {
    min-width: 0;
    min-height: 250px;
    padding: 6px 4px 4px;
  }
  #cityStep .taiwan-map {
    width: 100%;
    max-height: 226px;
  }
  #cityStep .city-rail {
    min-width: 0;
    gap: 5px;
  }
  #cityStep .rail-title { font-size: 13px; }
  #cityStep .city-list {
    max-height: 238px;
    overflow-y: auto;
    padding-right: 2px;
    gap: 4px;
  }
  #cityStep .city-btn {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 2px 6px;
    min-width: 0;
    padding: 6px;
    font-size: 14px;
    line-height: 1.25;
  }
  #cityStep .city-btn .sub {
    grid-column: 2;
    margin-left: 0;
    font-size: 11px;
    line-height: 1.25;
  }
  #cityStep .map-caption { font-size: 11px; }
  .panel-head { margin-bottom: 8px; padding-bottom: 6px; gap: 6px; }
}

@media (max-width: 640px) {
  #districtView { margin-top: 0; }
  #districtView.person-focused .district-summary,
  #districtView.person-focused #districtCensus,
  #districtView.person-focused #districtAreaNote { display: none; }
}


/* 2026-09-13 使用者回饋：選區晶片寫行政區、有公開紀錄下寫分類人數、GPS 定位選區 */
.chip-area {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  max-width: 22em;
}
.tag-breakdown { gap: 8px 10px; }
.break-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
}
.break-item strong { font-weight: 700; }
.break-item:disabled { opacity: 0.45; cursor: default; }
.break-item.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.break-item:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.locate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.locate-btn:hover { border-color: var(--red); color: var(--red); }
.locate-btn:disabled { opacity: 0.6; cursor: wait; }
.locate-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.locate-status {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.locate-status[data-tone="ok"] { color: var(--ink); }
.locate-status[data-tone="error"] { color: var(--red); }
.locate-choices { margin: 0 0 12px; }


/* 2026-09-13 使用者回饋：人卡回到約 4:5，照片改 4:3 佔約六成，文字壓縮，第二筆以後收合 */
.card-v2.person-card--share .avatar,
.card-v2.person-card--share .photo { aspect-ratio: 4 / 3; }
.card-v2.person-card--share .avatar img,
.card-v2.person-card--share .photo img { object-position: 50% 0%; }
.card-v2.person-card--share .card-main,
.card-v2.person-card--share .person-card__body { padding: 12px 14px 12px; }
.card-v2.person-card--share .name,
.person-card--share .name { font-size: 26px; line-height: 1.1; }
@media (min-width: 768px) {
  .card-v2.person-card--share .name,
  .person-card--share .name { font-size: 28px; }
}
.card-v2.person-card--share .card-location { margin-top: 2px; font-size: 12px; }
.card-v2.person-card--share .card-tags { margin: 6px 0 8px; }
.card-v2.person-card--share .record-block { padding: 8px 0 0; }
.card-v2.person-card--share .record-block + .record-block { margin-top: 8px; }
.card-v2.person-card--share .record-heading { margin: 0 0 4px; }
.card-v2.person-card--share .record-offense,
.card-v2.person-card--share .record-offense.offense {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.card-v2.person-card--share .record-compact-fields { gap: 4px 10px; }
.card-v2.person-card--share .record-compact-fields dt { font-size: 13px; }
.card-v2.person-card--share .record-compact-fields dd { margin: 0; }
.card-v2.person-card--share .record-compact-fields > dd:first-of-type {
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.card-v2.person-card--share .record-full > summary { font-size: 13px; }
.card-v2.person-card--share .more-recs { margin-top: 6px; }
.card-v2.person-card--share .more-recs > summary { font-size: 13px; }
.card-v2.person-card--share .more-recs-body { margin-top: 4px; padding-top: 0; border-top: 0; gap: 0; }
.card-v2.person-card--share .card-actions { margin-top: 8px; padding-top: 6px; font-size: 12px; gap: 4px 10px; }
.card-v2.person-card--share .card-disclaimer { margin: 6px 0 0; padding-top: 5px; font-size: 11px; }
.family-context-wrap { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.family-context-summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.family-context-wrap[open] .family-context-summary { margin-bottom: 4px; }
.family-context-wrap .family-context-title { display: none; }

/* 家族接棒獨立一節（不計入有公開紀錄） */
.family-label { margin-top: 22px; }
.family-hint { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.family-strip { display: grid; gap: 6px; margin-bottom: 8px; }
.family-row {
  display: grid;
  grid-template-columns: minmax(6em, auto) minmax(0, 1fr);
  gap: 2px 12px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
}
.family-row .name { font-weight: 700; font-size: 16px; }
.family-row .name a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--red); }
.family-row .meta { color: var(--muted); font-size: 13px; }
.family-row .relation { grid-column: 1 / -1; }
.family-row .stage { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
@media (min-width: 768px) {
  .family-row { grid-template-columns: 8em 10em minmax(0, 1fr); }
  .family-row .relation { grid-column: auto; }
  .family-row .stage { grid-column: 2 / -1; }
}
.theme-btn.theme-family { border-style: dashed; }


/* 人卡再壓縮：桌面 3 欄、標籤列與選區列不佔高（標籤仍在 DOM 供分享／驗證） */
@media (min-width: 1100px) {
  #districtPeople.grid, #people.grid, .grid, .person-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
#districtPeople .card-v2.person-card--share .card-location { display: none; }
.card-v2.person-card--share .card-tags { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.card-v2.person-card--share .record-heading { display: inline; margin: 0; }
.card-v2.person-card--share .record-heading .record-status-chip { margin-right: 6px; vertical-align: 2px; font-size: 12px; padding: 1px 5px; }
.card-v2.person-card--share .record-offense,
.card-v2.person-card--share .record-offense.offense { display: inline; margin: 0; }
.card-v2.person-card--share .record-block { display: flex; flex-direction: column; gap: 6px; }
.card-v2.person-card--share .record-block > .record-heading + .record-offense { display: inline; }
.card-v2.person-card--share .record-title-line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.3;
}
.card-v2.person-card--share .card-actions { border-top: 0; margin-top: 6px; padding-top: 0; }
.card-v2.person-card--share .card-disclaimer { margin-top: 4px; padding-top: 4px; }
.family-row .stage::before { content: "前任案件："; }
@media (min-width: 768px) {
  .family-row .stage { grid-column: 3; }
}

.data-boundary::before { content: "" !important; }

/* 選區頁分類展開 */
.record-group { margin: 0 0 18px; }
.record-group .group-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--ink);
}
.group-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.name-links { display: flex; flex-wrap: wrap; gap: 8px; }
.name-link {
  padding: 4px 12px; border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 700 14px/1.3 var(--font-sans); cursor: pointer;
}
.name-link:hover { border-color: var(--red); color: var(--red); }
#districtPeople.grid { display: block; }
/* 地圖填滿左欄（使用者 2026-09-13：左邊地圖可以更大） */
@media (min-width: 780px) {
  .map-layout { grid-template-columns: 1.4fr 0.6fr; }
  .taiwan-map { width: 100%; max-width: none; }
  .map-stage { min-height: 0; }
}
/* 首頁主題列壓成一行小晶片，讓地圖仍在首屏 */
#themeStep { padding-top: 12px; padding-bottom: 10px; }
#themeStep .panel-head { margin-bottom: 8px; padding-bottom: 6px; }
#themeStep .panel-head h2 { font-size: 18px; }
#themeStep .theme-copy { display: none; }
#themeStep .theme-row { display: flex; flex-wrap: wrap; gap: 6px; }
#themeStep .theme-btn { padding: 5px 10px; min-width: 0; }
#themeStep .theme-btn .theme-name { font-size: 14px; }
#themeStep .theme-btn .theme-hint { font-size: 11px; }
@media (min-width: 780px) { .wrap { min-height: calc(100vh + 260px); } }
@media (max-width: 640px) {
  #themeStep .theme-btn .theme-hint { display: none; }
  #themeStep .theme-btn { padding: 4px 10px; }
  #themeStep .panel-head h2 { font-size: 16px; }
}

.civil-full > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.card-v2.person-card--share .election-invalidity { padding: 8px 10px; }

/* 罪名兩段：法條小字、罪名粗體不拆字 */
.record-offense .offense-law { display: block; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.3; letter-spacing: 0.02em; }
.record-offense .offense-name { font-weight: 700; }
/* 罪名：法條與有罪晶片同行小字，罪名自成一行；標題區最多 3 行 */
.record-offense .offense-law { display: inline; }
.record-offense .offense-name { display: block; }
.card-v2.person-card--share .record-title-line { -webkit-line-clamp: 3; }

/* 2026-09-13 傍晚回饋：不顯示法條、只標現任、政黨與姓名同行、選區在姓名下一行且離線遠一點 */
.record-offense .offense-law { display: none; }
.person-card--share .name-row { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.person-card--share .name-row .id-meta,
.card-v2.person-card--share .meta-row { margin: 0; font-size: 15px; line-height: 1.5; white-space: nowrap; color: var(--muted); }
.incumbent-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 2px; font-size: 12px; line-height: 1.6; color: var(--ink); vertical-align: 1px; }
#districtPeople .card-v2.person-card--share .card-location { display: block; }
.card-v2.person-card--share .card-location { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }

/* 主題鈕：字置中放大、去提示小字；先選縣市說明放標題下 */
#themeStep .theme-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 16px; min-height: 48px; }
#themeStep .theme-btn .theme-name { font-size: 17px; }
#themeStep .theme-btn .theme-hint { font-size: 12px; }
.theme-btn .theme-name, .theme-btn .theme-hint { display: block; text-align: center; }
#cityStep .panel-head .panel-hint { margin: 6px 0 0; text-align: left; max-width: none; }

/* 人名即人物頁連結；選區晶片整齊網格 */
.name-link { color: inherit; text-decoration: none; }
.name-link:hover { color: var(--red); }
#districtChips.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: 10px; }
#districtChips .chip { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 640px) { #districtChips.chips { grid-template-columns: 1fr 1fr; } #districtChips .chip { min-width: 0; } }

/* 民事當選無效展開欄位比照刑事 */
.card-v2.person-card--share .election-invalidity { border: 0; padding: 0; background: transparent; }
.card-v2.person-card--share .election-invalidity-title { font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.card-v2.person-card--share .record-status-chip.civil { color: #2b4a8a; border-color: #2b4a8a; }
.card-v2.person-card--share .election-invalidity .record-fields dt,
.card-v2.person-card--share .election-invalidity .record-fields dd { font-size: 14px; }

/* 民事區塊：與刑事同樣式但用獨立 class（驗證器要分清刑民） */
.civil-block { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 0; border-top: 1px solid var(--line); }
.civil-title-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 16px; line-height: 1.3; }
.civil-heading { display: inline; margin-right: 6px; }
.civil-status-chip { display: inline-block; padding: 1px 5px; border: 1px solid #2b4a8a; color: #2b4a8a; font: 400 12px/1.5 var(--font-sans); vertical-align: 2px; margin-right: 6px; }
.civil-offense { display: inline; margin: 0; font: 700 16px/1.3 var(--font-sans); color: var(--ink); }
.civil-compact-fields { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 4px 10px; margin: 0; }
.civil-compact-fields dt { font-size: 13px; color: var(--muted); }
.civil-compact-fields dd { margin: 0; font-size: 14px; line-height: 1.45; }
.civil-full > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.civil-fields { margin: 6px 0 0; display: grid; gap: 4px; }
.civil-field { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 0 8px; }
.civil-label { font-size: 13px; color: var(--muted); }
.civil-value { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.card-v2.person-card--share .election-invalidity-title { display: none; }
/* 人名連結：不吃卡片內通用 a 樣式 */
.card-v2.person-card--share .name > a.name-link,
.person-card--share .name > a.name-link {
  display: inline; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent;
  font: inherit; font-size: inherit; font-weight: inherit; font-family: inherit; line-height: inherit;
  color: inherit; text-decoration: none; box-shadow: none; letter-spacing: inherit;
}
.person-card--share .name > a.name-link:hover { color: var(--red); }
.card-v2.person-card--share .card-disclaimer { white-space: normal; line-height: 1.45; }

/* 搜尋：無紀錄者列表 */
.no-record-list { margin-top: 16px; display: grid; gap: 6px; }
.no-record-row { display: grid; grid-template-columns: 7em minmax(0,1fr); gap: 2px 12px; padding: 8px 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; line-height: 1.45; }
.no-record-row .name { font-weight: 700; font-size: 17px; font-family: var(--font-serif); grid-row: span 2; align-self: center; }
.no-record-row .where { color: var(--ink); }
.no-record-row .meta { color: var(--muted); font-size: 13px; }
.no-record-row .status { grid-column: 2; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .no-record-row { grid-template-columns: 1fr; } .no-record-row .name { grid-row: auto; } .no-record-row .status { grid-column: auto; } }
.map-label { font-size: 12px; letter-spacing: 0; }
.map-label.small { font-size: 10.5px; }

.map-leader { stroke: var(--ink); stroke-width: 0.8; }
.taiwan-map.has-selection .map-leader { opacity: 0.5; }
/* 政黨與姓名同行（覆蓋 2034 行的 column 規則） */
.card-v2.person-card--share .name-row,
.person-card--share .name-row { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.card-v2.person-card--share .name-row .name { flex: 0 1 auto; width: auto; }
.card-v2.person-card--share .name-row .id-meta { flex: 0 1 auto; width: auto; display: inline-flex; align-items: center; gap: 4px; }

.record-offense .offense-name { display: inline; }

/* 有罪為預設不標，只標起訴（使用者 2026-09-13） */
.record-block[data-record-type="有罪"] .record-status-chip { display: none; }

/* 首頁主標下的宣言 */
.manifesto { margin: 10px 0 6px; max-width: 46em; font-size: 16px; line-height: 1.7; color: var(--ink); }
.manifesto p { margin: 0 0 6px; }
.manifesto p + p { color: var(--red); font-weight: 700; }
@media (max-width: 640px) { .manifesto { font-size: 15px; } }

/* 宣言只在標點處換行 */
.manifesto p { word-break: keep-all; overflow-wrap: normal; }
@media (max-width: 480px) { .manifesto p { word-break: normal; } }
/* 人卡照片框改正方形（使用者 2026-09-13：補邊改正方形） */
.card-v2.person-card--share .avatar,
.card-v2.person-card--share .photo { aspect-ratio: 1 / 1; }
/* 單人頁：卡片寬度限制，正方形照片才不會撐滿版 */
#districtView.person-focused #districtPeople.grid,
#districtView.person-focused .group-grid { display: grid; grid-template-columns: minmax(0, 440px); }
/* 政黨列：有黨徽與無黨徽同高同基線 */
.card-v2.person-card--share .name-row { align-items: center; }
.card-v2.person-card--share .name-row .id-meta { display: inline-flex; align-items: center; min-height: 24px; line-height: 24px; }
.card-v2.person-card--share .party-mark { display: inline-flex; align-items: center; gap: 4px; line-height: 24px; }
.card-v2.person-card--share .party-mark img { width: 22px; height: 22px; display: block; }
.card-v2.person-card--share .incumbent-tag { vertical-align: 0; margin-top: 0; }
/* 首頁：主標與說明右側的紅框 */
.hero { display: flex; flex-direction: column; }
.hero-row { display: flex; align-items: flex-start; gap: 24px; }
.hero-row .hero-text { flex: 1 1 auto; min-width: 0; }
.hero-badge {
  flex: 0 0 auto; align-self: center; margin-top: 8px;
  padding: 14px 18px; border: 3px solid var(--red); border-radius: 4px;
  color: var(--red); font-family: var(--font-serif); font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: 0.04em; white-space: nowrap;
  background: var(--surface);
}
@media (max-width: 780px) { .hero-row { flex-direction: column; gap: 10px; } .hero-badge { align-self: flex-start; font-size: 18px; padding: 10px 14px; } }
@media (min-width: 980px) { .hero-text h1 { white-space: nowrap; font-size: clamp(30px, 3.2vw, 40px); } }

/* Demo19 round 20: compact inner header and clear result actions. */
.home-link { color: inherit; text-decoration: none; }
.hero .search-wrap { order: 1; margin: 16px 0 0; width: 100%; max-width: none; }
.wrap.is-inner .hero { flex-direction: row; align-items: center; gap: 16px; padding: 12px 0; margin-bottom: 12px; }
.wrap.is-inner .hero-row { flex: 1 1 50%; min-width: 0; }
.wrap.is-inner .hero h1 { font: 700 18px/1.4 var(--font-sans); white-space: normal; margin: 0; letter-spacing: 0; }
.wrap.is-inner .hero .search-wrap { flex: 1 1 50%; width: auto; min-width: 0; margin: 0; }
.wrap.is-inner .hero .manifesto, .wrap.is-inner .hero-badge { display: none; }
.solid-btn, .card-v2.person-card--share .card-share,
.card-v2.person-card--share .card-share:hover {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 16px; border: 2px solid var(--red);
  border-radius: 4px; background: var(--red); color: #fff;
  font: 700 15px/1.4 var(--font-sans); text-decoration: none; cursor: pointer;
}
.solid-btn:hover { filter: brightness(.9); }
.ghost-btn { min-height: 44px; }
.share-feedback { font-size: 14px; line-height: 1.5; }
.share-feedback:empty { display: none; }
.share-url { display: block; user-select: text; -webkit-user-select: text; white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.district-foot-actions, .theme-page-actions, .next-steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 10px; }
.next-steps { border-top: 2px solid var(--line-strong); padding-top: 20px; }
.city-all > summary { cursor: pointer; padding: 16px; border: 2px solid var(--red); color: var(--red); border-radius: 4px; font-weight: 700; min-height: 52px; }
.city-all[open] > summary { margin-bottom: 18px; }
.city-all-page > .panel-head { display: none; }
#cityAllGrid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
#peopleStep.theme-page h2 { font-size: 30px; line-height: 1.35; }
#peopleStep.theme-page .section-label { display: none; }
.theme-page-copy { font-size: 17px; line-height: 1.6; margin: 10px 0; }
#themeStep .theme-btn .theme-hint { display: block; }
.locate-result { padding: 12px; border: 1px solid var(--line-strong); margin: 12px 0; }
.locate-result .locate-status { margin-top: 0; }
#districtSummary { padding: 0 0 14px; border: 0; background: transparent; margin: 0 0 12px; }
#districtSummaryArea { font-size: 23px; line-height: 1.45; margin-bottom: 8px; }
#districtSummaryCounts { font-size: 16px; line-height: 1.6; }
#districtView.person-focused { max-width: 760px; margin-inline: auto; }
#districtView.person-focused #districtPeople.grid { justify-content: center; }
.producer { margin: 10px 0 28px; font-weight: 700; }
.record-sources { margin-top: 8px; font-size: 14px; line-height: 1.5; }
.record-sources summary { cursor: pointer; font-weight: 700; }
.record-sources ul { margin: 8px 0; padding-left: 20px; }
.family-fields a { overflow-wrap: anywhere; }
@media (max-width: 779px) {
  .wrap.is-inner .hero { gap: 10px; }
  .wrap.is-inner .hero h1 { font-size: 14px; }
  .wrap.is-inner .hero .search { font-size: 14px; padding-right: 4px; }
  #cityStep .map-layout { display: flex; flex-direction: column; gap: 16px; }
  #cityStep .city-rail { order: -1; width: 100%; }
  #cityStep .city-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: none; overflow: visible; padding: 0; gap: 8px; }
  #cityStep .city-btn { min-height: 58px; padding: 9px; font-size: 16px; }
  #cityStep .city-btn .sub { font-size: 12px; }
  #cityStep .map-stage { width: 100%; min-height: 0; }
  #cityStep .taiwan-map { max-height: 300px; }
  #cityStep .panel-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  #districtView > .panel-head { flex-direction: column; align-items: stretch; gap: 10px; }
  #districtView .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  #districtViewTitle { font-size: 28px; }
  #districtSummaryArea { font-size: 21px; }
  #districtSummaryCounts { font-size: 15px; }
  #peopleStep.theme-page h2 { font-size: 27px; }
}
#people.family-theme-table { display: block; }
.family-theme-row { padding: 16px 0; border-bottom: 1px solid var(--line-strong); }
.family-theme-heading { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.family-theme-heading > a { color: var(--ink); font-size: 22px; font-weight: 700; }
.family-theme-heading > span { font-size: 15px; }
.family-theme-row .family-context-wrap { margin-top: 8px; }
/* Keep native hidden state authoritative over component display rules. */
[hidden] { display: none !important; }
.family-profile { padding: 16px; border: 1px solid var(--line-strong); }
.family-profile .family-theme-heading h3 { margin: 0; font-size: 24px; }
.family-profile > .solid-btn { margin-top: 16px; }
/* 第二十輪主控補：縣市頁標題與「重新選縣市」在窄屏不互搶 */
@media (max-width: 640px) {
  #districtStep .panel-head { flex-wrap: wrap; gap: 8px; }
  #districtStep #districtTitle { font-size: 24px; }
  #districtStep #clearCity { white-space: nowrap; }
}

/* Round 24: reusable sharing panel */
.share-dialog { width:min(620px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:18px; border:2px solid var(--ink,#161410); background:#f2f2ef; color:#161410; overflow:auto; }
.share-dialog::backdrop { background:rgb(0 0 0 / 60%); }
.share-dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.share-dialog-heading h2 { margin:0; font-size:24px; }
.share-preview { display:block; width:100%; height:auto; }
.share-caption,.share-save-hint { font-size:14px; line-height:1.6; margin:12px 0; }
.share-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.share-dialog .solid-btn,.share-dialog .ghost-btn { display:flex; align-items:center; justify-content:center; min-height:44px; text-align:center; padding:10px 8px; font-size:15px; text-decoration:none; }
.share-actions [data-share-native] { grid-column:1 / -1; }
.share-dialog .share-url { display:block; overflow-wrap:anywhere; user-select:text; }
.share-dialog .share-feedback { display:block; margin-top:8px; }

/* County executive layer, using the existing person card. */
.office-badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 4px 8px; border-radius: 6px; background: #e9edf1; color: #253744; }
.count-note { font-size: 14px; color: #53616c; }

#themeStep .theme-stage { width: 106px; min-height: 48px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--paper); color: var(--ink); font: 700 17px var(--font-sans); cursor: pointer; }
/* Keep the county choices in the first viewport with the added stage picker. */
#themeStep { padding-block: 6px; }
#themeStep .theme-btn { padding: 4px 12px; line-height: 1.25; }
#themeStep .theme-btn .theme-name, #themeStep .theme-btn .theme-hint { line-height: 1.25; }
#themeStep .theme-btn { gap: 0; }
#themeStep .panel-head { margin-bottom: 4px; padding-bottom: 4px; }

/* Round36: county executive entry and city-list badge. */
.city-label { display: inline-flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.city-mayor-badge { display: inline-block; flex: none; padding: 1px 3px; border: 1px solid #781b25; border-radius: 2px; background: #f4e5da; color: #781b25; font-size: 12px; font-weight: 700; line-height: 1.25; }
#themeStep .theme-btn.theme-mayor { border-color: #781b25; color: #781b25; }
@media (max-width: 779px) {
  #themeStep .theme-btn { padding-inline: 8px; }
  #themeStep .theme-stage { width: 100px; padding-inline: 4px; }
  #themeStep .theme-name { white-space: nowrap; }
  #cityStep .city-btn .sub { white-space: nowrap; }
}

/* Round39: adopted offense style A, across all person cards. */
.card-v2.person-card--share .record-title-line {
  -webkit-line-clamp: 2; font-size: 20px; line-height: 1.4;
}
.card-v2.person-card--share .record-offense.offense {
  font-size: 20px; line-height: 1.4; font-weight: 700; color: #881c27;
}
.card-v2.person-card--share .record-block .record-status-chip { color: #881c27; border-color: currentColor; background: transparent; }

.site-statement { font-size:12px; line-height:1.6; color:#4a4a47; margin:20px 0; overflow-wrap:anywhere; }
.site-statement a { color:inherit; text-decoration:underline; }
.photo-credit { font-size:12px; line-height:1.5; color:#4a4a47; margin:4px 0; }
.photo-credit a { color:inherit; }

/* Round45: mobile reading units and touch targets; preserve the established palette. */
.nb, .party-name, .incumbent-tag, .office-badge, .city-mayor-badge { white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
.offense-phrase { display: inline-block; max-width: 100%; word-break: keep-all; overflow-wrap: normal; }
@media (max-width: 779px) {
  .wrap { padding-inline: 16px; }
  .panel { padding-inline: 16px; }
  .hero h1 { text-wrap: balance; }
  .hero h1 .title-unit { white-space: nowrap; }
  .wrap.is-inner .hero h1 .title-unit { white-space: normal; }
  .manifesto p, .theme-page-copy, .panel-hint, .footer-note, .card-disclaimer { text-wrap: pretty; }
  .wrap.is-inner .home-link { display: flex; flex-wrap: wrap; align-content: center; min-height: 44px; }
  .wrap.is-inner .home-link .title-unit { display: contents; }
  .panel-head h2, #districtSummaryArea { text-wrap: balance; }
  #themeStep .theme-btn { padding-inline: 6px; }
  #themeStep .theme-row { gap: 6px; }
  #cityStep .panel-head { gap: 8px; }
  #cityStep .city-btn { padding-inline: 8px; }
  #cityStep .city-label { gap: 3px; }
  .chip-title, .chip-counts { text-wrap: pretty; }
  .chip-counts { line-height: 1.65; }
  .card-v2.person-card--share .name, .family-theme-heading .name, .no-record-row .name, .roster-row .name { white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
  .card-v2.person-card--share .name > a.name-link { display: inline-flex; align-items: center; min-height: 44px; }
  .card-v2.person-card--share .name-row { row-gap: 4px; }
  .card-v2.person-card--share .name-row .id-meta { flex-wrap: wrap; gap: 6px; }
  .card-v2.person-card--share .record-title-line, .civil-title-line { display: block; overflow: visible; -webkit-line-clamp: unset; text-wrap: pretty; }
  .card-v2.person-card--share .record-offense { word-break: normal; overflow-wrap: normal; }
  .card-v2.person-card--share .record-compact-fields > dd { font-size: 14px; line-height: 1.6; word-break: normal; overflow-wrap: normal; }
  .record-full > summary, .civil-full > summary, .more-recs > summary, .record-sources > summary, .family-context-summary { min-height: 44px; padding-block: 11px; box-sizing: border-box; line-height: 22px !important; }
  .more-recs > summary { white-space: nowrap; }
  .card-v2.person-card--share .record-full .record-fields { margin-left: -58px; }
  .card-v2.person-card--share .record-full .record-field { grid-template-columns: 1fr; gap: 3px; padding-block: 4px; }
  .card-v2.person-card--share .record-full .record-value, .civil-value { font-size: 14px; line-height: 1.6; word-break: normal; overflow-wrap: normal; }
  .card-v2.person-card--share .record-full .record-label { font-size: 12px; line-height: 1.6; }
  .civil-fields { margin-left: -52px; }
  .civil-field { grid-template-columns: 1fr; }
  .family-context, .family-case { padding: 12px; }
  .family-fields, .family-case-fields { gap: 10px; }
  .family-field { font-size: 14px; line-height: 1.6; grid-template-columns: 1fr; gap: 2px; }
  .family-field dt { font-size: 12px; }
  .family-field dd { word-break: normal; overflow-wrap: break-word; }
  .family-context-summary { text-wrap: pretty; }
  .family-theme-heading > a, .family-row .name a, .name-links .name-link, .break-item { display: inline-flex; align-items: center; min-height: 44px; }
  .family-theme-heading { gap: 4px 12px; }
  .family-theme-heading > a { white-space: nowrap; }
  .record-full a, .record-sources a, .civil-value a, .family-fields a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
  .record-sources li + li { margin-top: 4px; }
  .footer-note { font-size: 14px; line-height: 1.65; margin-block: 24px 16px; }
  .site-statement { margin-block: 16px; overflow-wrap: normal; }
  .site-statement a, .photo-credit a { position: relative; white-space: nowrap; }
  .site-statement a::after, .photo-credit a::after { content: ''; position: absolute; inset: -14px 0; min-height: 44px; }
  .share-dialog { width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 14px; }
  .share-dialog-heading { margin-bottom: 8px; }
  .share-dialog-heading h2 { font-size: 22px; line-height: 1.4; }
  .share-preview { max-height: 24dvh; object-fit: contain; }
  .share-caption { font-size: 13px; line-height: 1.5; margin: 8px 0; text-wrap: pretty; }
  .share-actions { grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; }
  .share-actions > a { grid-column: span 2; }
  .share-actions [data-share-download], .share-actions [data-share-copy] { grid-column: span 3; }
  .share-actions [data-share-copy] { grid-column: 1 / -1; }
  .share-dialog .solid-btn, .share-dialog .ghost-btn { font-size: 14px; padding: 8px 4px; line-height: 1.45; }
  .share-save-hint { font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
  .share-dialog .share-feedback:empty { display: none; }
}

.hero h1 .title-unit { color: inherit; }

@media (max-width: 779px) {
  .record-full a, .record-sources a, .civil-value a, .family-fields a { min-width: 44px; }
}
.back-to-top { position: fixed; right: 16px; bottom: 16px; z-index: 20; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--ink); border-radius: 4px; background: var(--surface); color: var(--ink); cursor: pointer; }
.back-to-top svg { display: block; width: 22px; height: 22px; }
@media (min-width: 780px) { .back-to-top { display: none; } }
@media (max-width: 779px) {
  .roster-details > summary { min-height: 44px; display: flex; align-items: center; }
  .share-dialog [data-share-close] { min-width: 44px; }
}

/* Rag 棉紙配色：只調整色彩，不加紋理與紙張切換。 */
.panel, .family-profile { border-color: #c9c9c5; }
.panel-head, .family-theme-row { border-bottom-color: #c9c9c5; }
.card-v2.person-card--share .person-card__body,
.card-v2.person-card--share .card-main,
.share-dialog, .share-case-choice select { background-color: var(--surface); }

/* Round47: independently focusable county choice and executive-page link. */
.city-btn { position: relative; }
.city-select { border: 0; padding: 0; margin-block: -8px; min-height: 44px; background: transparent; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
.city-mayor-badge { position: relative; pointer-events: auto; text-decoration: none; }
.city-mayor-badge::after { content: ""; position: absolute; inset: -14px 0; }
.city-select:focus-visible, .city-mayor-badge:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
.mayor-entry { margin: 0 0 16px; line-height: 1.7; }
.mayor-entry a { color: var(--stamp); font-weight: 700; display: inline-block; min-height: 44px; align-content: center; }

/* Round48: predecessor cases use the existing family context and record typography. */
.family-cases { grid-column: 1 / -1; min-width: 0; }
.family-cases .family-case { margin: 0; min-width: 0; }
.family-case .record-offense { margin: 0 0 10px; color: #881c27; font-size: 20px; font-weight: 700; line-height: 1.4; overflow-wrap: break-word; }
.family-cases > summary { min-height: 44px; padding-block: 11px; box-sizing: border-box; line-height: 22px; }
.family-case .family-field { font-size: 14px; line-height: 1.6; }

.family-case a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }

/* Round61: neutral gray palette; three reusable surface tones. */
:root {
  --bg: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #e9e9e6;
  --record-sink: #f2f2ef;
  --muted: #4a4a47;
  --line: #c9c9c5;
  --red-soft: #e9e9e6;
  --map-idle: #e2e2de;
  --map-hover: #d5d5d0;
  --radius: 8px;
  --radius-photo: 8px;
  --paper-grain: none;
  --paper-grain-stock: none;
  --paper-grain-sink: none;
  --paper-grain-micro: none;
}
body { background: var(--bg); }
.panel {
  margin-top: 24px; padding: 24px; border: 0; border-radius: 16px;
  background: var(--surface-2); box-shadow: none;
}
.panel-head { border: 0; gap: 16px; margin-bottom: 16px; padding: 0; }
.panel-hint, .count-note { color: var(--muted); }
.mast, .next-steps, .district-foot-actions, .family-theme-row { border: 0; }
.next-steps { margin-top: 24px; padding-top: 0; gap: 8px; }
.hero { padding-bottom: 16px; }
.hero-row { gap: 16px; }
.hero-badge { border: 0; background: transparent; padding: 8px 0; margin-top: 0; }
.search { border: 0; border-radius: var(--radius); background: var(--surface); padding-block: 16px; }
.search::placeholder { color: var(--muted); opacity: 1; }
.search:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px;
}
.ghost-btn, .solid-btn, .locate-btn, .theme-btn, .city-btn, .chip,
#themeStep .theme-stage, .city-all > summary, .name-links .name-link, .break-item,
.card-v2.person-card--share .card-share, .card-v2.person-card--share .card-share:hover {
  border: 0; border-radius: var(--radius); box-shadow: none; min-height: 44px;
  padding: 8px 16px; background: var(--surface); color: var(--ink);
}
.solid-btn, .card-v2.person-card--share .card-share, .card-v2.person-card--share .card-share:hover {
  background: var(--red); color: #fff;
}
.ghost-btn:hover, .locate-btn:hover, .theme-btn:hover, .city-btn:hover, .city-btn.sync-hover, .chip:hover {
  background: var(--bg); color: var(--ink); border: 0; box-shadow: none;
}
#themeStep .theme-btn.active, .theme-btn.active, .city-btn.active, .chip.active,
.break-item.active { border: 0; background: var(--red); color: #fff; }
#themeStep .theme-btn.active .theme-hint, .city-btn.active .sub, .chip.active .chip-counts,
.chip.active .chip-title, .city-btn.active .city-label { color: #fff; }
#themeStep .theme-btn.theme-mayor { border: 0; color: var(--ink); }
#themeStep .theme-btn.theme-mayor.active { color: #fff; }
#themeStep { padding: 16px 24px; }
#themeStep .panel-head { padding: 0; margin-bottom: 8px; }
#themeStep .theme-row { gap: 8px; }
#themeStep .theme-btn { padding: 8px 12px; }
#themeStep .theme-stage { width: 112px; padding-inline: 8px; font-size: 16px; }
.city-list, .chips, #districtChips.chips, .family-strip { gap: 8px; }
.city-swatch { border: 0; border-radius: 50%; }
.city-btn.active .city-swatch { background: #fff; }
.city-mayor-badge, .office-badge, .incumbent-tag, .result-count {
  border: 0; border-radius: 4px; background: var(--surface-2); color: var(--muted);
}
.city-mayor-badge { font-size: 11px; padding: 2px 4px; }
.office-badge { font-size: 12px; padding: 4px 8px; }
.incumbent-tag { font-size: 11px; padding: 2px 4px; }
.city-btn.active .city-mayor-badge { background: var(--surface); color: var(--ink); }
.result-count { padding: 8px; background: var(--surface); }
.map-stage, #cityStep .map-stage { border: 0; border-radius: var(--radius); background: var(--bg); }
.locate-result, .family-profile, .no-record-row, .family-row, .roster-strip, .data-boundary {
  border: 0; border-radius: var(--radius); padding: 16px; background: var(--surface);
}
#districtChips .chip { padding: 16px; }
#districtSummary { padding: 0; margin-bottom: 24px; }
.district-foot-actions { margin-top: 24px; padding-top: 0; }
.grid, .group-grid, .person-cards { gap: 24px; }
.card-v2.person-card--share {
  border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: none;
}
.card-v2.person-card--share .avatar,
.card-v2.person-card--share .photo,
.card-v2.person-card--share .person-photo { border: 0; }
.card-v2.person-card--share .card-main,
.card-v2.person-card--share .person-card__body,
.card-v2.person-card--share.card-neutral .person-card__body,
.card-v2.person-card--share.card-has-guilty .person-card__body {
  border: 0; padding: 16px; background: var(--surface); box-shadow: none;
}
.card-v2.person-card--share .card-location { margin: 8px 0 16px; }
.card-v2.person-card--share .record-block,
.card-v2.person-card--share .civil-block {
  border: 0; padding: 16px; margin: 0; border-radius: var(--radius); background: var(--bg); gap: 8px;
}
.card-v2.person-card--share .record-block + .record-block { margin-top: 16px; }
.card-v2.person-card--share .more-recs { margin-top: 8px; }
.card-v2.person-card--share .more-recs-body { border: 0; padding: 0; margin-top: 8px; gap: 0; }
.card-v2.person-card--share .record-full .record-fields { border: 0; margin-top: 8px; padding-top: 8px; }
.card-v2.person-card--share .card-actions { border: 0; margin-top: 16px; padding: 0; gap: 8px; }
.card-v2.person-card--share .card-disclaimer { border: 0; margin-top: 8px; padding-top: 0; }
.card-v2.person-card--share .election-invalidity { margin-top: 16px; }
.card-v2.person-card--share .record-status-chip, .civil-status-chip, .tag[data-theme] {
  border-width: 1px; border-radius: 2px; font-size: 11px; padding: 1px 4px;
}
.family-context-wrap { border: 0; margin-top: 16px; padding-top: 0; }
.family-context { border: 0; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.family-fields { gap: 16px; }
.family-theme-row { margin-bottom: 16px; padding: 16px; background: var(--surface); border-radius: var(--radius); }
.family-profile .family-theme-row { padding: 0; }
.family-profile .family-context { background: var(--bg); }
.family-row .name a { border: 0; text-decoration: underline; text-decoration-color: var(--red); }
.roster-details { border: 0; margin-top: 24px; }
.roster-details > summary { padding-block: 8px; }
.roster-row { border: 0; padding-block: 8px; }
.share-dialog {
  border: 0; border-radius: 16px; padding: 24px; background: var(--surface);
  box-shadow: 0 16px 64px rgb(22 20 16 / 20%);
}
.share-dialog .ghost-btn { border: 0; border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.share-preview { border-radius: var(--radius); }
.share-dialog-heading { gap: 16px; margin-bottom: 16px; }
.share-actions { gap: 8px; }
.back-to-top { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 16px rgb(22 20 16 / 12%); }
@media (min-width: 1100px) {
  .grid, .person-cards, #people.grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 779px) {
  .panel { margin-top: 16px; padding: 16px; }
  #themeStep { padding: 16px; }
  #themeStep .theme-btn { padding: 8px; }
  #themeStep .theme-row { gap: 8px; }
  #themeStep .theme-stage { width: 104px; padding-inline: 8px; }
  #cityStep.map-panel { margin-top: 16px; }
  #cityStep .city-btn { padding: 8px; }
  .panel-head { gap: 8px; margin-bottom: 16px; }
  .grid, .group-grid, .person-cards { gap: 16px; }
  .share-dialog { padding: 16px; }
  .share-dialog-heading { margin-bottom: 8px; }
  .share-dialog .solid-btn, .share-dialog .ghost-btn { padding: 8px 4px; }
  .share-actions { gap: 8px; }
}
.solid-btn:hover { background: #981324; color: #fff; filter: none; }
.card-v2.person-card--share .record-compact-fields { gap: 8px; }
@media (max-width: 779px) {
  .card-v2.person-card--share .record-full .record-fields { margin-left: -56px; }
}
#themeStep .theme-stage { min-height: 48px; font-size: 17px; }
.family-disclaimer { border: 0; padding: 0; margin-top: 16px; }

/* Round 45 approved: one 4:5 preview, actions remain visible. */
.share-preview { max-height: 32dvh; object-fit: contain; }
@media (max-width: 779px) { .share-preview { max-height: 24dvh; } }

.share-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.share-actions > a { grid-column: span 2; }
.share-actions [data-share-download], .share-actions [data-share-copy] { grid-column: span 3; }

/* Round45 integration: current mayor links and predecessor cases share the same surfaces. */
.city-select { border-radius: var(--radius); }
.family-cases .family-case { border: 0; padding: 16px; margin-top: 8px; background: var(--bg); border-radius: var(--radius); }
.family-cases .more-recs-body { border: 0; padding: 0; margin-top: 8px; }
.family-case-fields { gap: 16px; }
.family-cases > summary { border: 0; padding-block: 8px; margin-top: 8px; }
.family-row .family-cases, .family-theme-row .family-cases { border: 0; }
.mayor-entry { border: 0; padding: 0; margin-bottom: 16px; background: transparent; }

/* Round50: keep one visible sentence and never offer an empty judgment disclosure. */
.card-v2.person-card--share .record-compact-fields:has(.record-full[open]) > .sentence-summary { display: none; }
.card-v2.person-card--share .record-unlinked-fields { display: grid; grid-template-columns: 4em minmax(0, 1fr); gap: 8px; margin: 0; font-size: 14px; line-height: 1.6; }
.record-unlinked-fields dt { color: var(--muted); }
.record-unlinked-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.card-v2.person-card--share .record-title-line { display: block; overflow: visible; -webkit-line-clamp: unset; word-break: normal; overflow-wrap: anywhere; }
.card-v2.person-card--share .record-offense { word-break: normal; }
.record-offense .offense-phrase, .record-offense .nb { display: inline; white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.family-case .record-offense { white-space: normal; word-break: normal; overflow-wrap: anywhere; }

/* Round53: family cards use the same square photo area as person cards. */
#people.family-theme-table { display: grid; }
#districtFamily.family-strip { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.family-photo-card { display: flex; flex-direction: column; min-width: 0; padding: 0; gap: 0; margin-bottom: 0; overflow: hidden; border: 0; border-radius: var(--radius); background: var(--surface); }
.family-photo-card > .person-photo { position: relative; display: block; width: 100%; height: auto; min-height: 0; max-height: none; aspect-ratio: 1 / 1; flex: 0 0 auto; overflow: hidden; padding: 0; border: 0; border-radius: 0; background: var(--record-sink); }
.family-card-body { min-width: 0; padding: 16px; }
.family-row .family-card-body { display: flex; flex-direction: column; gap: 8px; }
.family-card-body > .solid-btn { margin-top: 16px; }
.relationship-links { display: flex; flex-wrap: wrap; gap: 8px 12px; overflow-wrap: anywhere; }
.relationship-evidence { margin-top: 8px; }
.relationship-evidence > summary { cursor: pointer; min-height: 44px; align-content: center; }
.relationship-evidence-body { margin-top: 8px; line-height: 1.6; overflow-wrap: anywhere; }
@media (min-width: 780px) {
  #districtFamily.family-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}

/* Round59: expanded judgment fields occupy the card width, with one narrow label column. */
.card-v2.person-card--share .record-compact-fields { grid-template-columns: 5em minmax(0, 1fr); }
.card-v2.person-card--share .record-compact-fields:has(.record-full[open]) > .judgment-label { display: none; }
.card-v2.person-card--share .record-compact-fields:has(.record-full[open]) > .judgment-content { grid-column: 1 / -1; }
.card-v2.person-card--share .record-full .record-fields { margin: 8px 0 0; padding: 0; min-width: 0; }
.card-v2.person-card--share .record-full .record-field { grid-template-columns: 5em minmax(0, 1fr); gap: 8px; }
.card-v2.person-card--share .record-full .record-value,
.card-v2.person-card--share .record-full .record-value .nb,
.card-v2.person-card--share .record-full .case-number {
  min-width: 0; max-width: 100%; white-space: normal; word-break: normal; overflow-wrap: anywhere;
}

/* Round62: preserve full village boundaries behind a native disclosure. */
.village-details { margin: 12px 0 24px; color: var(--muted); line-height: 1.8; }
.village-details summary { cursor: pointer; min-height: 44px; padding: 8px 0; font-weight: 700; }
.village-details p { margin: 8px 0; overflow-wrap: anywhere; }
.district-search-result { text-decoration: none; color: inherit; }

/* Round 67: maker credit under hero badge. */
.hero-badge-wrap { flex: 0 0 auto; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-badge-wrap .hero-badge { margin-top: 0; align-self: auto; }
.hero-maker { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 600 14px/1.3 var(--font-sans); letter-spacing: 0.06em; text-decoration: none; }
.hero-maker img { width: 22px; height: 22px; object-fit: contain; }
.hero-maker:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 780px) { .hero-badge-wrap { align-self: flex-start; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 14px; } }
.wrap.is-inner .hero-badge-wrap { display: none; }

/* Round 73 demo */
.party-chips { display:flex; gap:6px; overflow-x:auto; max-width:100%; padding:6px 0 10px; margin-bottom:8px; }
.party-chips[hidden] { display:none; }
.party-chips .chip { flex:0 0 auto; width:auto; min-width:0; min-height:44px; padding:8px 12px; font-size:14px; white-space:nowrap; text-align:center; }
.party-chips .chip.is-active { background:var(--red); color:white; border-color:var(--red); }
.wrap.is-inner #statsStep { display:none; }
#statsStep { padding:14px 20px; }
#statsDetails > summary { cursor:pointer; min-height:44px; align-content:center; }
#statsDetails > summary strong { font-size:19px; margin-right:16px; }
#statsSummary { font-size:14px; color:var(--muted); }
#statsCharts { display:grid; gap:16px; margin-top:18px; }
.stat-card { background:#fff; border:1px solid var(--line); padding:24px; min-width:0; }
.stat-heading { display:flex; justify-content:space-between; align-items:start; gap:16px; margin-bottom:24px; }
.stat-heading h3 { margin:0; font-size:23px; line-height:1.5; }
.stat-heading button { flex-shrink:0; font-size:14px; }
.stat-bars { display:grid; gap:14px; }
.stat-bar-row { display:grid; grid-template-columns:180px minmax(0,1fr) 64px; align-items:center; gap:16px; font-size:18px; }
.stat-bar-row > span { overflow-wrap:anywhere; }
.stat-bar-row strong { color:var(--red); font-size:24px; }
.stat-bar-row small { font-size:13px; color:var(--muted); font-weight:400; }
.stat-track { background:#f2f2ef; height:20px; }
.stat-track i { display:block; background:var(--red); height:100%; }
.stat-note { color:var(--muted); font-size:14px; line-height:1.7; margin:20px 0 0; }
.stat-party-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.stat-party { border:1px solid var(--line); min-width:0; }
.stat-party h4 { padding:16px; margin:0; background:#f2f2ef; font-size:20px; text-align:center; }
.stat-party h4 strong { display:block; color:var(--red); font-size:26px; }
.stat-analysis-head,.stat-analysis-row { display:grid; grid-template-columns:36px minmax(0,1fr) 42px; gap:8px; padding:12px; line-height:1.6; font-size:16px; border-top:1px solid var(--line); }
.stat-analysis-head { font-size:13px; color:var(--muted); }
.stat-analysis-row strong { color:var(--red); white-space:nowrap; }
@media(max-width:779px) {
  #statsStep { padding:8px 16px; margin-top:10px; }
  #statsDetails > summary strong { font-size:17px; }
  #statsSummary { display:block; margin-top:4px; font-size:13px; }
  .stat-card { padding:16px 12px; }
  .stat-heading { gap:8px; margin-bottom:18px; }
  .stat-heading h3 { font-size:18px; }
  .stat-heading button { padding:8px; font-size:12px; }
  .stat-bar-row { grid-template-columns:100px minmax(0,1fr) 44px; gap:8px; font-size:14px; }
  .stat-bar-row strong { font-size:20px; }
  .stat-track { height:16px; }
  .stat-party-grid { grid-template-columns:1fr; }
}
@media(max-width:779px) {
  .wrap:not(.is-inner) .hero { padding-bottom:0; }
  .wrap:not(.is-inner) .hero-row { gap:4px; }
  .wrap:not(.is-inner) .hero .search-wrap { margin-top:8px; }
  .wrap:not(.is-inner) .hero-badge { padding-block:2px; }
  .wrap:not(.is-inner) #themeStep { padding-block:12px; margin-top:8px; }
  .wrap:not(.is-inner) #cityStep { margin-top:8px; }
  .wrap:not(.is-inner) #cityStep .panel-head { margin-bottom:8px; }
  #statsStep { padding-block:4px; }
}
/* Full registration denominators and party colors. */
#statParties .stat-bar-row { grid-template-columns:180px minmax(0,1fr) 260px; }
#statParties .stat-party-count { font-size:16px; color:var(--ink); font-weight:600; text-align:right; white-space:nowrap; }
#statParties .party-mark { display:inline-flex; align-items:center; gap:6px; min-width:0; }
#statParties .party-name { white-space:normal; overflow-wrap:anywhere; }
.stat-party h4 { color:#fff; }
.stat-party h4 .party-mark { display:flex; justify-content:center; align-items:center; gap:8px; }
.stat-party h4 .party-mark img { background:#fff; border-radius:50%; padding:2px; box-sizing:content-box; }
.stat-party h4 strong { color:#fff; font-size:18px; margin-top:8px; }
@media(max-width:779px) {
  #statParties .stat-bar-row { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  #statParties .stat-party-count { font-size:12px; grid-column:2; grid-row:1; }
  #statParties .party-mark { grid-column:1; grid-row:1; font-size:14px; gap:4px; }
  #statParties .party-mark img { width:18px; height:18px; }
  #statParties .stat-track { grid-column:1 / -1; grid-row:2; }
  #statParties .stat-bars { gap:18px; }
}
.stat-party h4 .party-mark, .stat-party h4 .party-name { color:inherit; }
.stat-draft-note { color:var(--red); font-weight:700; }
#statParties .party-mark img { flex-shrink:0; }
#zeroRecordParties { margin-top:20px; border-top:1px solid var(--line); padding-top:12px; }
#zeroRecordParties > summary { cursor:pointer; font-size:14px; line-height:1.7; min-height:44px; align-content:center; }
#zeroRecordParties > .stat-bars { margin-top:16px; }
#zeroRecordParties .zero-collapse, #zeroRecordParties[open] .zero-expand { display:none; }
#zeroRecordParties[open] .zero-collapse { display:inline; }
#zeroRecordParties .zero-expand, #zeroRecordParties .zero-collapse { white-space:nowrap; }
@media(max-width:779px) {
  #zeroRecordParties > summary { font-size:13px; list-style:none; }
  #zeroRecordParties > summary::-webkit-details-marker { display:none; }
}
/* Larger chart typography, including mobile and the three-party tables. */
.stat-heading h3 { font-size:24px; }
.stat-heading button { font-size:15px; }
.stat-bar-row { font-size:18px; }
.stat-bar-row strong { font-size:28px; }
.stat-bar-row small, .stat-note { font-size:15px; }
#statParties .stat-bar-row { grid-template-columns:180px minmax(0,1fr) 340px; }
#statParties .party-mark { font-size:18px; }
#statParties .stat-party-count { font-size:20px; }
#statParties .stat-party-count b { font-size:28px; }
.stat-party h4 { font-size:22px; }
.stat-party h4 strong { font-size:20px; }
.stat-party h4 strong b { font-size:28px; }
.stat-party h4 strong span { white-space:nowrap; }
.stat-analysis-head, .stat-analysis-row { grid-template-columns:32px minmax(0,1fr) 56px; }
.stat-analysis-head { font-size:15px; }
.stat-analysis-row { font-size:18px; }
.stat-analysis-row strong { font-size:24px; }
#zeroRecordParties > summary { font-size:15px; }
@media(max-width:779px) {
  .stat-heading { flex-wrap:wrap; }
  .stat-heading h3 { flex:1 1 190px; font-size:24px; }
  .stat-heading button { margin-left:auto; font-size:14px; }
  .stat-bar-row { grid-template-columns:120px minmax(0,1fr) 58px; font-size:18px; }
  .stat-bar-row strong { font-size:28px; }
  #statParties .stat-bar-row { grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; }
  #statParties .party-mark { font-size:18px; }
  #statParties .party-mark img { width:22px; height:22px; }
  #statParties .stat-party-count { display:contents; font-size:20px; white-space:normal; }
  #statParties .stat-party-count b { grid-column:2; grid-row:1; font-size:28px; text-align:right; color:var(--ink); }
  #statParties .stat-party-count > span { grid-column:1 / -1; grid-row:2; text-align:right; font-size:18px; color:var(--ink); }
  #statParties .stat-track { grid-row:3; margin-top:4px; }
}
.stat-category-unit { display:inline-block; white-space:nowrap; }
@media(max-width:779px) {
  #statOffenses .stat-bar-row { grid-template-columns:140px minmax(0,1fr) 58px; }
  #statParties .stat-party-count b { line-height:1.2; }
  #statParties .stat-party-count > span { line-height:1.4; }
}
/* 第七十七輪：手機版政黨圖人數與比例同一行（使用者 2026-09-15）。 */
@media(max-width:779px) {
  #statParties .stat-bar-row { grid-template-columns:minmax(0,1fr); gap:2px 0; }
  #statParties .party-mark { grid-column:1; grid-row:1; }
  #statParties .stat-party-count { display:block; grid-column:1; grid-row:2; text-align:right; white-space:nowrap; font-size:16px; line-height:1.4; color:var(--ink); }
  #statParties .stat-party-count b { display:inline; font-size:22px; line-height:1.2; }
  #statParties .stat-party-count > span { display:inline; font-size:16px; line-height:1.4; }
  #statParties .stat-track { grid-column:1; grid-row:3; margin-top:4px; }
  #statParties .stat-bars { gap:14px; }
}
