:root {
  --border-color: #62B3B8;
  --primary_send: #95f9fe;
  --primary_send-hover: #63f1f9;
  --primary: #62B3B8;
  --primary-hover: #4e9fa4;
  --background: #EFFEFF;
  --white: #fff;
  --text: #111;
  --muted: #6b7280;
  --chip-bg: #f3f4f6;
  --chip-active-bg: #e0f7f8;
  --shadow: 0 8px 20px rgba(0, 0, 0, .06);
  --rhythm: 8px;
  --lh: 1.5;
}


/* =========================
   Reset / Base
   ========================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text);
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}


/* =========================
   Search Form (카톡 직사각형)
   ========================= */


.search-title {
  font-family: 'Lemon', sans-serif;
  margin: 60px;
  color: var(--border-color);
  font-size: 50px;
  margin-top: 70px;
}

form[method="get"] {
  width: 900px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  transition: box-shadow .15s ease, border-color .15s ease;
  /* margin: 6rem auto 1.5rem; */
}

form[method="get"]:hover,
form[method="get"]:focus-within {
  box-shadow: var(--shadow);
  border-color: transparent;
}

/* 입력창 */
form[method="get"] input[type="text"] {
  flex: 1;
  height: 44px;
  font-size: 16px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 .6rem;
}

/* 플레이스홀더 */
form[method="get"] input::placeholder {
  color: #80868b;
}

/* 제출 버튼 */
form[method="get"]>button {
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .15s ease;
}

form[method="get"]>button:hover {
  background: #f1f3f4;
}

form[method="get"]>button:active {
  background: #e8eaed;
}

form[method="get"]>button svg {
  width: 24px;
  height: 24px;
  fill: #5f6368;
}

/* 보충 질문 말풍선 */
form[method="get"]>div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

form[method="get"]>div strong {
  align-self: flex-start;
  background: #f1f1f1;
  color: #333;
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 80%;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

form[method="get"]>div strong::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 6px;
  border: 8px solid transparent;
  border-right-color: #f1f1f1;
}

/* 보충 질문 입력창 (말풍선처럼 동작) */
/* 컨테이너: 오른쪽 정렬 */
.additional_ques {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid #eef2f7;
  padding-left: 20px;
  align-items: flex-end;
  /* 👉 내부 아이템을 오른쪽으로 */
}

/* 타이틀 말풍선(좌측) */
.additional_ques>strong {
  align-self: flex-start;
  display: inline-block;
  max-width: min(80%, 72ch);
  background: #f1f1f1;
  color: #333;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.additional_ques>strong::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 6px;
  border: 8px solid transparent;
  border-right-color: #f1f1f1;
}

/* ✅ 오른쪽 입력 말풍선 */
.followup-bubble {
  align-self: flex-end;
  /* 오른쪽으로 붙이기 */
  display: inline-block;
  width: auto;
  /* 가로 유동 */
  min-width: 120px;
  /* 시작은 한 줄짜리 작은 풍선 */
  max-width: 80%;
  /* 가로 최대폭 */
  min-height: 40px;
  /* 한 줄 높이 */
  max-height: 220px;
  /* 세로 최대(넘으면 스크롤) */

  padding: 10px 14px;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  line-height: 1.5;
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);

  resize: none;
  /* 드래그 금지 */
  overflow: hidden;
  /* 자동확장용 */
  white-space: pre-wrap;
  /* 줄바꿈 유지 */
  overflow-wrap: anywhere;
  /* 긴 단어 분해 */
  transition: width .05s ease, height .05s ease;
  position: relative;
}

/* 꼬리 */
.followup-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 6px;
  border: 8px solid transparent;
  border-left-color: var(--background);
}

/* 포커스 */
.followup-bubble:focus,
.followup-bubble:focus-visible {
  outline: none;
  border-color: var(--border-color);
}

/* 모바일에서 가로 상한 완화 */
@media (max-width: 600px) {
  .followup-bubble {
    max-width: 92%;
  }
}

form[method="get"]>div button[type="submit"] {
  align-self: flex-end;
  background: var(--primary_send);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  margin-top: 4px;
  transition: background .2s ease;
}

form[method="get"]>div button[type="submit"]:hover {
  background: var(--primary_send-hover);
}

.additional_ques {
  border-left: 1px solid #eef2f7;
  padding-left: 20px;
}

/* 기존 질문 말풍선(읽기 전용) */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: .5rem;
}

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.bubble-user {
  align-self: flex-start;
  background: #f1f1f1;
  color: #333;
  position: relative;
}

.bubble-user::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 6px;
  border: 8px solid transparent;
  border-right-color: #f1f1f1;
}



/* =========================
   Tag Rail / Filter Bar
   ========================= */
.tag-rail,
.filter-bar,
/* 이색적 필터 추가 */
.unique-filter-bar {
  max-width: 1100px;
  margin: 0 auto calc(var(--rhythm) * 2);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-rail .track {
  flex: 1;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-rail .track::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  font-size: 14px;
}

.chip.active {
  background: var(--chip-active-bg);
  border-color: var(--border-color);
  color: var(--primary-hover);
  font-weight: 700;
}

.chip.more {
  border-style: dashed;
  background: #fff;
}

.tag-rail[data-expanded="false"] .extra {
  display: none;
}

.tag-rail[data-expanded="true"] .extra {
  display: inline-flex;
}

/* =========================
   Section Title
   ========================= */
.place-section__title {
  max-width: 1100px;
  margin: 24px auto 12px;
  padding: 0 12px;
  font-size: 20px;
  font-weight: 700;
}


/* =========================
   Place List (3 → 2 → 1 cols)
   ========================= */
.place-list {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

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

@media (max-width: 600px) {
  .place-list {
    grid-template-columns: 1fr;
  }
}


/* =========================
   Card
   ========================= */
.place-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .12s ease;
  /* transform 제거 */
  position: relative;
  /* 팝업 기준점 */
  z-index: auto;
  /* 기본값 */
}

.place-item:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
}

/* Media: square */
.place-item__map {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  flex-shrink: 0;
  border-radius: 14px 14px 0 0;
  position: relative;
  z-index: 1;
  /* 지도는 항상 밑에 */
  overflow: hidden;
  /* 라운드 내로 잘리게 */
  min-height: 220px;
  /* 높이 0 방지 */
}

/* Header */
.place-item__head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 버튼 50%/50% */
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #eef2f7;
}

/* 제목/메타 전체 폭 */
.place-item__name {
  grid-column: 1 / -1;
  font-weight: 700;
  font-size: 16px;
}

.place-item__meta {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--muted);
}

/* 자세히 보기 버튼 */
.place-item__link {
  grid-column: 1 / -1;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 13px;
}

.place-item__link:hover {
  background: var(--chip-active-bg);
}

/* 50% 버튼 분할 */
.like-form {
  grid-column: 1 / 2;
  display: flex;
}

.add-to-route-btn {
  grid-column: 2 / 3;
}

.like-button,
.add-to-route-btn {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.like-button {
  border-color: #f43f5e;
  color: #e11d48;
}

.like-button:hover {
  background: #fff0f3;
}

.add-to-route-btn {
  border-color: var(--border-color);
}

.add-to-route-btn:hover {
  background: var(--chip-active-bg);
}

/* 태그 리스트 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 12px 14px 14px;
  border-top: 1px solid #eef2f7;
  margin: 0;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #334155;
}


/* =========================
   Route Dropdown (Popup)
   ========================= */
.route-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 14px;
  z-index: 10001;
  /* 지도보다 항상 위 */
  display: none;
  width: min(360px, 86vw);
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
  animation: rd-pop .12s ease-out;
}

@keyframes rd-pop {
  from {
    transform: translateY(-4px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 팝업 열릴 때 카드 자체를 위로 */
.place-item.show-dropdown {
  z-index: 10000;
}

.place-item.show-dropdown .route-dropdown {
  display: block;
}

/* 꼬리 */
.route-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 18px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent #e5e7eb transparent;
}

.route-dropdown::after {
  content: "";
  position: absolute;
  top: -9px;
  right: 18px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
}

/* 내부 */
.route-dropdown .route-list {
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  color: #374151;
  background: #fafafa;
  margin-bottom: 12px;
  display: flex;
  flex-flow: row;
  gap: 10px;
}

.route-list div button {
  border: 1px solid var(--border-color);
  background-color: #fff;
  height: 20px;
  border-radius: 10px;
  transition: 0.3s;
}

.route-list div button:hover {
  background-color: var(--chip-active-bg);
}

.route-dropdown hr {
  border: 0;
  height: 1px;
  background: #f1f5f9;
  margin: 12px 0;
}

.create-route-form {
  z-index: 99999;
}

.route-dropdown .create-route-form input {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

.route-dropdown .create-route-form label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  margin-bottom: 8px;
}

.create-route-btn {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
}

.create-route-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}


/* =========================
   Pagination
   ========================= */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 28px 0;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn {
  display: inline-block;
  padding: 8px 12px;
  margin-right: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff
}

.btn.active {
  background: var(--border-color);
  color: #fff;
  border-color: var(--border-color)
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 24px 0
}

.pagination a,
.pagination span {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff
}

.pagination .current {
  background: var(--border-color);
  color: #fff
}


/* =========================
   Radio Tab – 이중선 완전 차단(override 강제)
   ========================= */

/* 라디오 숨김 */
.filter-bar input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* label: 컨테이너만(테두리/배경/패딩/아웃라인 전부 제거) */
.filter-bar label {
  display: inline-flex !important;
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  cursor: pointer !important;
  box-shadow: none !important;
  gap: 15px;
}

/* 실제 버튼 모양은 span 하나만 담당 */
.filter-bar label>span {
  display: inline-block !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-color) !important;
  /* ← 테두리는 span만 */
  background: #fff !important;
  font-size: 14px !important;
  color: inherit !important;
  transition: background .3s, color .3s, border-color .3s, box-shadow .2s !important;
  box-shadow: none !important;
}

/* 비선택 hover */
.filter-bar label:hover>span {
  background: var(--chip-active-bg) !important;
}

/* 선택 상태 */
.filter-bar input[type="radio"]:checked+span {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 600 !important;
}

/* 선택 + hover */
.filter-bar input[type="radio"]:checked+span:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

/* 키보드 포커스일 때만 포커스 링은 span에만 */
.filter-bar input[type="radio"]:focus-visible+span {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

/* 마우스 클릭 후 포커스 링 제거 */
.filter-bar input[type="radio"]:focus:not(:focus-visible)+span {
  outline: none !important;
}

/* 여기부터 이색적 필터 관련 css */


/* 체크박스 숨김 */
.unique-filter-bar input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* label: 컨테이너 */
.unique-filter-label {
  display: inline-flex !important;
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  cursor: pointer !important;
  box-shadow: none !important;
  gap: 8px;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

/* 실제 버튼 모양 */
.unique-filter-text {
  display: inline-block !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-color) !important;
  background: #fff !important;
  font-size: 14px !important;
  color: inherit !important;
  transition: background .3s, color .3s, border-color .3s !important;
  position: relative;
}

/* 비선택 hover */
.unique-filter-label:hover .unique-filter-text {
  background: var(--chip-active-bg) !important;
}

/* 선택 상태 */
.unique-filter-bar input[type="checkbox"]:checked+.unique-filter-text {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 600 !important;
}

/* 선택된 상태의 앞에 체크 아이콘 추가 */
.unique-filter-bar input[type="checkbox"]:checked+.unique-filter-text::before {
  content: '✓ ';
  margin-right: 4px;
}

/* 선택 + hover */
.unique-filter-bar input[type="checkbox"]:checked+.unique-filter-text:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

/* 키보드 포커스 */
.unique-filter-bar input[type="checkbox"]:focus-visible+.unique-filter-text {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

/* 마우스 클릭 후 포커스 링 제거 */
.unique-filter-bar input[type="checkbox"]:focus:not(:focus-visible)+.unique-filter-text {
  outline: none !important;
}

/* 체크박스 숨기기 */
.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 기본 상태 (선택 안됨) */
.custom-checkbox span {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid #ccc;
  /* 회색 테두리 */
  background: #fff;
  /* 흰 배경 */
  font-size: 14px;
  color: #555;
  /* 회색 글씨 */
  font-weight: 500;
  transition: background .3s, color .3s, border-color .3s, box-shadow .3s;
  cursor: pointer;
  position: relative;
  width: 100%;
  text-align: center;
}

/* hover */
.custom-checkbox span:hover {
  background: #f8fafc;
  border-color: #999;
}

/* 체크된 상태 */
.custom-checkbox input[type="checkbox"]:checked+span {
  background: #62B3B8;
  /* 진한 파란/민트색 배경 */
  color: #fff;
  /* 흰색 글씨 */
  border-color: #62B3B8;
  font-weight: 600;
  box-shadow: 0 0 6px rgba(98, 179, 184, 0.5);
}

/* 체크 아이콘 추가 */
.custom-checkbox input[type="checkbox"]:checked+span::before {
  content: "✔";
  /* 체크 표시 */
  position: absolute;
  left: 10px;
  font-size: 14px;
}