:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --text: #17262b;
  --muted: #566a71;
  --border: #cfdadd;
  --accent: #0a748a;       /* 白文字で 5:1 以上 */
  --accent-hover: #085f72;
  --accent-soft: #e3f3f6;
  --accent-tint: #eef8fa;  /* プランパネルの地色 */
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-soft: #fff6df;
  --star: #b26b00;
  --focus: #0a8ca8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a1d;
    --surface: #17262b;
    --text: #e8f1f3;
    --muted: #9fb4ba;
    --border: #2e444b;
    --accent: #1aa6c2;
    --accent-hover: #3bb9d3;
    --accent-soft: #12333b;
    --accent-tint: #0f2328;
    --danger: #ff8a80;
    --danger-soft: #3a1c1a;
    --warn-soft: #34290f;
    --star: #ffb74d;
    --focus: #5fd0e6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  overflow-wrap: anywhere;
}
main, .site-header, .site-footer { max-width: 720px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.site-header { padding-top: 16px; padding-bottom: 4px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.35rem; }
.brand img { display: block; width: 44px; height: 44px; }
.brand-h1 { margin: 0; font-size: inherit; line-height: inherit; font-weight: inherit; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.form { margin-top: 12px; display: grid; gap: 14px; }
.field { min-width: 0; }
label, legend { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
input[type=text], input[type=date], select {
  width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px; font: inherit; font-size: 16px; /* iOSの自動ズーム防止 */
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
input[type=date] { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.row3 { align-items: end; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row3 label { font-size: 0.78rem; }

.msg { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 0.9rem; font-weight: 600; }
.more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--accent); }
.more-body { display: grid; gap: 14px; padding-top: 4px; }
.checks { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checks legend { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 10px; font-weight: 500; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

button { font: inherit; }
button.primary, a.btn {
  display: block; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 1.15rem; font-weight: 800; text-align: center; text-decoration: none;
}
@media (prefers-color-scheme: dark) { button.primary, a.btn { color: #04222a; } }
button.primary:hover, a.btn:hover { background: var(--accent-hover); }
button.primary:disabled { opacity: .65; cursor: progress; }
button.secondary { display: block; width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: var(--surface); color: var(--accent); border: 2px solid var(--accent); font-weight: 700; }
button.secondary:disabled { opacity: .65; cursor: progress; }
a.btn { min-height: 48px; font-size: 1rem; padding: 12px; }
a.btn.small { min-height: 44px; font-size: 0.95rem; padding: 10px; }

.status { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.status h2 { margin: 0 0 6px; font-size: 1.05rem; }
.status p { margin: 0 0 10px; }
.status.error { border-color: var(--danger); }
.status button { max-width: 360px; }
.status > :last-child { margin-bottom: 0; }

.result-head { margin: 20px 0 8px; }
.result-head h2 { margin: 0; font-size: 1.15rem; }
.result-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.result-head .note { padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--text); }

.result-meta { display: flex; align-items: flex-start; gap: 4px; }
.result-meta p { flex: 1; min-width: 0; }
.share-btn { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 44px; min-height: 44px; margin: 0 -4px 0 8px; padding: 0 4px 0 10px;
  border: 0; border-left: 1px solid var(--border); border-radius: 0; background: none; color: var(--accent); font-size: 0.68rem; font-weight: 700; line-height: 1.1; cursor: pointer; }
.share-btn:hover { color: var(--accent-hover); }
.result-head .share-status { margin: 4px 0 0; font-size: 0.9rem; font-weight: 700; color: var(--accent); text-align: right; }
.result-head .share-status:empty { display: none; }
.share-fallback { margin-top: 6px; }
.share-fallback[hidden] { display: none; }
.result-head .share-hint { margin: 0 0 4px; font-weight: 700; color: var(--text); }
input.share-url { width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hotel { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 12px; padding: 12px; }
.thumb { width: 104px; height: 78px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hotel h3 { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.meta { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.star { color: var(--star); font-weight: 800; }
.plan { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.85rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-box { grid-column: 1 / -1; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.price-label { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.price { margin: 0; font-size: 1.55rem; font-weight: 800; line-height: 1.3; }
.price small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.price-sub { margin: 0; font-size: 0.82rem; color: var(--muted); }
.hotel .action { grid-column: 1 / -1; margin-top: 8px; display: grid; gap: 8px; }
.jump-note { margin: 0; font-size: 0.78rem; color: var(--muted); text-align: center; }
.hotel { scroll-margin-top: 8px; }
.plans { grid-column: 1 / -1; margin: 8px 0 4px; padding: 0 10px 12px; min-width: 0;
  background: var(--accent-tint); border: 2px solid var(--accent); border-radius: 12px; }
.plans-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  margin: 0 -10px 10px; padding: 4px 10px 4px 12px; min-height: 52px;
  background: var(--surface); border-bottom: 2px solid var(--accent); border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 8px -4px rgba(0,0,0,.25); }
.plans-bar-text { flex: 1; min-width: 0; }
.plans-bar-text p { margin: 0; }
.plans-bar-name { font-weight: 800; font-size: 0.92rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plans-bar-count { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.plans-close { flex: none; min-width: 72px; min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; font-weight: 800; font-size: 0.95rem; }
@media (prefers-color-scheme: dark) { .plans-close { color: #04222a; } }
.plans-close:hover { background: var(--accent-hover); }
.plans-body > button.plans-end { margin-top: 12px; }
.plans[hidden], .plan-row[hidden] { display: none; }
.plans-title { margin: 0 0 6px; font-weight: 700; }
.plans-text { margin: 0 0 10px; font-size: 0.9rem; color: var(--muted); }
.plans-body > button.secondary { margin-top: 8px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); min-width: 0; }
.plan-row p { margin: 0; }
.plan-name { font-weight: 700; font-size: 0.95rem; line-height: 1.4; }
.plan-room { font-size: 0.82rem; color: var(--muted); }
.plan-meal { margin-top: 2px; font-size: 0.82rem; font-weight: 700; color: var(--accent); }
.plan-price { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.plan-price small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.plan-row .price-label { margin-top: 6px; }
.plan-row a.btn { margin-top: 8px; }
.info-link { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 0.9rem; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.info-link:hover { color: var(--accent-hover); }
.plan-desc { margin-top: 6px; }
.plan-desc summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 0.88rem; font-weight: 700; color: var(--accent); }
.plan-desc p { margin: 0 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface); font-size: 0.85rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.no-link { margin: 0; font-size: 0.85rem; color: var(--muted); }

.more-wrap { margin: 16px 0 8px; }
.shown { margin: 0 0 8px; text-align: center; color: var(--muted); font-size: 0.9rem; }

.site-footer { margin-top: 20px; padding-top: 10px; padding-bottom: 16px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); }
.site-footer p { margin: 0 0 6px; line-height: 1.6; }
.site-footer a { color: var(--muted); }
.field[hidden] { display: none; }
.credit img { max-width: 100%; height: auto; }
.credit a { display: inline-block; background: #fff; padding: 2px; border-radius: 4px; }

/* 温泉地ページ・トップの「温泉地から探す」 */
form[hidden] { display: none; }
.hero { margin-top: 12px; }
.hero h1 { margin: 0 0 6px; font-size: 1.4rem; line-height: 1.35; }
.hero .intro { margin: 0 0 6px; }
.hero-sub { margin: 0 0 4px; font-size: 0.85rem; color: var(--muted); }
.hero-sub a { color: var(--accent); }
.date-hint { margin: 6px 0 0; font-size: 0.9rem; font-weight: 700; color: var(--accent); }
.date-hint[hidden] { display: none; }
input[type=date].need-date { border: 2px solid var(--accent); }
.spa-links { margin-top: 24px; }
/* 「2時間で行ける温泉地」「温泉地から探す」の見出し。左の帯で見出しらしくする（2026-11-08） */
.spa-links h2 { margin: 0 0 10px; padding-left: 10px; border-left: 4px solid var(--accent);
  font-size: 1.1rem; line-height: 1.4; color: var(--text); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text); font-size: 0.9rem; text-decoration: none; }
.chips a:hover { background: var(--accent-soft); }
.region { margin: 0 0 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.region summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px;
  cursor: pointer; font-weight: 700; list-style: none; }
.region summary::-webkit-details-marker { display: none; }
.region summary::after { content: "＋"; color: var(--muted); }
.region[open] summary::after { content: "－"; }
.region .chips { padding: 0 12px 12px; }

/* 食事バッジ・並べ替え */
.meal { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 800; line-height: 1.7; vertical-align: 1px; }
.meal-none { background: var(--bg); color: var(--muted); border: 1px solid var(--border); line-height: 1.5; }
.sortbar { margin: 10px 0 0; }
.sortbar-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sort-btn { min-height: 48px; padding: 6px 8px; border: 2px solid var(--accent); border-radius: 12px; background: var(--surface); color: var(--accent);
  font-size: 0.9rem; font-weight: 700; cursor: pointer; line-height: 1.3; }
.sort-btn[aria-pressed=true] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .sort-btn[aria-pressed=true] { color: #04222a; } }
.result-head .sort-hint { margin: 6px 0 0; font-size: 0.8rem; }

/* リスト / 地図の切り替えと地図（Leaflet は地図を開いたときに初めて読み込む） */
.view-toggle { margin: 0 0 12px; }
.view-toggle[hidden] { display: none; }
.view-toggle button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; padding: 0 16px;
  border: 2px solid var(--accent); border-radius: 12px; background: var(--surface); color: var(--accent); font-size: 1rem; font-weight: 800; cursor: pointer; }
.view-toggle button:hover { background: var(--accent-soft); }
.map-wrap { margin: 0 0 12px; max-width: 100%; }
.map-wrap[hidden], .map-loading[hidden] { display: none; }
.map-loading { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; }
#map { width: 100%; max-width: 100%; height: 460px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--accent-soft); }
@media (max-width: 559px) { #map { height: 60vh; min-height: 280px; } }
.map-wrap .leaflet-container { font: inherit; font-size: 0.9rem; }
.map-wrap .leaflet-control-attribution { font-size: 0.8rem; padding: 2px 6px; color: #333; }
.map-wrap .leaflet-control-attribution a { color: #0b5f73; text-decoration: underline; }
.map-wrap .pin-icon { background: none; border: 0; }
.map-wrap .pin { --pin-bg: var(--accent); position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 8px)); display: block; white-space: nowrap;
  padding: 1px 7px; border: 2px solid var(--surface); border-radius: 8px; background: var(--pin-bg); color: #fff;
  font-size: 0.78rem; font-weight: 800; line-height: 1.4; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
/* 吹き出しの先端が宿の位置。白い縁の三角の上に、本体色の三角を重ねる */
.map-wrap .pin::before, .map-wrap .pin::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left-style: solid; border-right-style: solid; border-top-style: solid; border-left-color: transparent; border-right-color: transparent; }
.map-wrap .pin::before { bottom: -11px; border-width: 10px 7px 0; border-top-color: var(--surface); }
.map-wrap .pin::after { bottom: -8px; border-width: 8px 5px 0; border-top-color: var(--pin-bg); }
@media (prefers-color-scheme: dark) { .map-wrap .pin { color: #04222a; } }
.map-wrap .pin-nop { --pin-bg: var(--surface); color: var(--text); border-color: var(--accent); }
.map-wrap .pin-center { --pin-bg: var(--text); color: var(--bg); border-color: var(--bg); font-size: 0.8rem; }
.map-wrap .leaflet-marker-icon:focus-visible .pin { outline: 3px solid var(--focus); outline-offset: 2px; }
.map-wrap .leaflet-popup-content-wrapper, .map-wrap .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.map-wrap .leaflet-popup-content { margin: 12px 14px; font-size: 0.9rem; line-height: 1.5; }
.map-wrap a.leaflet-popup-close-button { color: var(--muted); }
.pin-pop p { margin: 0 0 4px; }
.pin-pop-name { font-weight: 800; font-size: 0.95rem; }
.pin-pop-label { font-size: 0.8rem; color: var(--muted); }
.pin-pop-price { font-size: 1.2rem; font-weight: 800; }
.map-wrap .pin-pop a.btn { margin-top: 8px; color: #fff; }
@media (prefers-color-scheme: dark) { .map-wrap .pin-pop a.btn { color: #04222a; } }
.pin-pop button.secondary.small { margin-top: 8px; min-height: 44px; }
.hotel:focus { outline: none; }
.hotel.hl { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (min-width: 560px) {
  .hotel { grid-template-columns: 160px minmax(0, 1fr); }
  .thumb { width: 160px; height: 120px; }
}
@media (prefers-reduced-motion: no-preference) {
  .spinner { display: inline-block; width: 1em; height: 1em; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; vertical-align: -2px; margin-right: 8px; animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}

/* トップの「場所」欄: 複数の温泉地に合ったときの候補リンク（見た目は温泉地一覧の .chips を使う） */
.place-choices { margin-top: 8px; }
.place-choices[hidden] { display: none; }
.choices-title { margin: 0 0 6px; font-size: 0.9rem; font-weight: 700; color: var(--accent); }

/* 旅のジャンルへのリンク（トップの上部）。見た目は .chips を使う */
.genre-links { margin: 12px 0 0; }
.chips a.ext { border-style: dashed; color: var(--muted); }
.chips a.ext small { margin-left: 6px; font-size: 0.7rem; }
.hero-chips { margin: 8px 0 4px; }

/* 検索前の一覧（日付を入れる前の宿。カードは検索結果と同じ .hotel） */
.prelist { margin: 20px 0 8px; }
.prelist[hidden] { display: none; }
.prelist h2 { margin: 0; font-size: 1.15rem; line-height: 1.4; }
.prelist .prelist-note { margin: 4px 0 12px; color: var(--muted); font-size: 0.9rem; }
.prelist .card[hidden] { display: none; }
.prelist-more-wrap { margin: 12px 0 0; text-align: center; }
.hotel-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* 出発地ページ（/from/）とリンク。リンクの見た目は .chips を使う */
.origin-links { margin: 8px 0 0; }
.links-label { margin: 0 0 4px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.chips a small { margin-left: 6px; font-size: 0.75rem; color: var(--muted); }
.origin-hub { margin: 16px 0; }
.origin-list { margin: 16px 0; }
.origin-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.origin-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; }
.origin-spa { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.origin-min { font-weight: 700; text-align: right; }
.origin-route { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); }
.access-note { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.access-note a { color: var(--accent); }
