/* ZIPCHELIN — one ground, one ink, one accent. No gradients, glows or glass. */
:root {
  --ground: #F7F6F2;
  --surface: #FFFFFF;
  --subtle: #EFECE6;
  --ink: #18181B;
  --muted: #52525B;
  --line: #E4E2DC;
  --accent: #A61C3C;
  --accent-soft: #FDECEF;
  --cmp: #1D4ED8;
  --good: #15803D;
  --warn: #B45309;
  --head-h: 48px;
  --tab-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --r: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.45 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cmp); outline-offset: 2px; }

/* ---------- header (English brand + human-friendly condition trigger) ---------- */
.top {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  min-height: calc(var(--head-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 6px; flex: none; border: 0; background: none; padding: 4px 2px;
  font-weight: 800; font-size: 13.5px; letter-spacing: 0.14em; color: var(--accent);
}
.brand .mark { width: 20px; height: 20px; }
.brand .guide { display: none; margin-left: 1px; font-weight: 250; letter-spacing: 0.14em; } /* MICHELIN GUIDE: same caps, thin weight */
@media (min-width: 480px) { .brand .guide { display: inline; } } /* phones: brand only, the summary pill needs the room */
.summary {
  flex: 1; min-width: 0; min-height: 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 0 11px 0 12px; text-align: left; font-size: 12.5px; color: var(--muted);
}
.sum-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-txt b { color: var(--ink); font-weight: 650; }
.sum-ico { width: 15px; height: 15px; color: var(--accent); flex: none; }
.hint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 12px; font-size: 12px; color: var(--muted); background: var(--subtle);
}
.hint button { border: 0; background: none; color: var(--accent); font-weight: 650; min-height: 28px; padding: 0 4px; white-space: nowrap; }

/* ---------- 3-tab linear navigation ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; color: var(--muted);
}
.tabs button[aria-selected="true"] { color: var(--accent); font-weight: 700; }
.tabs svg { width: 20px; height: 20px; }

main {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px calc(var(--tab-h) + var(--safe-b) + 16px);
}
body.explore-mode main { overflow: hidden; padding: 0; }

/* ---------- shared controls ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.cap-l { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.sub { font-size: 12px; color: var(--muted); }
.good { color: var(--good); }
.warn { color: var(--warn); }
.muted { color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.chips { display: flex; gap: 6px; }
.chips.wrap { flex-wrap: wrap; }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 13px; white-space: nowrap;
}
.chip.sm { min-height: 30px; padding: 0 9px; font-size: 12px; }
.chip[aria-pressed="true"], .chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip.add { color: var(--accent); border-style: dashed; }
.chip .x { width: 13px; height: 13px; opacity: 0.75; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; min-height: 34px; padding: 0 11px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 650; }
.seg.small button { min-height: 30px; padding: 0 8px; font-size: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stepper button { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; }
.stepper b { min-width: 52px; text-align: center; font-size: 13.5px; }
.empty { padding: 36px 12px; text-align: center; color: var(--muted); }
.empty button { margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 13px; font-weight: 600;
  text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn svg { width: 14px; height: 14px; }
.link { border: 0; background: none; padding: 0 2px; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 2px; margin-left: 4px; border: 1px solid currentColor; }
.skel { background: var(--subtle); border-radius: 6px; min-height: 14px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- unified explore tab ---------- */
#tab-explore { display: flex; flex-direction: column; height: 100%; }
.ex-top {
  flex: none; position: relative; z-index: 25;
  padding: 8px 12px; background: var(--ground); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.ex-bar { display: flex; align-items: center; gap: 6px; }
.ex-bar .scroll-x { flex: 1; min-width: 0; padding-right: 4px; }
.fbtn { position: relative; gap: 4px; }
.fbtn svg { width: 15px; height: 15px; }
.fdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ex-quick { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ex-quick::-webkit-scrollbar { display: none; }
.ex-quick #budgetPill b { color: var(--ink); font-weight: 700; }
.ex-quick #budgetPill[aria-expanded="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.ex-quick #budgetPill[aria-expanded="true"] b { color: #fff; }
.sort-sel {
  margin-left: auto; flex: none; min-height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink);
}
.reg-pop {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font-size: 12px; color: var(--muted);
}
.reg-pop b { color: var(--ink); font-weight: 650; }
.reg-pop .sig-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--muted); }
.reg-pop.good .sig-dot { background: var(--good); }
.reg-pop.warn .sig-dot { background: var(--warn); }
.reg-pop .rp-act { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.inline-pop {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  display: flex; flex-direction: column; gap: 6px;
}
.inl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-panel {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px;
}
.ep-row { display: flex; align-items: center; gap: 8px; }
.ep-row .cap-l { flex: none; }
.ep-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: end; }
.ep-grid label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 2px; }
.ep-grid select { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); padding: 0 6px; font-size: 12.5px; color: var(--ink); }

.ex-body { position: relative; flex: 1; min-height: 0; display: flex; }
.ex-list-pane {
  flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 12px calc(var(--tab-h) + var(--safe-b) + 74px);
}
.ex-map-pane { position: relative; flex: 1; min-width: 0; height: 100%; }
#tab-explore[data-view="list"] .ex-map-pane { display: none; }
#tab-explore[data-view="map"] .ex-list-pane { display: none; }

.view-fab {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); transform: translateX(-50%);
  z-index: 28; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 650; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(24, 24, 27, 0.22);
}
.view-fab svg { width: 16px; height: 16px; }

/* lightweight scannable explore rows */
.ex-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 6px; }
.meta { margin: 0; font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.corr-btn { flex: none; gap: 4px; color: var(--accent); border-color: rgba(166, 28, 60, 0.3); background: var(--surface); font-weight: 650; }
.corr-btn svg { width: 14px; height: 14px; color: var(--accent); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.row { display: flex; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:active, .row.sel { background: var(--subtle); }
.r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.r-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-main .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 3px; }
.star-pill { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink); flex: none; }
.star-pill svg { width: 13px; height: 13px; color: var(--accent); }
.star-pill svg.off { color: var(--line); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badges em { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--subtle); color: var(--muted); line-height: 18px; white-space: nowrap; }
.badges em.deal { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.badges em.bib { background: var(--accent); color: #fff; font-weight: 650; }
.badges em.up { background: none; border: 1px solid var(--accent); color: var(--accent); font-weight: 650; }
.cap-up { display: inline-block; margin-right: 4px; padding: 0 3px; border: 1px solid var(--accent); border-radius: 3px; color: var(--accent);
  font-style: normal; font-size: 9.5px; font-weight: 700; line-height: 12px; vertical-align: 1px; }
.cap-bib { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 3px; background: var(--accent); color: #fff;
  font-style: normal; font-size: 9.5px; font-weight: 700; line-height: 14px; vertical-align: 1px; }
.badges em.com { background: #EEF2FF; color: var(--cmp); font-weight: 600; }
.badges em.nb-top { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.badges em.nb-visited { background: #EAF7EE; color: var(--good); font-weight: 650; }
.badges em.nb-hold { background: var(--subtle); color: var(--muted); font-weight: 600; }
.r-num { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; flex: none; }
.r-num b { font-size: 14.5px; white-space: nowrap; }
.r-num span { font-size: 12.5px; font-weight: 650; white-space: nowrap; }

/* map + viewport analysis layers */
#map { position: absolute; inset: 0; bottom: calc(var(--tab-h) + var(--safe-b)); background: var(--subtle); z-index: 0; }
#map .leaflet-tile-pane { filter: grayscale(0.85) brightness(1.04) contrast(0.92); }
.map-top { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 20; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-top .chip { box-shadow: 0 1px 2px rgba(24, 24, 27, 0.12); }
.zone-lvl {
  display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--surface); box-shadow: 0 1px 3px rgba(24, 24, 27, 0.14);
}
.zone-lvl button { border: 0; background: none; min-height: 28px; padding: 0 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.zone-lvl button + button { border-left: 1px solid var(--line); }
.zone-lvl button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.map-legend {
  position: absolute; left: 10px; bottom: calc(var(--tab-h) + var(--safe-b) + 64px); z-index: 20;
  max-width: calc(100% - 76px); padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px;
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.12);
}
.ml-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ml-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.map-ctl { position: absolute; right: 10px; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.map-ctl .icon-btn { width: 40px; height: 40px; box-shadow: 0 1px 2px rgba(24, 24, 27, 0.15); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(24, 24, 27, 0.3); transform: translate(-50%, -50%); }
.cap {
  display: inline-block; transform: translate(-50%, -50%); padding: 2px 7px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--ink); font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.cap.sel, .dot.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.cap.sel .cap-up { border-color: #fff; color: #fff; } /* wine-on-wine vanished once selected */
.cap.sel .cap-bib { background: #fff; color: var(--accent); }
.cap.over { border-color: var(--muted); border-style: dashed; color: var(--muted); }
.cap { cursor: pointer; }
.cap::before { content: ""; position: absolute; inset: -5px -4px; } /* 뱃지 클릭·호버 범위 확장 (별 영역은 제외) */
.cap-st { pointer-events: none; z-index: 1; }
.cap { position: relative; }
.cap-st { position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%); display: flex; gap: 1px;
  padding: 1px 3px; border-radius: 999px; background: var(--surface); color: var(--accent); line-height: 0; }
.cap .cap-st svg { width: 10px; height: 10px; } /* beats .leaflet-pane svg below */
.cap-st svg.off { color: var(--line); }
.dot.sel { width: 14px; height: 14px; border-color: #fff; }
.sch { display: grid; place-items: center; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 4px; background: var(--surface); border: 1px solid var(--muted); font-size: 10px; font-weight: 700; color: var(--ink); }
.sch.high { border-color: var(--ink); background: var(--ink); color: #fff; }
.z-lbl {
  display: inline-block; transform: translate(-50%, -50%); padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(166, 28, 60, 0.35);
  color: var(--accent); font-size: 10.5px; font-weight: 700; white-space: nowrap; pointer-events: none;
}
.ac-lbl {
  display: inline-block; transform: translate(-50%, -50%); padding: 2px 6px; border-radius: 999px;
  background: #9A3412; color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.25); pointer-events: none;
}
.sh-pin {
  display: inline-block; transform: translate(-50%, -50%); padding: 1px 6px; border-radius: 5px;
  background: var(--cmp); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap;
  border: 1px solid #fff; box-shadow: 0 1px 2px rgba(24, 24, 27, 0.22);
}
.sh-pin.mart { background: var(--surface); color: var(--cmp); border-color: var(--cmp); font-weight: 600; font-size: 10px; }
.leaflet-div-icon.zc { background: none; border: 0; }
.leaflet-pane svg { width: auto; height: auto; } /* the global 18px icon rule was clipping Leaflet's vector overlay */
.dong-n { display: inline-block; transform: translate(-50%, -50%); font-size: 11.5px; font-weight: 800; color: var(--ink); }
.dong-n.dark { color: #fff; }
.dong-l { display: inline-block; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.ml-sw.dot { border-radius: 50%; width: 9px; height: 9px; transform: none; } /* undo the map-marker .dot offset and size */
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.leaflet-popup-content b { font-size: 13.5px; }

/* ---------- compare & execute tab (crimson icon sub-tabs + zero-wrap readout & loc-card) ---------- */
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.home-card {
  min-width: 0; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; gap: 1px; border-left: 3px solid var(--accent);
}
.home-card.tgt { border-left-color: var(--cmp); }
button.home-card { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hc-stars { display: inline-flex; gap: 1px; color: var(--accent); }
.hc-stars svg { width: 12px; height: 12px; }
.hc-stars svg.off { opacity: 0.2; }
/* 하단: 지금 보는 목표 단지 노트 */
.t-note { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tn-head b { display: block; font: 600 16px/1.3 "Noto Serif KR", serif; }
.tn-rate { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.tn-rate .stars svg { width: 14px; height: 14px; }
.tn-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; font-size: 12px; }
.tn-facts div { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.tn-facts dt { color: var(--muted); }
.tn-facts dd { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-links { display: flex; align-items: center; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
.tn-links button { margin-right: auto; padding: 0; border: 0; background: none; font: inherit; font-weight: 650; color: var(--accent); }
.tn-links a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.tn-links a svg { width: 11px; height: 11px; }
.home-card b, .home-card .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-card b { font-size: 14px; }
.pair .icon-btn { align-self: center; }
#targetChips { margin: 8px 0; }
.hscroll { position: relative; }
.hs-btn {
  position: absolute; top: 50%; z-index: 1; transform: translateY(-50%); width: 30px; height: 34px;
  border: 0; font-size: 22px; line-height: 1; color: var(--ink); background: var(--ground);
}
.hs-btn[hidden] { display: none; }
.hs-btn.l { left: 0; padding-right: 6px; box-shadow: 10px 0 10px -4px var(--ground); }
.hs-btn.r { right: 0; padding-left: 6px; box-shadow: -10px 0 10px -4px var(--ground); }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.metric { padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.metric .v { display: block; font-size: 17.5px; font-weight: 750; letter-spacing: -0.01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .d { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Michelin-crimson icon sub-tabs */
.subtabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px;
  padding: 4px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--subtle);
}
.subtabs button {
  border: 1px solid transparent; background: none; min-height: 40px; padding: 4px 6px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.subtabs button svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.subtabs button[aria-selected="true"] {
  background: var(--surface); color: var(--accent); border-color: rgba(166, 28, 60, 0.25); font-weight: 700;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}
.subtabs button[aria-selected="true"] svg { color: var(--accent); }
@media (max-width: 400px) {
  .subtabs button { flex-direction: column; gap: 2px; min-height: 48px; font-size: 11.5px; }
}

.chart-card { padding: 10px 10px 8px; }
.chart-top { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.chart-ctl { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
/* structured zero-wrap readout */
.readout { display: flex; flex-direction: column; gap: 5px; min-height: 46px; }
.ro-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ro-top b { font-size: 13px; color: var(--ink); }
.ro-tag { padding: 1px 6px; border-radius: 4px; background: var(--subtle); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ro-cell { padding: 5px 8px; border-radius: 7px; background: var(--ground); min-width: 0; }
.ro-cell span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-cell b { display: block; font-size: 13.5px; white-space: nowrap; }
.ro-cell.mine b { color: var(--accent); }
.ro-cell.tgt b { color: var(--cmp); }
.chart-wrap { position: relative; height: 200px; }
.chart-wrap.gapc { height: 92px; margin-top: 4px; }
.chart-wrap canvas { touch-action: pan-y; }
.legend { margin: 6px 0 0; font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.lg { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent); margin-right: 3px; vertical-align: middle; }
.lg.tgt { border-color: var(--cmp); }
.lg.dash { border-top: 2px dashed var(--muted); }
.lg.bar { height: 9px; width: 9px; border: 0; background: var(--good); opacity: 0.7; }

.peek { margin-top: 10px; }
.peek summary {
  list-style: none; cursor: pointer; padding: 10px 12px; font-size: 12px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.peek summary::-webkit-details-marker { display: none; }
.peek summary .pk-more { flex: none; font-size: 11.5px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.peek[open] summary { border-bottom: 1px solid var(--subtle); }
.peek-body { padding: 10px 12px; display: grid; grid-template-columns: 1fr; gap: 10px; font-size: 12.5px; }
.sub-metric .sm-row { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.sub-metric .sm-note { margin-top: 2px; font-size: 11.5px; color: var(--muted); }

/* responsive 2-row loc-card so 역·학·녹·쇼 never orphans a single bar */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.loc-card {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 12px;
}
.lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lc-head .stars svg { width: 14px; height: 14px; }
.lc-head b { font-size: 14px; }
.lc-go { font-size: 12px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.lc-bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.lc-bar { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--muted); min-width: 0; }
.lc-bar span { display: flex; justify-content: space-between; align-items: baseline; gap: 2px; white-space: nowrap; }
.lc-bar b { font-size: 11px; color: var(--ink); font-weight: 650; }
.lc-bar > i { display: block; height: 4px; border-radius: 2px; background: var(--subtle); overflow: hidden; }
.lc-bar > i > i { display: block; height: 100%; background: var(--ink); }

.compare, .switch { padding: 11px 12px; }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.c-scroll { overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.compare th, .compare td { padding: 6px; border-bottom: 1px solid var(--subtle); text-align: right; }
.compare thead th { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.compare tbody th, .compare thead th:first-child { text-align: left; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.compare td.best { color: var(--accent); font-weight: 700; }
.compare td.z { color: var(--muted); }
.compare .me { margin-right: 4px; font-size: 10.5px; color: var(--accent); }
.sw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sw-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.sw-grid input { width: 100%; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 15px; background: var(--surface); color: var(--ink); }
.sw-out { margin: 10px 0 6px; }
.sw-out div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--subtle); font-size: 13px; }
.sw-out div span:first-child { color: var(--muted); }

/* ---------- overlays (body children) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(24, 24, 27, 0.32); }
.backdrop.over { z-index: 75; }
.modal {
  position: fixed; z-index: 85; left: 50%; top: 50%; width: min(520px, calc(100% - 24px)); max-height: 82dvh;
  transform: translate(-50%, -46%); opacity: 0; visibility: hidden; transition: opacity 0.15s, transform 0.15s;
  background: var(--surface); border-radius: 14px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(24, 24, 27, 0.18);
}
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.m-body { overflow-y: auto; padding: 4px 16px 16px; font-size: 13px; line-height: 1.6; overscroll-behavior: contain; }
.m-body h4 { margin: 12px 0 2px; font-size: 13.5px; }
.m-body p { margin: 0; }
.m-body .sub { margin-top: 12px; }

/* 3-tab settings drawer + knockknock SVG regional picker */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(450px, 100%);
  background: var(--ground); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.2s ease; visibility: hidden;
  padding-top: var(--safe-t);
}
.drawer.open { transform: none; visibility: visible; }
.d-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 48px; }
.d-head b { font-size: 15.5px; }
.d-tabs {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.d-tabs button { border: 0; background: none; min-height: 40px; font-size: 13px; font-weight: 600; color: var(--muted); }
.d-tabs button[aria-selected="true"] { color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 700; }
.d-body { flex: 1; overflow-y: auto; padding: 12px 12px calc(24px + var(--safe-b)); overscroll-behavior: contain; }
.d-pane { display: flex; flex-direction: column; gap: 16px; }
.d-body h3 { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.d-body input[type="search"] { width: 100%; min-height: 40px; margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--surface); font-size: 14.5px; }
.my-box { padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.my-box b { display: block; font-size: 14.5px; }
.tip { margin: 6px 2px 0; font-size: 11.5px; color: var(--muted); }
.qlist, .tlist { list-style: none; margin: 8px 0 0; padding: 0; }
.qlist li, .tlist li { padding: 8px 2px; border-bottom: 1px solid var(--line); }
.qlist .nm { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.qlist .chips { margin-top: 6px; flex-wrap: wrap; }
.qlist button.rg { width: 100%; text-align: left; border: 0; background: none; min-height: 36px; font-size: 14px; display: flex; justify-content: space-between; }
.tlist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tlist .icon-btn { width: 32px; height: 32px; }
.backup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.backup-row .btn { flex: 1; }

/* interactive Korea SVG district picker (knockknock map.js) */
.km-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.km-head h3 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#kmapViews { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
#kmapViews button { padding: 0 4px; text-align: center; }
.kmap-wrap {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden; display: grid; place-items: center; touch-action: none; user-select: none;
}
.kmap-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.kmap-svg.panning { cursor: grabbing; }
.kmap-svg path { fill: var(--subtle); stroke: var(--surface); stroke-width: 0.9; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill 0.12s; }
.kmap-svg path:hover { fill: #D9D4C9; }
.kmap-svg path.on { fill: var(--accent); stroke: var(--surface); }
.kmap-svg text { fill: var(--ink); font-weight: 600; text-anchor: middle; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-linejoin: round; }
.kmap-svg text.on { fill: #fff; stroke: var(--accent); }
.kmap-ctl {
  position: absolute; right: 8px; bottom: 8px; z-index: 4;
  display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); box-shadow: 0 1px 4px rgba(24, 24, 27, 0.14);
}
.kmap-ctl button {
  min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px;
  background: var(--ground); color: var(--ink); font-size: 13px; font-weight: 700; display: inline-grid; place-items: center;
}
.kmap-ctl button.km-rst { font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 8px; }

/* budget editor card (shared in explore inline & settings drawer) */
.budget-card { padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.inline-pop .budget-card { border: 0; padding: 0; border-radius: 0; background: none; }
.bud-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bud-total { font-size: 12px; color: var(--muted); }
.bud-total b { color: var(--accent); font-weight: 700; }
.bud-ctl { display: flex; align-items: center; gap: 6px; }
.bud-nudge { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); font-size: 12px; font-weight: 650; flex: none; }
.bud-input-wrap {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 10px; min-height: 34px;
}
.bud-input-wrap input {
  width: 100%; min-width: 0; border: 0; background: none; padding: 0;
  font-size: 15px; font-weight: 700; text-align: right; color: var(--ink); outline: none;
}
.bud-input-wrap span { font-size: 12.5px; color: var(--muted); flex: none; }
.bud-range { width: 100%; margin: 2px 0; accent-color: var(--accent); height: 22px; cursor: pointer; }
.bud-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.bud-presets .chip { min-height: 28px; padding: 0 9px; font-size: 11.5px; }

/* 5-axis weight controls & calibration quiz modal */
.w-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.w-head h3 { margin: 0; }
.w-card { padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.w-list { display: flex; flex-direction: column; gap: 7px; }
.w-row { display: grid; grid-template-columns: 52px 1fr 36px; gap: 8px; align-items: center; font-size: 12.5px; }
.w-row span { color: var(--ink); font-weight: 600; white-space: nowrap; }
.w-row input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); height: 22px; cursor: pointer; }
.w-row b { text-align: right; font-size: 12.5px; color: var(--accent); }
.w-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--subtle); }

.quiz-body { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.qz-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.qz-prog { height: 5px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.qz-prog i { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease; }
.qz-q { margin: 2px 0 0; font-size: 15.5px; font-weight: 700; line-height: 1.45; color: var(--ink); }
.qz-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.qz-quote {
  margin: 0; padding: 11px 13px; border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0;
  background: var(--ground); font-size: 14.5px; font-weight: 650; line-height: 1.5; color: var(--ink);
}
.qz-opts { display: flex; flex-direction: column; gap: 7px; }
.qz-opt {
  width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--ground); display: flex; flex-direction: column; gap: 2px;
}
.qz-opt b { font-size: 13.5px; color: var(--ink); line-height: 1.35; }
.qz-opt span { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.qz-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) { .qz-opt:hover { border-color: var(--accent); } } /* touch: :hover sticks to the last tapped spot */
.qz-opt[aria-pressed="true"] b { color: var(--accent); }
.qz-persona {
  padding: 11px 13px; border: 1px solid rgba(166, 28, 60, 0.25); border-left: 3px solid var(--accent);
  border-radius: 10px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 4px;
}
.qz-persona span { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; }
.qz-persona b { font-size: 16px; color: var(--ink); }
.qz-persona p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.qz-res { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); }
.qz-bar-row { display: grid; grid-template-columns: 54px 1fr 36px 46px; gap: 6px; align-items: center; font-size: 12.5px; }
.qz-bar-row .bar { height: 7px; border-radius: 4px; background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
.qz-bar-row .bar i { display: block; height: 100%; background: var(--accent); }
.qz-bar-row b { text-align: right; color: var(--ink); }
.qz-delta { text-align: right; font-size: 11px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.qz-delta.up { color: var(--accent); }
.qz-delta.dn { color: var(--muted); }
.qz-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; flex-wrap: wrap; }

/* Stage 2: conjoint blind A/B duel cards & consistency report */
.qz-sub { margin: -4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.qz-duel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .qz-duel { grid-template-columns: 1fr; } }
.qz-card {
  width: 100%; text-align: left; padding: 11px 11px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--ground); display: flex; flex-direction: column; gap: 7px;
}
.qz-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) { .qz-card:hover { border-color: var(--accent); } }
.qz-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.qz-card-badge { font-size: 11px; font-weight: 750; color: var(--accent); letter-spacing: 0.04em; }
.qz-card-price { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.qz-card-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qz-card-bars { display: flex; flex-direction: column; gap: 4px; }
.qz-cb { display: grid; grid-template-columns: 44px 1fr 24px; gap: 5px; align-items: center; font-size: 11px; color: var(--muted); }
.qz-cb.win { color: var(--ink); font-weight: 700; }
.qz-cb > i { display: block; height: 5px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.qz-cb > i > i { display: block; height: 100%; background: var(--muted); }
.qz-cb.win > i > i { background: var(--accent); }
.qz-cb b { text-align: right; font-size: 11px; }
.qz-card-fact { font-size: 11px; color: var(--muted); padding-top: 5px; border-top: 1px solid var(--line); line-height: 1.4; }
.qz-card[aria-pressed="true"] .qz-card-fact { border-top-color: rgba(166, 28, 60, 0.2); }

.qz-cons {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 12px;
}
.qz-cons-score { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.qz-cons-pill { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid currentColor; }
.qz-cons-pill.good { color: var(--good); }
.qz-cons-pill.warn { color: var(--warn); }
.qz-cons-pill.accent { color: var(--accent); }
.qz-insights {
  margin: 0; padding: 9px 11px 9px 24px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--ground); font-size: 12px; line-height: 1.55; color: var(--ink); display: flex; flex-direction: column; gap: 4px;
}
.qz-insights li { margin: 0; }
.qz-shift { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.qz-reveal { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 7px 10px; font-size: 12px; }
.qz-reveal summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 650; color: var(--ink); }
.qz-reveal summary::-webkit-details-marker { display: none; }
.qz-reveal summary span { font-size: 11px; color: var(--accent); font-weight: 600; }
.qz-reveal ul { list-style: none; margin: 7px 0 0; padding: 7px 0 0; border-top: 1px solid var(--subtle); display: flex; flex-direction: column; gap: 5px; }
.qz-reveal li { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.qz-reveal li b { color: var(--ink); }

/* star/score vs price & pyeong-price correlation modal */
.modal-wide { width: min(640px, calc(100% - 20px)); max-height: 88dvh; }
.corr-body { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.corr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.corr-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.corr-kpi { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); min-width: 0; }
.corr-kpi span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-kpi b { display: block; font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-chart-wrap { position: relative; height: 228px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.corr-leg { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; color: var(--muted); align-items: center; }
.corr-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.corr-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.corr-tbl th, .corr-tbl td { padding: 6px 5px; border-bottom: 1px solid var(--subtle); text-align: right; white-space: nowrap; }
.corr-tbl th:first-child, .corr-tbl td:first-child { text-align: left; font-weight: 650; }
.corr-tbl thead th { font-size: 11px; color: var(--muted); font-weight: 500; }
.corr-picks { display: flex; flex-direction: column; gap: 4px; }
.corr-picks h4 { margin: 2px 0; font-size: 12px; color: var(--muted); }
.corr-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); font-size: 12.5px;
}
.corr-pick > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.corr-pick b { color: var(--good); white-space: nowrap; flex: none; }

/* ---------- detail sheet (draggable summary 52dvh <-> fullscreen 100dvh) ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  height: 52dvh; max-height: 100dvh; background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 14px 14px 0 0; box-shadow: 0 -2px 12px rgba(24, 24, 27, 0.12);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.22s ease, height 0.22s ease, border-radius 0.2s ease; visibility: hidden;
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: none; visibility: visible; }
.sheet.dragging { transition: none !important; }
.sheet.full {
  height: 100dvh; border-radius: 0; border-top: 0;
  padding-top: var(--safe-t); z-index: 78;
}
.grip { border: 0; background: none; height: 26px; flex: none; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grip i { width: 42px; height: 4px; border-radius: 2px; background: var(--line); }
.s-fixed { flex: none; padding: 0 14px 8px; touch-action: none; }
.s-head { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.s-head > div { min-width: 0; flex: 1; }
.s-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-head > .s-head-ctl { display: flex; gap: 5px; flex: none; margin-left: auto; } /* must outrank .s-head > div { flex: 1 } */
.s-badges { margin-top: 5px; }
.s-badges em { position: relative; cursor: help; }
.s-badges em[data-tip]:is(:hover, :focus-visible, :focus)::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; width: max-content; max-width: 240px;
  padding: 6px 9px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.45; white-space: normal;
}
.s-trade { margin: 5px 0 8px; font-size: 13px; }
.s-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.s-actions .btn { min-height: 34px; padding: 0 4px; font-size: 12px; }

.s-tabs {
  flex: none; display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ground);
}
.s-tabs button {
  position: relative; border: 0; background: none; min-height: 36px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.s-tabs button[aria-selected="true"] { color: var(--accent); background: var(--surface); border-bottom: 2px solid var(--accent); }
.ndot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 4px; vertical-align: 2px; }

.s-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px 20px; overscroll-behavior: contain; }
.rating { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.stars { display: inline-flex; gap: 1px; color: var(--accent); }
.stars svg { width: 17px; height: 17px; }
.stars svg.off { color: var(--line); }
.stars.tier { vertical-align: -2px; margin-right: 2px; }
.stars.tier svg { width: 13px; height: 13px; }
.rating b { font-size: 18px; }
.rating span { font-size: 12.5px; color: var(--muted); }
.rating .link { margin-left: auto; }
.axes { display: flex; flex-direction: column; gap: 7px; }
.axis { display: grid; grid-template-columns: 52px 1fr 30px; gap: 8px; align-items: center; font-size: 12.5px; }
.axis > span:first-child { white-space: nowrap; }
.axis[data-axis] { cursor: pointer; border-radius: 6px; padding: 2px 0; }
.axis[data-axis]:hover { background: var(--subtle); }
.axis .bar { height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.axis .bar i { display: block; height: 100%; background: var(--ink); }
.axis .n { text-align: right; font-weight: 700; }
.axis .basis { grid-column: 2 / 4; margin-top: -4px; font-size: 11.5px; color: var(--muted); }
.notice { margin: 10px 0 0; font-size: 12px; color: var(--warn); }
.notice.info { color: var(--muted); }

.commute-box { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.commute-box h4, .product h4, .layout-card h4, .recent-box h4, .notebook h4 {
  margin: 0 0 6px; font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.commute-box h4 .sub, .product h4 .sub, .layout-card h4 .sub, .recent-box h4 .sub, .notebook h4 .sub { font-weight: 400; font-size: 11px; }
.commute-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.commute-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); font-size: 12.5px; }
.commute-pill b { font-size: 13.5px; color: var(--ink); }

.poi-fold { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.poi-fold summary { list-style: none; cursor: pointer; min-height: 34px; display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.poi-fold summary::-webkit-details-marker { display: none; }
.poi-fold summary span { font-size: 11.5px; font-weight: 500; color: var(--accent); }
.poi-fold[open] summary span::before { content: "접기 ▴"; }
.poi-fold:not([open]) summary span::before { content: "펼치기 ▾"; }
.poi h4 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.poi ul { list-style: none; margin: 0; padding: 0; }
.poi li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--subtle); font-size: 12.5px; }
.poi li span:last-child { color: var(--muted); white-space: nowrap; }

.recent-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.recent-tbl th, .recent-tbl td { padding: 6px 4px; border-bottom: 1px solid var(--subtle); text-align: right; white-space: nowrap; }
.recent-tbl th:first-child, .recent-tbl td:first-child { text-align: left; }
.recent-tbl thead th { font-size: 11px; font-weight: 500; color: var(--muted); }
.recent-tbl tbody tr:last-child td { border-bottom: 0; }
.tag-direct { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 650; background: #FEF3C7; color: var(--warn); }

.product { margin-bottom: 12px; }
.product .axis .bar i { background: var(--cmp); }
.layout-card { padding-top: 10px; border-top: 1px solid var(--line); }
.ly-svg { display: block; width: 100%; height: 220px; background: var(--subtle); border-radius: 8px; }
.ly-svg polygon { fill: var(--cmp); stroke: var(--ink); stroke-opacity: 0.5; }
.ly-svg .ly-arrow { stroke: var(--accent); stroke-linecap: round; }
.ly-svg text { fill: var(--ink); text-anchor: middle; dominant-baseline: central; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 0.6px; }
.ly-svg .ly-n { fill: var(--muted); font-weight: 700; }
#layoutBox .sub, .ly-mini .sub { margin: 4px 0 0; font-size: 11.5px; }
.cmp-vis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--subtle); }
.cmp-vis figure { margin: 0; min-width: 0; }
.cmp-vis figcaption { font-size: 12px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-vis .me { margin-right: 4px; font-size: 10.5px; color: var(--accent); }
.cmp-vis .me.tgt { color: var(--cmp); }
.ly-mini .ly-svg { height: 150px; }
.area-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 6px; font-size: 12px; line-height: 1.35; }
.area-sq { width: 52px; height: 52px; flex: none; }
.area-sq rect { fill: var(--cmp); fill-opacity: 0.35; stroke: var(--cmp); stroke-width: 1.5; }

.nb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.nb-tags .chip[data-nb-tag="top"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.nb-tags .chip[data-nb-tag="visited"][aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.nb-tags .chip[data-nb-tag="hold"][aria-pressed="true"] { background: var(--muted); border-color: var(--muted); color: #fff; }
.nb-checks { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.nb-checks .chip { min-height: 28px; padding: 0 8px; font-size: 11.5px; }
.nb-memo { width: 100%; min-height: 92px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--ground); font-size: 13px; color: var(--ink); }
.nb-memo:focus { background: var(--surface); }
.src { margin: 12px 0 4px; font-size: 11px; line-height: 1.5; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 99999;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- desktop (960px+) ---------- */
@media (min-width: 960px) {
  .tabs { position: static; order: 0; height: 42px; padding: 0; grid-template-columns: repeat(3, 176px); justify-content: center; border-top: 0; border-bottom: 1px solid var(--line); }
  .tabs button { flex-direction: row; font-size: 13.5px; gap: 6px; }
  .tabs svg { width: 17px; height: 17px; }
  main { padding: 16px max(24px, calc((100vw - 920px) / 2)) 32px; }
  body.explore-mode main { padding: 0; }
  .ex-top { padding: 8px 16px; }
  .ex-body { display: grid; grid-template-columns: 396px 1fr; }
  #tab-explore[data-view="list"] .ex-map-pane,
  #tab-explore[data-view="map"] .ex-list-pane { display: block; }
  .ex-list-pane { border-right: 1px solid var(--line); padding: 10px 12px 24px; }
  .view-fab { display: none; }
  #map { bottom: 0; }
  .map-ctl { bottom: 24px; }
  .map-legend { bottom: 16px; }
  .toast { bottom: 28px; }
  .chart-top { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .chart-ctl { flex-direction: row; justify-content: flex-end; }
  .readout { flex: 1; max-width: 460px; }
  .chart-wrap { height: 290px; }
  .chart-wrap.gapc { height: 120px; }
  .peek-body { grid-template-columns: 1fr 1fr; }
  .sw-grid { grid-template-columns: repeat(4, 1fr); }
  .sheet {
    left: 12px; right: auto; top: calc(var(--head-h) + 52px); bottom: 12px; width: 396px; height: auto; max-height: none;
    border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgba(24, 24, 27, 0.14);
    transform: translateX(calc(-100% - 24px)); padding-top: 0;
  }
  .sheet.open { transform: none; }
  .sheet.full { left: 12px; right: 12px; top: calc(var(--head-h) + 12px); bottom: 12px; width: auto; height: auto; border-radius: 14px; border: 1px solid var(--line); }
  body.sheet-open:not(.explore-mode) main { padding-left: max(424px, calc((100vw - 920px) / 2)); }
  .sheet .grip { display: none; }
  .sheet .s-fixed { padding-top: 16px; } /* grip is hidden here, so the head needs its own top room */
}

/* ---------- loading states: each one speaks its section's language ---------- */
.ld-dots::after {
  content: "…"; display: inline-block; width: 0; overflow: hidden; vertical-align: bottom;
  animation: ld-dots 1.4s steps(4, jump-none) infinite;
}
@keyframes ld-dots { to { width: 1.1em; } }

/* 이달의 선정: three rosettes awarded one by one */
.ld-judge { display: flex !important; align-items: center; gap: 8px; padding: 14px 0; }
.ld-ros { display: inline-flex; gap: 3px; color: var(--wine, var(--accent)); }
.ld-ros svg { width: 16px; height: 16px; opacity: 0.18; animation: ld-award 2.4s ease-in-out infinite; }
.ld-ros svg:nth-child(2) { animation-delay: 0.35s; }
.ld-ros svg:nth-child(3) { animation-delay: 0.7s; }
@keyframes ld-award { 20%, 60% { opacity: 1; transform: scale(1.08); } 80%, 100% { opacity: 0.18; transform: none; } }

/* 후보 목록: rows shaped like the real ones, a light sweep runs down the list */
.ld-row { cursor: default; }
.ld-row .r-main { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ld-row .skel { animation: ld-sweep 1.6s var(--d, 0s) ease-in-out infinite; }
.skel.sm { min-height: 10px; }
@keyframes ld-sweep { 0%, 100% { opacity: 1; } 45% { opacity: 0.45; } }

/* 가치관 진단: questions slide past each other, the progress bar morphs (View Transitions) */
#quizBody { view-transition-name: qz-body; }
.qz-prog { view-transition-name: qz-prog; }
::view-transition-group(qz-prog) { animation-duration: 0.32s; animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
::view-transition-old(qz-body) { animation: qz-out 0.2s ease-in both; }
::view-transition-new(qz-body) { animation: qz-in 0.28s 0.06s cubic-bezier(.2, .7, .2, 1) both; }
.qz-back::view-transition-old(qz-body) { animation-name: qz-out-back; }
.qz-back::view-transition-new(qz-body) { animation-name: qz-in-back; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@keyframes qz-out { to { opacity: 0; transform: translateX(-24px); } }
@keyframes qz-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes qz-out-back { to { opacity: 0; transform: translateX(24px); } }
@keyframes qz-in-back { from { opacity: 0; transform: translateX(-24px); } }

/* 입지·배치 비교: the real table, score cells pulsing in a diagonal wave */
.ld-table td .skel { display: block; width: 26px; min-height: 12px; margin: 0 auto; animation: ld-sweep 1.4s var(--d, 0s) ease-in-out infinite; }
.c-head .ld-dots { font-weight: 400; }

/* 입지 상세: gauges take readings */
.ld-gauge i { width: 0; background: var(--ink) !important; opacity: 0.22; animation: ld-read 1.8s var(--d, 0s) cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes ld-read { 50% { width: var(--w, 60%); } 100% { width: 0; } }
.rating .ld-dots { margin-left: 8px; }

/* 단지 배치도: a blueprint drawing itself */
.ld-layout { display: grid; place-items: center; gap: 10px; min-height: 240px; align-content: center;
  border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); }
.ld-layout.mini { min-height: 150px; }
.ld-plan { width: 180px !important; height: 108px !important; }
.ld-layout.mini .ld-plan { width: 120px !important; height: 72px !important; }
.ld-plan path { fill: var(--cmp); fill-opacity: 0; stroke: var(--cmp); stroke-width: 0.8; stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: ld-draw 3.2s var(--d) ease-in-out infinite; }
@keyframes ld-draw { 35% { stroke-dashoffset: 0; fill-opacity: 0; } 55%, 80% { stroke-dashoffset: 0; fill-opacity: 0.3; } 100% { stroke-dashoffset: 0; fill-opacity: 0; opacity: 0; } }
.ld-steps { position: relative; height: 1.4em; width: 100%; margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.ld-steps span { position: absolute; inset: 0; opacity: 0; }
.ld-steps span:nth-child(1) { animation: ld-step 3s forwards; }
.ld-steps span:nth-child(2) { animation: ld-step 3s 3s forwards; }
.ld-steps span:nth-child(3) { animation: ld-stay 0.5s 6s forwards; }
@keyframes ld-step { 10%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ld-stay { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ld-dots::after { animation: none; width: 1.1em; }
  .ld-ros svg, .ld-row .skel, .ld-gauge i, .ld-plan path { animation: none; }
  .ld-ros svg { opacity: 1; }
  .ld-plan path { stroke-dashoffset: 0; }
  .ld-steps span { animation: none !important; }
  .ld-steps span:nth-child(1) { opacity: 1; }
}

/* Inspector's Note (editorial 2-line curation summary) */
.insp-note {
  margin: 0 0 10px; padding: 9px 11px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; background: var(--ground);
}
.insp-note .in-k { display: block; font-size: 10px; font-weight: 750; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 3px; }
.insp-note p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.t-note .insp-note { margin: 8px 0 6px; padding: 8px 10px; }
.lad-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  margin-top: 8px; padding: 9px 11px; border: 1px solid rgba(166, 28, 60, 0.3); border-radius: 9px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 650;
}
.lad-cta span { color: var(--ink); font-weight: 500; font-size: 12px; }

/* Upgrade Ladder modal */
.lad-body { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.lad-flow {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 6px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground);
}
.lad-node { min-width: 0; }
.lad-node span { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.lad-node b { display: block; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.lad-node em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.lad-node.mid span, .lad-node.mid b { color: var(--accent); }
.lad-node.dream span { color: var(--cmp); }
.lad-arr { color: var(--muted); font-size: 14px; font-weight: 700; }
.lad-list { display: flex; flex-direction: column; gap: 8px; }
.lad-item {
  padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  display: flex; flex-direction: column; gap: 6px;
}
.lad-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lad-nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lad-no { font-family: "Noto Serif KR", serif; font-weight: 600; color: var(--accent); font-size: 13px; flex: none; }
.lad-nm b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lad-price { font-size: 14px; font-weight: 750; white-space: nowrap; }
.lad-kpis { display: flex; flex-wrap: wrap; gap: 5px 10px; font-size: 11.5px; color: var(--muted); }
.lad-kpis b { color: var(--ink); font-weight: 650; }
.lad-kpis b.good { color: var(--good); }
.lad-prog { display: flex; flex-direction: column; gap: 3px; }
.lad-bar { height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.lad-bar i { display: block; height: 100%; background: var(--accent); }
.lad-legs { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.lad-act { display: flex; gap: 6px; padding-top: 4px; border-top: 1px solid var(--subtle); }
.lad-act .btn { flex: 1; min-height: 32px; font-size: 12px; }

/* Family Guidebook Card modal */
.card-body { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.card-prev {
  border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); padding: 8px;
  max-height: 52dvh; overflow-y: auto; display: flex; justify-content: center;
}
.card-prev canvas { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 10px rgba(24, 24, 27, 0.12); }
.card-act { display: flex; gap: 8px; }
.card-act .btn { flex: 1; }

/* Brand Intro Page (Michelin crimson star hero + Zip Gourmand editorial paper) */
.modal-about {
  width: min(760px, calc(100% - 16px)); max-height: 90dvh; overflow: hidden;
  background: #F7F3EC; border: 0;
}
.ab-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(24, 24, 27, 0.16); color: #fff; display: grid; place-items: center;
}
.ab-scroll { overflow-y: auto; overscroll-behavior: contain; }
.ab-hero {
  background: #B91C2E; color: #fff; text-align: center;
  padding: 42px 24px 36px;
}
.ab-mark { width: 64px; height: 64px; color: #fff; display: block; margin: 0 auto 14px; }
.ab-title { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -0.01em; }
.ab-sub { margin: 6px 0 0; font-size: 11.5px; letter-spacing: 0.18em; opacity: 0.82; }
.ab-tiers {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
  margin-top: 34px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.ab-tier { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ab-stars { display: inline-flex; gap: 4px; color: #fff; }
.ab-stars svg { width: 26px; height: 26px; }
.ab-cut { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; opacity: 0.85; }
.ab-tier p { margin: 0; font-size: 13.5px; line-height: 1.55; font-weight: 500; word-break: keep-all; }
@media (max-width: 560px) {
  .ab-hero { padding: 34px 18px 28px; }
  .ab-mark { width: 54px; height: 54px; }
  .ab-title { font-size: 22px; }
  .ab-tiers { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; padding-top: 20px; }
  .ab-tier + .ab-tier { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.18); }
  .ab-tier p br { display: none; }
}
.ab-paper { background: #F7F3EC; color: #2A1E1A; padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.ab-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .ab-badges { grid-template-columns: 1fr; } }
.ab-card { padding: 14px 16px; border: 1px solid rgba(42, 30, 26, 0.14); border-radius: 10px; background: #fff; }
.ab-k { display: block; font-size: 10.5px; font-weight: 750; letter-spacing: 0.16em; color: #8A1C33; margin-bottom: 4px; }
.ab-card h3, .ab-axes h3 { margin: 0 0 6px; font-family: "Noto Serif KR", serif; font-size: 16px; font-weight: 600; color: #2A1E1A; }
.ab-card p, .ab-note { margin: 0; font-size: 12.5px; line-height: 1.6; color: #5C493D; word-break: keep-all; }
.ab-axes { padding: 14px 16px; border: 1px solid rgba(42, 30, 26, 0.14); border-radius: 10px; background: #fff; }
.ab-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.ab-chips span { padding: 4px 10px; border-radius: 999px; background: #F7F3EC; border: 1px solid rgba(42, 30, 26, 0.12); font-size: 12px; color: #5C493D; }
.ab-chips b { color: #2A1E1A; margin-right: 3px; }
.ab-foot { display: flex; gap: 8px; }
.ab-foot .btn { flex: 1; }

/* ---------- 첫 방문 가이드: 반투명 레이어 + 강조 영역 + 말풍선 ---------- */
.guide-btn { flex: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--muted); font: 600 14px/1 "Noto Serif KR", serif; }
#guide { position: fixed; inset: 0; z-index: 100000; }
#guide .g-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 200vmax rgba(26, 18, 15, 0.62); outline: 2px solid #F7F3EC;
  transition: left .25s, top .25s, width .25s, height .25s; pointer-events: none; }
#guide .g-card { position: fixed; width: min(320px, calc(100vw - 32px)); padding: 18px 18px 14px; border-radius: 10px;
  background: #F7F3EC; color: #2A1E1A; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); }
#guide .g-step { font-size: 11px; letter-spacing: 0.2em; color: #8A1C33; }
#guide h3 { margin: 6px 0 6px; font: 600 17px/1.3 "Noto Serif KR", serif; }
#guide p { margin: 0; font-size: 13px; line-height: 1.55; color: #735B4C; }
#guide .g-nav { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
#guide .g-nav button { min-height: 36px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 13px; }
#guide .g-skip { margin-right: auto; padding: 0 4px !important; border: 0; background: none; color: #735B4C; }
#guide .g-prev { border: 1px solid rgba(42, 30, 26, 0.2); background: none; color: #2A1E1A; }
#guide .g-next { border: 1px solid #8A1C33; background: #8A1C33; color: #F7F3EC; }

/* ---------- 메인 (home): 가이드북 톤 — 이 탭 안에서만 쓰는 색·서체 ---------- */
#tab-home { --paper: #F7F3EC; --brown: #2A1E1A; --taupe: #735B4C; --wine: #8A1C33; --rule: rgba(42, 30, 26, 0.13);
  margin: -10px -12px 0; min-height: calc(100% + 10px); padding: 8px 22px 24px; background: var(--paper); color: var(--brown); }
#tab-home h2, #tab-home .h-gap, #tab-home .h-no { font-family: "Noto Serif KR", serif; font-weight: 600; }
#tab-home .h-top { display: flex; justify-content: space-between; padding-top: 10px; font-size: 11px; letter-spacing: 0.18em; color: var(--wine); }
#tab-home .h-hero { display: block; width: 100%; padding: 26px 0 22px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: inherit; font: inherit; text-align: center; }
#tab-home button.h-hero { cursor: pointer; }
#tab-home .h-eyebrow { display: block; font-size: 11px; letter-spacing: 0.25em; color: var(--taupe); }
#tab-home .h-gap { display: block; margin: 10px 0 6px; font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; }
#tab-home .h-pair { display: block; font-size: 13px; color: var(--taupe); }
#tab-home .h-trend { display: block; min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--wine); }
#tab-home .h-link { display: block; margin-top: 10px; font-size: 11.5px; color: var(--taupe); }
#tab-home h2 { margin: 22px 0 2px; font-size: 17px; }
#tab-home .h-sub { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 0.06em; color: var(--taupe); }
#tab-home .h-picks { margin: 0; padding: 0; list-style: none; }
#tab-home .h-pick { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: baseline; width: 100%; padding: 14px 0;
  border: 0; border-top: 1px solid var(--rule); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
#tab-home .h-no { font-size: 15px; color: var(--wine); }
#tab-home .h-nm { display: block; font-size: 15px; font-weight: 650; }
#tab-home .h-why { display: block; margin-top: 3px; font-size: 12px; color: var(--taupe); }
#tab-home li.h-why { padding: 14px 0; border-top: 1px solid var(--rule); }
#tab-home .h-stars { display: inline-flex; gap: 1px; color: var(--wine); }
#tab-home .h-stars svg { width: 15px; height: 15px; }
#tab-home .h-stars svg.off { opacity: 0.22; }
#tab-home .h-btn { min-height: 38px; margin-top: 14px; padding: 0 18px; border: 1px solid var(--wine); border-radius: 999px; background: none; color: var(--wine); font: inherit; font-size: 13px; }
#tab-home .h-tag { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 700; color: var(--wine); }
#tab-home .h-more { display: block; width: 100%; margin-top: 14px; padding: 12px 0; border: 0; border-top: 1px solid var(--rule); background: none; color: var(--wine); font: inherit; font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; }
@media (min-width: 960px) { #tab-home { max-width: 600px; min-height: 0; margin: 8px auto 0; padding: 12px 40px 32px; border: 1px solid var(--rule); border-radius: 6px; } }
#tab-home .h-news { margin: 0; padding: 0; list-style: none; }
#tab-home .h-news li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 13px; line-height: 1.5; }
#tab-home .h-nk { font-size: 11.5px; letter-spacing: 0.04em; color: var(--wine); }
#tab-home .h-link-in { padding: 0; border: 0; background: none; color: var(--brown); font: inherit; font-weight: 650; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; cursor: pointer; }
#tab-home .h-zg { display: inline-block; padding: 1px 6px; border: 1px solid var(--wine); border-radius: 999px; font-size: 10.5px; font-weight: 700; color: var(--wine); letter-spacing: 0.04em; white-space: nowrap; }
#tab-home .h-foot-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
#tab-home .h-foot-act button { min-height: 38px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 999px; background: none; color: var(--wine); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
#tab-home .h-foot-act button.pri { border-color: var(--wine); background: var(--wine); color: var(--paper); }
