/* 背景道路はGoogleマップの正規描画。形状や画像に加工を加えない。 */
body { height: 100dvh; }
#map { background: #eef0f2; }
.partner-map-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
  font-family: inherit;
  z-index: 10;
}
.partner-map-popup {
  padding: 10px;
  background: #1e2025;
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 7px;
  max-height: min(220px, 25dvh);
  overflow: auto;
}

/* 既存のRemyカラーを保った、カテゴリーと簡潔な店舗一覧。 */
.category-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 6px;
  margin-bottom: 7px;
  scrollbar-width: thin;
  scrollbar-color: #756327 transparent;
  overscroll-behavior-x: contain;
}
.category-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid #42454e;
  border-radius: 20px;
  background: #252830;
  color: #e4e5e9;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
}
.category-button[aria-pressed="true"] {
  color: #121316;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: bold;
}
.category-count { margin-left: 5px; font-size: .72rem; opacity: .8; }
.browse-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.browse-controls .list-order { margin: 0; }
.map-toggle {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: transparent;
  color: var(--gold-light);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.search-note { margin-top: 6px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.partner-guide { flex: 0 0 auto; color: var(--text-sub); font-size: .78rem; line-height: 1.55; }
.partner-guide p { margin: 0 0 6px; }
.partner-list-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.partner-list-links a { color: var(--gold-light); text-underline-offset: 3px; padding-block: 3px; }
.partner-list-links a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.list-heading { flex: 0 0 auto; margin: 4px 0 0; color: var(--gold-light); font-size: .9rem; line-height: 1.45; }
.shop-card { display: block; flex: 0 0 auto; padding: 0; }
.shop-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  margin: 0;
  list-style: none;
  cursor: pointer;
  min-height: 66px;
  border-radius: 6px;
}
.shop-card .card-header::-webkit-details-marker { display: none; }
.summary-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shop-card .shop-name { font-size: .95rem; }
.shop-kind { font-size: .78rem; color: var(--text-sub); line-height: 1.4; }
.detail-chevron {
  color: var(--gold);
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: transform .15s;
  line-height: 1;
}
.shop-card[open] .detail-chevron { transform: rotate(90deg); }
.shop-card[open] .card-header { border-bottom: 1px solid #343843; border-radius: 6px 6px 0 0; }
.shop-details { padding: 12px 14px 14px; }
.shop-card:not([open]) .shop-details { display: none; }
.detail-number { color: var(--gold-light); font-size: .76rem; margin-bottom: 7px; }
.shop-details .shop-info { margin-bottom: 12px; }
.popup-kind { color: var(--gold-light); font-size: .78rem; margin-bottom: 7px; }
.empty-state { margin: 0; }
@media (max-width: 380px) {
  .category-button { padding-inline: 11px; }
  .shop-card .card-header { padding: 11px 12px; }
  .shop-details { padding-inline: 12px; }
  .map-toggle { padding-inline: 9px; }
}

/* ナイト／デイと地域の大きな切り替え。ヘッダー直下で地図の文脈を先に選べる。 */
.map-mode-controls {
  flex: 0 0 auto;
  padding: 9px 12px 8px;
  background: #18191d;
  border-bottom: 1px solid #2e3038;
}
.mode-tabs,
.region-tabs {
  display: flex;
  gap: 7px;
}
.mode-tabs { margin-bottom: 7px; }
.mode-button,
.region-button {
  min-height: 38px;
  border: 1px solid #4a4e58;
  border-radius: 7px;
  background: #252830;
  color: #e4e5e9;
  font: inherit;
  cursor: pointer;
}
.mode-button {
  flex: 1 1 50%;
  padding: 9px 12px;
  color: var(--gold-light);
  font-size: 1rem;
  font-weight: bold;
}
.region-tabs { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #756327 transparent; }
.region-button {
  flex: 1 0 auto;
  padding: 7px 11px;
  font-size: .8rem;
  white-space: nowrap;
}
.mode-button[aria-pressed="true"],
.region-button[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #121316;
  font-weight: bold;
}

/* 日中の企業詳細。カードは会社ごとに一つ、拠点情報だけを中で分ける。 */
.company-description {
  margin: 0 0 10px;
  color: #e4e5e9;
  font-size: .84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.company-info { margin-bottom: 11px; }
.locations-heading {
  margin: 12px 0 6px;
  color: var(--gold-light);
  font-size: .82rem;
}
.location-detail {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #343843;
  border-radius: 6px;
  background: #191b20;
}
.location-name {
  margin: 0 0 5px;
  color: #f1f2f4;
  font-size: .84rem;
  line-height: 1.4;
}
.location-info,
.verification-note,
.popup-location-label {
  font-size: .78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.location-info { color: var(--text-sub); }
.location-buttons { margin-top: 9px; }
.company-buttons { margin-top: 12px; }
.verification-note {
  margin: 11px 0 0;
  padding-left: 8px;
  border-left: 2px solid var(--gold);
  color: var(--gold-light);
}
.popup-location-label { margin: -3px 0 6px; color: var(--text-sub); }

/* ロゴを残しつつ、正式な長い名称はモバイルで自然に改行する。 */
.logo-title > span:not(.sr-only) {
  white-space: normal;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

/* prepare_site.py が挿入する JavaScript 無効時のデイ静的フォールバック。 */
.static-day-partners {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #3a3d46;
}
.static-day-partners > h2 {
  margin: 0 0 10px;
  color: var(--gold-light);
  font-size: 1rem;
}
.static-partner-card {
  margin: 8px 0;
  border: 1px solid #343843;
  border-left: 4px solid var(--gold);
  border-radius: 7px;
  background: #1e2025;
}
.static-partner-card > summary {
  padding: 11px 12px;
  color: var(--gold-light);
  cursor: pointer;
  font-weight: bold;
}
.static-partner-card > :not(summary) { margin: 0 12px 11px; }
.partner-location {
  padding: 9px;
  border: 1px solid #343843;
  border-radius: 6px;
  background: #191b20;
}
.partner-location + .partner-location { margin-top: 8px; }
.partner-location h3 { margin: 0 0 4px; font-size: .84rem; }
.partner-location p { margin: 0; color: var(--text-sub); font-size: .8rem; line-height: 1.5; }
.partner-location a { color: var(--gold-light); }

@media (max-width: 430px) {
  .brand-logo { width: 72px; height: 43px; }
  .logo-title { gap: 8px; }
  .logo-title > span:not(.sr-only) { font-size: clamp(.74rem, 3.4vw, .96rem); }
  .map-mode-controls { padding: 7px 9px; }
  .mode-tabs,
  .region-tabs { gap: 5px; }
  .mode-tabs { margin-bottom: 5px; }
  .mode-button { min-height: 36px; padding: 7px 5px; font-size: .88rem; }
  .region-button { min-height: 33px; padding: 6px 8px; font-size: .74rem; }
}

/* 高さ568〜736px級の携帯も含め、操作部に押し出されず一覧をスクロールできる。 */
@media (max-height: 750px) {
  header { min-height: 43px; padding-block: 4px; }
  .brand-logo { width: 58px; height: 34px; }
  .logo-title > span:not(.sr-only) { font-size: clamp(.68rem, 2.8vw, .82rem); }
  .shop-count { padding: 2px 7px; font-size: .7rem; }
  .map-mode-controls { padding-block: 5px; }
  .mode-tabs { margin-bottom: 4px; }
  .mode-button { min-height: 31px; padding-block: 5px; font-size: .83rem; }
  .region-button { min-height: 28px; padding-block: 4px; font-size: .7rem; }
  .search-bar { padding-block: 5px; }
  .category-tabs { margin-bottom: 4px; padding-bottom: 3px; }
  .category-button { min-height: 31px; padding-block: 4px; }
  .search-note { display: none; }
  .browse-controls { margin-top: 5px; }
  .shop-list { min-height: 72px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .logo-title > span:not(.sr-only) { font-size: .72rem; }
  .map-mode-controls { display: flex; gap: 12px; align-items: center; }
  .mode-tabs, .region-tabs { flex: 1 1 50%; min-width: 0; }
  .mode-tabs { margin-bottom: 0; }
}

/* スマホも地図と操作部を固定し、一覧だけを内部スクロール。 */
@media (max-width: 760px), (pointer: coarse) and (max-height: 550px) {
  body { height: 100dvh; min-height: 0; overflow: hidden; }
  .map-region { height: clamp(160px, 36dvh, 300px); min-height: 120px; flex: 0 1 auto; }
  .shop-list { flex: 1 1 0; min-height: min(140px, 23dvh); overflow-y: auto; overscroll-behavior: contain; }
  .map-mode-controls { padding: 5px 9px; }
  .map-mode-controls .mode-button { min-height: 36px; padding-block: 6px; }
  .map-mode-controls .region-button { min-height: 32px; padding-block: 5px; }
  .category-button { min-height: 36px; padding-block: 5px; }
  .search-bar { padding: 5px 10px; }
  .category-tabs { margin-bottom: 4px; padding-bottom: 3px; }
  .browse-controls { margin-top: 4px; }
  .map-toggle, .clear-search { min-height: 36px; padding: 6px 8px; }
  .search-bar input { font-size: 16px; }
  .search-note { display: none; }
  .shop-list { scroll-behavior: auto; }
}
@media (orientation: landscape) and (max-height: 550px) and (max-width: 1000px) {
  body { height: 100dvh; overflow: hidden; display: grid; grid-template-columns: 48% 52%; grid-template-rows: auto auto auto minmax(0, 1fr); }
  header { grid-column: 1 / -1; }
  .map-mode-controls { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; }
  .mode-tabs, .region-tabs { flex: 1 1 50%; margin-bottom: 0; }
  .map-region { grid-column: 1; grid-row: 3 / 5; height: 100%; min-height: 0; }
  .search-bar { grid-column: 2; grid-row: 3; }
  .shop-list { grid-column: 2; grid-row: 4; min-height: 0; overflow-y: auto; }
  body.map-hidden .search-bar, body.map-hidden .shop-list { grid-column: 1 / -1; }
}

.map-actions {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 500;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
}
.map-actions > button {
  position: static;
  min-height: 36px;
  padding: 7px 9px;
  font: inherit;
  font-size: .72rem;
  border-radius: 6px;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  background: #1e2025;
  cursor: pointer;
}
.map-actions .map-expand { background: #d4af37; color: #121316; font-weight: bold; }
@media (max-width: 380px), (max-height: 550px) and (orientation: landscape) {
  .map-actions { right: 6px; top: 6px; gap: 4px; }
  .map-actions > button { padding: 6px; font-size: .65rem; }
}
body.map-expanded { position: fixed; width: 100%; overflow: hidden; }
body.map-expanded .map-region {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 2000;
}
body.map-expanded .partner-map-popup { max-height: min(320px, 45dvh); }
