:root {
    --primary: #176b55;
    --primary-dark: #0d4f3e;
    --primary-soft: #e8f5f0;
    --accent: #ffcb66;
    --text: #17211d;
    --muted: #65716c;
    --line: #dfe7e3;
    --surface: #ffffff;
    --background: #f4f7f5;
    --danger: #b42318;
    --shadow: 0 14px 35px rgba(22, 56, 45, 0.08);
    --radius-lg: 22px;
    --radius-md: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
fieldset {
    margin: 0;
    padding: 0;
}

fieldset {
    border: 0;
}

body {
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background: var(--background);
    font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    word-break: keep-all;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid rgba(23, 107, 85, 0.35);
    outline-offset: 2px;
}

/* 헤더 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(223, 231, 227, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 40px));
    min-height: 68px;
    margin: 0 auto;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 14px 14px 14px 5px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(23, 107, 85, 0.22);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-copy strong {
    font-size: 17px;
    letter-spacing: -0.02em;
}

.brand-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 10px 15px;
    border-radius: 10px;
    color: #52605a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.nav-link.is-active {
    color: #fff;
    background: var(--primary);
}

/* 본문 */
.page-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 64px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 40px 46px 56px;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 86% 12%, rgba(255, 203, 102, 0.34), transparent 30%),
        linear-gradient(135deg, #0b4f3d 0%, #18755b 58%, #2a8e6f 100%);
    box-shadow: var(--shadow);
}

.hero-animal {
    background:
        radial-gradient(circle at 86% 12%, rgba(255, 203, 102, 0.4), transparent 32%),
        linear-gradient(135deg, #12423f 0%, #1d6b62 58%, #2f8a79 100%);
}

.hero::after {
    position: absolute;
    right: -70px;
    bottom: -100px;
    width: 270px;
    height: 270px;
    border: 42px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #e5fff4;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.hero h1 {
    position: relative;
    z-index: 1;
    max-width: 760px;
    font-size: clamp(28px, 4.2vw, 44px);
    line-height: 1.22;
    letter-spacing: -0.045em;
}

.hero p {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
}

.hero-stats {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-stats div {
    min-width: 128px;
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-stats dt {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
}

.hero-stats dd {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* 검색 */
.search-panel {
    position: relative;
    z-index: 2;
    margin: -26px 24px 0;
    padding: 20px 22px;
    border: 1px solid rgba(223, 231, 227, 0.85);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-grid {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field label {
    color: #47534e;
    font-size: 12px;
    font-weight: 800;
}

.field input,
.field select {
    width: 100%;
    height: 48px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
    color: #9aa49f;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 107, 85, 0.11);
}

.primary-button {
    height: 48px;
    padding: 0 30px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(23, 107, 85, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.chip {
    position: relative;
    cursor: pointer;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip span {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #4b5852;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chip span::before {
    margin-right: 6px;
    color: #b6c0bb;
    content: "+";
}

.chip input:checked + span {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.chip input:checked + span::before {
    color: var(--primary);
    content: "\2713";
}

.chip input:focus-visible + span {
    outline: 3px solid rgba(23, 107, 85, 0.35);
    outline-offset: 2px;
}

.near-button {
    height: 36px;
    margin-left: auto;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    color: #4a3300;
    background: var(--accent);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.near-button::before {
    margin-right: 6px;
    content: "\25CE";
}

.near-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ad-box {
    display: block;
    width: 100%;
    min-height: 100px;
    margin: 24px 0;
    overflow: hidden;
    text-align: center;
}

/* 결과 */
.results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    align-items: start;
    gap: 22px;
}

.panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(22, 56, 45, 0.055);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #edf1ef;
}

.panel-title h2 {
    font-size: 20px;
    letter-spacing: -0.025em;
}

.panel-title p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.result-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 800;
}

.place-list {
    list-style: none;
}

.place-card {
    padding: 16px 24px;
    border-bottom: 1px solid #edf1ef;
    transition: background-color 0.2s ease;
}

.place-card:last-child {
    border-bottom: 0;
}

.place-card.is-selected {
    background: #f3faf7;
    box-shadow: inset 4px 0 0 var(--primary);
}

.place-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.place-name {
    padding: 0;
    border: 0;
    color: var(--primary-dark);
    background: transparent;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.place-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.place-name:disabled {
    color: var(--text);
    cursor: default;
    text-decoration: none;
}

.distance {
    flex: 0 0 auto;
    color: #b06d00;
    font-size: 13px;
    font-weight: 800;
}

.place-address {
    margin-top: 3px;
    color: #4b5852;
    font-size: 14px;
}

.place-sub {
    color: var(--muted);
    font-size: 12px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
    list-style: none;
}

.badge {
    padding: 2px 8px;
    border-radius: 6px;
    color: #4b5852;
    background: #f0f4f2;
    font-size: 12px;
    font-weight: 700;
}

.badge-type {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.badge-strong {
    color: #7a4a00;
    background: #fff3d6;
}

.place-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}

.place-actions a {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: #44514b;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.place-actions a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.place-actions .action-strong {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

.place-actions .action-strong:hover {
    color: #fff;
    background: var(--primary-dark);
}

.state-box {
    display: grid;
    min-height: 185px;
    padding: 28px;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.state-box strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
}

.state-box.is-error strong {
    color: var(--danger);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px;
    border-top: 1px solid #edf1ef;
}

.page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: #44514b;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.page-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.map-panel {
    position: sticky;
    top: 88px;
}

.map-canvas {
    width: 100%;
    height: 520px;
    background: #e9efec;
}

.map-selection {
    min-height: 74px;
    padding: 14px 20px;
    border-top: 1px solid #edf1ef;
    color: var(--muted);
    font-size: 13px;
}

.map-selection strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
    font-size: 14px;
}

/* 지역 링크, 안내 */
.hub-section,
.guide-section {
    margin-top: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.hub-section h2,
.guide-section h2 {
    font-size: 20px;
    letter-spacing: -0.025em;
}

.hub-section > p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.city-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.city-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid #e6ece9;
    border-radius: 11px;
    color: #3e4b45;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.city-link span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.city-link:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.city-link.is-active {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.guide-item {
    padding: 18px;
    border-radius: var(--radius-md);
    background: #f6f9f7;
}

.guide-item h3 {
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-size: 15px;
}

.guide-item p {
    color: var(--muted);
    font-size: 13px;
}

.partner-area {
    margin-top: 22px;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.site-footer {
    padding: 26px 20px 34px;
    border-top: 1px solid var(--line);
    color: #718079;
    background: #fff;
    font-size: 12px;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
}

.footer-links a {
    color: #4b5852;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .results-layout {
        grid-template-columns: 1fr;
    }

    .map-panel {
        position: static;
        order: -1;
    }

    .map-canvas {
        height: 360px;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .header-inner,
    .page-shell {
        width: calc(100% - 32px);
    }

    .header-inner {
        min-height: 60px;
        gap: 12px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 12px 12px 12px 4px;
        font-size: 11px;
    }

    .brand-copy small {
        display: none;
    }

    .brand-copy strong {
        font-size: 15px;
    }

    .site-nav {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 9px;
        font-size: 13px;
    }

    .hero {
        padding: 28px 22px 46px;
        border-radius: 22px;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-stats div {
        flex: 1 1 40%;
        min-width: 0;
    }

    .hero-stats dd {
        font-size: 17px;
    }

    .search-panel {
        margin: -24px 8px 0;
        padding: 16px;
        border-radius: 17px;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .primary-button {
        width: 100%;
    }

    .near-button {
        width: 100%;
        margin-left: 0;
    }

    .panel-header {
        padding: 18px 18px 14px;
    }

    .place-card {
        padding: 15px 18px;
    }

    .map-canvas {
        height: 300px;
    }

    .hub-section,
    .guide-section {
        padding: 22px 18px;
    }

    .city-links {
        grid-template-columns: repeat(2, 1fr);
    }
}
