/* ============================================================
   ヒトアセ / HITOASE — 銭湯の暖簾 × スポーツタオル
   生成り地に藍（暖簾）、汗＝朱赤。データの正確さが売りなので
   飾りは青海波の気配だけに絞り、情報は端正に組む。
   ============================================================ */

:root {
  --bg: #F5F1E8;            /* 生成り（タオル地） */
  --bg-deep: #ECE6D8;
  --card: #FFFFFF;
  --ink: #253038;           /* 墨に近い藍鼠 */
  --ink-2: rgba(37, 48, 56, .72);   /* 小サイズ文字用に4.5:1以上を確保 */
  --ink-3: rgba(37, 48, 56, .40);
  --line: rgba(37, 48, 56, .14);
  --ai: #274A78;            /* 藍・暖簾 */
  --ai-deep: #1D3A61;
  --accent: #E8502E;        /* 朱・汗（装飾・大きい文字用） */
  --accent-text: #B23517;   /* 朱の文字用（白・accent-soft地で4.5:1以上） */
  --accent-soft: #FBE9E2;
  --ok: #3E7C4F;
  --nav-h: 58px;
  --hdr-h: 62px;
  --seg-h: 44px;
  --radius: 12px;
  --font-latin: "Avenir Next", "Avenir", "Segoe UI", sans-serif;
  --font: var(--font-latin), "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  --seigaiha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cg fill='none' stroke='%23274A78' stroke-width='1'%3E%3Cpath d='M2 20a18 18 0 0 1 36 0M8 20a12 12 0 0 1 24 0M14 20a6 6 0 0 1 12 0'/%3E%3Cpath d='M-18 10a18 18 0 0 1 36 0M-12 10a12 12 0 0 1 24 0M-6 10a6 6 0 0 1 12 0'/%3E%3Cpath d='M22 10a18 18 0 0 1 36 0M28 10a12 12 0 0 1 24 0M34 10a6 6 0 0 1 12 0'/%3E%3C/g%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* display指定のある要素（.seg等）でもhidden属性を効かせる */
[hidden] { display: none !important; }

html { height: 100%; }

body {
  height: 100%;
  font-family: var(--font);
  font-feature-settings: "palt";
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

a { color: var(--ai); }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- ヘッダー：暖簾 ---------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 1100;
  height: calc(var(--hdr-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(rgba(245, 241, 232, .92), rgba(245, 241, 232, .92)),
    var(--seigaiha) var(--bg);
  background-size: auto, 40px 20px;
  border-top: 4px solid var(--ai);       /* 暖簾の竿 */
  border-bottom: 1px solid var(--line);
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  color: var(--ai-deep);
}

.logo em {
  font-style: normal;
  color: var(--accent);
}

.logo .drop {
  width: 13px;
  height: 13px;
  margin-left: 3px;
  fill: var(--accent);
  align-self: center;
  transform: translateY(2px);
}

.romaji {
  font-family: var(--font-latin);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--ink-2);
  margin-top: 1px;
}

.cnt {
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ai);
  white-space: nowrap;
}

body.offline .cnt::after {
  content: "オフライン";
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--ink-3);
  border-radius: 99px;
}

/* ---------- 都市セグメント ---------- */
.seg {
  position: sticky;
  top: calc(var(--hdr-h) + env(safe-area-inset-top));
  z-index: 1090;
  display: flex;
  gap: 6px;
  padding: 8px 16px 6px;
  background: var(--bg);
}

.seg button {
  flex: 1;
  height: 32px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  transition: all .18s ease;
}

.seg button.on {
  background: var(--ai);
  border-color: var(--ai);
  color: #fff;
}

/* ---------- 絞り込みバー ---------- */
.chips {
  position: sticky;
  top: calc(var(--hdr-h) + var(--seg-h) + env(safe-area-inset-top));
  z-index: 1080;
  background: linear-gradient(var(--bg) 70%, rgba(245, 241, 232, 0));
  padding: 2px 16px 10px;
}

.filter-bar { display: flex; gap: 8px; align-items: center; }

.fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  font-size: 12px;
  transition: border-color .18s ease;
}

.fb-btn.on { border-color: var(--accent); }

.fb-k { color: var(--ink-2); font-weight: 600; }
.fb-v { font-weight: 800; color: var(--ink); }
.fb-btn.on .fb-v { color: var(--accent-text); }
.fb-caret { color: var(--ink-3); font-size: 10px; }

.fb-clear {
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ai);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- メイン ---------- */
#view {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

/* 地図モードは全画面 */
#app.map-mode #view {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- カード ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; }

.card {
  position: relative;
  display: flex;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--gc, var(--ai));
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(37, 48, 56, .05);
  animation: card-in .4s ease both;
  transition: transform .15s ease, box-shadow .15s ease;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 48, 56, .10);
  }
}

.card-main {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 12px 4px 12px 14px;
  text-decoration: none;
  color: inherit;
}

.card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }

.gchip {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--gc, var(--ai));
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 0 5px;
  line-height: 1.7;
}

.gchip.big { font-size: 12px; padding: 1px 8px; }

.card-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-top { align-items: flex-start; }
.card-top .gchip { margin-top: 2px; }

.card-access {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
}

.card-fee {
  font-family: var(--font-latin);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-top: 4px;
}

.unknown { font-size: 12px; font-weight: 500; color: var(--ink-2); }

/* 営業時間は一覧では1行に省略し、全文は詳細で見せる */
.card-hours {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-hours::before {
  content: "営業 ";
  font-weight: 600;
  color: var(--ink-2);
}

.card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.bdg {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 8px;
  background: var(--bg);
}

.bdg.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, #fff);
}

/* 鮮度警告：情報全体にかかる注意なので黄土色で区別する */
.bdg.stale {
  color: #8A6100;
  font-weight: 700;
  border-color: rgba(138, 97, 0, .4);
  background: #FBF3E0;
}

.warn {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(138, 97, 0, .3);
  background: #FBF3E0;
  color: #6B4C00;
  font-size: 12.5px;
  line-height: 1.7;
}

.verified-days { color: var(--ink-2); font-weight: 500; }

.report-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ai);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 性別制限は行けるかどうかを左右するので目立たせる */
.bdg.gender {
  color: var(--accent-text);
  font-weight: 700;
  border-color: color-mix(in srgb, var(--accent-text) 55%, transparent);
  background: var(--accent-soft);
}

.gender-note { display: block; font-weight: 700; color: var(--accent-text); }
.gender-sub { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.save-btn {
  flex-shrink: 0;
  width: 46px;
  border: 0;
  background: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: grid;
  place-items: center;
}

.save-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.8;
  transition: all .15s ease;
}

.save-btn.on svg {
  fill: var(--accent);
  stroke: var(--accent);
  animation: pop .25s ease;
}

@keyframes pop {
  50% { transform: scale(1.25); }
}

/* ---------- 詳細 ---------- */
.detail { animation: card-in .3s ease both; }

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 4px;
}

.back-btn {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ai);
}

.detail-title { margin: 6px 0 8px; }

.detail-title h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 6px;
}

.dsec {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 12px;
}

.dsec h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--ai);
  margin-bottom: 8px;
}

.fee-sec { border-left: 4px solid var(--gc, var(--ai)); }

.fee-big {
  font-family: var(--font-latin);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.dlist .drow {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
}

.dlist .drow:first-child { border-top: 0; }

.dlist dt { color: var(--ink-2); font-weight: 600; }
.dlist dd { min-width: 0; overflow-wrap: anywhere; }

.detail-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; }
.detail-links.col { flex-direction: column; gap: 8px; align-items: flex-start; }

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ai);
  text-decoration: none;
  border-bottom: 1.5px solid color-mix(in srgb, var(--ai) 30%, transparent);
  padding-bottom: 1px;
  overflow-wrap: anywhere;
}

.ext-link svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

.verified {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.note { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; }

/* ---------- 地図 ---------- */
.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.lmap {
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
}

.leaflet-container { font-family: var(--font); }

.leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255, 255, 255, .75) !important;
}

.pin-wrap { background: none; border: 0; }

.pin {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 3px rgba(37, 48, 56, .35));
  transition: transform .15s ease;
  transform-origin: 50% 95%;
}

.pin svg {
  width: 100%;
  height: 100%;
  fill: var(--gc, var(--ai));
  stroke: #fff;
  stroke-width: 1.6;
}

.pin-wrap.sel .pin { transform: scale(1.3); }

.pin-cluster { background: none; border: 0; }

.cluster-inner {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ai);
  color: #fff;
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(37, 48, 56, .35);
}

.map-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  max-width: 560px;
  margin: 0 auto;
  animation: sheet-in .22s ease both;
}

.map-card .card { box-shadow: 0 8px 24px rgba(37, 48, 56, .22); }

/* ---------- ボトムシート ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(37, 48, 56, .38);
  display: flex;
  align-items: flex-end;
  animation: fade-in .18s ease both;
}

@keyframes fade-in { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom));
  animation: sheet-in .25s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  margin: 2px auto 10px;
}

.sheet-h {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--ai);
  margin: 12px 0 8px;
}

.sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.sheet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all .15s ease;
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gc, var(--ink-3));
}

.sheet-chip.on {
  border-color: var(--gc, var(--ai));
  color: var(--ink);
  background: color-mix(in srgb, var(--gc, var(--ai)) 8%, #fff);
}

.sheet-chip.cond.on,
.sheet-chip.gender.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.sheet-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  gap: 12px;
}

.sheet-clear {
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ai);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet-clear:disabled {
  color: var(--ink-3);
  text-decoration: none;
  cursor: default;
}

.sheet-done {
  height: 42px;
  padding: 0 28px;
  border: 0;
  border-radius: 99px;
  background: var(--ai);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
}

body.sheet-open { overflow: hidden; }

/* ---------- 保存 ---------- */
.saved-groups { display: flex; flex-direction: column; gap: 6px; }

.saved-city {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--ai);
  margin: 14px 0 8px;
  padding-left: 2px;
}

/* ---------- ナビ ---------- */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
}

.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
  color: var(--ink-2);
  position: relative;
  transition: color .15s ease;
}

.nav a svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.nav a.on { color: var(--accent-text); }
.nav a.on svg { stroke: var(--accent); }

.nav a.on::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

/* ---------- 空状態・起動 ---------- */
.empty, .boot {
  text-align: center;
  padding: 64px 24px 48px;
  color: var(--ink-2);
  font-size: 14px;
}

.empty svg {
  width: 44px;
  height: 44px;
  fill: color-mix(in srgb, var(--ai) 22%, transparent);
  stroke: none;
  margin-bottom: 12px;
}

.empty p { font-weight: 600; }
.empty .note { max-width: 300px; margin: 6px auto 0; font-weight: 500; }

.link-btn {
  display: inline-block;
  margin-top: 16px;
  border: 0;
  background: none;
  font-size: 13.5px;
  color: var(--ai);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn.strong {
  font-weight: 800;
  text-decoration: none;
  background: var(--ai);
  color: #fff;
  padding: 10px 24px;
  border-radius: 99px;
}

.boot .spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 14px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.boot.err { line-height: 2; }

/* ---------- フッター ---------- */
.site-foot {
  margin-top: 36px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.site-foot a { color: var(--ink-2); }

#app.map-mode .site-foot { display: none; }

/* ---------- aboutページ ---------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.page h1 { font-size: 20px; margin: 16px 0 12px; color: var(--ai-deep); }
.page h2 { font-size: 15px; margin: 24px 0 8px; color: var(--ai); }
.page p, .page li { font-size: 14px; color: var(--ink); }
.page ul { padding-left: 20px; margin: 8px 0; }

/* ---------- モーション配慮 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- デスクトップ ---------- */
@media (min-width: 900px) {
  .seg, .chips { max-width: 640px; margin: 0 auto; }
  .seg { left: 0; right: 0; }
  #app.map-mode .map-card { max-width: 420px; margin-left: auto; margin-right: 24px; }
}

/* ---------- 現在地 ---------- */
.here-wrap { background: none; border: 0; }

.here-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1A73E8;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(37, 48, 56, .4);
}

.here-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(26, 115, 232, .35);
  animation: here-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes here-pulse {
  from { transform: scale(1); opacity: .8; }
  to { transform: scale(3); opacity: 0; }
}

.geo-ctl { margin-bottom: 8px !important; }

.geo-btn {
  display: block;
  border: 0;
  background: var(--card);
  color: var(--ai);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 7px 9px;
  border-radius: 4px;
}

.card-dist {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ai);
  font-variant-numeric: tabular-nums;
}

.geo-consent-text {
  font-size: 13.5px;
  line-height: 1.8;
  margin: 4px 0;
}

.geo-consent-text.sub {
  font-size: 12px;
  color: var(--ink-2);
}
