/* ========================================
   Result Page - Compact Header Bar
   ======================================== */
.result-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
}
.result-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.result-bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.result-bar-count {
    font-size: 0.9375rem;
    color: #374151;
    white-space: nowrap;
}
.result-bar-count strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0369a1;
}
.result-bar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.result-bar-badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
}

/* ========================================
   Result Layout — メイン + サイドバー
   ======================================== */
.result-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.result-main {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.result-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- カード共通 --- */
.facility-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 0.875rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    isolation: isolate;
}
.facility-card:hover {
    box-shadow: 0 10px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.04);
    transform: translateY(-3px);
}

/* カードは常に縦並び（画像上・コンテンツ下） */

/* --- サービス種別バッジ（右上オーバーレイ） --- */
.facility-card-types {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.facility-card-types .facility-card-type {
    position: static;
}
.facility-card-type {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}
.facility-card-type--a {
    background: #e0f2fe;
    color: #0369a1;
}
.facility-card-type--b {
    background: #d1fae5;
    color: #065f46;
}
.facility-card-type--transition {
    background: #ede9fe;
    color: #5b21b6;
}
/* --- お気に入りボタン（左上） --- */
.facility-card-fav {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    padding: 0;
}
.facility-card-fav:hover {
    color: #facc15;
    background: rgba(255,255,255,0.95);
    transform: scale(1.1);
}
.facility-card-fav.is-bookmarked {
    color: #facc15;
}
.facility-card-fav svg {
    width: 16px;
    height: 16px;
}

/* --- 画像下辺グラデーション影（常に表示） --- */
.facility-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3rem;
    background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
    z-index: 1;
}

/* --- タグバッジ（画像下辺） --- */
.facility-card-tags {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
}
.facility-card-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    color: #1e293b;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    white-space: nowrap;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 画像エリアの上で影+半透明背景で視認性UP */
.facility-card .facility-card-types {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 9999px;
}
.facility-card .facility-card-types .facility-card-type {
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.facility-card .facility-card-type {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.facility-card .facility-card-type--a {
    background: rgba(224,242,254,0.9);
}
.facility-card .facility-card-type--b {
    background: rgba(209,250,229,0.9);
}
.facility-card .facility-card-type--transition {
    background: rgba(237,233,254,0.9);
}

/* --- 画像エリア --- */
.facility-card-image {
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}
.facility-card-image {
    position: relative;
    width: 100%;
    height: 160px;
}
@media (max-width: 767px) {
    .facility-card-image {
        height: 140px;
    }
}
.facility-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}
.facility-card:hover .facility-card-image img {
    transform: scale(1.06);
}

/* --- カード本文 --- */
.facility-card-body {
    flex: 1;
    min-width: 0;
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- 名前 --- */
.facility-card-name-group {
    min-width: 0;
    padding-right: 3.5rem; /* バッジ分の余白 */
}
.facility-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.facility-card:hover .facility-card-name {
    color: var(--card-type-color, #0369a1);
}
.facility-card-corp {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- メタ行（住所・電話）--- */
.facility-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.5;
}
.facility-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}
.facility-card-meta-icon {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    color: #94a3b8;
}
.facility-card-meta-item {
    max-width: 100%;
}
.facility-card-meta-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* --- 無限スクロール ローダー --- */
.infinite-loader,
.infinite-end {
    grid-column: 1 / -1;
}
.infinite-loader {
    display: flex;
    justify-content: center;
    padding: 0;
    min-height: 1px;
}
.infinite-loader .infinite-spinner {
    display: none;
}
.infinite-loader.active {
    padding: 2rem 0;
}
.infinite-loader.active .infinite-spinner {
    display: block;
}
.infinite-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.infinite-end {
    display: none;
    justify-content: center;
    padding: 1.5rem 0;
    font-size: 0.8125rem;
    color: #94a3b8;
}
.infinite-end.active {
    display: flex;
}

/* --- ページネーション（PCのみ表示） --- */
.pagination-bar {
    display: flex;
}
@media (max-width: 767px) {
    .pagination-bar {
        display: none;
    }
}

/* --- サイドバー: 検索ボックス --- */
.sidebar-search {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sidebar-search h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-search h3 svg {
    color: #0ea5e9;
    flex-shrink: 0;
}
.sidebar-search .field-group {
    margin-bottom: 0.75rem;
}
.sidebar-search .field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.375rem;
}
.sidebar-search .field-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.sidebar-search .field-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.08);
}
.field-inline-selects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
.field-input.field-select {
    appearance: none;
    padding-right: 1.875rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}
.field-input.field-select option {
    color: #0f172a;
}
.sidebar-toggle-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.sidebar-toggle-btn {
    padding: 0.375rem 0.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.375rem;
    background: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #374151;
}
.sidebar-toggle-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.sidebar-toggle-btn.active[data-value="A型"] {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}
.sidebar-toggle-btn.active[data-value="B型"] {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}
.sidebar-toggle-btn.active[data-value="移行型"] {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #5b21b6;
}
.sidebar-search-submit {
    width: 100%;
    padding: 0.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-weight: 700;
    font-size: 0.8125rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}
.sidebar-search-submit:hover {
    opacity: 0.9;
}
.sidebar-search-clear {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-search-clear:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* --- サイドバーカード --- */
.sidebar-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.sidebar-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.sidebar-card-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
}
.sidebar-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.sidebar-card:hover .sidebar-card-image img {
    transform: scale(1.05);
}
.sidebar-card-content {
    padding: 1rem 1.25rem 1.25rem;
}
.sidebar-card h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.sidebar-card p {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}
.sidebar-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0284c7;
    transition: color 0.2s;
}
.sidebar-card--guide .sidebar-card-link {
    color: #7c3aed;
}
.sidebar-card--nearby .sidebar-card-link {
    color: #059669;
}
.sidebar-card:hover .sidebar-card-link {
    text-decoration: underline;
}

/* --- モバイルレスポンシブ --- */
@media (max-width: 767px) {
    .result-layout {
        flex-direction: column;
    }
    .result-sidebar {
        display: none;
    }
    .result-main {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .facility-card-meta-text {
        white-space: normal;
    }
}
/* プレースホルダー画像の高さ調整 */
.facility-card-image .w-full.h-full {
    width: 100%;
    height: 100%;
}

/* ========================================
   Floating Search Button + Modal
   ======================================== */
.search-float-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    border-radius: 9999px;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s ease;
}
.search-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(14, 165, 233, 0.5);
}

/* モーダル */
.search-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.search-modal-overlay.open {
    display: flex;
}
.search-modal {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.search-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}
.search-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.15s;
}
.search-modal-close:hover {
    background: #e5e7eb;
}
.search-modal-body {
    padding: 1.5rem;
}
.search-modal-body .field-group {
    margin-bottom: 1.25rem;
}
.search-modal-body .field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}
.search-modal-body .field-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}
.search-modal-body .field-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.search-modal-body .field-input.field-select {
    background-position: right 0.75rem center;
}

/* モーダル内のトグルボタン */
.modal-toggle-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.modal-toggle-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #374151;
}
.modal-toggle-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.modal-toggle-btn.active[data-value="A型"] {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}
.modal-toggle-btn.active[data-value="B型"] {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}
.modal-toggle-btn.active[data-value="移行型"] {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #5b21b6;
}
.search-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}
.search-modal-submit {
    flex: 1;
    padding: 0.75rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9375rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.search-modal-submit:hover {
    opacity: 0.9;
}
.search-modal-submit-icon {
    display: inline;
    vertical-align: -2px;
    margin-right: 4px;
}
.search-modal-nearby {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid #34d399;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
}
.search-modal-nearby:hover {
    background: linear-gradient(135deg, #2cc48b 0%, #0f9f70 100%);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
}
.search-modal-clear {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.search-modal-clear:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.search-spa-panel {
    display: none;
}

.search-spa-panel.is-active {
    display: block;
}

.result-bar.is-hidden {
    display: none;
}

/* ========================================
   Map Search Panel
   ======================================== */
.map-search-panel {
    min-height: 520px;
}

.nearby-status {
    margin-bottom: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
}

.nearby-status.hidden {
    display: none;
}

.nearby-status-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.nearby-status-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.nearby-status-loading {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.map-search-layout {
    --map-panel-height: max(520px, calc(100vh - 180px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1rem;
    align-items: start;
}

.map-search-stage {
    position: relative;
    border-radius: 0.875rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    height: var(--map-panel-height);
    min-height: 520px;
}

.spa-map-canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.map-floating-controls {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.map-bottom-bar {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.map-bottom-bar > * {
    pointer-events: auto;
}

.map-mobile-icon-btn {
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 9999px;
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.18);
}

.map-mobile-icon-btn-geo {
    background: rgba(2, 132, 199, 0.95);
    color: #ffffff;
}

.map-mobile-icon-btn-filter {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    max-width: 170px;
    justify-content: flex-start;
    padding-right: 0.9rem;
    pointer-events: auto;
}

/* --- ピン表示時の色凡例 --- */
.map-pin-legend {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.18);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #334155;
    line-height: 1;
    white-space: nowrap;
}
.map-pin-legend.is-visible {
    display: inline-flex;
}
.map-pin-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.map-pin-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.map-pin-legend-dot--a  { background: #EF4444; }
.map-pin-legend-dot--b  { background: #3B82F6; }
.map-pin-legend-dot--tr { background: #10B981; }

#map-filter-summary {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- マーカー表示切替トグル --- */
.map-marker-toggle {
    display: inline-flex;
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(6px);
}
.map-marker-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    color: #64748b;
    transition: background 0.15s, color 0.15s;
}
.map-marker-toggle-btn:first-child {
    border-right: 1px solid #e2e8f0;
}
.map-marker-toggle-btn.is-active {
    background: rgba(2, 132, 199, 0.95);
    color: #ffffff;
}

/* --- マップ上カードマーカー --- */
.map-card-marker {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.22));
    transition: z-index 0s, filter 0.15s;
}
.map-card-marker.is-selected {
    z-index: 10;
    filter: drop-shadow(0 4px 12px rgba(2, 132, 199, 0.4));
}
.map-card-marker-inner {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ffffff;
    max-width: 170px;
    min-width: 100px;
    transition: border-color 0.15s;
}
.map-card-marker.is-selected .map-card-marker-inner {
    border-color: #0284c7;
}
.map-card-marker-photo {
    width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.map-card-marker-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.map-card-marker-photo svg {
    width: 20px;
    height: 20px;
    color: #94a3b8;
}
.map-card-marker-body {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}
.map-card-marker-name {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.map-card-marker-types {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.map-card-marker-type {
    font-size: 0.5625rem;
    font-weight: 600;
    line-height: 1;
}
.map-card-marker-type--a { color: #0ea5e9; }
.map-card-marker-type--b { color: #10b981; }
.map-card-marker-type--transition { color: #8b5cf6; }
.map-card-marker-inner--no-photo {
    max-width: 140px;
}
.map-card-marker-inner--no-photo .map-card-marker-body {
    padding: 5px 10px;
}
.map-card-marker-tail {
    width: 12px;
    height: 8px;
    margin: -1px auto 0;
}
.map-card-marker-tail polygon {
    fill: #ffffff;
}
.map-card-marker.is-selected .map-card-marker-tail polygon {
    fill: #0284c7;
}

.map-result-sidebar {
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    background: #ffffff;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    height: var(--map-panel-height);
    min-height: 520px;
    overflow: hidden;
}

.map-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.25rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.map-result-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
}

.map-result-count {
    font-size: 0.8125rem;
    color: #475569;
}

.map-result-count strong {
    font-size: 1.125rem;
    color: #0284c7;
    margin-right: 0.25rem;
}

.map-facility-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: block;
    padding-right: 0.125rem;
}

.map-facility-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
    min-height: 250px;
    margin-bottom: 0.75rem;
}

.map-facility-card:last-child {
    margin-bottom: 0;
}

.map-facility-card .facility-card-image {
    height: 148px;
}

.map-facility-card .facility-card-name {
    white-space: normal;
}

.map-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: flex-end;
}

.map-filter-modal.hidden {
    display: none !important;
}

.map-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.map-filter-sheet {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    padding: 1rem 0.875rem 1.125rem;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.2);
    max-height: min(70vh, 520px);
    overflow: auto;
}

.map-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.map-filter-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.map-filter-close {
    border: none;
    background: #e2e8f0;
    color: #334155;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    font-size: 1rem;
    line-height: 1;
}

.map-filter-group + .map-filter-group {
    margin-top: 0.875rem;
}

.map-filter-label {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.map-filter-chip-row {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.map-filter-chip {
    border: none;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(6px);
}

.map-filter-chip.is-active {
    background: #0ea5e9;
    color: #ffffff;
}

.map-filter-actions {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.map-filter-reset,
.map-filter-apply {
    border: none;
    border-radius: 0.625rem;
    min-height: 40px;
    font-size: 0.8125rem;
    font-weight: 800;
}

.map-filter-reset {
    background: #f1f5f9;
    color: #334155;
}

.map-filter-apply {
    background: #0284c7;
    color: #ffffff;
}

.map-mobile-preview {
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    z-index: 6;
}

.map-mobile-preview.hidden {
    display: none !important;
}

.map-mobile-preview .facility-card {
    margin: 0;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.25);
}

.map-mobile-preview-close {
    position: absolute;
    top: -0.5rem;
    right: -0.25rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    font-size: 1rem;
    line-height: 1;
    z-index: 2;
}

@media (min-width: 768px) {
    .map-mobile-preview {
        display: none !important;
    }
}

.facility-card.is-map-active {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.16), 0 8px 24px rgba(15, 23, 42, 0.18);
}

/* ========================================
   Facility Overlay
   ======================================== */
.facility-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: none;
}

.facility-overlay.is-open {
    display: block;
}

.facility-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
}

.facility-overlay-sheet {
    position: absolute;
    inset: 1rem;
    border-radius: 0.875rem;
    background: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.32);
}

.facility-overlay-close {
    position: sticky;
    top: 0.75rem;
    right: 0.75rem;
    margin: 0 0 -36px auto;
    display: block;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
}

.facility-overlay-content {
    padding: 0;
    overflow-x: hidden;
}

.facility-overlay-loading,
.facility-overlay-error {
    padding: 1.5rem;
    text-align: center;
    color: #475569;
}

.facility-overlay-fragment {
    background: #ffffff;
}

.facility-overlay-content .facility-overlay-fragment {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.facility-overlay-content .facility-overlay-fragment .facility-hero-container {
    max-width: none;
    margin: 0;
    padding-top: 0;
}

.facility-overlay-content .facility-overlay-fragment .facility-hero {
    margin: 0;
}

.facility-overlay-content .facility-overlay-fragment .layout-container,
.facility-overlay-content .facility-overlay-fragment .related-section {
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 1023px) {
    .map-search-layout {
        --map-panel-height: max(420px, calc(100vh - 180px));
        grid-template-columns: 1fr;
    }

    .map-result-sidebar {
        height: 380px;
        min-height: 380px;
    }

    .map-search-stage,
    .spa-map-canvas {
        height: var(--map-panel-height);
        min-height: var(--map-panel-height);
    }
}

@media (max-width: 767px) {
    .map-search-panel {
        min-height: 0;
    }

    .search-spa-container.is-mobile-map-active {
        padding-top: 0;
        padding-right: 0;
        padding-bottom: 0;
        padding-left: 0;
    }

    .map-bottom-bar {
        bottom: max(3rem, calc(env(safe-area-inset-bottom, 0px) + 2.5rem));
        left: calc(env(safe-area-inset-left, 0px) + 0.625rem);
    }

    .map-mobile-icon-btn-filter {
        top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
        right: calc(env(safe-area-inset-right, 0px) + 0.5rem);
        max-width: min(68vw, 220px);
    }

    .map-search-panel.is-active {
        margin-left: 0;
        margin-right: 0;
    }

    .map-search-panel.is-active .nearby-status {
        margin-bottom: 0.375rem;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .map-search-layout {
        --map-panel-height: var(--mobile-map-height, calc(100dvh - 7.5rem));
        gap: 0;
        grid-template-columns: 1fr;
    }

    .map-search-stage,
    .spa-map-canvas {
        height: var(--map-panel-height);
        min-height: var(--map-panel-height);
    }

    .map-result-sidebar {
        height: 360px;
        min-height: 360px;
    }

    .map-result-sidebar {
        display: none;
    }

    .map-search-stage {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .map-facility-card {
        min-height: 220px;
    }

    .map-facility-card .facility-card-image {
        height: 132px;
    }

    .map-mobile-preview .facility-card {
        min-height: 0;
    }

    .map-mobile-preview .facility-card-image {
        height: 118px;
    }

    .facility-overlay-sheet {
        inset: 0;
        border-radius: 0;
        overflow-x: hidden;
    }

    .facility-overlay-close {
        top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
        right: 0.5rem;
    }

    .facility-overlay-content .facility-overlay-fragment .layout-container {
        padding: 1rem 0.75rem;
    }

    .facility-overlay-content .facility-overlay-fragment .related-section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .facility-overlay-content .facility-overlay-fragment .main-content,
    .facility-overlay-content .facility-overlay-fragment .gray-box {
        min-width: 0;
    }

    .facility-overlay-content .facility-overlay-fragment .info-row {
        flex-direction: column;
        gap: 0.35rem;
    }

    .facility-overlay-content .facility-overlay-fragment .info-label {
        width: auto;
    }

    .facility-overlay-content .facility-overlay-fragment .info-value,
    .facility-overlay-content .facility-overlay-fragment .info-value a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .facility-overlay-content .facility-overlay-fragment .related-card {
        min-width: 0;
    }
}
