/* Korea ZipCode Hub — Apple-inspired Design System */

:root,
[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-secondary: #e8e8ed;
  --bg-tertiary: #f0f0f5;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9f0a;
  --naver: #03c75a;
  --kakao: #fee500;
  --kakao-text: #191919;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --nav-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Apple SD Gothic Neo", Pretendard, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --overlay: rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-secondary: #2c2c2e;
  --bg-tertiary: #3a3a3c;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --overlay: rgba(0, 0, 0, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

body.admin-body {
  padding: 0 0 calc(1.5rem + var(--safe-b));
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

[x-cloak] {
  display: none !important;
}

/* ── Layout ── */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px 48px;
}

.page--admin {
  max-width: 1180px;
  padding-top: 16px;
}

.page--login {
  max-width: 400px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 22px;
}

/* ── Site header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.brand {
  min-width: 0;
}
.brand__title {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}
.brand__sub {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-secondary);
  border-radius: 999px;
  gap: 2px;
}
.seg__btn {
  min-width: 64px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.seg__btn.is-active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
}
.seg__btn.is-active[data-map="naver"] {
  color: var(--naver);
}
.seg__btn.is-active[data-map="kakao"] {
  color: var(--kakao-text);
  background: var(--kakao);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 980px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 510;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease),
    opacity 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  background: var(--bg-tertiary);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled,
.btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding: 0 10px;
}
.btn--ghost:hover {
  background: var(--accent-soft);
}

.btn--danger {
  color: var(--danger);
  background: transparent;
}
.btn--danger:hover {
  background: rgba(255, 59, 48, 0.1);
}

.btn--icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 50%;
}

.btn--subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #1e293b);
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn--subtle:hover:not(:disabled) {
  background: var(--color-surface-hover, #f1f5f9);
  color: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
}
.btn--subtle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

.btn--block {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
}

.btn.is-active {
  background: var(--accent);
  color: #fff;
}
.btn.is-active:hover {
  background: var(--accent-hover);
}

.btn--donate {
  background: rgba(255, 45, 85, 0.1);
  color: #ff2d55;
  font-weight: 600;
  border: 1px solid rgba(255, 45, 85, 0.2);
  transition: all 0.2s var(--ease);
}
.btn--donate:hover {
  background: #ff2d55;
  color: #ffffff;
  border-color: #ff2d55;
  box-shadow: 0 4px 12px rgba(255, 45, 85, 0.3);
}
.btn--donate__icon {
  color: #ff2d55;
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--donate:hover .btn--donate__icon {
  color: #ffffff;
  transform: scale(1.2);
}
[data-theme="dark"] .btn--donate {
  background: rgba(255, 55, 95, 0.18);
  color: #ff375f;
  border-color: rgba(255, 55, 95, 0.3);
}
[data-theme="dark"] .btn--donate:hover {
  background: #ff375f;
  color: #ffffff;
  border-color: #ff375f;
  box-shadow: 0 4px 14px rgba(255, 55, 95, 0.4);
}
[data-theme="dark"] .btn--donate__icon {
  color: #ff375f;
}

/* ── Cards / surfaces ── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card + .card {
  margin-top: 16px;
}

/* ── Form controls ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled,
.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input::placeholder {
  color: var(--text-tertiary);
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Search shell */
.search-shell {
  position: relative;
}
.search-shell__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
}
.search-shell .input {
  padding-left: 42px;
  padding-right: 44px;
  min-height: 52px;
  font-size: 1.0625rem;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
}
.search-shell__clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.search-shell__clear:hover {
  background: var(--bg-tertiary);
}

/* ── Autocomplete Dropdown ──────────────────────────── */
.ac-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  animation: acFadeIn 0.13s ease;
}
@keyframes acFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover,
.ac-item.is-active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.ac-item__zip {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 6px;
  padding: 2px 7px;
  min-width: 52px;
  text-align: center;
}
.ac-item__text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .ac-dropdown {
  background: rgba(30,32,40,0.96);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
[data-theme="dark"] .ac-item:hover,
[data-theme="dark"] .ac-item.is-active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.hint-row__kbd {
  margin-left: auto;
  opacity: 0.7;
  font-size: 0.75rem;
}

.section-head__range {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.zip-btn,
.addr-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: inherit;
  max-width: 100%;
}
.zip-btn {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.zip-btn:hover,
.addr-btn:hover .addr {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.addr-btn {
  text-align: left;
  width: 100%;
}

.search-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* sticky search on mobile */
@media (max-width: 768px) {
  .card[aria-label="주소 검색"] {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* History chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.chip:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
}
.chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.chip__remove {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}
.chip__remove:hover {
  color: var(--danger);
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.hint-row__label {
  font-weight: 500;
}
.hint-row button {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-weight: 510;
}
.hint-row button:hover {
  text-decoration: underline;
}

/* ── Results ── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 14px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head__meta {
  color: var(--accent);
  font-weight: 600;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar .select {
  width: auto;
  min-height: 36px;
  font-size: 0.8125rem;
}

.sort-bar {
  display: none;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sort-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 510;
  cursor: pointer;
}
.sort-chip.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.table-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.table-wrap.is-loading .data-table {
  opacity: 0.45;
  pointer-events: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.data-table th.is-center,
.data-table td.is-center {
  text-align: center;
}
.data-table th.sortable {
  cursor: pointer;
}
.data-table th.sortable:hover {
  color: var(--accent);
}
.sortable-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  word-break: break-word;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr {
  transition: background 0.15s var(--ease);
}
.data-table tbody tr:hover {
  background: var(--accent-soft);
}

.zip {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.addr {
  font-weight: 510;
  line-height: 1.4;
}
.addr__secondary {
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 510;
  border: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tag:hover {
  background: var(--bg-tertiary);
}
.tag.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.row-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn:hover {
  transform: scale(1.06);
  text-decoration: none;
}
.icon-btn--map-naver {
  background: var(--naver);
  color: #fff;
}
.icon-btn--map-kakao {
  background: var(--kakao);
  color: var(--kakao-text);
}

/* Empty / loading */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}
.empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.empty h3 {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.empty p {
  margin: 0;
  font-size: 0.875rem;
}

/* Pagination */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.pager__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 510;
  cursor: pointer;
}
.pager__btn:hover:not(:disabled) {
  background: var(--bg-secondary);
}
.pager__btn.is-active {
  background: var(--accent);
  color: #fff;
}
.pager__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pager__ellipsis {
  color: var(--text-tertiary);
  padding: 0 4px;
  font-weight: 600;
}
.pager__total {
  margin-left: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-secondary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #f5f5f7;
  font-size: 0.875rem;
  font-weight: 510;
  text-align: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="dark"] .toast {
  background: rgba(44, 44, 46, 0.95);
}
.toast--success {
  background: rgba(52, 199, 89, 0.92);
  color: #fff;
}
.toast--warning {
  background: rgba(255, 159, 10, 0.95);
  color: #1d1d1f;
}
.toast--error {
  background: rgba(255, 59, 48, 0.95);
  color: #fff;
}

/* Overlay spinner */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.overlay__panel {
  text-align: center;
  padding: 28px;
}
.overlay__text {
  margin: 16px 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--accent {
  border-color: var(--accent-soft);
  border-top-color: var(--accent);
}
.table-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}
.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Admin shell ── */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.admin-nav__brand {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.admin-nav__brand:hover {
  text-decoration: none;
  opacity: 0.75;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.admin-tabs .btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--text-secondary);
}
.admin-tabs .btn.is-active {
  background: var(--accent);
  color: #fff;
}
.admin-tabs .btn:hover:not(.is-active) {
  background: var(--bg-secondary);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 16px;
}
.admin-actions .input,
.admin-actions .select {
  min-height: 40px;
}
.admin-actions .input--grow,
.admin-actions .input-with-clear.input--grow {
  flex: 1 1 200px;
}
.admin-actions .select {
  width: auto;
  flex: 0 0 auto;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 510;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.check-pill input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.stat-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.stat-cloud__title {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}
.stat-pill {
  display: inline-flex;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 510;
}
.stat-pill strong {
  color: var(--accent);
  font-weight: 700;
}

.dropzone {
  margin: 16px 0;
  padding: 40px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--bg);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.file-list {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.file-list__item {
  padding: 2px 0;
}

.log-box {
  margin-top: 16px;
  height: 280px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-box--tall {
  height: 400px;
  margin-top: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.log-line {
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.status-bar strong {
  color: var(--text);
  font-weight: 600;
}
.status-bar--scan {
  flex-direction: column;
  align-items: stretch;
}
.status-bar__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.scan-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.scan-progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  width: 0%;
  min-width: 0;
  transition: width 0.28s ease;
}

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.callout__body {
  flex: 1 1 200px;
  min-width: 0;
}
.callout__body h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}
.callout__body p {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* API playground */
.api-panel {
  background: #1c1c1e;
  color: #f5f5f7;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.api-panel h2,
.api-panel h4 {
  color: #f5f5f7;
}
.api-panel code {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #0a84ff;
}
.api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}
.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  color: #d1d1d6;
}
.api-table th,
.api-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.api-pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  background: #000;
  padding: 12px;
  border-radius: var(--radius-sm);
  color: #34c759;
  height: 160px;
  overflow: auto;
  white-space: pre-wrap;
}
.api-url {
  background: #000;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(10, 132, 255, 0.5);
  word-break: break-all;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #a1a1a6;
  position: relative;
}
.api-url__label {
  position: absolute;
  top: -9px;
  left: 14px;
  background: #1c1c1e;
  padding: 0 8px;
  font-size: 0.625rem;
  color: #0a84ff;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.api-result {
  width: 100%;
  min-height: 320px;
  max-height: 320px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  background: #000;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #f5f5f7;
  overflow: auto;
  line-height: 1.4;
}
.api-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.param-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.param-row label {
  width: 72px;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #d1d1d6;
  margin: 0;
}
.param-row .input,
.param-row select {
  flex: 1;
  min-height: 32px;
  background: #000;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.8125rem;
}
.param-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.api-opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
}
.api-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.api-opt label {
  font-size: 0.7rem;
  color: #d1d1d6;
  white-space: nowrap;
  margin: 0;
}
.api-opt select {
  flex: 1;
  min-width: 0;
  min-height: 26px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 0.65rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal {
  width: 100%;
  max-width: 720px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal__head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Help modal */
.section-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.input-with-clear {
  position: relative;
  min-width: 0;
}
.input-with-clear.input--grow {
  flex: 1 1 200px;
}
.input-with-clear .input {
  width: 100%;
  padding-right: 36px;
}
.input-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.input-clear:hover {
  background: var(--bg-tertiary);
}

.chips__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  align-self: center;
  margin-right: 2px;
}
.chips--fav {
  margin-top: 10px;
}
.chip--fav {
  border-color: rgba(255, 159, 10, 0.35);
  background: rgba(255, 159, 10, 0.08);
}
.icon-btn.is-fav {
  color: #ff9f0a;
  background: rgba(255, 159, 10, 0.15);
}
.search-hint-kbd {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  align-self: center;
}

/* Admin dark body uses same CSS vars */
.help-trigger {
  color: var(--accent);
  background: var(--accent-soft);
}
.help-trigger:hover {
  background: var(--accent-soft);
  filter: brightness(0.96);
}

.modal--help {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, 820px);
  padding-bottom: 16px;
  overflow: hidden;
}
.help-subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 400;
}
.help-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  min-height: 0;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.help-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.help-nav__item {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 510;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.help-nav__item:hover {
  background: var(--bg-secondary);
  color: var(--text);
}
.help-nav__item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.help-body {
  overflow-y: auto;
  padding: 20px 22px 28px;
  background: var(--bg-elevated);
  -webkit-overflow-scrolling: touch;
}
.help-article h3 {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.help-article h4 {
  margin: 22px 0 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.help-article p,
.help-article li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.help-article p {
  margin: 0 0 10px;
}
.help-article ul,
.help-article ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}
.help-article li {
  margin-bottom: 6px;
}
.help-article li::marker {
  color: var(--text-tertiary);
}
.help-article strong {
  color: var(--text);
  font-weight: 600;
}
.help-article code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}
.help-article kbd {
  font-family: var(--mono);
  font-size: 0.75rem;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  background: var(--bg);
}
.help-article a {
  font-weight: 510;
}
.help-callout {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid transparent;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text);
}
.help-callout--warn {
  background: rgba(255, 159, 10, 0.12);
  color: var(--text);
}
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 8px 0 16px;
}
.help-table th,
.help-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}
.help-table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  font-size: 0.75rem;
}
.help-foot {
  margin-top: 14px;
  padding-top: 14px;
  justify-content: space-between;
}
.help-overlay {
  z-index: 1100;
}

@media (max-width: 768px) {
  .help-layout {
    grid-template-columns: 1fr;
  }
  .help-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .help-nav__item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
  }
  .help-body {
    padding: 16px;
    max-height: 50dvh;
  }
  .help-foot {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-form .span-2 {
  grid-column: span 2;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-group .input[readonly] {
  background: var(--bg);
  color: var(--text-tertiary);
}

.login-card {
  width: 100%;
  padding: 36px 28px;
  text-align: center;
}
.login-card .brand__title {
  font-size: 1.5rem;
}
.login-card .brand__sub {
  margin-bottom: 28px;
}
.login-form {
  text-align: left;
}
.login-form .field {
  margin-bottom: 14px;
}
.login-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 510;
  text-align: left;
}
.login-foot {
  margin-top: 28px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.sync-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
}
.sync-toolbar .field {
  width: 110px;
}
.sync-toolbar .field--sm {
  width: 72px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-desc {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .page {
    padding: 0 16px 40px;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 16px;
    padding-top: 20px;
  }
  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .sort-bar {
    display: flex;
  }

  .data-table thead {
    display: none;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
  }
  .data-table tbody tr:last-child {
    border-bottom: none;
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: none;
    text-align: right !important;
  }
  .data-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: left;
  }
  .data-table td .addr {
    text-align: right;
  }
  .row-actions {
    justify-content: flex-end;
  }

  .admin-nav {
    flex-direction: column;
    align-items: stretch;
    position: static;
  }
  .admin-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .admin-tabs .btn {
    flex-shrink: 0;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }
  .grid-form .span-2 {
    grid-column: span 1;
  }

  .api-grid,
  .param-grid,
  .api-opt-grid {
    grid-template-columns: 1fr;
  }

  .sync-toolbar {
    justify-content: stretch;
  }
  .sync-toolbar .field,
  .sync-toolbar .field--sm {
    flex: 1 1 40%;
    width: auto;
  }

  .section-head {
    margin-top: 24px;
  }
}

@media (max-width: 480px) {
  .seg__btn {
    min-width: 56px;
  }
  .btn--primary.btn--search {
    width: 100%;
  }
  .search-actions {
    width: 100%;
  }
  .chip__text {
    max-width: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible for a11y */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:focus-visible,
.icon-btn:focus-visible,
.chip:focus-visible {
  outline-offset: 3px;
}

/* ── Modal & Detail Component Styles ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
  position: relative;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal__sub {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
}

.modal__close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal__close:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.modal__tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.modal__tab {
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.modal__tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.eng-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eng-grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.eng-card {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.eng-card--highlight {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.eng-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.eng-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.eng-card__val {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.eng-card__val--lg {
  font-size: 1.0625rem;
  color: var(--accent);
}

.office-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.office-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.office-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.office-card__info {
  flex: 1;
  min-width: 0;
}

.office-card__title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.office-card__name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-card__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.office-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
}

.icon-btn--accent {
  color: var(--accent);
}

/* ── 🏘️ Life Info (생활권 정보) ──────────────────────── */
.life-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.life-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 14px 16px;
}
.life-section__title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.life-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.life-card:last-child { border-bottom: none; }
.life-card__name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.life-card__dist {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 6px;
  padding: 2px 7px;
  min-width: 44px;
  text-align: center;
}
.life-empty {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  padding: 6px 0;
}
.life-link-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.life-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.life-link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.life-link-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary));
  transform: translateY(-2px);
}
.life-link-btn__icon { font-size: 1.4rem; flex-shrink: 0; }
.life-link-btn__label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.life-link-btn__arrow {
  font-size: 1rem;
  color: var(--accent);
  opacity: 0.7;
}
.life-link-tip {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 4px;
}
.life-link-tip code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--accent);
}
.life-kakao-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ── 🔐 Address Masking (주소 마스킹) ───────────────── */
.mask-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px 14px;
}
.mask-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.mask-level {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.mask-level.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.mask-level:hover {
  border-color: var(--accent);
}
.mask-level__num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.mask-level__label {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.mask-result {
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
}
.mask-result__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.mask-result__val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
  margin-bottom: 6px;
}
.mask-result__sub {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.mask-preview {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mask-preview__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.82rem;
}
.mask-preview__k {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 56px;
}
.mask-preview__v {
  color: var(--text-secondary);
  word-break: break-all;
}

[data-theme="dark"] .mask-level.is-active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ── 📊 Stats & Region Features (지역 통계 & 연계기능) ──── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
}
.stats-card {
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stats-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}
.weather-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-primary));
  border-radius: 10px;
  padding: 10px 12px;
}
.weather-box__main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.weather-box__icon { font-size: 1.6rem; }
.weather-box__temp { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.weather-box__desc { font-size: 0.82rem; color: var(--text-secondary); margin-left: auto; }
.weather-box__sub {
  display: flex;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--text-tertiary);
}
.weather-box__sub b { color: var(--text-primary); }
.area-code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 10px 14px;
}
.area-code-box__code {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}
.area-code-box__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.btn-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Modern Search Hero & Remote Area Enhancements ──────────────────────────── */
.search-card-hero {
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: visible;
}
.search-card-hero:focus-within {
  box-shadow: 0 8px 36px rgba(0, 113, 227, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 113, 227, 0.35);
}
[data-theme="dark"] .search-card-hero {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .search-card-hero:focus-within {
  box-shadow: 0 8px 36px rgba(10, 132, 255, 0.22);
  border-color: rgba(10, 132, 255, 0.45);
}

/* Integrated Search Input Container */
.search-shell-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.search-shell-main {
  flex: 1;
  position: relative;
  min-width: 0;
}
.search-shell-main .input {
  min-height: 54px;
  font-size: 1.05rem;
  padding-left: 44px;
  padding-right: 42px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-tertiary);
  transition: all 0.2s ease;
}
.search-shell-main .input:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

/* Remote Area Badge in Table */
.badge--remote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 6px;
}
.badge--remote:hover {
  transform: translateY(-1px) scale(1.03);
}
.badge--jeju {
  background: rgba(255, 149, 0, 0.15);
  color: #d46b08;
  border: 1px solid rgba(255, 149, 0, 0.35);
}
[data-theme="dark"] .badge--jeju {
  background: rgba(255, 159, 10, 0.22);
  color: #ffaa33;
  border-color: rgba(255, 159, 10, 0.45);
}
.badge--island {
  background: rgba(0, 122, 255, 0.12);
  color: #0066cc;
  border: 1px solid rgba(0, 122, 255, 0.3);
}
[data-theme="dark"] .badge--island {
  background: rgba(10, 132, 255, 0.22);
  color: #64b5f6;
  border-color: rgba(10, 132, 255, 0.45);
}

/* Modal Remote Area Panel */
.remote-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.remote-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.remote-banner--standard {
  background: color-mix(in srgb, var(--success) 8%, var(--bg-tertiary));
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
}
.remote-banner--jeju {
  background: rgba(255, 149, 0, 0.1);
  border-color: rgba(255, 149, 0, 0.35);
}
.remote-banner--island {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.35);
}
.remote-banner__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.remote-banner__content {
  flex: 1;
  min-width: 0;
}
.remote-banner__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.remote-banner__sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.remote-banner__fee {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.remote-banner__fee-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.remote-banner__fee-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #d46b08;
}
.remote-banner--island .remote-banner__fee-val {
  color: #0066cc;
}
[data-theme="dark"] .remote-banner--island .remote-banner__fee-val {
  color: #64b5f6;
}

.remote-details__title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.remote-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.remote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}
.remote-table th {
  background: var(--bg-tertiary);
  padding: 9px 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.remote-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.remote-table tr:last-child td {
  border-bottom: none;
}

/* Modern Chip UI Improvements */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.chips__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-right: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 0.825rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.chip--fav {
  background: rgba(255, 149, 0, 0.08);
  border-color: rgba(255, 149, 0, 0.25);
  color: var(--text);
}
.chip--fav:hover {
  background: rgba(255, 149, 0, 0.16);
  border-color: rgba(255, 149, 0, 0.4);
}
.chip__remove {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  border-radius: 50%;
  transition: color 0.15s;
}
.chip__remove:hover {
  color: var(--danger);
}

/* Zipcode Button Capsule */
.zip-btn {
  display: inline-block;
  padding: 4px 9px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  cursor: pointer;
  transition: all 0.15s ease;
}
.zip-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

/* Address sub text */
.addr-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.addr-sub {
  display: block;
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 모바일 & 태블릿 플로팅 퀵 액션 바 */
.floating-quick-bar {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-surface, #ffffff);
  color: var(--color-primary, #2563eb);
  border: 1px solid var(--color-border, #e2e8f0);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border-color: var(--color-primary, #2563eb);
}

.floating-btn:active {
  transform: scale(0.92);
}

[data-theme='dark'] .floating-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: #60a5fa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .floating-btn:hover {
  background: #2563eb;
  color: #ffffff;
}

@media (max-width: 480px) {
  .floating-quick-bar {
    right: 14px;
    bottom: 18px;
    gap: 8px;
  }
  .floating-btn {
    width: 42px;
    height: 42px;
  }
}

