/* 두 지도 페이지(전체 고객사 index.html, iframe용 clients/index.html)가 함께 쓰는 스타일 */
/* taloscorp.io 고객사 페이지에 맞춘 색 (남색 글자, 흰 배경, 옅은 남색 강조) */
:root {
  --paper: #ffffff;
  --tint: #f6f7fc;
  --select: #eff2ff;
  --ink: #002266;
  --muted: #000000de; /* 보조 글자색 (주소·탭·기준일 등) */
  --line: #e3e6ee;
  --pin: #c6000a; /* 계약 중인 기관 */
  --pin-other: #c6000a; /* 그 외(협의중·계약종료·미계약) 기관 */
  --panel: max(500px, 30vw);
  --sheet-top: 64px; /* 모바일 시트를 끝까지 올려도 위에 남는 지도 높이 */
  --fs: 1.5; /* 글자 배율. 아래 @media에서 화면 폭에 따라 줄인다 */
}
/* 전체 고객사 페이지: 계약 중인 기관과 그 외 기관의 색을 나눈다 (모양은 병원·사업장) */
:root[data-variant='all'] {
  --pin: #d5355d;
  --pin-other: #002266;
}
/* 글자 크기 4단계: 1400px 이상 1.5배, 1100~1399px 1.3배, 821~1099px 1.15배, 모바일 1배
   홈페이지 iframe(최대 1400px)에서도 가장 큰 단계가 적용된다 */
@media (max-width: 1399px) {
  :root {
    --fs: 1.3;
  }
}
@media (max-width: 1099px) {
  :root {
    --fs: 1.15;
  }
}
@media (max-width: 820px) {
  :root {
    --fs: 1;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family:
    'Noto Sans KR',
    -apple-system,
    'Apple SD Gothic Neo',
    'Malgun Gothic',
    sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
  color: var(--ink);
  background: var(--paper);
  display: grid;
  grid-template-columns: var(--panel) 1fr;
  height: 100vh;
}
aside {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  min-height: 0;
}
.handle {
  display: none;
}
.sheet-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
header {
  padding: 32px 28px 30px; /* 제목과 필터 사이 */
}
.brand {
  font-size: calc(15px * var(--fs));
  font-weight: 700;
  margin: 0 0 20px;
}
h1 {
  font-size: calc(28px * var(--fs));
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 .count {
  font-variant-numeric: tabular-nums;
}
/* iframe으로 넣었을 때: 바깥 페이지에 제목이 있으니 브랜드 줄을 숨기고 제목을 줄인다 */
.embed .brand {
  display: none;
}
.embed header {
  padding: 24px 28px 27px;
}
.embed h1 {
  font-size: calc(20px * var(--fs));
}
/* 모양 = 기관 유형(병원 원·사업장 네모) */
.mark,
.pin {
  color: var(--pin);
}
.mark.other,
.pin.other {
  color: var(--pin-other);
}
.mark svg,
.pin svg,
.seg-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.mark {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}
.seg-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 5px;
  vertical-align: -1px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 16px;
  column-gap: 8px;
  padding: 0 28px 16px;
}

.seg {
  grid-column: 1 / -1;
  display: flex;
  margin: 0;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  background: var(--tint);
}
.seg label {
  flex: 1;
  position: relative;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg span {
  display: block;
  padding: 16px 0;
  border-radius: 4px;
  text-align: center;
  font-size: calc(14px * var(--fs));
  color: var(--muted);
  white-space: nowrap;
}
.seg b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}
.seg input:checked + span {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}
/* 선택된 탭은 아이콘이 흰색이 되므로 안쪽 십자·건물은 남색으로 */
.seg input:checked + span .seg-icon [stroke='#fff'] {
  stroke: var(--ink);
}
.seg input:checked + span .seg-icon [fill='#fff'] {
  fill: var(--ink);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
input,
select {
  font: inherit;
  font-size: calc(15px * var(--fs));
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 11px;
  min-width: 0;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px; /* 왼쪽 여백 11 + 화살표 12 + 간격 11 */
  background: #fff
    url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%278%27 viewBox=%270 0 12 8%27%3E%3Cpath d=%27M1 1.5l5 5 5-5%27 fill=%27none%27 stroke=%27%23002266%27 stroke-width=%271.8%27/%3E%3C/svg%3E')
    no-repeat right 11px center / 12px 8px;
}
/* 전체 지역 선택 폭: 예전(내용 길이, 홈페이지용 지도 기준 약 6em)의 1.5배 */
#region {
  width: 9em;
}
/* 검색어 지우기(X): 말풍선 닫기와 같은 아이콘 */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  background: url('icon-close.svg') no-repeat center / 12px 12px;
  cursor: pointer;
}
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

ul.list {
  list-style: none;
  margin: 0;
  padding: 0 0 24px;
  overflow-y: auto;
  flex: 1;
  border-top: 1px solid var(--line);
}
ul.list li {
  border-bottom: 1px solid var(--line);
}
ul.list button {
  all: unset;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 4px 12px;
  width: 100%;
  padding: 28px;
  cursor: pointer;
}
ul.list button:hover {
  background: var(--tint);
}
ul.list button[aria-current='true'] {
  background: var(--select);
  box-shadow: inset 3px 0 0 var(--ink);
}
ul.list .mark {
  align-self: center; /* 기관명 줄의 가운데 */
}
.name {
  font-size: calc(15px * var(--fs));
  font-weight: 500;
}
.addr {
  grid-column: 2;
  font-size: calc(13px * var(--fs));
  color: var(--muted);
  line-height: 1.45;
}
.nogeo {
  grid-column: 2;
  font-size: calc(12px * var(--fs));
  color: var(--muted);
}
.empty {
  padding: 24px 28px;
  color: var(--muted);
  font-size: calc(14px * var(--fs));
}

footer {
  padding: 14px 28px;
  font-size: calc(12px * var(--fs));
  color: var(--muted);
  border-top: 1px solid var(--line);
}

#map {
  height: 100%;
  background: var(--tint);
}
#map.failed {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: calc(14px * var(--fs));
}

.pin {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(22, 34, 46, 0.4));
  transition:
    transform 0.15s,
    opacity 0.15s;
}
.pin::before {
  content: '';
  position: absolute;
  inset: -6px;
} /* 손가락으로 누르기 쉽게 */
.pin.dim {
  opacity: 0.2;
}
.pin.on {
  transform: scale(1.4);
}
.pop-wrap {
  padding-bottom: 16px;
}
/* 상세 말풍선: Figma 'Talos-Website' 3002:3 시안. 시안 수치는 가장 큰 화면(글자 1.5배) 기준이라 --k로 줄인다 */
.pop {
  --k: max(0.8, calc(var(--fs) / 1.5));
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(16px * var(--k));
  width: min(calc(488px * var(--k)), calc(100vw - 48px));
  padding: calc(20px * var(--k)) calc(20px * var(--k)) calc(24px * var(--k));
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 34, 102, 0.16);
  color: var(--ink);
  font-family: inherit;
  white-space: normal;
}
.pop::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  margin-left: -7px;
  border: 7px solid transparent;
  border-bottom: 0;
  border-top-color: #fff;
}
.pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pop-name {
  font-weight: 700;
  font-size: calc(20px * var(--k));
  line-height: 1.3;
}
/* 12px 아이콘은 그대로 두고 누르는 영역만 28px로 넓힌다 (아이콘 위치는 시안과 같게 음수 여백) */
.pop-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.pop-close:hover {
  background: var(--tint);
}
.pop-addr {
  margin: 0;
  color: var(--muted);
  font-size: calc(20px * var(--k));
  line-height: 1.45;
}
.pop-copy {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  vertical-align: -3px;
  cursor: pointer;
}
.pop-copy:hover {
  background: var(--tint);
}
.pop-copied {
  margin-left: 4px;
  font-size: calc(14px * var(--k));
  color: var(--ink);
}
.pop-links {
  display: flex;
  gap: calc(14px * var(--k));
  margin-top: calc(39px * var(--k)); /* 주소와 버튼 사이 55px = 위 간격 16 + 39 */
}
.pop-links a {
  flex: none;
  width: calc(140px * var(--k));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(6.5px * var(--k)) 0;
  border: 1px solid #67708a;
  border-radius: 6px;
  color: #67708a;
  font-size: calc(18px * var(--k));
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.pop-links a:hover {
  background: var(--tint);
}
.pop-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  body {
    display: block;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  /* 카카오 로고·저작권 표시는 가리면 안 되고 아래쪽에만 둘 수 있어서, 지도는 접힌 시트 위까지만 */
  #map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--peek, 150px);
    height: auto;
  }

  aside {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    height: calc(100vh - var(--sheet-top));
    height: calc(100dvh - var(--sheet-top));
    border-right: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 20px rgba(0, 34, 102, 0.14);
    transform: translateY(var(--y, calc(100% - 150px)));
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  aside.dragging {
    transition: none;
  }
  .grab {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
  }
  .handle {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 10px 0 6px;
    background: none;
    border: 0;
    cursor: inherit;
  }
  .handle span {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #c9cfdd;
  }
  header {
    padding: 4px 20px 24px;
  }
  .brand {
    font-size: calc(13px * var(--fs));
    margin: 0 0 6px;
  }
  h1 {
    font-size: calc(21px * var(--fs));
  }
  .embed h1 {
    font-size: calc(18px * var(--fs));
  }
  .embed header {
    padding: 2px 20px 21px;
  }

  .sheet-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: var(--hidden, 0px);
  }
  .filters {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--paper);
    padding: 0 20px 12px;
  }
  input,
  select {
    font-size: calc(16px * var(--fs));
    padding: 10px 12px;
  } /* 16px 미만이면 iOS가 확대함 */
  select {
    padding-right: 36px;
    background-position: right 12px center;
  } /* 왼쪽 여백 12와 같게 */
  .seg span {
    padding: 8px 0;
  }
  ul.list {
    flex: none;
    overflow: visible;
    padding-bottom: 0;
  }
  ul.list button {
    padding: 14px 20px;
  }
  .empty {
    padding: 24px 20px;
  }
  footer {
    padding: 16px 20px 24px;
    border-top: 0;
  }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  aside {
    transition: none;
  }
}
