:root {
  --ink: #26183f; --soft: #665b7a; --line: #ddd5ea; --bg: #f7f4fb; --card: #fff;
  --main: #6a35b5; --main-soft: #ebe1f8;
  --red: #b3261e; --red-soft: #fdeceb; --amber: #8a5a00; --amber-soft: #fff3d9;
}
html { font-size: 18px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 19px/1.5 "Gamja Flower", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--main); }
:focus-visible { outline: 3px solid #9b6ee0; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { display: block; max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.25; margin: 36px 0 18px; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: 1.05rem; margin: 0; }
.lead { color: var(--soft); margin: 0 0 18px; max-width: 60ch; }

.top { background: var(--ink); }
.top-in { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 16px; }
.logo { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; padding: 12px 0; }
nav { display: flex; gap: 0 20px; flex-wrap: wrap; }
nav a { color: #d3c6e8; text-decoration: none; padding: 14px 0 11px; border-bottom: 3px solid transparent; }
nav a[aria-current] { color: #fff; border-color: #b98cf5; font-weight: 700; }
.note { margin: 0 0 12px; background: var(--amber-soft); color: var(--amber); padding: 10px 14px; border-radius: 8px; font-size: .94rem; }

.types { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.types legend { font-weight: 700; margin-bottom: 8px; }
.types label { position: relative; }
.types input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.types span { display: block; padding: 9px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 600; }
.types input:checked + span { background: var(--main); border-color: var(--main); color: #fff; }
.types input[value="h24"]:checked + span { background: var(--red); border-color: var(--red); }
.types input:focus-visible + span { outline: 3px solid #9b6ee0; outline-offset: 2px; }
#searchForm { display: flex; flex-wrap: wrap; gap: 12px; }
.keyword { flex: 1 1 260px; }
#keyword, select { width: 100%; padding: 9px 12px; border: 1px solid #b5a9c9; border-radius: 8px; background: var(--card); }
select:disabled { color: var(--soft); background: var(--bg); }

.finder { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; margin-top: 28px; align-items: start; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 10px; }
.link { background: none; border: 0; color: var(--main); text-decoration: underline; padding: 8px 0; }
.field { display: block; font-weight: 700; margin: 16px 0 6px; }

.map-all { display: block; padding: 10px 14px; background: var(--main-soft); border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.results { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.results > li { padding: 18px 4px; border-bottom: 1px solid var(--line); }
.results .empty { color: var(--soft); padding: 32px 4px; }
.results p { margin: 2px 0; color: var(--soft); font-size: .94rem; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 4px; background: var(--main-soft); color: var(--main); margin-bottom: 4px; }
.badge.wild { background: #e4ecfb; color: #1f4f9c; }
.badge.shelter { background: var(--amber-soft); color: var(--amber); }
.badge.h24 { background: var(--red-soft); color: var(--red); }
.acts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .94rem; }
.btn { border: 1px solid var(--main); background: var(--main); color: #fff; border-radius: 8px; padding: 11px 22px; font-weight: 700; text-decoration: none; display: inline-block; }
.btn.ghost { background: none; color: var(--main); width: 100%; margin-top: 16px; }


.ad { margin-block: 28px; text-align: center; }
.ad small { display: block; color: var(--soft); font-size: .75rem; margin-bottom: 4px; }
.ad-body, .ad .adsbygoogle { display: block; width: 100%; max-width: 728px; height: 100px; margin-inline: auto; }
.ad[data-ad="map"] { margin-block: 24px 64px; }
.ad.preview .ad-body { border: 1px dashed #b5a9c9; border-radius: 8px; color: var(--soft); display: grid; place-items: center; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
@media (min-width: 761px) {
  .ad-body, .ad .adsbygoogle { height: 90px; }
  .ad[data-ad="map"] .ad-body, .ad[data-ad="map"] .adsbygoogle { height: 100px; }
}
.map-open { display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 10px; padding: 12px 16px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.map-open:hover { border-color: var(--main); }
.map-open b { font-size: 1.1rem; color: var(--main); }
.map-open small { color: var(--soft); }
#miniMap svg { display: block; width: 92px; height: auto; fill: #dccff0; stroke: #fff; stroke-width: 4; }
#miniMap .on { fill: var(--main); }
#mapDialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 14px; padding: 18px 20px 20px; color: var(--ink); background: #f1ebf9; overflow: hidden; }
#mapDialog::backdrop { background: rgb(28 14 52 / .55); }
.map-head { display: flex; justify-content: space-between; align-items: center; }
#bigMap svg { display: block; width: 100%; height: min(660px, calc(100dvh - 190px)); overflow: visible; }
#bigMap path { fill: #d2bff0; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; fill-rule: evenodd; }
#bigMap text { font-size: 14px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
#bigMap .region { cursor: pointer; outline: none; }
#bigMap .city path { fill: #b99de6; }
#bigMap .city text { font-size: 12px; }
#bigMap .region.on path { fill: #9c74dc; }
#mapZoom { pointer-events: none; }
#mapZoom .zoomed { transform-box: fill-box; transform-origin: center; transform: scale(var(--zoom)); animation: grow .18s ease-out; filter: drop-shadow(0 4px 6px rgb(28 14 52 / .35)); }
#mapZoom path { fill: var(--main); }
#mapZoom text { fill: #fff; }
@keyframes grow { from { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #mapZoom .zoomed { animation: none; } }

.warn { background: var(--red-soft); color: var(--red); padding: 12px 16px; border-radius: 8px; font-weight: 600; margin: 0 0 24px; }
.warn a { color: inherit; }
.pets { margin-bottom: 26px; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 20px; }
.topics button { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: left; font-weight: 700; }
.topics span { display: block; font-size: 1.5rem; }
.topics button[aria-pressed="true"] { border-color: var(--main); background: var(--main-soft); box-shadow: inset 0 0 0 1px var(--main); }
#checkForm { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
#checkForm fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
#checkForm legend { font-weight: 700; margin-bottom: 6px; }
#checkForm label { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
#checkForm input { width: 20px; height: 20px; flex: none; margin: 3px 0 0; accent-color: var(--main); }
.outcome { margin-top: 16px; border-radius: 10px; padding: 22px; background: var(--main-soft); }
.outcome.l2 { background: var(--amber-soft); } .outcome.l3 { background: var(--red-soft); }
.outcome.l2 h3 { color: var(--amber); } .outcome.l3 h3 { color: var(--red); }
.outcome h3 { font-size: 1.35rem; line-height: 1.3; }
.outcome h4 { margin: 14px 0 4px; }
.outcome ul { margin: 0 0 18px; padding-left: 20px; }
.outcome.l3 .btn { background: var(--red); border-color: var(--red); }
.gap { margin-top: 52px; margin-bottom: 4px; }
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0 32px; margin: 0; }
.vitals div { border-top: 1px solid var(--line); padding: 14px 0; }
.vitals dt { color: var(--soft); }
.vitals dd { margin: 0; }
.vitals b { font-size: 1.15rem; }
.counter { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-top: 20px; }
.counter p { margin: 4px 0 0; color: var(--soft); }
.counter > div:first-child { flex: 1 1 280px; }
.counter-act { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
output { font-weight: 700; font-variant-numeric: tabular-nums; }
footer { margin-top: 60px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--soft); font-size: .9rem; }

.logo { font-size: 1.45rem; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.2rem; }
.results p, .acts, .note, footer, .badge { font-size: 1rem; }
#bigMap text { font-size: 17px; }
#bigMap .city text { font-size: 14px; }
.seasons { margin: 12px 0 8px; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 32px; margin: 8px 0 0; }
.tips div { border-top: 1px solid var(--line); padding: 14px 0; }
.tips dt { font-weight: 700; font-size: 1.15rem; }
.tips dd { margin: 2px 0 0; }
.food { margin-top: 24px; }
.food.never { color: var(--red); } .food.avoid { color: var(--amber); }
.food.never + .tips div { border-color: #efb9b5; } .food.avoid + .tips div { border-color: #e6cf9c; }
.article h2 { margin: 32px 0 6px; }
.article p, .article li { max-width: 68ch; line-height: 1.65; }
.article ul { padding-left: 1.2em; }
#intro { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
.crumb { margin: 32px 0 -20px; color: var(--main); font-weight: 700; }
.article .warn { margin-top: 32px; }
.report input[name="place"], .report textarea { width: 100%; max-width: 640px; padding: 9px 12px; border: 1px solid #b5a9c9; border-radius: 8px; background: var(--card); font: inherit; color: inherit; }
.report .btn { display: block; margin: 16px 0; }
.note.sent { background: var(--main-soft); color: var(--main); }
.reads { padding-left: 1.2em; margin: 4px 0 16px; }
.sources { margin-top: 36px; color: var(--soft); }

@media (max-width: 760px) {
  .finder { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  h1 { margin-top: 24px; }
  nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; width: 100%; }
  nav a { padding: 8px 0 6px; text-align: center; }
  .seasons { gap: 6px; }
  .seasons label { flex: 1; }
  .seasons span { padding-inline: 0; text-align: center; }
}
