:root {
  --accent: #e86a92;
  --accent-dark: #c94f78;
  --ink: #2b2b2b;
  --muted: #777;
  --line: #e5e0e0;
  --bg: #fff9fb;
  --stale-opacity: 0.45;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
header.site {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
header.site .logo { font-size: 22px; font-weight: 700; color: var(--accent-dark); text-decoration: none; }
header.site nav a { margin-right: 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
header.site nav a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 20px; }
h2 { font-size: 17px; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.note { color: var(--muted); font-size: 13px; }
.sample-banner {
  background: #fff3cd; border: 1px solid #e6c964; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 12px;
}
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 12px;
}
.filters label { font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
select, input[type="text"], input[type="number"], textarea {
  padding: 7px 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; background: #fff;
}
button, .btn {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 8px 16px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.secondary, .btn.secondary { background: #888; }
button.danger { background: #c0392b; }
.layout { display: block; }
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .lists { grid-template-columns: 1fr; } }
#map { height: 440px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; }
.size-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.size-chips button {
  background: #fff; color: var(--ink); border: 1.5px solid var(--accent);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600;
}
.size-chips button:hover { background: #fdeef3; }
.size-chips button.active { background: var(--accent); color: #fff; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
}
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.badge {
  display: inline-block; font-size: 12px; border-radius: 10px; padding: 1px 8px; margin-right: 6px;
}
.badge.in_stock { background: #dff5e1; color: #20713a; }
.badge.low { background: #fdf0d5; color: #8a5a00; }
.badge.out { background: #fbe3e3; color: #a33; }
.badge.pr { background: #333; color: #fff; font-weight: 700; }
.stale { opacity: var(--stale-opacity); }
.price { font-weight: 700; }
.per-unit { color: var(--muted); font-size: 13px; }
.freshness { color: var(--muted); font-size: 12px; }
.pr-box {
  background: #fff; border: 1px dashed #bbb; border-radius: 8px; padding: 10px 12px; margin: 16px 0;
  font-size: 13px;
}
.pr-box .badge { margin-bottom: 4px; }
.pr-box a.disabled { color: var(--muted); pointer-events: none; text-decoration: none; }
form.post-form { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
form.post-form label { display: block; margin-bottom: 12px; font-size: 14px; }
form.post-form label > span { display: block; font-weight: 600; margin-bottom: 4px; }
form.post-form select, form.post-form input, form.post-form textarea { width: 100%; max-width: 480px; }
.radio-row label { display: inline-block; margin-right: 14px; font-weight: normal; }
.message { padding: 10px 12px; border-radius: 8px; margin: 12px 0; display: none; }
.message.ok { background: #dff5e1; display: block; }
.message.err { background: #fbe3e3; display: block; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.admin th, table.admin td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.admin th { background: #faf3f5; }
footer.site { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0; }
footer.site a { color: var(--muted); margin: 0 6px; }

/* ===== トップ: 地図＋一覧の連動UI（ママパパマップ風） ===== */
main.wide { max-width: 1280px; }
.filter-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px;
}
.filter-group { margin-bottom: 10px; }
.filter-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  background: #fff; color: var(--ink); border: 1.5px solid var(--accent);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chips button small { font-weight: 400; color: var(--muted); font-size: 11px; margin-left: 2px; }
.chips button:hover { background: #fdeef3; }
.chips button.active { background: var(--accent); color: #fff; }
.chips button.active small { color: #ffe3ee; }
.brand-chips button { border-color: #b9a7d9; }
.brand-chips button.active { background: #8a6fc9; border-color: #8a6fc9; }
.filter-panel .filters { border: none; padding: 0; margin: 4px 0 0; }

.view-toggle { display: none; gap: 8px; margin-bottom: 10px; }
.view-toggle button { flex: 1; background: #fff; color: var(--ink); border: 1.5px solid var(--accent); }
.view-toggle button.active { background: var(--accent); color: #fff; }

.layout {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.map-pane { position: sticky; top: 12px; }
.map-pane #map { height: calc(100vh - 170px); min-height: 420px; margin-bottom: 6px; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.map-legend .dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-right: 4px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px #bbb;
}
.dot.in_stock { background: #2e9e52; } .dot.low { background: #e6a817; }
.dot.out { background: #d9534f; } .dot.none { background: #1a73e8; }
.list-pane { min-width: 0; }
.list-head h2 { margin-top: 0; }
@media (max-width: 800px) {
  .view-toggle { display: flex; }
  .layout { grid-template-columns: 1fr; }
  .map-pane { position: static; }
  .map-pane #map { height: 62vh; min-height: 340px; }
  .layout[data-view="list"] .map-pane { display: none; }
  .layout[data-view="map"] .list-pane { display: none; }
}

/* 地図ピン（在庫状態で色分け） */
.pin-wrap { background: transparent; border: none; }
.pin {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  margin: 4px auto; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  background: #1a73e8;
}
.pin.in_stock { background: #2e9e52; }
.pin.low { background: #e6a817; }
.pin.out { background: #d9534f; }
.pin.selected { width: 28px; height: 28px; box-shadow: 0 0 0 3px var(--accent), 0 1px 6px rgba(0,0,0,.4); }

/* 店舗カード（在庫サマリ統合） */
.store-card { cursor: pointer; }
.store-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.badge.none { background: #eceff1; color: #666; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.tag {
  font-size: 12px; border-radius: 999px; padding: 1px 10px;
  background: #f3eefc; color: #5b4a8a; border: 1px solid #d9cdf2;
}
.tag.size { background: #fdeef3; color: #a03a5f; border-color: #f3c3d4; }
.tag.hit { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.report-line { font-size: 13px; margin-top: 4px; }

/* ===== v6: ママパパマップ風・全画面ステージ ===== */
main.map-app { max-width: none; padding: 0 10px; }
.filter-bar {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px;
}
.filter-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.filter-label { font-size: 13px; font-weight: 700; padding-top: 8px; white-space: nowrap; }
.filter-bar .filters { border: none; padding: 0; margin: 2px 0 0; }
.filter-bar .note { margin: 4px 0 0; }

.stage { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #eef1f3; }
.stage .map-pane { position: relative; }
.stage #map { height: calc(100vh - 250px); min-height: 480px; margin: 0; border-radius: 0; }
.stage .map-legend {
  position: absolute; left: 10px; bottom: 10px; z-index: 600;
  background: rgba(255,255,255,.92); border-radius: 8px; padding: 5px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.map-fabs { position: absolute; right: 12px; bottom: 16px; z-index: 600; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.fab {
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); text-decoration: none;
}
.fab.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.stage .list-pane {
  background: #fff; overflow-y: auto; height: calc(100vh - 250px); min-height: 480px;
  padding: 10px 12px; border-left: 1px solid var(--line);
}
.stage .list-head h2 { margin: 2px 0 4px; font-size: 17px; }
.pin.hover { width: 27px; height: 27px; box-shadow: 0 0 0 3px #8a6fc9, 0 1px 6px rgba(0,0,0,.4); }
.map-note { margin: 10px 2px 0; }

@media (max-width: 800px) {
  main.map-app { padding: 0; }
  .filter-bar { border-radius: 0; border-left: none; border-right: none; }
  .stage { display: block; border: none; border-radius: 0; overflow: visible; background: none; }
  .stage #map { height: 56vh; min-height: 340px; }
  .stage .list-pane {
    height: auto; max-height: none; border-left: none; padding: 10px;
  }
  .stage[data-view="map"] .list-pane { max-height: 38vh; overflow-y: auto; border-top: 1px solid var(--line); }
  .stage[data-view="list"] .list-pane { max-height: none; }
  .stage[data-view="list"] .map-pane { display: none; }
  .map-fabs { bottom: 12px; }
}

/* ===== v7: ママパパマップの見た目に寄せる ===== */
:root {
  --accent: #f26d7d;
  --accent-dark: #d94f63;
  --bg: #fff5f6;
  --line: #f3d9dd;
}
body { background: var(--bg); font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif; }
header.site { background: #fff; }
header.site .logo { color: var(--accent-dark); }

/* ヒーロー（入口カード） */
.hero {
  background: linear-gradient(180deg, #ffeef1, #fff7f8);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 14px 14px; margin-bottom: 10px; text-align: center;
}
.hero h1 { font-size: 21px; margin: 0 0 4px; color: var(--accent-dark); }
.hero h1::before { content: none; }
.hero-sub { margin: 0 0 12px; font-size: 14px; color: #7a5a60; }
.entry-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 640px; margin: 0 auto; }
.entry-card {
  background: #fff; color: var(--ink); border: 2px solid var(--accent); border-radius: 14px;
  padding: 14px 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 2px 0 var(--accent);
}
.entry-card:hover { background: #fff0f2; }
.entry-emoji { font-size: 26px; line-height: 1.2; }
.entry-name { font-size: 14px; font-weight: 700; }
@media (max-width: 560px) { .entry-name { font-size: 12.5px; } .hero h1 { font-size: 18px; } }

/* 見出しのピンク縦線アクセント */
.stage .list-head h2 { border-bottom: none; border-left: 5px solid var(--accent); padding: 0 0 0 8px; }

/* チップとボタンを丸く・やわらかく */
.chips button { box-shadow: 0 1px 2px rgba(217,79,99,.18); }
.fab { border-color: var(--line); }
.fab.primary { box-shadow: 0 3px 8px rgba(217,79,99,.35); }

/* ピン: しずく型＋おむつ絵文字（ママパパマップの絵入りピン風） */
.pin {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.pin::after { content: "🧷"; transform: rotate(45deg); filter: grayscale(0.1); line-height: 1; }
.pin.selected { width: 34px; height: 34px; }
.pin.hover { width: 33px; height: 33px; }

/* 近くの店ボックス・距離表示 */
#nearby-box { border-bottom: 2px solid var(--line); margin-bottom: 10px; padding-bottom: 4px; }
.dist { color: var(--accent-dark); font-weight: 700; }

/* ===== v9: 洗練（余白・影・色の統一） ===== */
header.site { position: sticky; top: 0; z-index: 1000; box-shadow: 0 1px 8px rgba(160, 60, 80, .08); }
.tagline { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .tagline { display: none; } }

/* ヒーロー */
.hero { padding: 26px 16px 20px; border-radius: 18px; box-shadow: 0 2px 10px rgba(217, 79, 99, .07); }
.hero h1 { font-size: 24px; letter-spacing: .02em; }
.entry-card { transition: transform .15s ease, box-shadow .15s ease; padding: 18px 6px 14px; }
.entry-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(217, 79, 99, .18); }
.entry-emoji { font-size: 30px; }

/* 絞り込みバー */
.filter-bar { border-radius: 14px; box-shadow: 0 1px 4px rgba(160, 60, 80, .05); padding: 12px 14px; }
.chips button { padding: 9px 18px; font-size: 14.5px; transition: all .15s ease; }
.chips button:hover { transform: translateY(-1px); }
.chips button.active { box-shadow: 0 3px 8px rgba(217, 79, 99, .3); }
.brand-chips button { border-color: var(--accent); }
.brand-chips button.active { background: var(--accent); border-color: var(--accent); }
.filter-details { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.filter-details summary {
  cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--accent-dark);
  list-style: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px;
}
.filter-details summary::before { content: "▸"; }
.filter-details[open ] summary::before { content: "▾"; }
.filter-details summary::-webkit-details-marker { display: none; }
.filter-details .filters { margin-top: 8px; }
select { border-radius: 10px; border-color: #e3c8cd; padding: 8px 10px; }

/* ステージとカード */
.stage { border-radius: 16px; box-shadow: 0 6px 20px rgba(140, 50, 70, .09); }
.stage .list-pane { background: linear-gradient(180deg, #fff, #fffcfd); }
.stage .list-pane::-webkit-scrollbar { width: 8px; }
.stage .list-pane::-webkit-scrollbar-thumb { background: #f0c3cb; border-radius: 4px; }
.card { border-radius: 14px; box-shadow: 0 1px 3px rgba(120, 40, 60, .06); padding: 12px 14px; transition: box-shadow .15s ease; }
.card:hover { box-shadow: 0 4px 12px rgba(120, 40, 60, .12); }
.card h3 { font-size: 15.5px; }
.badge { border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.tag { padding: 2px 11px; font-size: 12.5px; }
.report-line { font-size: 13.5px; }

/* ピン・凡例・ボタン */
.pin-wrap { filter: drop-shadow(0 2px 3px rgba(60, 10, 20, .35)); }
.pin { border-width: 2.5px; box-shadow: none; }
.pin.selected { box-shadow: 0 0 0 3px var(--accent); }
.stage .map-legend { border-radius: 999px; padding: 6px 14px; font-size: 12.5px; }
.fab { padding: 10px 18px; font-size: 14.5px; transition: transform .15s ease; }
.fab:hover { transform: translateY(-1px); }
.sample-banner { border-radius: 10px; }

/* 店舗追加: 場所ピン */
.pin-block { margin-bottom: 12px; }
.pin-label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
#suggest-map { height: 300px; border-radius: 10px; border: 1px solid var(--line); }
.pin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ===== v16: 通常スクロール型トップページ（地図／選択店舗／履歴／右カラム） ===== */
.home-page {
  background: var(--bg);
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
.home-page [hidden] { display: none !important; }
.home-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(160, 60, 80, .08);
}
.home-header-inner {
  width: min(1440px, 100%);
  min-height: 62px;
  margin: 0 auto;
  padding: 8px clamp(12px, 2.5vw, 32px);
  display: flex;
  align-items: center;
  gap: 18px;
}
.home-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--accent-dark);
  text-decoration: none;
  white-space: nowrap;
}
.home-logo-icon { font-size: 25px; line-height: 1; }
.home-logo-text { font-size: 19px; font-weight: 800; letter-spacing: .02em; }
.home-logo-tagline { color: var(--muted); font-size: 11px; font-weight: 700; }
.home-topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  white-space: nowrap;
}
.home-topnav a { color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.home-topnav a:hover { color: var(--accent-dark); text-decoration: underline; }
.filter-toggle-button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: #fff0f3;
  color: var(--accent-dark);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}
.home-topnav + .filter-toggle-button { margin-left: 0; }
.filter-toggle-button:hover { background: #ffe1e8; }
.filter-toggle-button[aria-expanded="true"] { background: var(--accent); color: #fff; }
.filter-toggle-icon { width: 17px; height: 17px; }

.home-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.5vw, 32px) 42px;
}
.search-card,
.filter-panel,
.content-card,
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 3px 14px rgba(140, 50, 70, .06);
}
.search-card { padding: 16px; margin-bottom: 16px; }
.search-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.section-eyebrow {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}
.search-card h1,
.filter-panel h2,
.content-card h2,
.side-card h2 {
  margin: 0;
  border: none;
  padding: 0;
  color: var(--ink);
  letter-spacing: .01em;
}
.search-card h1 { font-size: clamp(21px, 3vw, 30px); line-height: 1.3; }
.search-lead { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sample-notice {
  flex: 0 1 430px;
  margin: 2px 0 0;
  border: 1px solid #ecd27a;
  border-radius: 999px;
  background: #fff7cf;
  color: #755b00;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.45;
}
.quick-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 6px;
  scrollbar-width: none;
}
.quick-chips::-webkit-scrollbar { display: none; }
.active-filter-note { min-height: 1.5em; margin: 2px 0 0; color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.search-help { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.filter-panel {
  padding: 18px;
  margin-bottom: 18px;
  scroll-margin-top: 82px;
}
.panel-heading,
.section-heading,
.selected-store-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.panel-heading { margin-bottom: 16px; }
.panel-heading p,
.section-heading > p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.panel-close-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f6f6f6;
  color: #666;
  padding: 9px;
  box-shadow: none;
}
.panel-close-button:hover { background: #eeeeee; }
.panel-close-button svg { width: 100%; height: 100%; }
.filter-chip-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}
.filter-chip-group h3 {
  margin: 0 0 8px;
  color: #888;
  font-size: 12px;
  letter-spacing: .08em;
}
.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  border: none;
  border-top: 1px dashed var(--line);
  border-radius: 0;
  background: transparent;
  padding: 14px 0 0;
  margin: 0;
}
.filter-form label { min-width: 0; }
.filter-form select,
.filter-form button { width: 100%; }
.filter-clear-label button { margin-top: 2px; }
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px dashed var(--line);
  margin-top: 16px;
  padding-top: 14px;
}
.filter-actions p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-links { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.panel-links a { color: var(--muted); }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.home-page .main-column {
  max-width: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.content-card { padding: 16px; margin-bottom: 18px; scroll-margin-top: 82px; }
.section-heading { margin-bottom: 12px; }
.section-heading > p { max-width: 360px; text-align: right; }
.map-card { overflow: hidden; }
.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #edf1f2;
  isolation: isolate;
}
.home-page #map {
  width: 100%;
  height: clamp(380px, 58vh, 620px);
  min-height: 380px;
  margin: 0;
  border: none;
  border-radius: 0;
  z-index: 0;
}
.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  max-width: calc(100% - 190px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
  padding: 6px 11px;
  color: #555;
  font-size: 11.5px;
  font-weight: 800;
  pointer-events: none;
}
.map-legend .dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #aaa;
  vertical-align: -1px;
}
.map-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}
.map-post-button {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(217, 79, 99, .32);
  color: #fff;
  padding: 10px 15px;
  font-size: 13.5px;
  font-weight: 900;
  text-decoration: none;
}
.map-post-button:hover { background: var(--accent-dark); }
.locate-button {
  width: 46px;
  height: 46px;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  background: #fff;
  color: #1a73e8;
  padding: 11px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
}
.locate-button:hover { background: #f7fbff; }
.locate-button svg { width: 100%; height: 100%; }
.map-note { margin: 9px 2px 0; color: var(--muted); font-size: 12px; }

.selected-store-card {
  border-color: #f0b9c4;
  background: linear-gradient(180deg, #fff, #fffafb);
}
.selected-store-empty {
  border: 1.5px dashed #efb7c3;
  border-radius: 14px;
  background: #fff7f8;
  color: var(--muted);
  padding: 14px;
  font-size: 13px;
}
.selected-store-main { margin-bottom: 10px; }
.selected-store-summary { min-width: 0; }
.selected-store-summary h3 { margin: 0 0 3px; font-size: 18px; line-height: 1.35; }
.selected-store-meta,
.selected-store-address { margin: 0; color: var(--muted); font-size: 12.5px; }
.selected-report-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 13px;
}
.selected-report {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
}
.selected-report .freshness { margin-left: 5px; }
.selected-store-actions,
.side-card-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
.primary-action,
.secondary-action,
.affiliate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.35;
  text-decoration: none;
}
.primary-action,
.affiliate-button { background: var(--accent); color: #fff; box-shadow: 0 3px 9px rgba(217, 79, 99, .22); }
.primary-action:hover,
.affiliate-button:hover { background: var(--accent-dark); }
.secondary-action {
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent-dark);
}
.secondary-action:hover { background: #fff0f3; }
.helpful-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 900;
  box-shadow: none;
}
.helpful-button:hover { background: #fff0f3; }
.helpful-button.voted { background: var(--accent); color: #fff; }
.helpful-button:disabled { opacity: .55; cursor: wait; }
.helpful-count {
  min-width: 25px;
  border-radius: 999px;
  background: #fdeef3;
  color: var(--accent-dark);
  padding: 1px 7px;
  text-align: center;
  font-size: 12px;
}
.helpful-button.voted .helpful-count { background: rgba(255, 255, 255, .24); color: #fff; }
.action-message { min-height: 1.4em; margin: 7px 0 0; color: var(--accent-dark); font-size: 12px; font-weight: 700; }

.stores-card { scroll-margin-top: 82px; }
.nearby-box {
  border-bottom: 2px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 12px;
}
.nearby-box h3,
.store-list-heading h3 { margin: 0 0 5px; font-size: 16px; }
.store-list-heading { margin-bottom: 10px; }
.area-page-link { margin: 3px 0 0; font-size: 12.5px; }
.store-card-list { display: grid; gap: 10px; }
.store-card-list .card { margin: 0; }
.card-actions { margin-top: 10px; }
.card-actions a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.card-actions a:hover { border-color: var(--accent); background: #fff0f3; }

.history-list { display: grid; gap: 9px; }
.history-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
}
.history-date {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}
.history-main h3 { margin: 0 0 2px; font-size: 14.5px; }
.history-main h3 a { color: var(--ink); text-decoration: none; }
.history-main h3 a:hover { text-decoration: underline; }
.history-main p { margin: 1px 0; font-size: 12.5px; }
.history-area { color: var(--muted); }

.side-rail {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.side-card { padding: 16px; }
.side-card h2 { font-size: 17px; margin-bottom: 8px; }
.side-card p { font-size: 13px; }
.affiliate-card { border-color: #d8d2c4; background: linear-gradient(180deg, #fff, #fffdf6); }
.pr-label {
  display: inline-block;
  border-radius: 5px;
  background: #333;
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}
.affiliate-card .section-eyebrow { margin-top: 9px; }
.affiliate-button { width: 100%; margin: 5px 0 7px; }
.ad-slot:empty { display: none; }
.guide-steps { margin: 8px 0 10px; padding-left: 22px; font-size: 13.5px; }
.guide-steps li { margin: 4px 0; }
.side-card-actions .primary-action,
.side-card-actions .secondary-action { flex: 1 1 130px; }
.side-link-list { margin: 6px 0 0; padding-left: 19px; font-size: 13.5px; }
.side-link-list li { margin: 6px 0; }
.side-link-list a { color: var(--accent-dark); font-weight: 700; }

.home-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding: 20px 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.home-footer strong { color: var(--ink); font-size: 15px; }
.home-footer p { margin: 3px 0; }
.home-footer nav { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: flex-end; }
.home-footer a { color: var(--muted); }
.footer-disclosure { grid-column: 1 / -1; }

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #eeeeee;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 58px;
  justify-content: center;
  color: #888;
  font-size: 10.5px;
  font-weight: 800;
  text-decoration: none;
}
.mobile-nav svg { width: 23px; height: 23px; }
.mobile-nav a.mobile-nav-active { color: var(--accent-dark); }

/* 店舗詳細の履歴・役に立った */
.store-history-list { display: grid; gap: 9px; }
.store-history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}
.store-history-item p { margin: 3px 0; }
.store-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.report-card-actions { margin-top: 9px; }

@media (min-width: 1024px) {
  .home-page { padding-bottom: 0; }
  .mobile-nav { display: none; }
  .home-page #map { height: clamp(520px, 68vh, 700px); }
  .quick-chips { flex-wrap: wrap; overflow-x: visible; }
}

@media (max-width: 1100px) {
  .home-topnav { display: none; }
  .filter-toggle-button { margin-left: auto; }
}

@media (max-width: 1023px) {
  .content-grid { grid-template-columns: 1fr; }
  .side-rail { position: static; }
}

@media (max-width: 640px) {
  .home-header-inner { min-height: 56px; gap: 8px; }
  .home-logo-tagline { display: none; }
  .home-logo-text { font-size: 17px; }
  .home-logo-icon { font-size: 22px; }
  .filter-toggle-button { padding: 7px 11px; font-size: 12px; }
  .home-shell { padding-top: 12px; }
  .search-card,
  .filter-panel,
  .content-card { padding: 13px; }
  .search-card-head,
  .section-heading,
  .selected-store-main { flex-direction: column; }
  .section-heading > p { max-width: none; text-align: left; }
  .sample-notice { flex-basis: auto; border-radius: 12px; }
  .filter-chip-groups { grid-template-columns: 1fr; }
  .filter-actions { align-items: stretch; flex-direction: column; }
  .filter-actions .primary-action { width: 100%; }
  .home-page #map { height: 54vh; min-height: 340px; }
  .map-legend { max-width: calc(100% - 24px); bottom: 58px; }
  .map-actions { bottom: 10px; }
  .selected-store-actions > * { flex: 1 1 145px; justify-content: center; }
  .history-item { grid-template-columns: 1fr; gap: 3px; }
  .home-footer { grid-template-columns: 1fr; }
  .home-footer nav { justify-content: flex-start; }
}

/* ===== v17: PC専用レイアウト調整（モバイル〜1023pxはv16のまま） =====
   狙い: 検索バーを圧縮して地図を上に上げ、地図と選択店舗を横並びにし、
   店舗カードと履歴を2列にして横幅を使う。 */
@media (min-width: 1024px) {
  .home-header-inner { min-height: 56px; }
  .home-shell { padding-top: 12px; }

  /* 検索カードをツールバー並みに圧縮（チップは1行・小さめ） */
  .search-card { padding: 12px 16px 10px; margin-bottom: 14px; }
  .search-card-head { margin-bottom: 8px; align-items: center; }
  .search-card h1 { font-size: 24px; }
  .search-lead { font-size: 12.5px; }
  .sample-notice { font-size: 11px; padding: 5px 10px; }
  .quick-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .quick-chips button { padding: 5px 11px !important; font-size: 12.5px !important; }
  .active-filter-note { display: inline; margin-right: 10px; }
  .search-help { display: inline; font-size: 11.5px; }

  .content-grid { gap: 18px; grid-template-columns: minmax(0, 1fr) 308px; }
  .content-card { padding: 14px; }
  .section-heading { margin-bottom: 9px; }
  .home-page #map { height: clamp(460px, 58vh, 580px); }

  /* 右レール: 情報の鮮度カードはPCでは省略し、収まりを優先する。
     レール全体が画面より高い場合も末尾まで届くよう、内部スクロール可にする */
  .side-rail { gap: 14px; max-height: calc(100vh - 94px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 4px; }
  .side-card { padding: 14px; }
  .freshness-card { display: none; }

  /* 詳細フィルターはPCで4列に広げる */
  .filter-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .home-header-inner,
  .home-shell { width: min(1600px, 100%); }

  /* メインカラム内: 地図（左）と選択中の店舗（右）を横並びにする */
  .home-page .main-column {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr);
    gap: 18px;
    align-items: start;
  }
  .home-page .main-column .content-card { margin-bottom: 0; }
  .map-card { grid-column: 1; }
  .selected-store-card { grid-column: 2; }
  .stores-card,
  .history-card { grid-column: 1 / -1; }
  .home-page #map { height: clamp(480px, 62vh, 620px); }

  /* 選択中の店舗は細いカラム用に縦積みにする */
  .selected-store-card .section-heading { flex-direction: column; gap: 2px; }
  .selected-store-card .section-heading > p { text-align: left; }
  .selected-store-actions { flex-direction: column; align-items: stretch; }
  .selected-store-actions > * { justify-content: center; text-align: center; }

  /* 店舗カードと履歴は2列で横幅を使う */
  .store-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== v18: 最上部の更新履歴ストリップ ===== */
.top-history {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(140, 50, 70, .06);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.top-history-tab {
  flex: 0 0 auto;
  margin: 1px 0 0;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
}
.top-history-list {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  line-height: 1.5;
}
.top-history-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.top-history-list a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-history-list a:hover { color: var(--accent-dark); text-decoration: underline; }
.top-history-date { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.top-history-more {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .top-history { flex-wrap: wrap; gap: 8px 10px; padding: 9px 11px; }
  .top-history-list { order: 3; flex-basis: 100%; font-size: 12px; }
  .top-history-more { margin-left: auto; }
}

/* ===== v19: 店舗一覧の表示コントロール ===== */
.store-list-controls { display: flex; justify-content: center; margin-top: 14px; }
.store-list-controls[hidden] { display: none !important; }

/* ===== v21: 詳細条件ボタンの移設／地図ボタンの右上配置 ===== */
.search-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.search-help-row .search-help { margin: 0; }
.search-help-row .filter-toggle-button { margin-left: 0; flex: 0 0 auto; }
/* 地図右下は凡例・クレジットと被るため、投稿／現在地ボタンは右上へ */
.map-actions { top: 12px; bottom: auto; }
@media (max-width: 640px) {
  .map-actions { top: 10px; bottom: auto; }
  .map-legend { bottom: 12px; }
}

/* ===== v22: 取り扱いなし（not_carried）はグレー ===== */
.pin.not_carried { background: #9aa7b1; }
.dot.not_carried { background: #9aa7b1; }
.badge.not_carried { background: #eceff1; color: #666; }

/* ===== v29: 報告ごとの誤り指摘リンク ===== */
.report-flag-link { font-size: 12px; color: #8a5a63; margin-left: 8px; }

/* ===== v32: ヘッダーロゴを公式アイコンに統一 ===== */
.home-logo-mark { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.logo-mark { width: 28px; height: 28px; border-radius: 50%; vertical-align: -7px; margin-right: 6px; }

/* ===== v33: クイック絞り込みを縦並びグループ＋複数選択に ===== */
.quick-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.quick-group-title { margin: 0 0 5px; font-size: 13px; font-weight: 800; color: var(--accent-dark); display: flex; align-items: center; gap: 8px; }
.quick-multi { font-size: 10.5px; font-weight: 700; color: var(--muted); background: #f6e8ee; border-radius: 999px; padding: 1px 8px; }
.quick-groups .quick-chips { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; }
.filter-multi-label select[multiple] { min-height: 96px; }

/* ===== v34: Noto Sans JP タイポグラフィ ===== */
body { letter-spacing: .01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { letter-spacing: .02em; }
button, input, select, textarea { font-family: inherit; }
.leaflet-container { font-family: inherit; }

/* ===== v35: 「取り扱いなし」と「報告なし」を色で明確に区別 ===== */
/* 取り扱いなし = はっきりしたグレー（白抜き✕つき）/ 報告なし = 淡いブルーグレー地に青文字 */
.badge.not_carried { background: #5f6b76; color: #fff; }
.badge.not_carried::before { content: "✕ "; font-weight: 800; }
.badge.none { background: #e3ecf9; color: #3367b8; }
.pin.not_carried { background: #5f6b76; }
.dot.not_carried { background: #5f6b76; }

/* ===== v38: 棚写真AI認識 ===== */
.ai-recognize { margin-bottom: 20px; }
.ai-recognize label { display: block; margin-bottom: 12px; font-size: 14px; }
.ai-recognize label > span { display: block; font-weight: 600; margin-bottom: 4px; }
.ai-recognize input[type="number"] { width: 100%; max-width: 480px; }
.ai-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; font-size: 14px; }
.ai-item input[type="text"], .ai-item select { width: auto; }
.ai-item .ai-name { flex: 1 1 auto; min-width: 120px; }
.ai-empty { color: var(--muted); font-size: 13.5px; }
#ai-results h3 { margin: 16px 0 8px; font-size: 15px; }

/* ===== v40: 地図からの店舗追加ダイアログ ===== */
.add-store-dialog { position: fixed; inset: 0; z-index: 2000; background: rgba(30, 20, 25, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.add-store-dialog[hidden] { display: none; }
.add-store-card { background: #fff; border-radius: 12px; padding: 20px; max-width: 420px; width: 100%; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.add-store-card h3 { margin: 0 0 8px; }
.add-store-card label { display: block; margin-bottom: 12px; font-size: 14px; }
.add-store-card label > span { display: block; font-weight: 600; margin-bottom: 4px; }
.add-store-card input[type="text"] { width: 100%; }
.add-store-actions { display: flex; gap: 10px; margin-top: 12px; }
.map-add-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 54px; z-index: 900; background: #333; color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
#pr-rakuten-link { margin-top: 8px; }

/* ===== v43: スマホ向けPR帯（一覧の直後） / 履歴のもっと見る ===== */
.pr-strip-card { display: none; }
@media (max-width: 1023px) {
  .pr-strip-card { display: block; }
  .pr-strip-text { margin: 6px 0 10px; }
  .pr-strip-actions { display: flex; flex-wrap: wrap; gap: 8px; }
}
.history-more { margin-top: 10px; }

/* ===== v43: 一覧ページ（/stores.html）のタブ ===== */
.list-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.list-tab { border: 1.5px solid var(--accent, #d94f63); background: #fff; color: inherit; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.list-tab.active { background: var(--accent, #d94f63); color: #fff; }
.list-panel .store-card-list { margin-top: 12px; }
.pager { margin: 14px 0; text-align: center; }
.u-mt12 { margin-top: 12px; }
.u-mt8 { margin-top: 8px; }
.u-ml10 { margin-left: 10px; }
.u-block { display: block; }
.u-strong { font-weight: 600; margin-right: 8px; }
