:root {
  --bg: #f1f2f6;
  --surface: #f5f6fa;
  --surface-2: #fbfbfd;
  --line: rgba(20,24,34,0.06);
  --text: #12141a;
  --muted: #7f8694;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 10px 10px 24px rgba(24,29,39,0.08), -10px -10px 24px rgba(255,255,255,0.86);
  --shadow-soft-sm: 6px 6px 14px rgba(24,29,39,0.06), -6px -6px 14px rgba(255,255,255,0.9);
  --brand: #d32f2f;
  --green: #14a85a;
  --red: #e0362e;
  --muted-2: #b0b6c2;
  --map-blue: #1a56c8;
  --map-blue-soft: #dbe8ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 64px;
}

/* HERO */
.hero2 {
  margin: 14px 14px 0;
  background: linear-gradient(150deg, #7f1d1d 0%, #b91c1c 60%, #ef4444 100%);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(127,29,29,.22);
}

.hero-title2 {
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -.3px;
  margin-bottom: 6px;
}

.hero-sub2 {
  font-size: 12px;
  color: rgba(255,255,255,.72);
  line-height: 1.55;
}

/* SECTION */
.section {
  margin: 20px 14px 0;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: #131722;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow-soft-sm);
}

/* MAP CARD */
.map-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.map-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 12px 10px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}

.map-tab {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  color: var(--muted);
  box-shadow: var(--shadow-soft-sm);
  transition: all .15s;
}

.map-tab.active {
  background: linear-gradient(135deg,#ef5350,#b71c1c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(211,47,47,.30);
}

/* MAP AREA */
.map-stage {
  position: relative;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 30%),
    linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
}

.map-selected-pill {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19,23,34,.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 30;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.map-selected-pill.show {
  opacity: 1;
}

.map-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: var(--shadow-soft-sm);
}

.map-image {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

.map-point-group {
  position: absolute;
  width: 0;
  height: 0;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}

.map-point-group:hover,
.map-point-group:focus-visible {
  z-index: 20;
}

.map-point-group.is-hidden {
  display: none;
}

.map-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--map-blue);
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  z-index: 2;
  transition: transform 0.2s ease;
}

.map-point-group:hover .map-dot,
.map-point-group:focus-visible .map-dot {
  transform: translate(-50%, -50%) scale(1.18);
}

.weather-panel {
  position: absolute;
  bottom: 20px;
  left: 0;
  transform: translateX(-50%);
  min-width: 54px;
  background: rgba(255,255,255,.98);
  border: 1px solid #d8deea;
  border-radius: 6px;
  text-align: center;
  padding: 5px 4px;
  z-index: 3;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  box-shadow: 0 4px 10px rgba(18,20,26,0.08);
}

.map-point-group:hover .weather-panel,
.map-point-group:focus-visible .weather-panel {
  border-color: var(--map-blue);
  box-shadow: 0 6px 14px rgba(26,86,200,.16);
}

.map-panel-city {
  font-size: 11px;
  color: #333;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.1px;
}

/* 位置調整 */
.pos-bottom .weather-panel {
  bottom: auto;
  top: 20px;
}

.pos-top-right .weather-panel {
  bottom: 5px;
  left: 5px;
  transform: none;
}

.pos-right .weather-panel {
  bottom: auto;
  left: 10px;
  transform: none;
}

.pos-bottom-right .weather-panel {
  top: 10px;
  bottom: auto;
  left: 5px;
  transform: none;
}

.pos-top-left .weather-panel {
  bottom: 20px;
  right: -5px;
  left: auto;
  transform: none;
}

.pos-left .weather-panel {
  bottom: 10px;
  right: -5px;
  left: auto;
  transform: none;
}

.pos-bottom-left .weather-panel {
  top: 10px;
  bottom: auto;
  right: -5px;
  left: auto;
  transform: none;
}

.map-caption {
  padding: 10px 12px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.map-caption strong {
  color: var(--text);
}

.map-points-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
}

.map-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  padding: 5px 9px;
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  box-shadow: var(--shadow-soft-sm);
}

.map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--map-blue);
  box-shadow: 0 0 0 2px #fff;
}

/* CITY PILLS */
.city-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

.city-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  box-shadow: var(--shadow-soft-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: transform .15s;
}

.city-pill:active {
  transform: translateY(1px);
}

.city-pill.is-hidden {
  display: none;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d32f2f;
  flex-shrink: 0;
}

.dot.g {
  background: var(--green);
}

.dot.r {
  background: var(--red);
}

/* RANKING CHIPS */
.ranking-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.ranking-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: transform .15s;
}

.ranking-chip:active {
  transform: translateY(1px);
}

.ranking-chip-arrow {
  font-size: 10px;
  color: var(--muted);
}

/* REGION ACCORDION */
.region-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.region-item {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.region-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}

.region-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.region-name {
  font-size: 14px;
  font-weight: 800;
}

.region-count {
  font-size: 11px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

.region-arrow {
  font-size: 11px;
  color: var(--muted);
  transition: transform .2s;
}

.region-item.open .region-arrow {
  transform: rotate(180deg);
}

.region-body {
  display: none;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.region-item.open .region-body {
  display: block;
  padding-top: 12px;
}

.pref-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 7px;
}

.pref-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s;
}

.pref-btn:active {
  transform: translateY(1px);
}

.pref-btn-name {
  font-size: 13px;
  font-weight: 700;
}

.pref-btn-sub {
  font-size: 10px;
  color: var(--muted);
}

.pref-btn.hl {
  border-color: rgba(211,47,47,.25);
  background: linear-gradient(135deg,rgba(47,125,246,.07),rgba(47,125,246,.02));
}

.pref-btn.hl .pref-btn-name {
  color: #d32f2f;
}

.pref-btn.search-hidden {
  display: none;
}

/* UTILS */
.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 14px 0;
}

.aos {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
}

.aos.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 380px) {
  .pref-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .map-panel-city {
    font-size: 10px;
  }

  .weather-panel {
    min-width: 48px;
    padding: 4px 3px;
  }
}

/* =============================================
   ELECTION CARDS
============================================= */
.election-section {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  padding: 14px;
}

.election-section-head {
  margin-bottom: 12px;
}

.election-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.election-section-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.election-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.election-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg,#fff 0%,#f4f6fa 100%);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-soft-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.election-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(211,47,47,.18);
}

.election-card:active {
  transform: translateY(1px);
}

.election-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.election-date-month {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 7px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg,#ef5350,#b71c1c);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.2px;
  box-shadow: 0 4px 12px rgba(211,47,47,.22);
}

.election-date-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20, 168, 90, 0.12);
  color: #12824b;
  font-size: 10px;
  font-weight: 700;
}

.election-date-status.undecided {
  background: rgba(176,182,194,.22);
  color: #5f6776;
}

.election-body {
  min-width: 0;
}

.election-pref {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.election-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.election-arrow {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
}

.election-card.is-undecided .election-date-month {
  background: linear-gradient(135deg,#9aa3b2,#707887);
  box-shadow: 0 4px 12px rgba(127,134,148,.18);
}

@media (min-width: 768px) {
  .election-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}