/* 公式サイト inafes.jp のトップに合わせた色 */
:root {
  --sky: #28ADF2;
  --sky-deep: #0483C8;
  --grass: #90D849;
  --cream: #FFFEE8;
  --cream-2: #FFF6D1;
  --orange: #F37E2A;
  --orange-deep: #C55018;   /* 白い小さな文字を載せる面（白との差 4.6:1） */
  --btn: #F66700;
  --red: #EA482A;
  --yellow: #FFE150;
  --navy: #014D99;
  --ink: #333333;
  --ink-2: #5A5A5A;
  --line: #E9E2C2;
  --font: "Noto Sans JP", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--ink); background: var(--cream-2);
  -webkit-text-size-adjust: 100%; line-height: 1.6;
  /* 日本語を文節で改行する（Chrome 系。iPhone は BudouX が受け持つ）。最後の行が1〜2文字にならないようにする */
  word-break: auto-phrase; text-wrap: pretty; line-break: strict;
}
budoux-ja { display: inline; }
h2, h3, .nm { text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:active { filter: brightness(.92); }

/* 上の帯 */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; background: var(--sky); color: #fff;
}
.brand { display: flex; flex-direction: column; gap: 0; min-width: 0; white-space: nowrap; line-height: 1.2; }
.brand-name { font-weight: 900; font-size: 19px; letter-spacing: .02em; }
.brand-sub { font-weight: 700; font-size: 12px; }
.days { display: flex; background: rgba(255,255,255,.25); border-radius: 999px; padding: 3px; flex: none; }
.days button {
  border: 0; background: transparent; color: #fff; font-weight: 900; font-size: 15px;
  padding: 8px 12px; border-radius: 999px; line-height: 1.2; white-space: nowrap; min-height: 44px;
}
.days button small { font-size: 12px; font-weight: 700; }
.days button[aria-selected="true"] { background: #fff; color: var(--navy); }

.sample {
  margin: 0; padding: 8px 16px; background: var(--yellow); color: var(--ink);
  font-size: 13px; font-weight: 700;
}

/* 検索と絞り込み */
.finder { padding: 12px 16px 0; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--orange);
  border-radius: 999px; padding: 0 8px 0 14px; height: 48px;
}
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--orange-deep); stroke-width: 2.4; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 16px; background: transparent; }
.search input::-webkit-search-cancel-button { display: none; }
.clear { flex: none; position: relative; isolation: isolate; border: 0; background: none; width: 44px; height: 44px; margin-right: -6px; font-size: 16px; line-height: 1; }
.clear::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #EEE; z-index: -1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 0; scrollbar-width: none; scroll-padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 700; min-height: 44px;
}
.chip .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.chip[aria-pressed="true"] { background: var(--orange-deep); border-color: var(--orange-deep); color: #fff; }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px #fff; }
.facility .chip { border-color: #CFE9F8; color: var(--navy); }
.facility .chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* 地図 */
.mapwrap { position: relative; margin: 12px 16px 0; scroll-margin-top: 8px; border-radius: 16px; overflow: hidden; background: var(--grass); border: 3px solid #fff; box-shadow: 0 4px 0 rgba(1,77,153,.12); }
#map { display: block; width: 100%; height: 360px; height: clamp(280px, 62svh, 560px); touch-action: none; user-select: none; -webkit-user-select: none; }
.zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.zoom button {
  min-width: 44px; height: 44px; border: 0; border-radius: 10px; background: #fff; color: var(--navy);
  font-weight: 900; font-size: 18px; box-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.zoom #zfit { font-size: 13px; }
.legend {
  display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; background: rgba(255,255,255,.92);
  font-size: 12px; font-weight: 700; color: var(--ink);
}
/* 地図の左上の件数（押すと一覧へ） */
.map-count {
  position: absolute; left: 8px; top: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.map-count.none { background: var(--red); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* SVG の中身 */
.v-area-label { font-size: 13px; font-weight: 900; fill: var(--ink-2); }
.v-booth rect { stroke: #fff; stroke-width: 1.5; transition: opacity .2s; }
.v-booth text { font-size: 9px; font-weight: 700; fill: #fff; pointer-events: none; }
.v-booth.empty rect { fill: #fff; opacity: .55; stroke: #DDD; }
.v-booth.empty text { fill: #999; }
.v-booth.dim { opacity: .18; }
.v-booth.hit rect { stroke: var(--navy); stroke-width: 3; }
.v-booth.sel rect { stroke: var(--red); stroke-width: 4; }
.v-fac rect { fill: #fff; stroke: var(--navy); stroke-width: 2; }
.v-fac text { font-size: 12px; font-weight: 900; fill: var(--navy); pointer-events: none; }
.v-fac.dim { opacity: .35; }
.v-fac.sel rect { fill: var(--yellow); stroke: var(--red); stroke-width: 4; }
.v-pin { pointer-events: none; }

/* 一覧 */
.results { padding: 16px 16px 8px; scroll-margin-top: 8px; }
.results h2 { font-size: 15px; margin: 0 0 8px; color: var(--navy); }
#list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#list li button {
  width: 100%; text-align: left; display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center;
  background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 56px;
}
#list li button[aria-current="true"] { border-color: var(--red); }
.no { font-weight: 900; font-size: 15px; color: #fff; border-radius: 8px; text-align: center; padding: 6px 0; }
.tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nm { font-weight: 700; font-size: 15px; line-height: 1.4; }
.meta { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.empty-msg { background: #fff; border-radius: 12px; padding: 16px; font-size: 14px; }

/* 下から出るカード */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 12px calc(12px + var(--safe-b)); pointer-events: none; }
.sheet-card {
  position: relative; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 18px;
  border: 3px solid var(--orange); padding: 14px 16px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  pointer-events: auto;
}
.sheet-close { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #F2F2F2; font-size: 20px; }
.sheet-booth { display: inline-block; font-weight: 900; font-size: 13px; color: #fff; background: var(--orange-deep); border-radius: 6px; padding: 2px 10px; }
.sheet-card h3 { margin: 6px 44px 4px 0; font-size: 19px; line-height: 1.4; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-tags span { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 10px; color: #fff; }
.sheet-items { margin: 8px 0 0; font-weight: 700; font-size: 14px; }
.sheet-pr { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }

.foot { padding: 16px 16px calc(120px + var(--safe-b)); font-size: 13px; color: var(--ink-2); text-align: center; }
.foot p { margin: 0 0 4px; }
.foot a { color: var(--sky-deep); display: inline-block; padding: 12px 4px; }

/* 一覧を下まで見たときの「検索・地図へ戻る」 */
.to-top {
  position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 25; min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 999px; background: var(--orange-deep); color: #fff; font-size: 15px; font-weight: 900;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.to-top[hidden], .sheet:not([hidden]) ~ .to-top { display: none; }

@media (min-width: 720px) {
  .finder, .results, .foot { max-width: 760px; margin-left: auto; margin-right: auto; }
  .mapwrap { max-width: 728px; margin-left: auto; margin-right: auto; }
}
