:root {
  --paper: #f5f0e5;
  --card: #fffdf7;
  --ink: #20333a;
  --subtle: #687570;
  --line: #d9d0bf;
  --teal: #173c43;
  --orange: #df5a32;
  --green: #52684a;
  --radius: 16px;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.site-header { background: var(--teal); color: white; box-shadow: 0 2px 0 rgb(0 0 0 / 8%); }
.header-inner, .search-inner, .catalog { width: min(1500px, 100%); margin: 0 auto; padding-inline: 28px; }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--orange); font-size: 20px; }
h1 { margin: 0; font-size: 21px; letter-spacing: -0.03em; }
.site-header p { margin: 3px 0 0; color: rgb(255 255 255 / 66%); font-size: 12px; }
.map-total { margin-left: auto; padding: 6px 11px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 999px; color: rgb(255 255 255 / 76%); font-size: 12px; font-weight: 800; }

.search-bar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgb(245 240 229 / 95%); backdrop-filter: blur(12px); }
.search-inner { padding-block: 16px; }
.search-box { position: relative; display: block; max-width: 760px; }
.search-box span { position: absolute; left: 16px; top: 50%; transform: translateY(-53%); color: #697873; font-size: 27px; }
.search-box input { width: 100%; height: 49px; padding: 0 18px 0 48px; border: 1px solid var(--line); border-radius: var(--radius); outline: none; background: white; color: var(--ink); box-shadow: 0 2px 7px rgb(40 54 47 / 5%); }
.search-box input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgb(223 90 50 / 15%); }
#result-count { margin: 8px 0 0 3px; color: var(--subtle); font-size: 12px; font-weight: 700; }

.catalog { padding-block: 20px 70px; }
.group { margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 5px 20px rgb(54 67 57 / 7%); }
.group-summary { display: flex; align-items: center; gap: 11px; min-height: 60px; padding: 14px 20px; list-style: none; font-size: 17px; font-weight: 900; cursor: pointer; }
.group-summary::-webkit-details-marker { display: none; }
.group-summary::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px #f8ded1; }
.group-summary::after { content: "⌄"; margin-left: auto; color: var(--subtle); font-size: 20px; transition: transform 180ms ease; }
.group[open] > .group-summary::after { transform: rotate(180deg); }
.group-count { padding: 4px 9px; border-radius: 999px; background: #e8ede2; color: var(--green); font-size: 12px; }
.map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 18px 18px; }
.map-card { min-width: 0; overflow: hidden; border: 1px solid #ded6c8; border-radius: 14px; background: white; }
.map-card.expanded { grid-column: 1 / -1; }
.map-toggle { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.thumbnail { position: relative; aspect-ratio: 16 / 8.7; overflow: hidden; border-bottom: 1px solid #e1dacd; background: #20383d; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.map-toggle:hover .thumbnail img { transform: scale(1.025); }
.missing-shot { width: 100%; height: 100%; display: grid; place-items: center; color: rgb(255 255 255 / 62%); font-size: 13px; font-weight: 800; }
.recipe-count { position: absolute; right: 9px; bottom: 9px; padding: 5px 9px; border-radius: 999px; background: rgb(23 60 67 / 92%); color: white; font-size: 11px; font-weight: 900; }
.map-heading { display: flex; align-items: center; gap: 10px; padding: 13px 15px; }
.map-heading-text { min-width: 0; flex: 1; }
.map-name, .source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-name { font-size: 15px; font-weight: 900; }
.source-name { margin-top: 3px; color: var(--subtle); font-size: 11px; }
.chevron { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #f1ece2; transition: transform 180ms ease; }
.expanded .chevron { transform: rotate(180deg); }
.map-detail { display: none; padding: 20px; border-top: 1px solid #e2dacd; background: #fbf8f1; }
.expanded .map-detail { display: block; }
.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-header h2 { margin: 0; font-size: 23px; }
.detail-label { margin: 0 0 3px; color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.copy-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid #cabfac; border-radius: 10px; background: white; color: var(--ink); font-size: 12px; font-weight: 800; }
.detail-screenshot { width: 100%; max-height: 680px; border: 1px solid #d9d0c0; border-radius: 13px; background: #20353a; object-fit: contain; }
.detail-missing { min-height: 210px; border: 1px dashed rgb(255 255 255 / 22%); border-radius: 13px; background: #20353a; }
.recipe-section { margin-top: 22px; }
.recipe-section h3 { margin: 0 0 8px; color: #3f554b; font-size: 14px; }
.recipe-strip { overflow-x: auto; padding: 8px; border: 1px solid #d8d0c3; border-radius: 12px; background: #0f141c; scrollbar-color: var(--orange) #26343a; }
.recipe-strip img { width: auto; max-width: none; height: auto; }
.empty-state, .load-error { padding: 60px 20px; border: 1px dashed #cfc5b3; border-radius: 16px; background: rgb(255 255 255 / 55%); color: var(--subtle); text-align: center; }
.empty-state p, .load-error p { margin: 5px 0 0; font-size: 13px; }
noscript { display: block; padding: 30px; text-align: center; }

@media (max-width: 960px) { .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .header-inner, .search-inner, .catalog { padding-inline: 14px; }
  .map-grid { grid-template-columns: 1fr; padding-inline: 12px; }
  .map-card.expanded { grid-column: auto; }
  .group-summary { padding-inline: 16px; }
  .recipe-strip img { max-height: 190px; }
  .detail-header { align-items: flex-start; }
  .map-total { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
