/* 선 굵기는 두 가지만 씀: 먹색 선 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: #2f4f8f;
  --s2: #6f9be0;
  --s3: #dfd150;
  --s4: #f3edb8;
  --s5: #ffffff;
  --font: "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; }
/* 스크롤: 제목 영역은 제자리에 머물고, 검색창부터 아래(.sheet)가 그 위를 덮으며 올라감 */
.top { position: sticky; top: 0; z-index: 0; }
.sheet { position: relative; z-index: 1; background: var(--paper); padding-top: 12px; }
/* 검색창 + 지도(범례 포함)는 화면 맨 위에 닿으면 고정되고, 그 아래(목록·상세)만 스크롤됨 */
.pinned { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 10px 0 12px; }
/* 아이폰: 화면 맨 위 시간·배터리 영역(안전 영역)까지 고정 영역 바탕으로 덮어, 스크롤되는 목록이 그 틈으로 비치지 않게 함.
   viewport-fit=cover 일 때 env(safe-area-inset-top) 이 그 영역 높이(없는 기기는 0) */
.pinned { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.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); color: #fff; }
.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); color: #fff; }
.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); color: #fff; 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 { color: var(--mute); font-weight: 500; }

/* ------------------------- 상세 정보 ------------------------- */
.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; box-shadow: inset 0 0 0 1px var(--field); 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); }

/* ------------------------- 지도 핀 ------------------------- */
.pin {
  width: 24px; height: 24px; padding: 0; margin-bottom: 4px; border: 1.5px solid var(--ink); border-radius: 50% 50% 50% 0; /* 24px: 최소 터치 크기 */
  transform: rotate(-45deg); background: #a8a59c; box-shadow: 0 1px 4px rgba(20,20,20,.35);
}
.pin.b1 { background: var(--s1); border-color: var(--paper); }
.pin.b2 { background: var(--s2); }
.pin.b3 { background: var(--s3); }
.pin.b4 { background: var(--s4); }
.pin.b5 { background: var(--s5); }
.pin.selected { width: 32px; height: 32px; outline: 1.5px solid var(--ink); outline-offset: 2px; }

/* 지도 위 매장 카드 */
.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); }
