/* 지역 선택 모달 — partials/region_modal.php 가 직접 불러온다(타자·랭킹·마이페이지 공용). tokens.css 변수만 사용. */
.rg-modal { display: flex; flex-direction: column; gap: var(--sp-3); }
.rg-sub { color: var(--text-muted); margin: 0; }
.rg-step-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 var(--sp-2); }
.rg-search { width: 100%; }

/* Step 1 — 시·도 그리드 */
.rg-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-1);
  margin-top: var(--sp-3); max-height: 300px; overflow-y: auto;
}
@media (max-width: 560px) { .rg-grid { grid-template-columns: repeat(2, 1fr); } }
.rg-prov { border: 1px solid var(--border); text-align: center; color: var(--text); }
.rg-prov:hover { background: var(--surface-sunken); color: var(--text); }
.rg-sep { grid-column: 1 / -1; height: 0; margin: var(--sp-1) 0; border-top: 1px solid var(--border); }

/* Step 1 — 검색 결과(시·군·구 바로가기 · 옛 이름/통칭). 목록형 카드: 이름 + 소속 + 종류 칩 + 화살표 */
.rg-alias {
  display: flex; flex-direction: column; margin-top: var(--sp-2);
  border: 1px solid var(--border); border-radius: var(--radius-md, 10px);
  background: var(--surface); overflow: hidden;
}
.rg-alias[hidden] { display: none; }
.rg-alias-head { font-size: var(--fs-xs); color: var(--text-muted); padding: 8px 14px 4px; margin: 0; }
.rg-hit {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  background: none; border: 0; border-top: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-family: var(--font-ui); text-align: left;
  padding: 11px 14px; transition: background .12s ease;
}
.rg-alias-head + .rg-hit { border-top: 0; }
.rg-hit:hover { background: var(--surface-sunken); }
.rg-hit:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; background: var(--surface-sunken); }
.rg-hit-pin {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-red-soft); color: var(--brand-red); font-size: 14px;
}
.rg-hit-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.rg-hit-name { font-weight: 700; font-size: var(--fs-md, 1rem); }
.rg-hit-sub { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-hit-kind {
  flex: none; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  background: var(--surface-sunken); border-radius: var(--radius-full); padding: 2px 9px;
}
.rg-hit-kind.is-alias { background: var(--brand-gold-soft); color: var(--text); }
.rg-hit-go { flex: none; color: var(--text-faint); font-size: 18px; line-height: 1; }
.rg-hit:hover .rg-hit-go { color: var(--brand-red); }

/* Step 2 — 시·군·구 */
.rg-selected { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.rg-commune-box { position: relative; }
.rg-commune-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin: 4px 0 0; padding: var(--sp-1);
  list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-2); max-height: 240px; overflow-y: auto;
}
.rg-commune-item {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--text); font-family: var(--font-ui); font-size: var(--fs-sm); padding: 7px 10px; border-radius: var(--radius-sm);
}
.rg-commune-item:hover, .rg-commune-item:focus-visible { background: var(--surface-sunken); outline: none; }
.rg-commune-empty { color: var(--text-muted); font-size: var(--fs-sm); padding: 7px 10px; }
.rg-commune-selected { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 0; }
.rg-no-districts { font-size: var(--fs-xs); color: var(--text-muted); margin: var(--sp-1) 0 0; }

.rg-privacy { color: var(--text-faint); font-size: var(--fs-xs); margin: 0; }
.rg-actions { display: flex; justify-content: space-between; gap: var(--sp-3); }
