:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --white: #fff;
  --ink: #18202b;
  --muted: #687384;
  --soft: #9aa3b0;
  --line: #eceff3;
  --navy: #00437f;
  --navy-strong: #04305c;
  --navy-pale: #eaf2fb;
  --navy-mist: #f4f8fd;
  --sun: #ffd65a;
  --sun-pale: #fff6d8;
  --radius: 16px;
  --shadow-sm: 0 1px 2px #1a2b4010, 0 2px 8px #1a2b400c;
  --shadow-md: 0 6px 24px #12305214;
  --side-width: 412px;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); word-break: keep-all; letter-spacing: -0.01em; }
button, input { font: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid #6aa7e0; outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; display: block; flex: none; }
.skip { position: fixed; top: 10px; left: 10px; transform: translateY(-160%); z-index: 50; background: white; padding: 12px; border-radius: 8px; }
.skip:focus { transform: none; }

/* ── 전체 배치: 왼쪽 패널 + 오른쪽 지도 ── */
.app { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); height: 100dvh; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--white); border-right: 1px solid var(--line); position: relative; z-index: 2; }
.side-header { display: flex; align-items: center; gap: 8px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; flex: none; align-items: center; gap: 6px; margin-right: auto; white-space: nowrap; }
.brand-mascot { width: 36px; height: 36px; object-fit: contain; }
.brand strong { font-size: 24px; font-weight: 900; letter-spacing: -.07em; color: var(--navy-strong); }
.brand strong span { color: var(--sun); -webkit-text-stroke: .5px #e3b12a; }
.side-nav { display: flex; flex: none; gap: 2px; }
.nav-link { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--soft); }
.nav-link .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-link:hover { background: var(--bg); color: var(--navy); }
.nav-link[aria-current=page] { background: var(--navy-pale); color: var(--navy); }
.nav-link .icon { width: 20px; height: 20px; }
.profile-button { display: flex; align-items: center; min-width: 0; gap: 5px; height: 36px; padding: 0 12px 0 10px; margin-left: 4px; border: 0; border-radius: 99px; background: var(--navy); color: white; font-size: 13px; font-weight: 700; }
.profile-button .icon { flex: none; width: 16px; height: 16px; }
.profile-button:hover { background: var(--navy-strong); }
#profile-label { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 24px; scrollbar-width: thin; outline: none; }
.side-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--soft); }
.side-footer div { display: flex; gap: 10px; }
.side-footer a:hover { color: var(--navy); text-decoration: underline; }
.partner-logo { width: 86px; opacity: .9; }

.map-area { position: relative; margin: 12px; border-radius: 22px; overflow: hidden; background: #eef0ec; box-shadow: var(--shadow-md); isolation: isolate; }
.area-map { position: absolute; inset: 0; }
.map-notice { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5; background: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow-sm); }

/* ── 공통 버튼 ── */
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 46px; padding: 10px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 15px; font-weight: 700; }
.button .icon { width: 18px; height: 18px; }
.primary { background: var(--navy); color: white; }
.primary:hover { background: var(--navy-strong); }
.subtle { background: var(--bg); color: var(--ink); }
.subtle:hover { background: #e9edf2; }
.back-button { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.back-button:hover { background: var(--bg); color: var(--ink); }
.back-button .icon { width: 18px; height: 18px; }
.chip-button { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--ink); font-size: 13px; font-weight: 600; }
.chip-button:hover { border-color: #cfd6df; background: var(--bg); }
.chip-button.strong { background: var(--navy-pale); border-color: transparent; color: var(--navy); }
.chip-button.strong:hover { background: #dce9f7; }
.chip-button .icon { width: 15px; height: 15px; }
.text-button { color: var(--navy); background: none; border: 0; font-weight: 700; padding: 0; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.view-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 10px -6px; }

/* ── 음식 종류 색 ── */
.cuisine-korean { --food-ink: #c2410c; --food-wash: #fff1e8; --food-pin: #f97316; }
.cuisine-western { --food-ink: #b42346; --food-wash: #ffedf1; --food-pin: #e8436a; }
.cuisine-chinese { --food-ink: #b91c1c; --food-wash: #ffeceb; --food-pin: #dc3b2f; }
.cuisine-japanese { --food-ink: #1d4ed8; --food-wash: #ebf1ff; --food-pin: #3a6ff0; }
.cuisine-other { --food-ink: #047857; --food-wash: #e8f8f1; --food-pin: #16a37a; }
.cuisine-all { --food-ink: #a16207; --food-wash: #fff6d8; --food-pin: #e9a800; }

/* ── 질문지 ── */
.greeting { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: linear-gradient(120deg, var(--navy-pale), #f3f8ff 60%, var(--sun-pale)); }
.greeting-mascot { width: auto; height: 84px; margin: -6px 0 -10px; object-fit: contain; flex: none; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.greeting-bubble { display: inline-block; font-size: 18px; font-weight: 800; color: var(--navy-strong); letter-spacing: -.03em; }
.greeting-sub { margin-top: 3px; font-size: 13px; color: var(--muted); }
.quiz-nav { display: flex; align-items: center; gap: 6px; min-height: 34px; margin-bottom: 14px; }
.quiz-nav .back-button { margin-left: -6px; }
.quiz-steps { display: flex; gap: 4px; margin-left: auto; }
.quiz-steps button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px 0 4px; border: 0; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; }
.step-num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: white; font-size: 11px; font-weight: 800; }
.quiz-steps button[aria-current=step] { background: var(--navy); color: white; }
.quiz-steps button[aria-current=step] .step-num { color: var(--navy); }
.quiz-steps button:disabled { cursor: default; opacity: .55; }
.quiz-steps button:not(:disabled):not([aria-current]):hover { background: var(--navy-pale); color: var(--navy); }
.quiz-summary { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
#quiz-title { font-size: 24px; font-weight: 800; letter-spacing: -.045em; outline: none; }
.quiz-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.quiz-option { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; background: white; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-size: 15px; transition: transform .12s, border-color .12s, box-shadow .12s; }
.quiz-option strong { font-weight: 700; }
.quiz-option:hover { transform: translateY(-2px); border-color: transparent; box-shadow: 0 0 0 2px var(--food-pin, var(--navy)) inset, var(--shadow-sm); }
.food-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--food-wash); color: var(--food-ink); }
.food-icon svg { width: 26px; height: 26px; }
.quiz-options.stacked { grid-template-columns: 1fr; gap: 8px; }
.stacked .quiz-option { grid-template-columns: 1fr auto; justify-items: start; align-items: center; min-height: 64px; padding: 12px 14px 12px 16px; text-align: left; row-gap: 2px; }
.stacked .quiz-option strong { grid-column: 1; font-size: 16px; }
.stacked .quiz-option small { grid-column: 1; color: var(--muted); font-size: 13px; }
.stacked .quiz-option .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--soft); }
.stacked .quiz-option:hover { box-shadow: 0 0 0 2px var(--navy) inset; }
.random-banner { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 14px 14px 14px 12px; border: 0; border-radius: var(--radius); background: var(--sun-pale); color: var(--ink); text-align: left; }
.random-banner:hover { background: #ffefb8; }
.random-banner > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.random-banner strong { font-size: 15px; font-weight: 800; }
.random-banner small { font-size: 12px; color: #8a6a12; }
.random-dice { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sun); color: #5b4200; }
.random-banner > span:last-child { color: #a8892f; }
.lunch-shortcuts { display: flex; gap: 8px; margin-top: 9px; }
.lunch-shortcuts .button { flex: 1; padding-inline: 7px; }

/* ── 결과 목록 ── */
#result-title { font-size: 22px; font-weight: 800; letter-spacing: -.045em; outline: none; }
.result-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.result-filters span, .filter-clear { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; border: 0; }
.filter-clear { background: var(--navy-pale); color: var(--navy); }
.filter-clear .icon { width: 13px; height: 13px; }
.result-tools { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 4px; }
#result-status { font-size: 14px; color: var(--muted); font-weight: 600; }
.restaurant-list { display: grid; }
.place-card { border-bottom: 1px solid var(--line); }
.place-card:last-child { border-bottom: 0; }
.place-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: 14px; background: none; color: var(--ink); text-align: left; }
.place-main:hover, .place-card.is-hover .place-main { background: var(--navy-mist); }
.place-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.place-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.place-name strong { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-name .menu-mark { flex: none; margin-left: 0; }
.place-meta { font-size: 13px; color: var(--muted); }
.place-menu { font-size: 13px; color: var(--muted); }
.place-menu strong { color: var(--ink); font-weight: 700; }
.place-reason { font-size: 13px; line-height: 1.45; color: var(--ink); }
.place-review { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: #0f7a44; }
.place-review .icon { width: 13px; height: 13px; }
.list-cuisine { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--food-wash); color: var(--food-ink); }
.list-cuisine svg { width: 15px; height: 15px; }
.list-cuisine.big { width: 40px; height: 40px; border-radius: 12px; }
.list-cuisine.big svg { width: 24px; height: 24px; }
.place-thumb { width: 76px; height: 76px; flex: none; border-radius: 14px; overflow: hidden; background: var(--bg); }
.place-thumb img { width: 100%; height: 100%; object-fit: cover; }
.icon-thumb { display: grid; place-items: center; background: var(--food-wash); color: var(--food-pin); }
.icon-thumb svg { width: 36px; height: 36px; opacity: .85; }
.more-button { width: 100%; height: 46px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 14px; font-weight: 600; }
.more-button:hover { background: var(--bg); }
.skeleton { height: 92px; margin: 6px 0; border-radius: 14px; background: linear-gradient(90deg, var(--bg), #fbfcfd, var(--bg)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.map-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.map-link { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 11px; border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; }
.map-link:hover { background: #e7ebf0; }
.map-link .icon { width: 14px; height: 14px; color: var(--soft); }
.map-link.naver { background: #eafaf0; color: #04773a; }
.map-link.kakao { background: #fff8d6; color: #6b5300; }

/* ── 상세 ── */
.pick-badge { display: inline-block; margin-bottom: 10px; padding: 6px 12px; border-radius: 99px; background: var(--sun); color: #4a3600; font-size: 13px; font-weight: 800; animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.detail-hero { position: relative; height: 200px; border-radius: 18px; overflow: hidden; background: var(--bg); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.photo-credit { position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; border-radius: 6px; background: #0009; color: white; font-size: 11px; }
.icon-hero, .detail-hero.icon-thumb { display: grid; place-items: center; align-content: center; gap: 8px; background: var(--food-wash); color: var(--food-pin); }
.icon-hero svg, .detail-hero.icon-thumb svg { width: 64px; height: 64px; }
.icon-hero span { font-size: 12px; color: var(--food-ink); opacity: .8; }
.detail-head { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; }
#detail-title { font-size: 23px; font-weight: 800; letter-spacing: -.045em; line-height: 1.25; outline: none; }
.detail-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.detail-address { margin-top: 2px; font-size: 13px; color: var(--soft); }
.review-pill { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; height: 32px; padding: 0 11px; border-radius: 99px; background: #eafaf0; color: #04773a; font-size: 13px; font-weight: 700; }
.review-pill.muted { background: var(--bg); color: var(--muted); }
.review-pill .icon { width: 15px; height: 15px; }
.review-pill:hover { filter: brightness(.97); }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.route-info { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--navy-mist); border: 1px solid var(--navy-pale); }
.route-status { font-size: 14px; color: var(--muted); }
.route-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--muted); }
.route-time { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: 15px; }
.route-time strong { color: var(--navy); font-size: 18px; }
.route-summary .chip-button { margin-left: auto; }
.route-info .map-links { margin-top: 10px; }
.detail-block { margin-top: 22px; }
.detail-block h3 { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.detail-block h3 .icon { width: 17px; height: 17px; color: var(--navy); }
.menu-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.menu-list li { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.menu-dots { flex: 1; border-bottom: 1.5px dotted #d5dae1; transform: translateY(-4px); }
.menu-list strong { font-weight: 700; white-space: nowrap; }
.menu-mark { margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--sun-pale); color: #8a6200; font-size: 11px; font-weight: 800; font-style: normal; }
.data-note { margin-top: 8px; font-size: 12px; color: var(--soft); }
.keyword-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; }
.keyword-list li { padding: 6px 10px; border-radius: 10px; background: var(--bg); font-size: 13px; font-weight: 600; }
.keyword-list span { color: var(--navy); margin-left: 2px; }

/* ── 팀 인기 / 내 기록 ── */
.page-title { font-size: 23px; font-weight: 800; letter-spacing: -.045em; }
.page-sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.content-card { margin-top: 18px; }
.content-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.content-card p { color: var(--muted); line-height: 1.6; font-size: 14px; }
.content-card .button { margin-top: 14px; }
.rank-list, .history-list { margin: 0; padding: 0; list-style: none; }
.rank-list li, .history-list li { display: flex; min-height: 54px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.rank-list li:last-child, .history-list li:last-child { border: 0; }
.rank-num { display: grid; place-items: center; height: 28px; width: 28px; flex: none; background: var(--bg); color: var(--muted); border-radius: 9px; font-size: 13px; font-weight: 800; }
.rank-num.top { background: var(--sun); color: #4a3600; }
.rank-name, .history-info { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.rank-name:hover { color: var(--navy); }
.rank-count, .history-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.history-title { margin-top: 26px; }
.history-info small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; font-size: 13px; }
.delete-button { padding: 4px; color: #b4233f; font-size: 13px; }

/* ── 지도 위 요소 ── */
.map-hint { position: absolute; z-index: 4; top: 14px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 120px); padding: 9px 14px; border-radius: 99px; background: #fffffff2; color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.area-search { position: absolute; z-index: 5; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--navy); color: white; font-size: 14px; font-weight: 700; box-shadow: 0 6px 18px #00437f40; }
.area-search .icon { width: 16px; height: 16px; }
.area-search:not([hidden]) ~ .map-hint { display: none; }
.map-controls { position: absolute; z-index: 4; right: 14px; bottom: 34px; display: grid; background: white; border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; }
.map-controls button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); font-size: 20px; font-weight: 500; }
.map-controls button:last-child { border-bottom: 0; color: var(--navy); }
.map-controls button:hover { background: var(--bg); }
.map-controls .icon { width: 19px; height: 19px; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 8px 8px 0; }

.map-landmark { width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #69758a; box-shadow: 0 0 0 1px #69758a; pointer-events: none; }
.map-landmark > span { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: #455269; font-size: 12px; line-height: 1.25; font-weight: 750; white-space: nowrap; text-shadow: 0 1px 2px #fff, 0 0 4px #fff, 0 0 4px #fff; }
.map-landmark.station { width: 10px; height: 10px; background: #20724d; box-shadow: 0 0 0 1px #20724d; }
.map-landmark.station > span { padding: 2px 5px; border-radius: 5px; background: #fff; color: #185b3e; box-shadow: 0 1px 4px #17452e30; }
.area-map .maplibregl-ctrl-scale { border-color: #4c5665; color: #344054; font-weight: 600; }
.office-pin { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.office-pin img { width: 40px; height: 40px; padding: 2px; object-fit: contain; margin-bottom: -4px; border-radius: 50%; background: #fff; border: 2.5px solid var(--navy); box-shadow: 0 3px 8px #0003; }
.office-pin span { position: relative; padding: 5px 9px; border-radius: 9px; background: var(--navy); color: white; font-size: 12px; font-weight: 800; box-shadow: 0 3px 10px #00437f55; border: 2px solid white; white-space: nowrap; }
.office-pin span::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--navy); }

.food-pin { width: 34px; height: 42px; padding: 0; border: 0; background: none; cursor: pointer; }
.pin-head { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); background: var(--food-pin); border: 2.5px solid white; box-shadow: 0 3px 8px #0003; transition: transform .15s; }
.pin-head svg { width: 19px; height: 19px; color: white; transform: rotate(45deg); }
.pin-label { position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%); max-width: 120px; padding: 1px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 12px; font-weight: 700; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; pointer-events: none; }
.pin-label.is-hidden { visibility: hidden; }
.food-pin:hover .pin-head, .food-pin.is-hover .pin-head { transform: rotate(-45deg) scale(1.15); }
.food-pin.is-selected .pin-head { transform: rotate(-45deg) scale(1.3); box-shadow: 0 0 0 4px #ffffffb0, 0 5px 14px #0005; }
.food-pin.is-selected .pin-label { top: calc(100% + 6px); padding: 3px 8px; border-radius: 8px; background: var(--ink); color: white; text-shadow: none; font-size: 13px; max-width: 170px; }
.has-route .office-pin img { visibility: hidden; }
.route-walker { width: auto; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 3px #0004); pointer-events: none; }
.route-walker.walking { animation: hop .32s ease-in-out infinite alternate; }
@keyframes hop { to { translate: 0 -6px; } }

/* ── 대화상자 ── */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 28px); color: var(--ink); background: white; box-shadow: 0 24px 80px #0e2b4240; }
dialog::backdrop { background: #0b1d2e80; backdrop-filter: blur(2px); }
.dialog-content { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dialog-header h2 { font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.close { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--bg); color: var(--muted); }
.close:hover { background: #e7ebf0; }
.dialog-content p { margin-top: 8px; line-height: 1.55; color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.form { display: grid; gap: 8px; margin-top: 16px; }
.form label { font-weight: 700; font-size: 14px; }
.form input { height: 48px; border: 1px solid #dbe1e8; border-radius: 12px; padding: 0 14px; width: 100%; color: var(--ink); background: var(--bg); }
.form input:focus { background: white; border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px var(--navy-pale); }
.form .button { margin-top: 6px; }
.form small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.error { color: #b4233f !important; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 30px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: white; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md); }

/* ── 좁은 화면: 지도 위, 패널은 아래에서 올라오는 시트 ── */
@media (max-width: 899px) {
  :root { --map-height: 42dvh; --header-height: 58px; }
  .app { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
  .side { display: contents; }
  .side-header { order: 0; position: sticky; top: 0; z-index: 20; height: var(--header-height); padding: 10px 14px; background: white; }
  .map-area { order: 1; position: sticky; top: var(--header-height); z-index: 1; height: var(--map-height); margin: 0; border-radius: 0; box-shadow: none; }
  .side-body { order: 2; position: relative; z-index: 3; margin-top: -18px; overflow: visible; padding: 22px 16px 26px; background: white; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 20px #0d23381a; min-height: calc(100dvh - var(--header-height) - var(--map-height) + 18px); scroll-margin-top: calc(var(--header-height) + var(--map-height) - 18px); }
  .side-body::before { content: ''; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: #dde2e8; }
  .side-footer { order: 3; position: relative; z-index: 3; background: white; flex-wrap: wrap; }
  .brand strong { font-size: 22px; }
  .brand-mascot { width: 32px; height: 32px; }
  .map-hint { top: 10px; font-size: 12px; max-width: calc(100% - 24px); }
  .area-search { top: 10px; }
  .map-controls { right: 10px; bottom: 44px; }
  .map-area .maplibregl-ctrl-bottom-right { bottom: 18px; }
  .map-area .maplibregl-ctrl-bottom-left { bottom: 36px; }
  .map-controls button { width: 36px; height: 36px; }
  .greeting { padding: 10px 12px; margin-bottom: 12px; }
  .greeting-mascot { height: 68px; }
  .greeting-bubble { font-size: 16px; }
  .quiz-option { min-height: 82px; font-size: 14px; }
  .detail-hero { height: 170px; }
}

@media (max-width: 380px) {
  .side-header { gap: 6px; padding-inline: 10px; }
  .brand { gap: 4px; }
  .brand strong { font-size: 19px; }
  .brand-mascot { width: 28px; height: 28px; }
  .nav-link { width: 32px; height: 36px; }
  .quiz-steps button { padding-right: 6px; font-size: 11px; }
  .profile-button { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
