:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --ink: #1f2a37;
  --ink-sub: #5b6573;
  --line: #e4ddd1;
  --accent: #d9480f;
  --accent-soft: #fdebe1;
  --ok: #2f7d4f;
  --ok-soft: #e3f3e9;
  --warn: #9a6400;
  --warn-soft: #fff3d6;
  --shadow: 0 6px 24px rgba(31, 42, 55, .12);
  --radius: 14px;
  --header-h: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: block; object-fit: cover; background: #ff6a00;
}
.brand h1 { font-size: 17px; margin: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { margin: 0; font-size: 11px; opacity: .75; }
.ig-follow {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 500;
  background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af);
}

/* ---------- Filters ---------- */
.filters { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  color: var(--ink-sub);
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); height: 100%; }
.filters select, #sort {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 10px;
}
.toggle {
  height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; white-space: nowrap;
}
.toggle[aria-pressed="true"] { background: var(--warn-soft); border-color: #e8c46a; font-weight: 700; }
.link-btn { border: 0; background: none; color: var(--ink-sub); text-decoration: underline; cursor: pointer; padding: 0 4px; height: 40px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 13px;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip small { opacity: .6; }

/* ---------- Layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 380px 1fr; min-height: 0; }
.list-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: var(--bg); }
.list-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 13px; color: var(--ink-sub);
}
#sort { height: 34px; font-size: 13px; }
.shop-list { list-style: none; margin: 0; padding: 0 12px 16px; overflow-y: auto; flex: 1; }
.map-pane { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #e8e4dc; }

@media (min-width: 861px) {
  body:not(.page) { height: 100vh; overflow: hidden; }
  body:not(.page) .site-footer { display: none; }
}

/* ---------- Shop card ---------- */
.card {
  display: grid; grid-template-columns: 6px 1fr; gap: 0; margin-top: 10px;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.card:hover, .card:focus-visible { box-shadow: var(--shadow); outline: none; }
.card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card-bar { background: var(--c, var(--accent)); }
.card-main { padding: 12px 14px; min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.4; }
.card .genre { font-size: 12px; color: var(--ink-sub); white-space: nowrap; }
.card .comment { margin: 4px 0 8px; font-size: 13px; color: var(--ink-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-sub); white-space: nowrap; }
.badge.hiru { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.closed { background: #f3e3e3; color: #a33; }
.badge.ig {
  display: inline-grid; place-items: center; padding: 2px 5px; color: #fff;
  background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af);
}
.badge.ig svg { display: block; }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-sub); }

/* ---------- Map pins ---------- */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 13px; font-family: "Noto Sans JP", sans-serif; }
.pin.active { outline: 3px solid var(--ink); outline-offset: 1px; }
.leaflet-tooltip.pin-label { font-family: "Noto Sans JP", sans-serif; font-weight: 700; font-size: 12px; }
.map-btn {
  position: absolute; right: 12px; bottom: 28px; z-index: 500;
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center;
}
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #1c7ed6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(28,126,214,.25); }

/* ---------- Detail panel ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 20, 28, .35); z-index: 900; }
.detail {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--surface); z-index: 1000; box-shadow: var(--shadow);
  transform: translateX(105%); transition: transform .25s ease; overflow-y: auto;
}
.detail.open { transform: none; }
.close {
  position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.detail-body { padding: 20px 20px 40px; }
.d-genre { margin: 0; font-size: 13px; color: var(--ink-sub); display: flex; align-items: center; gap: 6px; }
.d-genre .dot { width: 10px; height: 10px; border-radius: 50%; }
.detail h2 { margin: 2px 0 8px; font-size: 22px; line-height: 1.35; padding-right: 30px; }
.d-comment { margin: 0 0 14px; }
.d-info { display: grid; grid-template-columns: 5.5em 1fr; gap: 6px 10px; margin: 0 0 16px; font-size: 14px; }
.d-info dt { color: var(--ink-sub); }
.d-info dd { margin: 0; word-break: break-word; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; flex: 1 1 auto;
}
.btn.primary { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); color: #fff; border: 0; }
.d-ig { border-top: 1px solid var(--line); padding-top: 16px; }
.d-ig h4 { margin: 0 0 8px; font-size: 14px; }
.ig-placeholder {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; background: var(--bg);
}
.ig-placeholder p { margin: 0 0 10px; font-size: 12px; color: var(--ink-sub); }
.ig-more { font-size: 13px; margin-top: 10px; }
.ig-more a { color: var(--accent); }
.instagram-media { min-width: 0 !important; }

/* ---------- Footer ---------- */
.site-footer { padding: 16px; font-size: 12px; color: var(--ink-sub); text-align: center; }
.site-footer p { margin: 4px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  html, body { height: auto; }
  .layout { flex: none; min-height: auto; grid-template-columns: 1fr; grid-template-rows: 46vh auto; }
  .map-pane { order: -1; height: 46vh; }
  .list-pane { border-right: 0; }
  .shop-list { overflow: visible; }
  .brand h1 { font-size: 15px; }
  .ig-follow span { display: none; }
  .ig-follow { padding: 8px; }
  .filters { position: sticky; top: 0; z-index: 800; }
  .detail {
    top: auto; left: 0; width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0;
    transform: translateY(105%);
  }
  .detail.open { transform: none; }
  .d-info { grid-template-columns: 5em 1fr; }
}

/* ---------- SEO用ページ（店舗・ジャンル） ---------- */
body.page { display: block; }
.page .brand { text-decoration: none; color: #fff; }
.brand-title { font-size: 17px; margin: 0; line-height: 1.3; font-weight: 700; }
.page .ig-follow span { display: inline; }
.page-main { max-width: 760px; margin: 0 auto; padding: 16px 16px 8px; }
.page-main h1 { font-size: 26px; line-height: 1.35; margin: 4px 0 8px; }
.page-main h1 small { font-size: 15px; color: var(--ink-sub); font-weight: 500; }
.page-main h2 { font-size: 18px; margin: 24px 0 10px; padding-left: 10px; border-left: 4px solid var(--accent); }
.page-main .lead { font-size: 15px; margin: 0 0 8px; }
.crumbs { font-size: 12px; color: var(--ink-sub); margin-bottom: 8px; }
.crumbs a { color: var(--ink-sub); }
.shop-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.shop-article .note { font-size: 12px; color: var(--ink-sub); margin: 14px 0 0; }
.shop-list.static { padding: 0; overflow: visible; }
.card-link { display: grid; grid-template-columns: 6px 1fr; text-decoration: none; color: inherit; }
.shop-list.static .card { display: block; }
.related p a, .page-genres a { color: var(--accent); }
.page-genres { max-width: 760px; margin: 8px auto 0; padding: 0 16px; }
.page-genres h2 { font-size: 16px; margin: 20px 0 10px; }
.page-genres ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.page-genres li a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; }
.page-genres .btn { display: inline-flex; flex: none; }
/* トップページ下部の掲載店一覧（検索エンジン・地図を使わない人向け） */
.seo-list { padding: 8px 16px 0; font-size: 13px; }
.seo-list summary { cursor: pointer; color: var(--ink-sub); }
.seo-list ul { columns: 2; padding-left: 18px; margin: 8px 0; }
.seo-list a { color: var(--ink); }
