/* 지도 위 주소 검색 패널 — docs/index.html #addressSearchShell.address-search-shell--above-map */

/* 입력 1단계 지도 하단 좌표·마커·영역 설명 텍스트 숨김 */
.input-step[data-input-step="1"] #addressMapMeta,
.input-step[data-input-step="1"] #addressMapOverlayMeta {
  display: none;
}

.address-search-shell.address-search-shell--above-map {
  position: relative;
  z-index: auto;
  width: 100%;
  max-width: none;
  margin: 0 0 0.85rem;
  padding: 1rem 1.15rem 1.05rem;
  overflow: visible;
  border-radius: var(--radius-xl, 1rem);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border-light));
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.08), transparent 52%),
    radial-gradient(circle at 100% 100%, rgba(5, 150, 105, 0.06), transparent 48%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 32px rgba(15, 23, 42, 0.07),
    0 2px 10px rgba(37, 99, 235, 0.05);
  backdrop-filter: none;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.address-search-shell--above-map:focus-within,
.address-search-shell--above-map.is-focused {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-light));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 14px 40px rgba(37, 99, 235, 0.12),
    0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.address-search-shell--above-map.is-busy::before {
  border-radius: var(--radius-xl, 1rem) var(--radius-xl, 1rem) 0 0;
}

.address-search-shell--above-map .address-search-shell__head {
  align-items: flex-start;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
  gap: 0.65rem;
}

.address-search-shell__title-block {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-width: 0;
}

.address-search-shell__mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 0.72rem;
  color: var(--accent);
  background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.14);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.address-search-shell__titles {
  min-width: 0;
  padding-top: 0.05rem;
}

.address-search-shell--above-map .address-search-shell__head .input-group-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.address-search-shell__lead {
  margin: 0.18rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.address-search-shell--above-map .address-search-panel-toggle {
  margin-top: 0.15rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border-light);
}

.address-search-shell--above-map .address-search-panel-toggle:hover {
  color: var(--ink-secondary);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-light));
}

.address-search-shell__sr-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.address-search-shell__search-bar {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
}

.address-search-shell__search-bar .address-search-shell__input-row {
  flex: 1 1 auto;
  min-width: 0;
}

.address-search-shell__coord-btn {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 3rem;
  margin: 0;
  padding-inline: 1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-light));
}

.address-search-shell__coord-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-light));
  background: color-mix(in srgb, var(--accent-soft) 35%, #fff);
}

.address-search-shell__api-toggle {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 3rem;
  margin: 0;
  padding-inline: 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-light));
}

.address-search-shell__api-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-light));
  background: color-mix(in srgb, var(--accent-soft) 35%, #fff);
}

.address-search-shell__api-toggle.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border-light));
  background: color-mix(in srgb, var(--accent-soft) 52%, #fff);
  color: var(--accent);
}

.address-search-shell--above-map:focus-within .address-search-shell__coord-btn,
.address-search-shell--above-map.is-focused .address-search-shell__coord-btn {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-light));
}

.address-search-shell__input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.3rem 0.85rem 0.3rem 0.95rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.04),
    0 2px 10px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.address-search-shell--above-map:focus-within .address-search-shell__input-row,
.address-search-shell--above-map.is-focused .address-search-shell__input-row,
.address-search-shell--above-map.is-typing .address-search-shell__input-row {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-light));
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.03),
    0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.address-search-shell__input-icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--muted);
  transition: color 0.18s ease;
}

.address-search-shell--above-map:focus-within .address-search-shell__input-icon,
.address-search-shell--above-map.is-focused .address-search-shell__input-icon,
.address-search-shell--above-map.is-typing .address-search-shell__input-icon {
  color: var(--accent);
}

.address-search-shell--above-map .address-search-shell__input-row #addressInput {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.35rem;
  margin: 0;
  padding: 0.35rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.address-search-shell--above-map .address-search-shell__input-row #addressInput:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.address-search-shell--above-map .address-search-shell__input-row #addressInput:hover:not(:focus) {
  border: none;
  box-shadow: none;
}

.address-search-shell--above-map .address-search-hint {
  margin-top: 0.55rem;
  padding-left: 0.15rem;
  font-size: 0.78rem;
}

.address-search-shell--above-map .address-api-status {
  margin-top: 0.65rem;
  padding: 0.48rem 0.72rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--muted-bg) 88%, #fff);
  border: 1px solid var(--border-light);
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.address-search-shell--above-map .address-api-actions {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
  gap: 0.45rem;
}

.address-search-shell--above-map .address-primary-btns > .secondary {
  flex: 0 1 auto;
  min-width: 7.5rem;
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-light));
}

.address-search-shell--above-map .address-primary-btns > .secondary:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-light));
  background: color-mix(in srgb, var(--accent-soft) 35%, #fff);
}

.address-search-shell--above-map .address-search-results:not(:empty) {
  margin-top: 0.45rem;
  max-height: min(15rem, 42vh);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-light));
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

.address-search-shell--above-map.address-search-shell--panel-collapsed {
  padding-bottom: 0.85rem;
}

.address-search-shell--above-map.address-search-shell--panel-collapsed .address-search-shell__head {
  margin-bottom: 0;
}

/* ── 고객 모드: 바깥 패널 없이 검색창·좌표조회만 ── */
body[data-role="customer"] .address-search-shell.address-search-shell--above-map {
  margin-bottom: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

body[data-role="customer"] .address-search-shell--above-map .address-search-shell__lead {
  font-size: 0.82rem;
}

body[data-role="customer"] .address-search-shell--above-map .address-search-shell__search-bar .address-search-shell__input-row {
  min-height: 3.9rem;
  padding-inline: 1.15rem 1.2rem;
}

body[data-role="customer"] .address-search-shell--above-map .address-search-shell__coord-btn {
  min-height: 3.9rem;
}

body[data-role="customer"] .address-search-shell--above-map .address-search-shell__input-row #addressInput {
  font-size: 1.12rem;
}

body[data-role="customer"] .address-search-shell--above-map #addressLookupStatus {
  display: none !important;
}

body[data-role="customer"] .address-search-shell--above-map .address-api-actions {
  margin-top: 0.45rem;
  padding-top: 0;
  border-top: none;
}

body[data-role="customer"] .address-search-shell--above-map .address-primary-btns {
  display: none;
}

body[data-role="customer"] #addressSearchResults:not(:empty) {
  margin-top: 0.5rem;
  border-radius: var(--radius-lg);
}

/* ── 직원 모드 ── */
body[data-role="staff"] .address-search-shell--above-map .address-search-shell__lead {
  max-width: 36rem;
}

body[data-role="staff"] .address-search-shell--above-map #addressLookupStatus {
  display: none;
}

body[data-role="staff"] .address-search-shell__coord-btn.is-action-ok {
  border-color: color-mix(in srgb, var(--ok) 52%, var(--border-light));
  background: color-mix(in srgb, var(--ok-soft) 72%, #fff);
  color: color-mix(in srgb, var(--ok) 82%, var(--ink));
}

body[data-role="staff"] .address-search-shell__coord-btn.is-action-warn {
  border-color: color-mix(in srgb, var(--warn) 52%, var(--border-light));
  background: color-mix(in srgb, var(--warn-soft) 68%, #fff);
}

body[data-role="staff"] .address-search-shell__coord-btn.is-action-error {
  border-color: color-mix(in srgb, var(--danger) 52%, var(--border-light));
  background: color-mix(in srgb, var(--danger-soft) 68%, #fff);
}

body[data-role="staff"] .address-search-shell--above-map .address-api-actions.address-api-actions--collapsed,
body[data-role="staff"] .address-search-shell--above-map #addressApiActionsPanel[hidden] {
  display: none !important;
}

body[data-role="staff"] .address-search-shell--above-map .address-api-actions:not(.address-api-actions--collapsed):not([hidden]) {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

body[data-role="staff"] .address-search-shell--above-map .address-primary-btns {
  display: contents;
}

body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .secondary,
body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .viewer-action-btn,
body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .viewer-action-link {
  flex: 0 0 auto;
  min-height: 2.35rem;
  white-space: nowrap;
}

body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .viewer-action-link {
  max-width: min(16rem, 34vw);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  padding-inline: 0.72rem;
}

@media (max-width: 640px) {
  .address-search-shell.address-search-shell--above-map {
    padding: 0.85rem 0.9rem 0.95rem;
  }

  .address-search-shell__mark {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.6rem;
  }

  .address-search-shell__mark svg {
    width: 17px;
    height: 17px;
  }

  .address-search-shell--above-map .address-search-shell__head .input-group-title {
    font-size: 0.96rem;
  }

  .address-search-shell__lead {
    font-size: 0.76rem;
  }

  .address-search-shell--above-map .address-search-shell__search-bar .address-search-shell__input-row {
    min-height: 2.85rem;
    padding-inline: 0.8rem 0.85rem;
  }

  .address-search-shell--above-map .address-search-shell__coord-btn,
  .address-search-shell--above-map .address-search-shell__api-toggle {
    min-height: 2.85rem;
    padding-inline: 0.72rem;
    font-size: 0.82rem;
  }

  body[data-role="staff"] .address-search-shell--above-map .address-api-actions {
    flex-wrap: wrap;
  }

  body[data-role="staff"] .address-search-shell--above-map .address-primary-btns {
    display: flex;
    flex: 1 1 100%;
    width: 100%;
  }

  body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .secondary,
  body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .viewer-action-btn,
  body[data-role="staff"] .address-search-shell--above-map .address-api-actions > .viewer-action-link {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
    max-width: none;
    white-space: normal;
  }

  body[data-role="customer"].view-input .address-search-shell--above-map {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  body[data-role="customer"].view-input .address-search-shell--above-map .address-search-shell__search-bar .address-search-shell__input-row {
    min-height: 3.35rem;
  }

  body[data-role="customer"].view-input .address-search-shell--above-map .address-search-shell__coord-btn {
    min-height: 3.1rem;
  }

  body[data-role="customer"].view-input .address-search-shell--above-map .address-search-shell__input-row #addressInput {
    font-size: 1.02rem;
  }
}
