:root {
  --bg: #f4f6f7;
  --ink: #333a38;
  --muted: #6b7b7b;
  --line: #e2e8e8;
  --accent: #3aa76d;
  --shadow: 0 6px 24px rgba(20, 40, 40, 0.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.app { position: relative; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.map { position: relative; flex: 1; min-height: 0; }

/* ---- ヘッダー（通常表示のみ） ---- */
.head { padding: 10px 14px 6px; background: #fff; border-bottom: 1px solid var(--line); }
.head__title { font-size: 17px; font-weight: 800; }
.head__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- 分類チップ＋お店の絞り込み ---- */
.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 5px 11px 5px 7px; cursor: pointer; line-height: 1;
}
.chip__dot {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff;
}
.chip__dot svg { width: 12px; height: 12px; display: block; }
.chip__count { color: var(--muted); font-weight: 600; }
.chip.off { opacity: 0.45; }
.chip.off .chip__dot { background: #b9c3c3; }
.brand-select select {
  font: inherit; font-size: 12px; font-weight: 700; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  padding: 5px 26px 5px 11px; max-width: 220px;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #889 50%), linear-gradient(135deg, #889 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

/* ---- 大きな地図でひらく（埋め込みのみ） ---- */
.open-full {
  display: none;
  position: absolute; z-index: 5; right: 10px; bottom: calc(34px + var(--safe-bottom));
  font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: none;
  background: rgba(255,255,255,0.96); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 7px 12px; box-shadow: 0 2px 10px rgba(20,40,40,0.14);
}

/* ---- ウォーターマーク ---- */
.watermark {
  position: absolute; z-index: 4; left: 8px; bottom: calc(26px + var(--safe-bottom));
  width: 110px; height: auto; opacity: 0.8; pointer-events: none;
}

/* ---- 出典表示・スケール ---- */
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-scale {
  background: rgba(255, 255, 255, 0.85); border: 1.5px solid #b9c6c6; border-top: none;
  color: #334747; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 0 0 4px 4px;
}

/* ---- 詳細シート（スマホ＝下から／PC＝右側） ---- */
.sheet {
  position: absolute; z-index: 10; left: 0; right: 0; bottom: 0;
  max-height: 62%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 6px 16px calc(14px + var(--safe-bottom));
}
.sheet[hidden] { display: none; }
.sheet__grip { width: 38px; height: 4px; border-radius: 2px; background: #d5dddd; margin: 2px auto 8px; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet__name { font-size: 16px; font-weight: 800; line-height: 1.4; }
.sheet__addr { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.sheet__close {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: none;
  background: #eef2f2; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
}
.sheet__list { list-style: none; margin: 10px 0 0; padding: 0; }
.sheet__item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.sheet__icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff;
}
.sheet__icon svg { width: 15px; height: 15px; display: block; }
.sheet__brand { font-size: 14px; font-weight: 800; line-height: 1.4; }
.sheet__rank {
  display: inline-block; font-size: 10px; font-weight: 800; color: #fff; background: var(--c);
  border-radius: 4px; padding: 1px 5px; margin-right: 5px; vertical-align: 2px;
}
.sheet__product { font-size: 12px; color: var(--ink); margin-top: 1px; }
.sheet__store { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sheet__store a { color: var(--muted); }
.sheet__actions { margin-top: 10px; display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 14px; background: #fff;
}

@media (min-width: 769px) {
  .sheet {
    left: auto; right: 14px; top: 50%; bottom: auto; transform: translateY(-50%);
    width: 340px; max-height: 80%; border-radius: 16px; padding-top: 12px;
  }
  .sheet__grip { display: none; }
}

/* ---- 埋め込み（?embed=1）：記事内iframe用。ヘッダーを出さず、操作部を一回り小さく ---- */
.app--embed .head { display: none; }
.app--embed .open-full { display: inline-flex; }
.app--embed .controls { padding: 6px 8px; gap: 5px; }
.app--embed .chip { font-size: 11px; padding: 4px 9px 4px 5px; }
.app--embed .chip__dot { width: 16px; height: 16px; }
.app--embed .chip__dot svg { width: 11px; height: 11px; }
.app--embed .brand-select select { font-size: 11px; padding: 4px 24px 4px 9px; max-width: 170px; }
.app--embed .sheet { max-height: 70%; }
@media (max-width: 480px) {
  /* スマホの記事内は操作部を横スクロールの1段にして、地図の高さを残す */
  .app--embed .controls { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .app--embed .controls::-webkit-scrollbar { display: none; }
  .app--embed .chips { flex-wrap: nowrap; }
  .app--embed .chip, .app--embed .brand-select { flex: none; white-space: nowrap; }
  .app--embed .chip__count { display: none; }
  .app--embed .open-full { font-size: 10px; padding: 5px 9px; }
  .app--embed .watermark { width: 88px; }
}

/* ---- 横浜花博の会場（目印） ---- */
.landmark { display: flex; flex-direction: column-reverse; align-items: center; pointer-events: none; }
.landmark__pin {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #3aa76d; color: #fff; border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.28);
}
.landmark__pin svg { width: 15px; height: 15px; display: block; }
.landmark__label {
  margin-bottom: 4px; white-space: nowrap;
  font-size: 11px; font-weight: 800; color: #2a7a50;
  background: rgba(255,255,255,0.95); border: 1px solid #cfe6d8; border-radius: 8px; padding: 2px 8px;
  box-shadow: 0 2px 8px rgba(20,40,40,0.14);
}
