/* 선 굵기는 두 가지만 씀: 먹색 선 1.5px / 연한 구분선 1px (키보드 초점 표시는 예외)
   저마다 홈페이지(zeomada-site/src/app/globals.css)의 톤앤매너를 따름
   - 종이색 바탕 + 먹색 글자 + 노랑(sun) 포인트, 각진 모서리, 종이 질감
   - 색약 안전: 빨강·초록 없이 파랑–노랑–흰색 축과 밝기 차이로 구분하고,
     모양(○ △ ✕, 빗금)을 함께 써서 색만으로 구분하지 않음 */
:root {
  --paper: #f4f2ec;
  --paper-2: #ebe8df;
  --card: #fbfaf6;
  --ink: #141414;
  --ink-2: #3a3a38;
  --mute: #4a4945;   /* 모든 배경에서 7:1 이상 */
  --field: #85827a;  /* 입력칸 테두리: 3:1 이상 */
  --line: #d9d5ca;
  --sun: #dfd150;
  --sun-2: #f0e67c;
  --sky: #b9cfe8;
  --blue: #6f9be0;
  --navy: #2f4f8f;   /* 검은 글자 뒤에는 쓰지 않음 */
  --warn: #574800;   /* 노란 계열 경고 글씨: 모든 배경에서 7:1 이상 (WCAG AAA) */
  /* 접근성 5단계(범례·핀·등급): 남색 → 파랑 → 노랑 → 연노랑 → 흰색 */
  --s1: #5b8ad6;   /* 검정 글씨 대비 5.3:1 */
  --s2: #a9c6ee;   /* 검정 글씨 대비 10:1 */
  --s3: #dfd150;
  --s4: #f3edb8;
  --s5: #ffffff;
  --font: "Paperlogy", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* PC에서도 모바일 폭 그대로(최대 430px) 가운데에 보여줌 */
body { max-width: 430px; margin: 0 auto; font-family: var(--font); font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
::selection { background: var(--sun); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 0; }
[hidden] { display: none !important; }

/* 종이 질감 */
.grain::after {
  content: ""; pointer-events: none; position: fixed; inset: 0; z-index: 60; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* 공통 가로 여백 (저마다: px-6 / md:px-10, 최대 폭 7xl) */
.top, .search, .map-full, .legend-wrap, .layout { padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(10px + env(safe-area-inset-right, 0px)); } /* 양옆 여백 10px (가로 모드 노치만큼 더함) */

/* ------------------------- 머리말 ------------------------- */
.top { padding-top: 56px; padding-bottom: 28px; }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); }
.top h1 { margin: 0; font-size: clamp(2.75rem, 8vw, 5.5rem); font-weight: 900; line-height: 1; letter-spacing: -0.05em; }
.sub { margin: 18px 0 0; max-width: 40rem; font-size: 14px; font-weight: 700; line-height: 1.75; color: var(--ink); }

/* 안내: 설명 아래 글 */
.notice { margin-top: 8px; max-width: 40rem; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.notice p { margin: 0 0 6px; }
.notice .link { margin-top: 2px; }
.link { background: none; border: 0; padding: 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.link:hover { background: var(--sun-2); }

/* ------------------------- 검색 ------------------------- */
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); /* 높이는 카드 색 띠와 같게. 입력 글씨는 16px(아이폰이 16px 미만 입력칸을 누르면 화면을 확대함) */
  background: var(--card); border: 1px solid var(--field); border-radius: 0;
}
.search input::placeholder { color: var(--mute); font-size: 13px; font-weight: 500; } /* 안내 문구는 띠 글씨와 같은 13px */
.search input:focus, .search input:focus-visible { outline: 1.5px solid var(--ink); outline-offset: -1.5px; border-color: var(--ink); }
.search button {
  height: 40px; padding: 0 32px; border: 0; border-radius: 0; font-size: 13px; font-weight: 700;
  background: var(--ink); color: var(--paper); transition: background .3s var(--ease), color .3s var(--ease);
}
.search button:hover { background: var(--sun); color: var(--ink); }

/* 지도: 화면 가로 전체, 테두리 없음 */
.map-box { position: relative; aspect-ratio: 4 / 3; } /* 가로 4 : 세로 3 */
.map { width: 100%; height: 100%; background: var(--paper-2); border: 1.5px solid var(--ink); }
.map-fallback { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--mute); font-size: 15px; gap: 8px; }
.legend-wrap { padding-top: 2px; }
.map-box .map-btn.myloc { right: 12px; bottom: 12px; }

/* 지도 아래: 목록 + 상세 정보 */
.layout { display: flex; flex-direction: column; gap: 24px; margin-top: 20px; margin-bottom: 56px; }
.list-wrap { }
.detail-wrap { order: -1; }
.detail-empty { margin: 0; padding: 40px 20px; text-align: center; font-size: 14px; color: var(--mute); border-top: 1.5px solid var(--ink); }

/* 지도 위 버튼 */
.map-btn {
  position: absolute; z-index: 5; border: 1.5px solid var(--ink); border-radius: 0; font-size: 14px; font-weight: 700;
  padding: 9px 14px; background: var(--card); color: var(--ink);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.map-btn:hover { background: var(--ink); color: var(--paper); }
.map-btn.research { top: 12px; left: 50%; transform: translateX(-50%); height: 34px; padding: 0 12px; font-size: 13px; background: var(--ink); color: var(--paper); white-space: nowrap; } /* 아래 끝 46px: 카드는 그 아래(52px~)에 놓임 */
.map-btn.research:hover { background: var(--sun); color: var(--ink); }
.map-btn.myloc { right: 14px; bottom: 14px; }
.map-box .map-btn.myloc { width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; }
.zoom { position: absolute; z-index: 5; top: 12px; right: 12px; display: flex; flex-direction: column; }
.zoom .map-btn { position: static; width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; }
.zoom .map-btn + .map-btn { border-top: 0; }

/* 범례: [긴 컬러바][정보 없음 상자] 나란히, 글자는 각 상자 아래 */
.legend { display: grid; grid-template-columns: 1fr 72px; gap: 0 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.legend-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.legend-bar { display: flex; height: 14px; border: 1.5px solid var(--ink); }
.legend-bar i, .meter-bar i { flex: 1; }
.legend-labels { display: flex; justify-content: space-between; gap: 8px; }
.b1 { background: var(--s1); } .b2 { background: var(--s2); } .b3 { background: var(--s3); } .b4 { background: var(--s4); } .b5 { background: var(--s5); }
.legend-none-box { height: 14px; background: #a8a59c; border: 1.5px solid var(--ink); }
.legend-none-label { text-align: center; color: var(--mute); white-space: nowrap; }

.progress { margin: 0; padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--mute); }
.empty { color: var(--mute); text-align: center; padding: 56px 16px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; } /* 카드 사이 4px */
.item {
  /* 안쪽 여백을 변수로 둬서, 테두리가 굵어져도(1→1.5px) 내용 위치가 그대로이고 색 띠가 테두리 안쪽에 딱 맞음 */
  --pt: 18px; --pr: 14px; --pl: 16px;
  position: relative; display: block; padding: var(--pt) var(--pr) var(--pt) var(--pl); cursor: pointer;
  border: 1px solid var(--field); transition: background .3s var(--ease); /* 비활성 카드: 비활성 검색창과 같은 선 */
}
.item:hover { background: var(--card); } /* 시설 칸(회색)과 겹치지 않게 */
.item[aria-current="true"], .item.open { --pt: 17.5px; --pr: 13.5px; --pl: 15.5px; background: var(--card); border: 1.5px solid var(--ink); } /* 활성 카드: 1.5px 먹색 테두리 하나(겹쳐 그리지 않음) */
.item-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: calc(-1 * var(--pt)) calc(-1 * var(--pr)) 14px calc(-1 * var(--pl)); padding: 6px 10px 6px 16px; /* 안쪽 여백을 넘어 테두리 안쪽 끝까지 */
  background: #a8a59c; color: var(--ink);
}
.item-top.b1 { background: var(--s1); }
.item-top.b2 { background: var(--s2); }
.item-top.b3 { background: var(--s3); }
.item-top.b4 { background: var(--s4); }
.item-top.b5 { background: var(--s5); box-shadow: inset 0 -1px 0 var(--line); } /* 흰색 띠는 아래 선으로 구분 */
.item-grade { font-size: 13px; font-weight: 700; }
/* 펼친(활성) 카드만: 스크롤해도 색 띠가 고정 영역 바로 아래에 붙어 있다가, 카드가 끝나면 함께 밀려 올라감 */
.item.open .item-top { position: sticky; top: var(--pinned-h, 0px); z-index: 1; }
.item-top .rank { color: inherit; } /* 순위 숫자도 띠 글씨색을 따라감(남색 띠에서는 흰색) */
.item-top-right { display: flex; align-items: center; gap: 8px; }
.item-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: inherit; }
.item.open .item-toggle svg { transform: rotate(180deg); }
button.item-toggle:hover { background: rgba(255,255,255,.25); }
/* 펼치기(항목 누르기) / 닫기(×) */
.item.open { background: var(--card); }
.item-detail { margin: 16px 0 0; cursor: default; }
.item-detail .meter { margin-top: 0; }
/* 펼친 카드 맨 아래 버튼 두 개: 가로로 꽉 채움, 위 표와 간격 */
.actions.actions-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.actions-2 .btn { justify-content: center; }
.rank { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.name-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.name { margin: 0; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; line-height: 1.35; }
.cat { font-size: 13px; color: var(--mute); }
.dist { font-weight: 800; color: var(--ink); }
.addr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 6px 0 12px; font-size: 14px; color: var(--ink-2); }
.addr-sm { margin: 0 0 10px; font-size: 13px; }
.floor { white-space: nowrap; } /* 주소와 같은 글씨로 바로 옆에 */
.warn { font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--warn); margin: 10px 0 0; }

/* 등급 표시(핀과 같은 색) */
.grade { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 0; white-space: nowrap; letter-spacing: -0.01em; color: var(--ink); }
.grade.b1 { background: var(--s1); }
.grade.b2 { background: var(--s2); }
.grade.b3 { background: var(--s3); }
.grade.b4 { background: var(--s4); box-shadow: inset 0 0 0 1px var(--field); }
.grade.b5 { background: var(--s5); box-shadow: inset 0 0 0 1.5px var(--ink); }
.grade.none { background: var(--paper-2); color: var(--mute); }
.g-high { background: var(--s1); padding: 1px 6px; }
.g-mid { background: var(--s3); padding: 1px 6px; }
.g-low { background: var(--s5); box-shadow: inset 0 0 0 1.5px var(--ink); padding: 1px 6px; }

/* ------------------------- 시설 정보: "엘리베이터 ○" 가로 나열 ------------------------- */
.facs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; }
.facs-msg { grid-column: 1 / -1; }
.facs-msg { color: var(--mute); }
.fac { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; background: var(--paper-2); white-space: nowrap; color: var(--ink); }
.fac-name { font-weight: 600; }
.fac-mark { display: inline-flex; align-items: center; color: var(--ink); }
.fac-x .fac-name, .fac-down .fac-name, .fac-na .fac-name { color: var(--mute); font-weight: 500; }
.fac-vis { display: contents; }
.fac-pair .fac-vis { display: flex; align-items: center; width: 100%; gap: 5px; }
.fac-pair .fac-vis > .fac-name:first-child { margin-right: auto; }
.fac-sub { font-weight: 500; color: var(--ink-2); }
.fac-sub + .fac-mark + .fac-sub { margin-left: 5px; }
.fac-mark-na { color: var(--mute); }

/* ------------------------- 상세 정보 ------------------------- */
.detail { background: var(--card); border: 1px solid var(--line); border-top: 1.5px solid var(--ink); border-radius: 0; padding: 22px; }
.d-title h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; }
.d-cat { margin: 4px 0 0; font-size: 13px; color: var(--mute); }

/* 점수: 범례와 같은 막대 + ▼ 위치 */
.meter { margin: 18px 0 6px; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.meter-grade { font-size: 20px; font-weight: 900; letter-spacing: -0.03em; }
.meter-score { font-size: 13px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.meter-bar { position: relative; display: flex; height: 16px; border: 1.5px solid var(--ink); }
.meter-bar i.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.meter-pointer { position: absolute; top: -12px; width: 0; height: 0; transform: translateX(-50%); border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 10px solid var(--ink); }
.meter-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--mute); }

.d-sec { margin-top: 22px; }
.d-sec h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); }
.d-sec dl { display: grid; grid-template-columns: 104px 1fr; margin: 0; font-size: 15px; border-top: 1.5px solid var(--ink); }
.d-sec dt, .d-sec dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.d-sec dt { color: var(--mute); font-weight: 600; font-size: 14px; }
.d-sec dd { margin: 0; color: var(--ink); }
.d-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; }
.d-note { margin: 4px 0 0; font-size: 13px; font-weight: 400; line-height: 1.65; color: var(--mute); }
.d-scale { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-weight: 500; }
.d-scale strong { font-weight: 800; }
.d-parking { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; background: var(--paper-2); color: var(--ink-2); } /* 선 없는 회색 상자 */
.d-tag.on { background: var(--sky); box-shadow: none; color: var(--ink); }


.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; padding: 12px 18px; border: 0; border-radius: 0;
  background: var(--sun); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--sun); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ------------------------- 지도 핀 -------------------------
   고르지 않은 핀: 지름 18px 동그란 점(누르는 영역은 24px 유지), 점 가운데가 매장 위치
   고른 핀: 물방울 핀 40px(이전 선택 핀 34px의 1.2배) + 바깥 먹색 선 */
.pin {
  display: block; position: relative; width: 24px; height: 24px; padding: 0; margin: 0; border: 0; background: transparent; /* block: 글자 기준선 아래 빈틈 없앰 */
  transform: translateY(50%); /* 지도 기준점이 아래 끝이라, 반만큼 내려 점 가운데를 매장 위치에 맞춤 */
  --pin-c: #a8a59c;
}
.pin::after {
  content: ""; position: absolute; inset: 3px; box-sizing: border-box;
  border: 1.5px solid var(--ink); border-radius: 50%; background: var(--pin-c); box-shadow: 0 1px 3px rgba(20,20,20,.3);
}
.pin.b1 { --pin-c: var(--s1); }
.pin.b2 { --pin-c: var(--s2); }
.pin.b3 { --pin-c: var(--s3); }
.pin.b4 { --pin-c: var(--s4); }
.pin.b5 { --pin-c: var(--s5); }
.pin.selected { width: 40px; height: 40px; transform: none; margin-bottom: 8px; /* 돌린 물방울 끝이 매장 위치에 오도록 */ }
.pin.selected::after {
  inset: 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  outline: 1.5px solid var(--ink); outline-offset: 2px; box-shadow: 0 2px 8px rgba(20,20,20,.45);
}

/* 지도 위 매장 카드 */
.map-card {
  position: relative; width: 300px; margin-bottom: 36px; padding: 12px; background: var(--card);
  border: 1.5px solid var(--ink); border-radius: 0; font-size: 14px; cursor: default;
}
/* 카카오 지도 레이어가 줄바꿈을 막아서(nowrap) 카드 안에서는 다시 줄바꿈되게 함 */
.map-card { white-space: normal; }
.map-card .facs, .map-card .warn { margin-left: 0; }
.map-card-head { margin-bottom: 6px; padding-right: 30px; } /* 오른쪽 30px: 닫기 버튼 자리 */
.map-card-title { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.map-card-title strong { max-width: 100%; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; }
.map-card-cat { font-size: 12px; color: var(--mute); }
/* 등급: 카드 위쪽 왼쪽에 인덱스처럼 튀어나온 탭 (카드 테두리와 이어짐) */
.map-card { margin-top: 26px; }
.map-card-tab {
  position: absolute; left: -1.5px; bottom: 100%; padding: 4px 10px 4.5px; z-index: 1; /* 아래 끝 = 카드 위 테두리 안쪽 선: 테두리를 덮어 이음새 없이 이어짐 */
  border: 1.5px solid var(--ink); border-bottom: 0; box-shadow: none !important;
}
.map-card-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink); padding: 0; }
.map-card .facs { gap: 4px; font-size: 12px; }
.map-card .fac { padding: 4px 8px; }  /* 칸 높이 줄임 */
.map-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 8px; }
.map-card .warn { flex: 1; font-size: 12px; line-height: 1.45; margin: 0; }
.map-card-icons { display: flex; flex-shrink: 0; gap: 6px; }
/* 아이콘만(상자·테두리 없음) */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; padding: 0; border: 0; background: none; color: var(--s1); text-decoration: none; transition: opacity .2s var(--ease); } /* 접근성 높음 추정과 같은 남색 */
.icon-btn:hover { opacity: .75; }
.map-card-tail { display: none; } /* 꼬리는 아래 ::before/::after 로 그림 */
/* 꼬리: 카드 아래 테두리 바깥쪽에 먹색 삼각형, 그 위에 카드색 삼각형을 1.5px 안쪽으로 겹침
   (45° 변의 두께 1.5px = 꼭짓점이 1.5×√2 ≈ 2.12px 올라감) → 테두리와 꼬리 선이 끊김 없이 이어짐 */
.map-card::before, .map-card::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-style: solid; border-bottom-width: 0; border-color: transparent;
}
/* 바깥(먹색): 아래 테두리 안쪽 선에서 시작 → 테두리 바깥 선 높이에서 폭 ±11px
   안쪽(카드색): 0.5px 위에서 시작해 머리카락 선을 덮고, 바깥보다 수직 2.12px(=1.5×√2) 안쪽 → 선 두께 1.5px로 이어짐 */
.map-card::before { top: 100%; border-width: 12.5px 12.5px 0; border-top-color: var(--ink); }
.map-card::after { top: calc(100% - 0.5px); border-width: 10.88px 10.88px 0; border-top-color: var(--card); }

/* ------------------------- 창(다이얼로그) ------------------------- */
dialog { max-width: 680px; border: 1.5px solid var(--ink); border-radius: 0; padding: 32px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(20,20,20,.55); }
dialog h2 { margin-top: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.04em; }
dialog h3 { font-size: 18px; font-weight: 800; margin-top: 28px; }
dialog p { color: var(--ink-2); line-height: 1.75; }
dialog table { width: 100%; border-collapse: collapse; font-size: 14px; border-top: 1.5px solid var(--ink); }
dialog th, dialog td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: left; vertical-align: top; line-height: 1.6; }
dialog th { font-size: 13px; color: var(--mute); }
dialog td:first-child { white-space: nowrap; font-weight: 700; color: var(--ink); padding-right: 12px; }
dialog td:last-child, dialog th:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
dialog ul { padding-left: 20px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
dialog .mark-help { list-style: none; padding-left: 0; }
dialog .mark-help b { display: inline-block; width: 24px; font-size: 16px; color: var(--ink); }
dialog form button { padding: 12px 22px; border: 0; border-radius: 0; background: var(--ink); color: var(--paper); font-weight: 700; }
dialog form button:hover { background: var(--sun); color: var(--ink); }

/* 카카오맵 장소 정보 창
   - 창 바깥 상자는 투명, 위에 탭 두 개 + 아래 먹색 테두리 상자
   - 창 크기를 '화면 크기 - 정수'로 잡아 가운데 정렬 위치가 0.5px에 떨어지지 않게 함(1.5px 선이 번지지 않도록) */
.place-dialog {
  width: min(480px, calc(100vw - 20px)); height: min(820px, calc(100dvh - 40px));
  padding: 0; border: 0; background: transparent; overflow: visible; display: none; flex-direction: column;
}
.place-dialog[open] { display: flex; }
.place-tabs { display: flex; justify-content: flex-end; gap: 6px; position: relative; z-index: 1; margin-bottom: -1.5px; /* 탭 아래 끝이 상자 위 테두리를 덮어 이어짐 */ }
.place-tabs form { margin: 0; }
.place-tab {
  display: inline-flex; align-items: center; justify-content: center; height: 33.5px; padding: 0 12px; /* 33.5 - 1.5(겹침) = 32 → 아래 상자 위 선이 정수 픽셀에 놓임 */
  border: 1.5px solid var(--ink); border-bottom: 0; background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 700; text-decoration: none; line-height: 1;
}
.place-tab:hover { background: var(--sun); }
a.place-tab { width: 112px; } /* 폭을 정수로 고정 → 탭 가장자리도 정수 픽셀 */
.place-close { width: 34px; height: 33.5px; padding: 0; font-size: 20px; }
dialog form button.place-close { background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-bottom: 0; }
dialog form button.place-close:hover { background: var(--sun); color: var(--ink); }
.place-box { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1.5px solid var(--ink); background: #fff; }
.place-dialog iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.place-note { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--mute); border-top: 1px solid var(--line); background: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ------------------------- 작은 화면 ------------------------- */
/* 모바일 기준 세부 조정 (PC에서도 같음) */
.top { padding-top: calc(32px + env(safe-area-inset-top, 0px)); padding-bottom: 20px; }
.search button { padding: 0 22px; }
.map-full { margin-top: 10px; }
.detail-empty { display: none; }
.d-sec dl { grid-template-columns: 92px 1fr; }
dialog { padding: 22px 18px; }
dialog h2 { font-size: 26px; }
.map-card { width: 232px; } /* 지도 가운데에 놓일 때 오른쪽 +/− 버튼 앞에서 끝나는 폭 */

/* ------------------------- 푸터 (검정 바탕) ------------------------- */
.footer { position: relative; z-index: 3; /* 고정된 검색창·지도(z-index 2) 위로 올라옴 */ padding: 28px 10px 40px; margin-top: 8px; background: var(--ink); color: rgba(244,242,236,.78); font-size: 13px; line-height: 1.7; }
.footer a { color: var(--paper); text-decoration: underline; text-decoration-color: rgba(244,242,236,.4); text-underline-offset: 3px; }
.footer a:hover { text-decoration-color: var(--sun); }
.footer-story {
  display: flex; align-items: center; justify-content: center; height: 40px; margin: 20px 0 0;
  border: 1.5px solid var(--paper); font-size: 13px; font-weight: 700; text-decoration: none !important;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.footer-story:hover { background: var(--sun); border-color: var(--sun); color: var(--ink) !important; }
.footer-info { display: grid; grid-template-columns: 72px 1fr; gap: 10px 12px; margin: 0; }
.footer-info dt { font-weight: 700; color: var(--paper); }
.footer-info dd { margin: 0; }
.footer-info ul { margin: 0; padding-left: 0; list-style: none; }
.footer-info li + li { margin-top: 6px; }
.footer-note { margin: 20px 0 0; }
.footer-copy { margin: 14px 0 0; }
.footer :focus-visible { outline-color: var(--sun); }
/* PC처럼 화면이 430px보다 넓을 때: 본문 폭은 그대로 두고 검정 바탕만 좌우 끝까지 채움
   (그림자로 양옆을 칠하고 위아래는 잘라냄 → 가로 스크롤이 생기지 않음) */
.footer { box-shadow: 0 0 0 100vmax var(--ink); clip-path: inset(0 -100vmax); }

/* ------------------------- 만든 이야기 페이지 ------------------------- */
.story .top { position: static; } /* 이야기 페이지는 제목이 고정되지 않음 */
.story-back { display: inline-block; margin-bottom: 28px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.story-body { padding: 0 10px 16px; }
.story-body section { padding: 24px 0; border-top: 1px solid var(--line); }
.story-body h2 { margin: 0 0 12px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.4; }
.story-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.story-body ul { margin: 0 0 12px; padding-left: 18px; font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.story-body li + li { margin-top: 8px; }
.story-body strong { color: var(--ink); }
.story-refs ul { list-style: none; padding-left: 0; font-size: 13px; }
.story-refs a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.story-refs a:hover { text-decoration-color: var(--ink); }
.story-body h3 { margin: 20px 0 6px; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
/* 추정 기준 창: 등급 색 목록 */
dialog .grade-scale { list-style: none; padding-left: 0; }
dialog .grade-scale li { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
dialog .grade-scale i { flex: none; width: 28px; height: 16px; border: 1.5px solid var(--ink); }
dialog .grade-scale .bn { background: #a8a59c; }
dialog .grade-scale b { color: var(--ink); margin-right: 4px; }
.story-body p a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.story-body p a:hover { background: var(--sun-2); }

.loc-notice { margin: 0 0 10px; padding: 8px 10px; font-size: 13px; line-height: 1.6; color: var(--ink-2); background: var(--paper-2); }

/* 추정 기준 팝업: 오른쪽 위 닫기(X) — 스크롤해도 따라옴 */
dialog .dialog-x-wrap { position: sticky; top: -14px; float: right; margin: -14px -10px 0 8px; z-index: 1; }
dialog form button.dialog-x { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: var(--paper); color: var(--ink); }
dialog form button.dialog-x:hover { background: var(--sun); color: var(--ink); }
dialog:focus, dialog:focus-visible { outline: none; }

/* ===================== 전체 화면 지도 (첫 화면) =====================
   페이지는 스크롤하지 않음. 지도가 화면 전체, 위에 i 버튼 + 검색창이 떠 있고,
   검색하면 아래에서 결과 카드가 올라옴(화면 절반까지만). 카드를 펼치면 화면을 덮음 */
html:has(body.map-page), body.map-page { height: 100%; overflow: hidden; overscroll-behavior: none; }
.app { position: fixed; top: 0; bottom: 0; left: 0; right: 0; max-width: 430px; margin: 0 auto; overflow: hidden; background: var(--paper-2); }
.app .map-full { position: absolute; inset: 0; padding: 0; margin: 0; }
.app .map-box { position: absolute; inset: 0; aspect-ratio: auto; }
.app .map { border: 0; }

.topbar { position: absolute; z-index: 20; top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; display: flex; gap: 6px; }
.topbar .search { flex: 1; min-width: 0; padding: 0; }
.topbar .search input { border: 1.5px solid var(--ink); }
.topbar .search button { padding: 0 20px; }
.info-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--ink); border-radius: 0; background: var(--sun); color: var(--ink); }
.info-btn:hover { background: var(--sun-2); }

/* i 아래: 위치 안내 버튼(세모 느낌표) + 안내 상자, 가운데: '이 지역에서 다시 검색' */
/* 세모: 상자 없이 아이콘만. 빨강은 주황 쪽(#ff5c39)으로 밝게 → 색약이어도 검은 테두리·느낌표와 밝기 대비 6.8:1 */
.loc-btn { position: absolute; z-index: 15; top: calc(56px + env(safe-area-inset-top, 0px)); left: 10px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; background: none; filter: drop-shadow(0 1px 2px rgba(20,20,20,.25)); }
.loc-btn:hover svg, .loc-btn[aria-expanded="true"] svg { transform: scale(1.08); }
.app .loc-notice { position: absolute; z-index: 16; top: calc(60px + env(safe-area-inset-top, 0px)); left: 56px; right: 58px; margin: 0; padding: 10px 36px 10px 12px; background: var(--card); border: 1.5px solid var(--ink); }
.app .loc-notice p { margin: 0; }
.loc-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ink); }
.loc-close:hover { background: var(--sun-2); }
.app .map-btn.research { position: absolute; z-index: 12; top: 0; left: 50%; transform: translate(-50%, var(--ry, -100px)); box-shadow: 0 2px 8px rgba(20,20,20,.25); will-change: transform; }

/* 오른쪽: 확대·축소, 내 위치 */
.map-ctrl { position: absolute; z-index: 15; top: calc(60px + env(safe-area-inset-top, 0px)); right: 10px; display: flex; flex-direction: column; gap: 8px; }
.map-ctrl .zoom { position: static; }
.map-ctrl .map-btn.myloc { position: static; width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; }

/* 아래: 결과 카드. 화면 절반 높이 안에서 스크롤(빈 곳은 지도를 그대로 만질 수 있음) */
.results { --peek: 176px; position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; height: 50%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; } /* 터치는 받되(아이폰은 pointer-events:none 이면 스크롤 안 됨), 카드 위 빈 곳은 clip-path 로 잘라 지도로 넘김 */
.results::-webkit-scrollbar { display: none; }
.results-inner { padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
.results-inner::before { content: ""; display: block; height: calc(50dvh - var(--peek)); } /* 처음엔 첫 카드 윗부분만 보임 */
.results .item { background: var(--paper); box-shadow: 0 2px 10px rgba(20,20,20,.12); }
.results .item:hover, .results .item[aria-current="true"], .results .item.open { background: var(--card); }
.results .progress, .results .empty { margin: 0 0 4px; padding: 10px 14px; background: var(--card); border: 1px solid var(--field); text-align: left; }
.results .item.open .item-top { top: 0; } /* 결과 영역 안에서 색 띠가 위에 붙음 */
/* 카드를 펼치면: 검색창 아래부터 화면 끝까지 덮음 */
.results.full { z-index: 18; top: calc(60px + env(safe-area-inset-top, 0px)); height: auto; background: transparent; pointer-events: auto; } /* 카드 사이·양옆 틈으로 지도가 보임 */
.results.full .results-inner { padding-top: 10px; }
.results.full .results-inner::before { display: none; }
.results.full .item { box-shadow: 0 2px 10px rgba(20,20,20,.12); }

/* i: 소개·기준·범례·만든 사람 (화면 전체) */
.info-panel { width: 100%; max-width: 430px; height: 100%; max-height: none; margin: 0 auto; padding: 0; border: 0; background: var(--paper); overflow-y: auto; }
.info-panel::backdrop { background: var(--paper); }
.info-panel .dialog-x-wrap { position: sticky; top: calc(10px + env(safe-area-inset-top, 0px)); float: right; margin: calc(10px + env(safe-area-inset-top, 0px)) 10px 0 0; }
.info-panel .top { padding-top: calc(32px + env(safe-area-inset-top, 0px)); }
.info-panel .legend-wrap { padding-bottom: 28px; }
.info-panel h1 { margin: 0; }
.info-panel .notice p, .info-panel .sub { color: var(--ink-2); }
.info-panel .sub { color: var(--ink); }
.info-panel .footer ul { padding-left: 0; font-size: 13px; color: inherit; }
.info-panel .footer { margin-top: 0; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.info-panel .footer p { color: inherit; line-height: 1.7; }

/* 진행 막대: 건물 정보 확인 n/전체 → 다 채우면 '완료'로 반짝이고 사라짐 */
.progress.bar { display: flex; align-items: center; gap: 10px; }
.pg-label { flex: none; min-width: 7.5em; font-size: 12px; font-weight: 700; color: var(--ink); }
.pg-track { position: relative; flex: 1; height: 8px; border: 1.5px solid var(--ink); background: var(--paper); overflow: hidden; }
.pg-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--s1); transition: width .35s var(--ease); }
.progress.done .pg-track i { background: var(--sun); }
.progress.done .pg-track i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.9) 50%, transparent 80%); transform: translateX(-100%); animation: pg-shine .8s var(--ease) .15s forwards; }
.progress.done { animation: pg-out .4s ease 1.1s forwards; }
@keyframes pg-shine { to { transform: translateX(100%); } }
@keyframes pg-out { to { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .pg-track i, .progress.done, .progress.done .pg-track i::after { transition: none; animation: none; } }

/* 시설 6칸: 둥근 알약 모양, 좋음(○·👍)은 연한 파랑 */
.facs .fac { border-radius: 999px; padding: 7px 12px; font-size: 12px; line-height: 1.6; }
.facs .fac-good { background: #dce7f5; }
.facs .fac-mark svg { width: 12px; height: 12px; }

/* 펼친 카드: 공공 데이터 정보 조회 (튀지 않게) */
.data-check { margin-top: 18px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.data-check h4 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.2em; color: var(--mute); }
.data-check-sub { margin: 4px 0 8px; font-size: 12px; line-height: 1.6; color: var(--mute); }
.data-check ul { list-style: none; margin: 0; padding: 0; font-size: 12px; line-height: 1.5; }
.data-check li { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; }
.dc-name { color: var(--ink-2); }
.dc-state { flex: none; font-weight: 700; color: var(--ink); }
.dc-no .dc-state { font-weight: 500; color: var(--mute); }

/* 펼친 카드 색 띠: 위에 붙으면 띠 위에 카드 테두리(1.5px)를 이어 그림 */
.results .item.open .item-top { top: 1.5px; }
.results .item.open .item-top.stuck { box-shadow: 0 -1.5px 0 1.5px var(--ink); }
/* 카드 접기: 펼친 동안 아래 가운데 */
.collapse-btn { position: absolute; z-index: 19; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; box-shadow: 0 2px 10px rgba(20,20,20,.3); }
.collapse-btn:hover { background: var(--sun); color: var(--ink); }
.results.full .results-inner { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } /* 맨 아래 카드가 버튼에 가리지 않게 */
.results .item.open .item-top.b5.stuck { box-shadow: 0 -1.5px 0 1.5px var(--ink), inset 0 -1px 0 var(--line); }

/* i 패널: 소개 → 색 막대 → 추정 기준(본문) → (가로줄) 정보 출처 → 만든 이야기 → 만든 사람 */
.info-sec { padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(10px + env(safe-area-inset-right, 0px)); }
.info-panel .legend-wrap { padding-top: 4px; padding-bottom: 8px; }
.info-criteria { padding-top: 24px; border-top: 1.5px solid var(--ink); margin-top: 20px; }
.info-criteria h2 { margin: 0 0 8px; font-size: 24px; font-weight: 900; letter-spacing: -0.04em; }
.info-story { padding-top: 4px; padding-bottom: 32px; }
.story-btn { display: flex; align-items: center; justify-content: center; height: 48px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; transition: background .3s var(--ease), color .3s var(--ease); }
.story-btn:hover { background: var(--sun); color: var(--ink); }
.info-sources { padding-top: 24px; padding-bottom: 24px; border-top: 1.5px solid var(--ink); margin-top: 28px; }
.info-sources h3 { margin: 0 0 8px; font-size: 14px; }
.info-panel .info-sources ul { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.info-sources li + li { margin-top: 6px; }
.info-sources a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.info-sources a:hover { background: var(--sun-2); }
.info-panel .sources-note { margin: 14px 0 0; font-size: 13px; color: var(--mute); }

/* 첫 안내 말풍선: i 버튼 바로 아래, 꼬리가 i를 가리킴 */
.coach { position: absolute; z-index: 25; top: calc(60px + env(safe-area-inset-top, 0px)); left: 10px; white-space: nowrap; display: flex; align-items: center; gap: 4px; padding: 10px 6px 10px 14px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; line-height: 1.5; cursor: pointer; box-shadow: 0 4px 14px rgba(20,20,20,.3); animation: coach-in .5s var(--ease) both; }
.coach p { margin: 0; }
.coach::before { content: ""; position: absolute; left: 13px; bottom: 100%; border: 7px solid transparent; border-bottom-color: var(--ink); }
.coach-close { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--paper); }
.coach-close:hover { color: var(--sun); }
@keyframes coach-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .coach { animation: none; } }
.info-criteria > p { font-size: 14px; line-height: 1.75; }

/* 카드 색 띠: 등급 글자 옆 점수 — 띠 글자색을 옅게 깐 둥근 상자 */
.item-score { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(20,20,20,.1); }

/* i 패널 본문: 사용 방법 번호 목록, 기호 설명 소제목 */
.info-criteria h2 + * { margin-top: 0; }
.info-criteria h2 ~ h2 { margin-top: 32px; }
.info-panel .steps, .info-panel .plain { padding-left: 0; list-style: none; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.info-panel .steps { counter-reset: step; }
.info-panel .steps li { position: relative; padding-left: 28px; margin: 6px 0; counter-increment: step; }
.info-panel .steps li::before { content: counter(step); position: absolute; left: 0; top: 3px; width: 20px; height: 20px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; line-height: 1; }
.info-panel .plain li { margin: 6px 0; }
.info-panel .plain b { display: inline-block; width: 20px; color: var(--ink); }
.info-panel .steps strong, .info-panel .plain strong { color: var(--ink); }
.info-panel .help-sub { margin: 12px 0 2px; font-size: 12px; font-weight: 700; color: var(--mute); }
.info-panel .help-note { font-size: 13px; color: var(--mute); }
.info-panel .mark-help { margin: 0; }
.info-panel .mark-help b { vertical-align: middle; }
.info-panel table { font-size: 13px; } .info-panel td:first-child { white-space: normal; width: 6.4em; } .info-panel td:nth-child(2) { color: var(--ink-2); }

/* ===== 둥근 모양 ===== */
/* 위: 동그란 i + 알약 모양 검색창(돋보기는 칸 안 오른쪽) */
.info-btn { border-radius: 50%; }
.topbar { gap: 8px; }
.topbar .search { position: relative; }
.topbar .search input { height: 40px; border-radius: 999px; padding: 0 44px 0 18px; background: #efefed; border: 1.5px solid var(--ink); }
.topbar .search .search-go { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: none; color: var(--ink); }
.topbar .search .search-go:hover { background: var(--sun); color: var(--ink); }
.app .loc-notice { left: 58px; border-radius: 14px; }
.coach { border-radius: 12px; }

/* 검색 결과 카드: 모서리 둥글게, 색 띠도 위쪽 모서리를 맞춤 */
.results .item { --rad: 14px; border-radius: var(--rad); }
.results .item-top { border-radius: calc(var(--rad) - 1px) calc(var(--rad) - 1px) 0 0; }
.results .item[aria-current="true"] .item-top, .results .item.open .item-top { border-radius: calc(var(--rad) - 1.5px) calc(var(--rad) - 1.5px) 0 0; }
.results .progress, .results .empty { border-radius: 14px; }
.app .map-btn.research { border-radius: 999px; }

/* 카드 머리(색 띠 + 매장명): 펼치면 함께 위에 붙음 */
.item-head { margin: calc(-1 * var(--pt)) calc(-1 * var(--pr)) 0 calc(-1 * var(--pl)); padding: 0 var(--pr) 0 var(--pl); }
.item-head > .item-top { margin-top: 0; }
.results .item.open .item-top { position: relative; top: auto; }
.results .item.open .item-head { position: sticky; top: 1.5px; z-index: 2; background: var(--card); padding-bottom: 10px; border-radius: calc(var(--rad) - 1.5px) calc(var(--rad) - 1.5px) 0 0; }
.results .item.open .addr { margin-top: 4px; } /* 매장명과 주소 사이를 조금 띄움(머리 아래 여백 10px + 4px) */

/* 지도 오른쪽 버튼: 모두 동그랗게, 간격 8px 일정 */
.map-ctrl { gap: 8px; }
.map-ctrl .zoom { display: flex; flex-direction: column; gap: 8px; }
.map-ctrl .map-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: 20px; line-height: 1; box-shadow: 0 1px 4px rgba(20,20,20,.15); }
.map-ctrl .zoom .map-btn + .map-btn { border-top: 1.5px solid var(--ink); }

/* 지금 보고 있는 카드(지도에 큰 핀으로 표시 중): 그림자를 진하게 */
.results .item[aria-current="true"]:not(.open) { box-shadow: 0 8px 8px -3px rgba(20,20,20,.45); } /* 아래·양옆으로, 위로는 거의 안 비침 */
/* 선택된 핀: 바깥 테두리 대신 그림자로 강조 */
.pin.selected::after { outline: none; box-shadow: none; }
.pin.selected { filter: drop-shadow(0 3px 3px rgba(20,20,20,.45)); } /* 작고 선명하게 */

/* 지도 버튼 아이콘: 글자 대신 SVG라 정확히 가운데 */
.map-ctrl .map-btn svg { display: block; }

/* ===== i 패널 본문: 제목은 한 줄, 설명은 그 아래 (콜론 없이) ===== */
.info-panel .steps li { display: flex; flex-direction: column; gap: 2px; padding-left: 32px; margin: 0 0 14px; }
.info-panel .steps li::before { top: 2px; width: 22px; height: 22px; border-radius: 50%; }
.info-panel .steps strong { font-size: 15px; }
.info-panel .steps span { font-size: 14px; color: var(--ink-2); }

.guide-rows { display: flex; flex-direction: column; gap: 10px; }
.guide-row { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.guide-row p { margin: 8px 0 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.guide-row p strong { display: block; font-size: 15px; color: var(--ink); }
.guide-demo { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.demo-score { padding: 1px 8px; border-radius: 999px; background: rgba(20,20,20,.1); font-size: 12px; }
.demo-fac { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--paper-2); font-size: 12px; font-weight: 600; }
.demo-fac.good { background: #dce7f5; }
.demo-check { display: flex; justify-content: space-between; width: 100%; padding: 6px 12px; border-radius: 10px; background: var(--paper-2); font-size: 12px; color: var(--ink-2); }

.legend-box { margin: 10px 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.legend-box-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.legend-box-title span { font-size: 12px; font-weight: 500; color: var(--mute); }
.info-panel .legend-box-note { margin: 8px 0 0; font-size: 12px; color: var(--mute); line-height: 1.6; }
.sym-list { list-style: none; margin: 0; padding: 0; }
.sym-list li { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.sym-list .ico { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--ink); }
.sym-list .ico.good { background: #dce7f5; }
.est-list li span strong { display: block; color: var(--ink); font-size: 14px; }

.data-cards { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.data-card { padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--card); }
.data-card p { margin: 0; }
.data-card .dc-org { font-size: 12px; font-weight: 600; color: var(--mute); }
.data-card .dc-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.data-card .dc-use { margin-top: 6px; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.data-card .dc-use::before { content: "가져오는 정보"; display: block; font-size: 11px; font-weight: 700; color: var(--mute); }
.data-card .dc-cycle { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--paper-2); font-size: 12px; font-weight: 700; color: var(--ink); }

.score-list { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1.5px solid var(--ink); }
.score-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.score-list li div { flex: 1; }
.score-list strong { display: block; font-size: 15px; color: var(--ink); }
.score-list span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.score-list > li > b { flex: none; min-width: 44px; padding: 2px 0; text-align: center; border-radius: 999px; background: var(--sun); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-list li.muted > b { background: var(--paper-2); }

.info-panel .caution { padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.info-panel .caution li { margin: 4px 0; }

/* 핵심 시설 정보 견본: 실제 카드처럼 6칸(2열) */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.demo-grid .demo-fac { justify-content: space-between; white-space: nowrap; }
.demo-grid .demo-fac svg { flex: none; }
.demo-sub { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--ink-2); }

/* 공공데이터 상자: 라벨 + 내용, 업데이트 주기 */
.data-card .dc-use::before { content: none; }
.data-card .dc-label { margin-top: 10px; font-size: 11px; font-weight: 700; color: var(--mute); letter-spacing: .02em; }
.data-card .dc-use { margin-top: 2px; }
.data-card .dc-cycle { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 10px; background: var(--paper-2); font-size: 13px; }
.data-card .dc-cycle span { flex: none; font-size: 11px; font-weight: 700; color: var(--mute); }
.data-card .dc-foot { margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--mute); }

/* 주요하게 보는 정보: 연표, 그림 타일 */
.info-panel .sub-h { margin: 18px 0 8px; font-size: 14px; font-weight: 800; color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 31px; top: 12px; bottom: 12px; width: 1.5px; background: var(--ink); }
.timeline li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.tl-date { flex: none; position: relative; z-index: 1; width: 56px; padding: 3px 0; text-align: center; border-radius: 999px; background: var(--sun); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timeline strong { display: block; font-size: 14px; color: var(--ink); }
.timeline span:not(.tl-date) { display: block; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.fact-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fact-tile svg { color: var(--ink); margin-bottom: 2px; }
.fact-tile strong { font-size: 14px; color: var(--ink); }
.fact-tile span { font-size: 12px; line-height: 1.6; color: var(--ink-2); }


/* 카드를 펼친 동안: 결과 영역(스크롤 틀) 자체를 카드 폭에 맞추고 위 모서리를 카드처럼 둥글게(14px).
   카드가 위로 지나갈 때 틀이 둥글게 잘라 줘서, 붙은 머리 옆으로 카드 몸통이 삐져나오지 않음(브라우저가 스크롤과 함께 처리) */
/* (테두리 정리) 결과 틀은 화면 양끝까지, 카드는 안쪽 여백 10px 안에. 틀 끝과 카드 선이 겹치지 않아 선이 잘리지 않음 */
.results .item.open .item-head { top: 1.5px; }

/* 위에 붙은 머리의 윤곽: 카드 테두리와 똑같은 모양(위 1.5px + 둥근 모서리)을 머리 위에 그림.
   예전 그림자 방식은 위쪽이 3px로 두 겹 겹쳐 두꺼워 보였음 */
.results .item.open .item-head { position: sticky; }
.results .item.open .item-head.stuck::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }


/* 펼친 카드 맨 위에서 아래로 끌 때 아이폰 기본 튕김(고무줄)이 끌어내리기와 겹치지 않게 */
.results.full { overscroll-behavior-y: none; }

/* 정보가 모이는 과정(다이어그램) */
.flow { display: flex; flex-direction: column; align-items: stretch; margin: 8px 0 4px; }
.flow-box { position: relative; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.flow-start, .flow-end { border: 1.5px solid var(--ink); }
.flow-end { background: #dce7f5; }
.info-panel .flow-box p { margin: 0; }
.flow-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.info-panel .flow-desc { margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.info-panel .flow-sub { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--mute); }
.flow-chips, .flow-use { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow-chips { margin-top: 8px; }
.flow-use { margin-bottom: 6px; }
.flow-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink); }
.c-addr { background: var(--sun); }
.c-name { background: var(--s2); }
.c-tel { background: var(--paper-2); border: 1px solid var(--line); }
.flow-plus { font-size: 12px; font-weight: 600; color: var(--mute); }
.flow-group { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1.5px dashed var(--field); border-radius: 18px; }
.flow-arrow { position: relative; display: flex; justify-content: center; padding: 8px 0 14px; }
.flow-arrow::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 6px; width: 1.5px; background: var(--ink); }
.flow-arrow::after { content: ""; position: absolute; left: calc(50% - 5px); bottom: 2px; border: 5px solid transparent; border-top: 6px solid var(--ink); border-bottom: 0; }
.flow-arrow span { position: relative; z-index: 1; padding: 2px 10px; border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-2); }

/* 다이어그램: 넣는 값(채운 꼬리표) → 데이터 → 나오는 값(테두리 꼬리표) */
.flow-io { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.flow-io .flow-chips { margin-top: 0; flex: 1; }
.io-label { flex: none; width: 58px; padding-top: 3px; font-size: 11px; font-weight: 700; color: var(--mute); }
.flow-data .flow-io:first-child { margin-top: 0; }
.flow-mid { position: relative; margin: 10px 0 !important; text-align: center; }
.flow-mid::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.flow-mid span { position: relative; padding: 2px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; }
.c-out { background: var(--card); border: 1.5px solid var(--ink); padding: 1px 9px; }
.c-result { background: var(--s1); }
.flow-legend { list-style: none; display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; padding: 0; font-size: 12px; color: var(--mute); }
.flow-legend li { display: flex; align-items: center; gap: 4px; }
.flow-legend .flow-chip { min-width: 22px; height: 14px; padding: 0 6px; }
.flow-legend span:last-child { margin-left: 4px; }

/* 해석 단계: 나오는 값 → (법 기준으로 해석) → 해석한 값 */
.flow-interp { position: relative; display: flex; justify-content: center; margin: 6px 0; padding: 6px 0 10px; }
.flow-interp::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 4px; width: 1.5px; background: var(--ink); }
.flow-interp::after { content: ""; position: absolute; left: calc(50% - 4px); bottom: 0; border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0; }
.flow-interp span { position: relative; z-index: 1; padding: 1px 10px; border-radius: 999px; background: var(--sun); font-size: 11px; font-weight: 800; color: var(--ink); }
.flow-end .flow-io { flex-direction: column; gap: 4px; }
.flow-end .io-label { width: auto; padding-top: 0; }

/* 데이터 이름: 상자 윗선 한가운데에 걸침 */
.flow-group { gap: 18px; padding-top: 20px; }
.flow-data { padding-top: 20px; }
.info-panel .flow-name { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); margin: 0; text-align: center; line-height: 1; }
.flow-name span { display: inline-block; max-width: calc(100% - 20px); padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.flow-step { position: relative; height: 22px; margin: 4px 0; }
.flow-step::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 5px; width: 1.5px; background: var(--ink); }
.flow-step::after { content: ""; position: absolute; left: calc(50% - 4px); bottom: 0; border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0; }

/* ===== 정보가 모이는 과정 v2: 가운데 정렬, 회색(카카오) → 노랑(OUTPUT) → 연파랑(INSIGHT) ===== */
.flow { display: flex; flex-direction: column; align-items: stretch; margin: 8px 0 4px; text-align: center; }
.fbox { position: relative; padding: 14px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.fstart, .fend { border: 1.5px solid var(--ink); }
.info-panel .fbox p { margin: 0; }
.ftitle { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 8px !important; }
.fgroup { display: flex; flex-direction: column; gap: 20px; padding: 22px 10px 12px; border: 1.5px dashed var(--field); border-radius: 18px; }
.fdata { padding-top: 22px; }
.info-panel .fname { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); text-align: center; line-height: 1; }
.fname span { display: inline-block; max-width: calc(100% - 16px); padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.fend .fr + .fr { margin-top: 10px; }
.fr-label { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--mute); }
.fr-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.fc { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.45; }
.fc-in { background: var(--paper-2); }
.fc-out { background: var(--sun); }
.fc-ins { background: #dce7f5; }
/* 화살표: 짧게, 위아래 빈틈 없이 */
.fa { position: relative; height: 18px; margin: 4px 0; }
.fa::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 4px; width: 1.5px; margin-left: -.75px; background: var(--ink); }
.fa::after { content: ""; position: absolute; left: 50%; bottom: 0; margin-left: -4px; border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0; }
.fa-text { height: 30px; margin: 6px 0; }
.fa-text span { position: relative; z-index: 1; display: inline-block; margin-top: 4px; padding: 1px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--ink-2); }
.fdata .fa-text span { background: var(--card); }
.flegend { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 12px 0 0; padding: 0; font-size: 12px; color: var(--mute); }
.flegend li { display: flex; align-items: center; gap: 6px; }
.flegend .fc { width: 22px; height: 12px; padding: 0; }

/* 화살표가 잘 보이게: 글 없는 화살표 26px, 글 있는 화살표는 글 아래로 선이 보이게 */
.fa { height: 26px; margin: 6px 0; }
.fa-text { height: auto; display: flex; flex-direction: column; align-items: center; margin: 6px 0; padding-bottom: 22px; }
.fa-text::before { top: 0; bottom: 5px; }
.fa-text span { margin-top: 0; }
.fa-strong span { border: 1.5px solid var(--ink); color: var(--ink); font-weight: 800; }
.fa-text { padding-top: 8px; }

/* 카카오맵 검색 상자도 데이터 상자처럼 이름을 윗선에, 검색어는 흰 꼬리표 */
.fstart { border: 1.5px solid var(--ink); }
.fc-q { background: #fff; border: 1.5px solid var(--ink); padding: 1.5px 9px; }
.flow > .fstart { margin-top: 12px; }
.flegend { align-items: flex-start; }

/* 연표: 연도 배지에 검은 테두리, 법 조항은 설명과 구분되는 작은 상자 */
.tl-date { border: 1.5px solid var(--ink); }
.info-panel .timeline .tl-law { display: block; margin-top: 6px; padding: 6px 10px; border-left: 1.5px solid var(--ink); background: var(--paper-2); border-radius: 0 8px 8px 0; font-style: normal; font-size: 11.5px; line-height: 1.6; color: var(--ink); }
.info-panel .timeline .tl-law b { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 800; color: var(--mute); }
.info-panel .timeline .tl-law { border-left: 0; border-radius: 8px; }

/* 두 데이터(건축물대장=파랑, 장애인편의시설=살구)를 함께 써서 만든 값은 반반 */
.fc-both { background: linear-gradient(90deg, #dce7f5 50%, #f4cfae 50%); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; margin: 0 6px 0 0; border: 1px solid rgba(255,255,255,.6); }
.dot-bld { background: #dce7f5; }
.dot-fac { background: #f4cfae; }
.flegend .dot { margin: 0 2px 0 3px; border-color: var(--line); }

/* 상가정보 색(연보라), 세 데이터를 함께 쓴 값은 세 칸 */
.dot-store { background: #ddd3f0; }
.fc-three { background: linear-gradient(90deg, #dce7f5 33.3%, #ddd3f0 33.3% 66.6%, #f4cfae 66.6%); }
/* 범례: 글이 길어도 한 덩어리로 줄바꿈 */
.flegend li { display: block; line-height: 1.7; }
.flegend li > .fc { display: inline-block; vertical-align: -1px; margin-right: 6px; }

/* ===== 다이어그램 v3: 데이터마다 다른 색(명도 비슷, 테두리 없음) ===== */
.fc { border: 0 !important; }
.s-kakao { background: #cfe8d6; }
.s-bld { background: #cfe0f6; }
.s-store { background: #e2d5f4; }
.s-fac { background: #f6d3bd; }
.s-raw { background: #ebe8e1; }
.s-q { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.s-bf { background: linear-gradient(90deg, #cfe0f6 50%, #f6d3bd 50%); }
.s-all { background: linear-gradient(90deg, #cfe0f6 33.3%, #e2d5f4 33.3% 66.6%, #f6d3bd 66.6%); }
.fname .dot { width: 9px; height: 9px; border: 0; margin-right: 6px; }
.s-q { background: var(--ink); color: var(--paper); box-shadow: none; } /* 사용자가 입력한 검색어 */
.data-card { border: 1px solid var(--line); } /* 사용하는 공공데이터 상자: 연한 선 */

/* 펼친 상태: 위 여백 없이 카드가 결과 영역 맨 위에서 시작 */
.results.full .results-inner { padding-top: 0; }



/* ===== 펼친 카드 머리 v4: 윗선을 머리 자체의 테두리로 그림 =====
   카드의 윗테두리는 없애고, 머리(색 띠+매장명)가 카드 테두리 바깥선까지 덮으며 위·양옆 1.5px 테두리를 직접 가짐.
   선이 한 층에서 한 번만 그려지고, 머리가 결과 틀 맨 위(0)에 붙어 위로 틈이 생기지 않음 */
.results .item.open { border-top-width: 0; }
.results .item.open .item-head {
  top: 0;
  margin-left: calc(-1 * var(--pl) - 1.5px); margin-right: calc(-1 * var(--pr) - 1.5px);
  padding-left: var(--pl); padding-right: var(--pr);
  border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 14px 14px 0 0;
  box-shadow: none;
}
.results .item.open .item-head.stuck { box-shadow: none; }
.results .item.open .item-top { border-radius: 12.5px 12.5px 0 0; }

/* 건축인허가정보 색(연분홍)과 섞인 값 */
.s-permit { background: #f3d5e2; }
.s-bpf { background: linear-gradient(90deg, #cfe0f6 33.3%, #f3d5e2 33.3% 66.6%, #f6d3bd 66.6%); }
.s-all4 { background: linear-gradient(90deg, #cfe0f6 25%, #f3d5e2 25% 50%, #e2d5f4 50% 75%, #f6d3bd 75%); }

/* 범례: 색 칩 오른쪽에 글을 두고, 줄이 바뀌어도 글끼리 왼쪽 정렬 */
.flegend li { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: start; }
.flegend li > .fc { margin: 4px 0 0; }
.flegend, .flegend .fl-text { text-align: left; }

/* 건축HUB: 주소 → 두 갈래(건축물대장 | 건축인허가) → 합쳐져 해석 → OUTPUT */
.s-bp { background: linear-gradient(90deg, #cfe0f6 50%, #f3d5e2 50%); }
.fname .dot + .dot { margin-left: -3px; }
.fsplit, .fmerge { position: relative; height: 30px; margin: 4px 0; }
.fsplit i, .fmerge i { position: absolute; background: var(--ink); }
.fsplit .v { left: 50%; top: 0; width: 1.5px; height: 12px; margin-left: -.75px; }
.fsplit .h, .fmerge .h { left: 25%; right: 25%; top: 12px; height: 1.5px; }
.fsplit .leg { top: 12px; bottom: 5px; width: 1.5px; margin-left: -.75px; }
.fsplit .l1, .fmerge .l1 { left: 25%; } .fsplit .l2, .fmerge .l2 { left: 75%; }
.fsplit .leg::after { content: ""; position: absolute; left: -3.25px; bottom: -5px; border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0; }
.fmerge .leg { top: 0; height: 13.5px; width: 1.5px; margin-left: -.75px; }
.fmerge .h { top: 12px; }
.fmerge .v { left: 50%; top: 12px; bottom: 0; width: 1.5px; margin-left: -.75px; }
.fpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
.fsub { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.info-panel .fsub-name { margin: 0 0 2px; font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.fsub-name .dot { margin-right: 4px; }
.fmerge-label { display: flex; justify-content: center; }
.fmerge-label span { padding: 1px 10px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--ink); font-size: 11px; font-weight: 800; color: var(--ink); }

/* 합쳐지는 화살표가 라벨에 바로 닿고, 라벨 아래 화살표도 라벨에서 바로 이어지게 */
.fmerge { margin-bottom: 0; }
.fmerge-label + .fa { margin-top: 0; }
.fmerge { margin-top: 0; } /* 두 상자 아래에서 바로 선이 시작 */

/* 검색어: 밝은 바탕 + 검은 테두리 */
.fc.s-q { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
/* 건축HUB 안쪽 두 상자 이름: 다른 상자처럼 윗선 한가운데 검은 알약 */
.fpair { margin-top: 10px; }
.fsub { position: relative; padding-top: 18px; }
.info-panel .fsub-name { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); margin: 0; text-align: center; line-height: 1; }
.fsub-name { display: block; }
.fsub-name > * { vertical-align: middle; }
.info-panel .fsub-name { font-size: 0; }
.fsub-name .dot { margin-right: 5px; }
.fsub-name span { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 800; white-space: nowrap; }

/* ===== 펼친 카드 테두리 v5: 선을 면(색 띠·카드 바탕) 위 레이어에 그림 =====
   카드 테두리 자리는 투명하게 두고, 선은 카드 위(::after)와 머리 위(::before)에 덮어 그림.
   면이 선을 가리지 않아 모서리·머리 아래 이음새가 끊기지 않음. 두 선은 같은 자리라 겹쳐도 두꺼워지지 않음 */
.results .item.open { border-color: transparent; border-top-width: 1.5px; }
.results .item.open::after { content: ""; position: absolute; inset: -1.5px; border: 1.5px solid var(--ink); border-radius: var(--rad); pointer-events: none; z-index: 3; }
.results .item.open .item-head {
  top: 1.5px; border: 0; border-radius: 12.5px 12.5px 0 0;
  margin-left: calc(-1 * var(--pl)); margin-right: calc(-1 * var(--pr));
}
.results .item.open .item-head::before { content: ""; position: absolute; top: -1.5px; left: -1.5px; right: -1.5px; bottom: 0; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: var(--rad) var(--rad) 0 0; pointer-events: none; z-index: 1; }

/* ===== 펼친 카드 테두리 v6: 윗선과 머리 사이 틈 없애기 =====
   머리가 1.5px 띄워져 붙어 있으면, 아이폰(3배 화면)에서 반올림으로 선과 띠 사이에 틈이 생겨
   아래로 스크롤된 내용이 비쳤음. 머리를 맨 위(0)에 붙이고 윗선을 머리 자체(불투명)에 그려 틈이 생길 수 없게 함 */
.results .item.open { border-top-width: 0; }
.results .item.open::after { top: 0; }
.results .item.open .item-head { top: 0; border-top: 1.5px solid var(--ink); }

/* ===== 펼친 카드 v7: 아이폰에서 선이 흐리고 얇아 보이던 것 =====
   둥근 틀을 자르려고 쓴 -webkit-mask-image 는 아이폰 사파리에서 그 안 전체를 흐리게(낮은 해상도로) 그릴 수 있음.
   마스크 대신 clip-path 로 같은 모양(위 모서리 14px)을 잘라, 선이 검색창 테두리와 같은 선명도로 그려지게 함 */
/* (v8에서 틀 자르기 없앰: 틀을 둥글게 자르면 카드 선과 겹쳐 선이 얇아지거나 끊겨 보였음) */

/* ===== 카드 테두리 v8: 결과 틀이 카드 선을 자르지 않게 =====
   - 결과 틀(스크롤 영역)은 둥글게 자르지 않고, 카드와 틀 끝 사이에 항상 여백을 둠
     → 카드 선·모서리·그림자가 틀에 잘리지 않음
   - 펼친 카드 머리가 위에 붙으면(.stuck) 위 모서리를 각지게: 카드가 위로 이어진 모양이 되어
     둥근 머리 옆으로 몸통 모서리가 삐져나오지 않음 */
.results.full { border-radius: 0; clip-path: none; -webkit-mask-image: none; mask-image: none; }
.results .item.open .item-head.stuck,
.results .item.open .item-head.stuck .item-top { border-radius: 0; }
.results .item.open .item-head.stuck::before { border-radius: 0; }

/* ===== 카드 테두리 v9 (최종): 선은 카드 자신의 테두리 한 겹만 =====
   그동안 펼친 카드는 카드 위(::after)·머리 위(::before)·색 띠 모서리를 따로 그려서,
   모서리에서 선과 색 띠가 어긋나 틈이 보였음.
   → 모든 카드: 카드 자신의 테두리(border)만 그리고, 안쪽 내용은 카드 모양대로 잘라냄(overflow: clip).
     색 띠는 모서리를 따로 둥글리지 않고 카드가 잘라 주므로, 선 안쪽 곡선과 색 띠 곡선이 항상 똑같음.
   (overflow: clip 은 스크롤 틀을 만들지 않아 펼친 카드 머리 '위에 붙기(sticky)'가 그대로 동작) */
.results .item { overflow: clip; }
.results .item .item-top,
.results .item[aria-current="true"] .item-top,
.results .item.open .item-top { border-radius: 0; }
.results .item.open { border: 1.5px solid var(--ink); }
.results .item.open::after { content: none; }
.results .item.open .item-head,
.results .item.open .item-head.stuck {
  top: 0; border: 0; border-radius: 0; box-shadow: none;
  margin-left: calc(-1 * var(--pl)); margin-right: calc(-1 * var(--pr));
  padding-left: var(--pl); padding-right: var(--pr);
}
.results .item.open .item-head::before { content: none; }
/* 머리가 위에 붙으면 카드 윗선은 화면 밖이므로, 색 띠 위에 같은 굵기 선을 그어 카드 윗선을 대신함 */
.results .item.open .item-head.stuck .item-top { box-shadow: inset 0 1.5px 0 var(--ink); }
.results .item.open .item-head.stuck .item-top.b5 { box-shadow: inset 0 1.5px 0 var(--ink), inset 0 -1px 0 var(--line); }


/* ------------------------- 첫 화면(스플래시) -------------------------
   진한 파랑 바탕 + 흰 로고. 가로는 여백 2 : 로고 3 : 여백 2 */
/* position: absolute (fixed 아님): 아이폰 사파리는 화면 위·아래에 붙은 fixed 요소의 색으로 막대를 칠하고
   스플래시가 사라진 뒤에도 그 파랑을 유지했음. absolute로 두면 막대는 바탕색(#F7F8F8)을 따름 */
.splash {
  position: absolute; inset: 0; z-index: 100;
  background: var(--navy); color: #fff;
  transition: opacity .6s var(--ease);
}
.splash.splash-out { opacity: 0; pointer-events: none; }
.splash-logo {
  position: absolute; left: calc(100% * 2 / 7); top: 50%;
  width: calc(100% * 3 / 7); height: auto;
  transform: translateY(-50%);
  overflow: visible; /* 위에서 떨어지는 바퀴가 잘리지 않게 */
}
.splash-disk { fill: var(--navy); } /* 바퀴 가운데 면 = 바탕색 (지나갈 때 n 왼쪽 기둥을 가림) */
.splash-maker {
  position: absolute; left: 50%; top: calc(100% * 5 / 6);
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.splash-zeomada { width: calc(100vw * 3 / 7 / 6); min-width: 24px; height: auto; display: block; }
.splash-maker p { margin: 0; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; color: #fff; }

/* 바퀴 모션 (크기는 그대로, 위치만): 떨어짐 → 튕김 → 멈춤 → n 문 안으로 → 나와서 제자리 */
.splash-wheel { animation: splash-wheel 5s both; }
@keyframes splash-wheel {
  0%    { transform: translate(0, -420px); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  11%   { transform: translate(0, 0);      animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  16%   { transform: translate(0, -45px);  animation-timing-function: cubic-bezier(.6, 0, 1, .6); }
  21%   { transform: translate(0, 0);      animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  23.5% { transform: translate(0, -10px);  animation-timing-function: cubic-bezier(.6, 0, 1, .6); }
  26%   { transform: translate(0, 0); }
  33%   { transform: translate(0, 0);      animation-timing-function: cubic-bezier(.45, 0, .7, 1); }
  54%   { transform: translate(570px, 0); }
  62%   { transform: translate(570px, 0);  animation-timing-function: cubic-bezier(.25, .6, .35, 1); }
  88%, 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-wheel { animation: none; }
}

/* 인포 패널 맨 위: 롤인맵 로고(움직임 없음), 왼쪽 위에 작게. MAP은 ROLLIN 오른쪽, 아랫선 맞춤 */
.info-panel h1.info-title { margin: 0 0 18px; line-height: 0; }
.info-logo { width: 152px; height: auto; display: block; color: var(--ink); }
.info-logo-disk { fill: var(--paper); }

/* ===================== PC 화면 (가로 860px 이상 = 모바일 폭의 약 두 배) =====================
   - 지도가 화면 전체를 차지
   - 왼쪽 위에 i · 검색창 · + · − · 현위치 버튼을 가로 한 줄로, 간격 8px로 똑같이
   - 느낌표(위치 설정 안내) 버튼은 그대로 i 아래
   - 검색 결과는 왼쪽 패널: 폭 = i 왼쪽 끝 ~ 현위치 버튼 오른쪽 끝
     결과가 적으면 버튼 줄 바로 아래에 붙어서 짧게, 많으면 화면 아래 끝까지 (그 안에서 스크롤) */
@media (min-width: 860px) {
  .map-page {
    --pc-gap: 8px;            /* 버튼 사이 간격 */
    --pc-btn: 40px;           /* 버튼 크기 */
    --pc-search: 300px;       /* 검색창 폭 */
    --pc-left: 10px;          /* 화면 왼쪽 여백 */
    --pc-top: calc(10px + env(safe-area-inset-top, 0px));
    /* 버튼 줄 전체 폭: i + 검색창 + (+, −, 현위치) + 간격 4개 */
    --pc-row: calc(var(--pc-btn) * 4 + var(--pc-search) + var(--pc-gap) * 4);
    --pc-panel-top: calc(var(--pc-top) + var(--pc-btn) + 10px);
  }
  body.map-page { max-width: none; }
  .app { max-width: none; }

  /* 버튼 한 줄: topbar(i + 검색창) 바로 오른쪽에 map-ctrl(+ − 현위치) */
  .topbar { left: var(--pc-left); right: auto; width: calc(var(--pc-btn) + var(--pc-gap) + var(--pc-search)); gap: var(--pc-gap); }
  .map-ctrl {
    top: var(--pc-top); right: auto;
    left: calc(var(--pc-left) + var(--pc-btn) + var(--pc-gap) * 2 + var(--pc-search));
    flex-direction: row; gap: var(--pc-gap);
  }
  .map-ctrl .zoom { flex-direction: row; gap: var(--pc-gap); }

  /* 위치 설정 안내 상자: 너무 넓게 퍼지지 않게 */
  .app .loc-notice { right: auto; width: calc(var(--pc-row) - 48px); }

  /* 왼쪽 결과 패널 */
  .results,
  .results.full {
    /* 틀은 양옆으로 8px씩 더 넓고, 안쪽 여백 8px → 카드는 i 왼쪽 끝 ~ 현위치 오른쪽 끝에 딱 맞고,
       카드 선·그림자는 틀 안쪽에 있어 잘리지 않음 */
    top: var(--pc-panel-top); bottom: auto; left: calc(var(--pc-left) - 8px); right: auto;
    width: calc(var(--pc-row) + 16px); height: auto;
    max-height: calc(100% - var(--pc-panel-top) - 10px - env(safe-area-inset-bottom, 0px));
    border-radius: 0; clip-path: none;
  }
  /* 느낌표 버튼이 보일 때는 그 아래부터 */
  .app:has(#locBtn:not([hidden])) .results { --pc-panel-top: calc(var(--pc-top) + var(--pc-btn) * 2 + 16px); }
  .results-inner, .results.full .results-inner { padding: 0 8px 10px; }
  .results-inner::before { display: none; } /* 모바일의 '첫 카드만 살짝 보이기' 빈 공간 없앰 */
  .results.full .results-inner { padding-bottom: 64px; } /* 맨 아래 카드가 '카드 접기'에 가리지 않게 */

  /* '카드 접기': 결과 패널 아래쪽 가운데 */
  .collapse-btn { left: calc(var(--pc-left) + var(--pc-row) / 2); }

  /* '이 지역에서 다시 검색': 결과 패널 오른쪽 지도 영역의 위쪽 가운데 */
  .app .map-btn.research {
    top: var(--pc-top);
    left: calc((var(--pc-left) + var(--pc-row) + 100%) / 2);
  }
}

/* 인포 패널: 화면 전체 폭으로 열고(스크롤 막대는 브라우저 오른쪽 끝), 내용만 가운데 모바일 폭(430px) */
.info-panel { max-width: none; padding: 0 max(0px, (100% - 430px) / 2); }

/* 지도 화면 바탕: 밝은 회색(#F7F8F8). 스플래시는 그 위에 덮이는 파란 화면
   (화면 위·아래 끝, 지도 그림이 아직 안 뜬 자리까지 같은 색) */
.map-page { --map-bg: #F7F8F8; }
html:has(body.map-page) { background: #F7F8F8; }
.app, .app .map { background: var(--map-bg); }

/* PC 스플래시: 저마다 로고만 0.6배. 로고 중심점 기준으로 줄여서 로고 가운데·글씨 위치는 그대로
   (닷톡 스플래시와 같게: 가로 768px 이상부터) */
@media (min-width: 768px) {
  .splash-zeomada { transform: scale(0.6); transform-origin: 50% 50%; }
  /* 롤인맵 모션 로고도 0.5배(가로 3/7 → 3/14), 화면 정가운데 기준 */
  .splash-logo { width: calc(100% * 3 / 14); left: calc(50% - 100% * 3 / 28); }
}
