:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #5d6670;
  --line: #d9dee3;
  --soft: #f3f5f7;
  --accent: #0b5cad;
  --c-food: #d9480f;
  --c-stay: #1c6ed6;
  --c-exp: #2b8a3e;
  --c-spot: #8e3aa8;
  --fav: #f08c00;
  --shadow: 0 2px 12px rgba(0, 0, 0, .15);
  --top-h: 132px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1e22;
    --fg: #e8eaed;
    --muted: #a3abb5;
    --line: #3a4048;
    --soft: #262a30;
    --accent: #6cb3ff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
}
a { color: var(--accent); }

/* ---- 上部バー ---- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 3;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: max(8px, env(safe-area-inset-top)) 16px 8px;
}
.title { font-size: 17px; margin: 0 0 6px; letter-spacing: .02em; }
.search input {
  width: 100%; font-size: 16px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--soft); color: var(--fg);
}
.chips { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  border-radius: 999px; padding: 4px 12px; font-size: 14px; cursor: pointer;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip .n { color: var(--muted); font-size: 12px; }
/* 選んでいるカテゴリ(「すべて」を含む)は塗りつぶす */
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip[aria-pressed="true"] .n { color: #dbe9ff; }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px #fff; }

/* ---- 地図とパネル ---- */
.layout { position: fixed; inset: var(--top-h) 0 0 0; }
.map { position: absolute; inset: 0; }

.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  height: 45%;
  transition: height .2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.panel[data-state="min"] { height: 64px; }
.panel[data-state="full"] { height: calc(100% - 12px); }
.handle {
  border: 0; background: transparent; padding: 8px 0 2px; cursor: pointer; width: 100%;
}
.handle span { display: block; margin: 0 auto; width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.panel-head {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
  padding: 0 16px 6px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.count { font-weight: 600; margin-right: auto; }
.toggle { color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.panel-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.note { font-size: 11px; color: var(--muted); padding: 6px 16px 8px; border-top: 1px solid var(--line); }
.panel[data-state="min"] .panel-body,
.panel[data-state="min"] .note { display: none; }

/* ---- 並び順・絞り込み ---- */
.panel-head select, .filter-btn {
  font-size: 13px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
}
.filter-btn { cursor: pointer; }
.filter-btn[aria-expanded="true"] { background: var(--soft); }
#filterCount:not(:empty) {
  margin-left: 4px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px;
}
.filters { padding: 8px 16px 10px; border-bottom: 1px solid var(--line); max-height: 45vh; overflow-y: auto; background: var(--soft); }
.filter-sec { margin-bottom: 10px; }
.filter-title { font-size: 13px; font-weight: 700; margin: 4px 0 6px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; margin-bottom: 4px; }
.filter-row .toggle { color: var(--fg); }
.filter-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.filter-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.filter-foot .btn { cursor: pointer; font-family: inherit; }
.filter-foot .link-btn { padding: 0; }

/* いま効いている条件(個別に ✕ で外せる) */
.active-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 16px; border-bottom: 1px solid var(--line); font-size: 13px; background: #fff4e6;
}
@media (prefers-color-scheme: dark) { .active-bar { background: #3a2a14; } }
.active-bar[hidden] { display: none; }
.active-label { color: var(--muted); font-size: 12px; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--fav); background: var(--bg);
  color: var(--fg); border-radius: 999px; padding: 2px 6px 2px 10px; font-size: 13px; cursor: pointer;
}
.active-chip span { color: var(--muted); font-size: 11px; }
.active-bar .link-btn { padding: 0; }
.tab-n:not(:empty) {
  margin-left: 4px; background: var(--fav); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 600;
}
/* 飲食のジャンル: スマホは横にスワイプ、PCは折り返して全部見せる */
.genre-bar {
  display: flex; gap: 6px; padding: 6px 16px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.genre-bar::-webkit-scrollbar { display: none; }
.genre-bar[hidden] { display: none; }
.genre-bar .tag-chip { flex: none; }
@media (min-width: 860px) { .genre-bar { flex-wrap: wrap; overflow: visible; } }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer;
}
.tag-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-chip .n { color: var(--muted); font-size: 11px; margin-left: 3px; }
.tag-chip[aria-pressed="true"] .n { color: #dbe9ff; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 6px 0 0; font-size: 13px; cursor: pointer; }

/* ---- 一覧 ---- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px;
  padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.list .star {
  grid-column: 3; grid-row: 1 / span 2; align-self: center;
  border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
}
.list .star:hover { background: var(--line); }
.list .star[aria-pressed="true"] { color: var(--fav); }
.list li:hover, .list li:focus-visible { background: var(--soft); outline: none; }
.list .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.list .name { font-weight: 600; }
.list .sub { grid-column: 2; color: var(--muted); font-size: 13px; }
.list .fav-mark { color: var(--fav); margin-left: 4px; }
.list .dist { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.badge {
  display: inline-block; font-size: 11px; padding: 0 6px; margin-left: 6px;
  border-radius: 4px; border: 1px solid var(--line); color: var(--muted); font-weight: 400;
  vertical-align: 1px;
}
.badge.warn { border-color: #e8590c; color: #e8590c; }
.empty { padding: 24px 16px; color: var(--muted); }
.list li.empty { display: block; cursor: default; }
.list li.empty:hover { background: none; }
.list li.empty .btn { margin-top: 10px; cursor: pointer; font-family: inherit; }

/* ---- お気に入り ---- */
.fav-lead { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.fav-list { list-style: none; margin: 0; padding: 0; }
.fav-list li {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.fav-list .num {
  width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.fav-name {
  border: 0; background: none; color: var(--fg); text-align: left; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; min-width: 0;
}
.fav-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.fav-ops { display: inline-flex; gap: 4px; }
.mini {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); cursor: pointer; font-size: 15px;
}
.mini:disabled { opacity: .35; cursor: default; }
#viewFavs .actions .btn { cursor: pointer; font-family: inherit; }
#viewFavs .btn:disabled { opacity: .5; cursor: default; }

/* ---- 詳細 ---- */
.detail { padding: 12px 16px 20px; }
.detail .back {
  border: 0; background: none; color: var(--accent); padding: 0; font-size: 14px; cursor: pointer;
}
.detail h2 { font-size: 19px; margin: 8px 0 2px; }
.detail .head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 10px;
  padding: 6px 10px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.icon-btn[aria-pressed="true"] { color: var(--fav); border-color: var(--fav); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; }
.tags li { font-size: 12px; background: var(--soft); border-radius: 4px; padding: 1px 7px; color: var(--muted); }
.detail .cat { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.detail dl { display: grid; grid-template-columns: 5.5em 1fr; gap: 6px 10px; margin: 0 0 12px; font-size: 14px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn {
  display: inline-block; text-decoration: none; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--fg); background: var(--soft); font-size: 14px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.detail details { font-size: 13px; color: var(--muted); }
.detail details ul { padding-left: 18px; margin: 6px 0; }
.detail details li { overflow-wrap: anywhere; }
.caution { font-size: 13px; color: #e8590c; margin: 6px 0; }

/* ---- PC: 左に一覧 ---- */
@media (min-width: 860px) {
  :root { --top-h: 64px; }
  .topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
  .title { margin: 0; white-space: nowrap; }
  .search { width: 320px; }
  .chips { margin: 0; }
  .panel, .panel[data-state] {
    top: 0; bottom: 0; right: auto; width: 380px; height: auto;
    border-radius: 0; box-shadow: 1px 0 0 var(--line);
  }
  .panel[data-state="min"] .panel-body, .panel[data-state="min"] .note { display: block; }
  .handle { display: none; }
  .panel-head { padding-top: 10px; }
  .map { left: 380px; }
}

.maplibregl-popup-content { color: #1f2328; font-size: 14px; padding: 8px 12px; }

/* ---- 右端のパネル(モデルコース・季節・お役立ち) ---- */
.drawer-ctrl button {
  display: block; width: auto; min-width: 72px; height: auto; padding: 8px 10px;
  font-size: 13px; font-weight: 600; color: #1f2328; background: #fff; cursor: pointer;
}
.drawer-ctrl button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.drawer {
  position: absolute; z-index: 5; inset: 0;
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.drawer[hidden] { display: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 17px; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 16px 16px; -webkit-overflow-scrolling: touch; }
.drawer-body[hidden] { display: none; }

/* コースを地図に出しているときの帯(地図の左上) */
.course-banner {
  position: absolute; z-index: 1; top: 10px; left: 10px; max-width: calc(100% - 130px);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg); border: 2px solid var(--fav); border-radius: 10px;
  padding: 4px 10px; font-size: 13px; box-shadow: var(--shadow);
}
.course-banner[hidden] { display: none; }
.course-banner .link-btn { padding: 0; font-weight: 600; }

@media (min-width: 860px) {
  .drawer { inset: 0 0 0 auto; width: 380px; }
  /* PCは地図の左上。右上のボタン(幅 約140px)と右のパネルに重ならない幅にする */
  .course-banner { left: 392px; max-width: min(460px, calc(100% - 532px)); }
  body.drawer-open .course-banner { max-width: min(460px, calc(100% - 912px)); }
  /* 右のパネルを開いている間は、地図のボタンをパネルの左に寄せる */
  body.drawer-open .maplibregl-ctrl-top-right,
  body.drawer-open .maplibregl-ctrl-bottom-right { right: 380px; }
}

/* 近くのお気に入り・最近見た */
.near-favs { background: var(--soft); border-radius: 8px; padding: 8px 12px; margin: 4px 0 10px; }
.near-favs h3 { font-size: 13px; margin: 0 0 4px; color: var(--muted); }
.near-favs ul { list-style: none; margin: 0; padding: 0; }
.near-favs .fav-name { display: flex; align-items: center; gap: 6px; width: 100%; }
.near-favs .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.near-favs .dist { margin-left: auto; color: var(--muted); font-size: 12px; }
.tab[hidden] { display: none; }
.recent-list { margin: 0 -16px 8px; }

/* 設定 */
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.opt span { display: flex; flex-direction: column; gap: 2px; }
.opt small { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ピンを押したときのカード */
.card-popup .maplibregl-popup-content { padding: 10px 12px; border-radius: 10px; }
.spot-card h3 { margin: 2px 0; font-size: 15px; line-height: 1.4; padding-right: 14px; }
.spot-card .card-sub { margin: 0; font-size: 12px; color: #5d6670; display: flex; align-items: center; gap: 6px; }
.spot-card .card-sub .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.spot-card .card-meta { margin: 0 0 8px; font-size: 12px; color: #5d6670; }
.spot-card .card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.spot-card .btn { font-size: 13px; padding: 5px 10px; background: #fff; color: #1f2328; border-color: #d9dee3; }
.spot-card .btn.primary { background: #0b5cad; color: #fff; border-color: #0b5cad; }
.spot-card .star { font-size: 20px; background: none; border: 0; cursor: pointer; color: #f08c00; }

/* 背景地図の切り替え(地図の右上) */
.basemap-ctrl select {
  display: block; border: 0; background: #fff; color: #1f2328;
  font-size: 13px; padding: 6px 8px; min-height: 29px; border-radius: 4px; cursor: pointer;
}

/* ---- 言語・タブ・ビュー ---- */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lang-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  border-radius: 8px; padding: 2px 10px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  flex: none; border: 0; background: none; color: var(--muted); padding: 6px 10px 8px; font-size: 14px;
  border-bottom: 3px solid transparent; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view[hidden] { display: none; }
.view.panel-body { display: block; padding: 8px 16px 16px; }
.view.panel-body[hidden] { display: none; }
.shared-note { font-size: 13px; margin: 8px 0 0; padding: 6px 8px; border-radius: 6px; background: var(--soft); }

.card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.card.active { border-color: #f08c00; box-shadow: 0 0 0 1px #f08c00 inset; }
.card h3 { font-size: 16px; margin: 2px 0 4px; }
.card p { margin: 4px 0; font-size: 14px; }
.card .btn { margin: 6px 0; cursor: pointer; font-family: inherit; }
.stops { margin: 6px 0 0; padding-left: 22px; font-size: 14px; }
.stops li { margin: 4px 0; }
.spot-links { display: flex; flex-wrap: wrap; gap: 6px; }
.spot-link {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg);
  color: var(--fg); border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; text-align: left;
}
.spot-link .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 10px; }
.month {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 8px;
  padding: 4px 0; font-size: 13px; cursor: pointer; position: relative;
}
.month.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.month small { position: absolute; top: 0; right: 3px; font-size: 8px; color: #e8590c; }
.emg { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 6px 0; font-size: 14px; }
.emg dd { margin: 0; }
.tel { font-weight: 700; font-size: 16px; text-decoration: none; }

/* ---- 印刷: 一覧だけを紙に出す ---- */
@media print {
  body { overflow: visible; }
  .topbar, .map, .handle, .tabs, .panel-head, .filters, .active-bar, .drawer, .course-banner, .list .star,
  .maplibregl-control-container { display: none !important; }
  .layout, .panel { position: static !important; height: auto !important; width: auto !important; box-shadow: none; }
  .panel-body { overflow: visible; }
  .list li { break-inside: avoid; padding: 4px 0; }
  .note { border: 0; }
}

/* スマホでは下部の注意書きを隠す(同じ内容は「お役立ち」タブにある) */
@media (max-width: 859px) {
  .note { display: none; }
}

/* ================================================================
   ボタンのデザイン(丸み・影・押したときの反応)
   ================================================================ */
:root { --radius: 999px; --ctrl-shadow: 0 2px 10px rgba(0, 0, 0, .16); }
button, select { font-family: inherit; }
button, .btn, .chip, .tag-chip, .lang-btn, .icon-btn, .mini, .filter-btn {
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
}
button:active:not(:disabled), .btn:active { transform: scale(.97); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 上のバー */
.top-actions { display: inline-flex; gap: 6px; }
.lang-btn {
  border-radius: var(--radius); padding: 4px 12px; font-size: 13px; font-weight: 600;
  background: var(--soft); border-color: transparent;
}
.lang-btn:hover { border-color: var(--line); }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.search input { border-radius: var(--radius); padding: 9px 16px; border-color: transparent; }
.search input:focus { outline: none; border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px rgba(11, 92, 173, .15); }

/* カテゴリ: 色の丸に種類の1文字(凡例の代わり) */
.chip { padding: 5px 12px 5px 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.chip.all { padding-left: 12px; }
.chip:hover { border-color: var(--accent); }
.chip .dot.lt {
  width: 20px; height: 20px; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 一覧の上の並び順・絞り込み */
.panel-head select, .filter-btn {
  border-radius: var(--radius); padding: 6px 12px; font-weight: 600; font-size: 13px;
  background: var(--soft); border-color: transparent; cursor: pointer;
}
.panel-head select:hover, .filter-btn:hover { border-color: var(--line); }

/* タブ: 角の丸い切り替えボタン */
.tabs { gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-radius: var(--radius); padding: 6px 14px; font-weight: 600; }
.tab:hover { background: var(--soft); }
.tab[aria-selected="true"] { background: var(--accent); color: #fff; }
.tab[aria-selected="true"] .tab-n:not(:empty) { background: #fff; color: var(--accent); }

/* ボタン類 */
.btn {
  border-radius: var(--radius); padding: 9px 16px; font-weight: 600; cursor: pointer;
  border-color: transparent; background: var(--soft);
}
.btn:hover { border-color: var(--line); }
.btn.primary { box-shadow: 0 2px 8px rgba(11, 92, 173, .3); }
.btn.primary:hover { filter: brightness(1.08); }
.icon-btn { border-radius: var(--radius); padding: 6px 14px; font-weight: 600; background: var(--soft); border-color: transparent; }
.mini { border-radius: 12px; background: var(--soft); border-color: transparent; }
.mini:hover:not(:disabled) { border-color: var(--line); }
.tag-chip { padding: 4px 12px; }
.active-chip { padding: 3px 8px 3px 12px; }
.card { border-radius: 16px; }
.near-favs { border-radius: 14px; }
.drawer-head .icon-btn { padding: 6px 14px; }

/* 地図の上のボタン(背景地図・ピンの表示・コース/季節/お役立ち・ズーム) */
.maplibregl-ctrl-group { border-radius: 14px !important; box-shadow: var(--ctrl-shadow) !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.basemap-ctrl, .drawer-ctrl { background: transparent !important; box-shadow: none !important; overflow: visible; }
.basemap-ctrl select {
  -webkit-appearance: none; appearance: none;
  border-radius: var(--radius); padding: 8px 32px 8px 14px; min-height: 36px; font-weight: 600;
  box-shadow: var(--ctrl-shadow);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231f2328' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.drawer-ctrl { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.drawer-ctrl button {
  width: auto; height: auto; min-width: 84px; border-radius: var(--radius) !important;
  padding: 8px 14px; box-shadow: var(--ctrl-shadow); border: 0 !important;
}
.drawer-ctrl button + button { border-top: 0 !important; }
.drawer-ctrl button:hover { background: #f1f4f8; }
.drawer-ctrl button[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .drawer-ctrl button[aria-pressed="true"] { color: #10243a; } }

/* ピンのカード */
.card-popup .maplibregl-popup-content { border-radius: 16px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.spot-card .btn { border-radius: var(--radius); padding: 6px 12px; }
.course-banner { border-radius: var(--radius); padding: 6px 14px; }

/* 1. 暗い表示では強調色が明るい水色になるので、上に乗る文字は濃い紺にする(白だと読みにくい) */
@media (prefers-color-scheme: dark) {
  :root { --on-accent: #0d2238; }
  .chip[aria-pressed="true"], .tag-chip[aria-pressed="true"], .tab[aria-selected="true"],
  .lang-btn[aria-pressed="true"], .btn.primary, #filterCount:not(:empty) { color: var(--on-accent); }
  .chip[aria-pressed="true"] .n, .tag-chip[aria-pressed="true"] .n { color: #1d3d5e; }
  .tab[aria-selected="true"] .tab-n:not(:empty) { background: var(--on-accent); color: #fff; }
  .chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--on-accent); }
}

/* 2. PCでは「設定」「English」を上のバーの右端に置き、検索欄を広く取る */
@media (min-width: 860px) {
  .title-row { display: contents; }
  .top-actions { order: 9; margin-left: auto; flex: none; }
  .chips { flex: 1; min-width: 0; }
}

/* 3. 背景地図とピンの表示をまとめた「地図」ボタン */
.layer-ctrl { position: relative; z-index: 5; }
.layer-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: #fff; color: #1f2328; font-size: 13px; font-weight: 600;
  border-radius: var(--radius); padding: 8px 14px; box-shadow: var(--ctrl-shadow);
}
.layer-btn:hover { background: #f1f4f8; }
.layer-btn[aria-expanded="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .layer-btn[aria-expanded="true"] { color: var(--on-accent); } }
.layer-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 3; width: 220px;
  background: #fff; color: #1f2328; border-radius: 16px; padding: 10px 12px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
}
.layer-panel[hidden] { display: none; }
.layer-title { margin: 4px 0 6px; font-size: 12px; font-weight: 700; color: #5d6670; }
.layer-title + .basemap-ctrl { margin-bottom: 8px; }
.layer-panel .basemap-ctrl { margin: 0 !important; float: none; }
.layer-panel .basemap-ctrl select { width: 100%; box-shadow: none; background-color: #f1f4f8; }

/* ================================================================
   色の決まり: 押せるものは青
   - 主なボタン・選んでいるもの: 濃い青で塗る
   - それ以外の押せるボタン: 薄い青の背景 + 青い文字
   - 地図の上のボタン: 白い背景 + 青い文字
   - オレンジは お気に入り(☆)とコースだけ。カテゴリの色は丸とピンだけ
   - 「設定」「English」は色を変えず、枠でボタンと分かるようにする
   ================================================================ */
:root { --accent-soft: #e6effa; --accent-ink: #0b5cad; --accent-line: #b9d0ea; }
@media (prefers-color-scheme: dark) {
  :root { --accent-soft: #1c3048; --accent-ink: #8cc4ff; --accent-line: #2f4d70; }
}

/* それ以外の押せるボタン */
.btn, .icon-btn, .mini, .filter-btn, .tag-chip, .chip, .active-chip, .seg button, .tab {
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid transparent;
}
.btn:hover, .icon-btn:hover, .mini:hover:not(:disabled), .filter-btn:hover, .tag-chip:hover, .chip:hover,
.active-chip:hover, .seg button:hover, .tab:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.chip .n, .tag-chip .n { color: var(--accent-ink); opacity: .75; }
.active-chip { border-color: var(--accent-line); }
.filter-btn[aria-expanded="true"] { border-color: var(--accent); }

/* 主なボタン・選んでいるもの */
.btn.primary, .chip[aria-pressed="true"], .tag-chip[aria-pressed="true"], .seg button[aria-pressed="true"],
.tab[aria-selected="true"], .choices button[aria-pressed="true"], .icon-btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.chip[aria-pressed="true"] .n, .tag-chip[aria-pressed="true"] .n { color: #fff; opacity: .85; }
@media (prefers-color-scheme: dark) {
  .btn.primary, .chip[aria-pressed="true"], .tag-chip[aria-pressed="true"], .seg button[aria-pressed="true"],
  .tab[aria-selected="true"], .choices button[aria-pressed="true"], .icon-btn[aria-pressed="true"] { color: var(--on-accent); }
  .chip[aria-pressed="true"] .n, .tag-chip[aria-pressed="true"] .n { color: var(--on-accent); }
}
/* お気に入りの「☆」はオレンジのまま */
#favBtn[aria-pressed="true"] { background: var(--fav); border-color: var(--fav); color: #fff; }

/* 並び順の切り替え(名前順 / 近い順) */
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--accent-soft); }
.seg button {
  border: 0; border-radius: var(--radius); padding: 5px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: transparent;
}
.seg button:hover { border: 0; background: rgba(11, 92, 173, .08); }

/* 地図の上のボタン: 白 + 青い文字 */
.layer-btn, .drawer-ctrl button { background: #fff; color: #0b5cad; }
.layer-btn:hover, .drawer-ctrl button:hover { background: #eef4fb; }
.layer-btn[aria-expanded="true"], .drawer-ctrl button[aria-pressed="true"] { background: #0b5cad; color: #fff; }
@media (prefers-color-scheme: dark) {
  .layer-btn[aria-expanded="true"], .drawer-ctrl button[aria-pressed="true"] { background: #0b5cad; color: #fff; }
}

/* 「地図」ボタンの中の選択肢(背景地図・ピンの表示) */
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.choices button {
  border: 1px solid #b9d0ea; background: #e6effa; color: #0b5cad; border-radius: var(--radius);
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.choices button:hover { border-color: #0b5cad; }
.choices button[aria-pressed="true"] { background: #0b5cad; border-color: #0b5cad; color: #fff; }
.layer-panel { width: 250px; }

/* ピンのカード(地図の上なので明るい色で固定) */
.spot-card .btn { background: #e6effa; color: #0b5cad; border-color: transparent; }
.spot-card .btn.primary { background: #0b5cad; color: #fff; }

/* 「設定」「English」: 色はそのまま、枠でボタンと分かるようにする */
.lang-btn { border: 1.5px solid var(--muted); background: var(--bg); }
.lang-btn:hover { border-color: var(--fg); }
.lang-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .lang-btn[aria-pressed="true"] { color: var(--on-accent); } }

/* 一覧の上の行(件数・並び順・絞り込み)を1行に収める */
.panel-head { column-gap: 8px; }
@media (max-width: 420px) {
  .panel-head .count { font-size: 12px; }
  .seg button { padding: 5px 9px; }
  .filter-btn { padding: 6px 10px; }
}

/* スマホ: 一覧パネルのスワイプ */
.panel.dragging { transition: none; }
.handle { touch-action: none; padding: 10px 0 6px; }
@media (max-width: 859px) { .tabs { touch-action: pan-x; } }

/* ================================================================
   イベント
   ================================================================ */
.sv-tabs { margin: 0 0 12px; }
.ev-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ev-map-btn { white-space: nowrap; flex: none; }
.ev-map-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .ev-map-btn[aria-pressed="true"] { color: var(--on-accent); } }
.ev-note-top { font-size: 12px; color: var(--muted); margin: 0 0 8px; line-height: 1.6; }
.ev-day {
  position: sticky; top: 0; z-index: 1; margin: 14px 0 6px; padding: 6px 2px;
  font-size: 14px; background: var(--bg); border-bottom: 2px solid #e8590c;
}
.ev-day.now { color: #c2255c; border-color: #c2255c; }
.ev-card { border-left: 4px solid #e8590c; }
.ev-card.now { border-left-color: #c2255c; }
.ev-card h3 { margin: 2px 0 4px; }
.ev-when { font-weight: 700; margin: 0 0 4px; }
.ev-time { font-weight: 400; color: var(--muted); margin-left: 4px; }
.ev-rule { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.ev-badge {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px;
  background: #fff0e6; color: #a33a00; vertical-align: 1px;
}
.ev-badge.fixed { background: #e7f5ee; color: #1b6e43; }
.ev-badge.announced { background: var(--accent-soft); color: var(--accent-ink); }
.ev-badge.now { background: #c2255c; color: #fff; }
.ev-src { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 0; }
.ev-card.flash { animation: evflash 1.6s ease-out; }
@keyframes evflash { 0%, 40% { box-shadow: 0 0 0 3px #e8590c; } 100% { box-shadow: none; } }
@media (prefers-color-scheme: dark) {
  .ev-badge { background: #4a2a14; color: #ffc9a3; }
  .ev-badge.fixed { background: #173a2a; color: #9be3bd; }
}
/* 場所の詳細の「この場所のイベント」 */
.ev-spot { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ev-spot .cat { margin: 0; }
.ev-link {
  display: inline-flex; gap: 8px; align-items: center; text-align: left; cursor: pointer;
  border: 1px solid #f3c3a4; background: #fff4ec; color: #8a3300; border-radius: 12px; padding: 6px 12px; font-weight: 600;
}
.ev-link:hover { border-color: #e8590c; }
.ev-link-d { font-size: 12px; background: #e8590c; color: #fff; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .ev-link { background: #3a2312; border-color: #6b3b1a; color: #ffc9a3; }
}
.chip.ev-chip[aria-pressed="true"] { background: #e8590c; border-color: #e8590c; color: #fff; }
.chip.ev-chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px #fff; }
.chip.ev-chip[aria-pressed="true"] .n { color: #fff; }
