: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: "Hiragino Kaku Gothic ProN", "Yu Gothic", 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: #9aa7b1; }
.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: #9aa7b1;
}
.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; }
