/* Reset and fullscreen layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f4f7f9;
    /* 落ち着いた背景色 */
}

#app {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    background: #fff;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    z-index: 1000;
    border-radius: 12px 12px 0 0;
    /* 上部のみ角丸 */
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-stats {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.zoom-display {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 123, 255, 0.2);
    white-space: nowrap;
}

/* レスポンシブ広告サイドバー */
.ad-sidebar {
    position: absolute;
    top: 0;
    right: -320px;
    /* 最初は隠す */
    width: 300px;
    height: 100%;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

/* PCレイアウト（768px以上） */
@media (min-width: 768px) {
    #app {
        width: calc(100vw - 360px);
        /* サイドバー分を引く */
        margin-right: 340px;
        /* 広告サイドバー分のマージンを確保 */
    }

    .ad-sidebar {
        position: fixed;
        top: 20px;
        right: 20px;
        width: 300px;
        height: calc(100vh - 40px);
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border: 1px solid #e0e0e0;
        z-index: 998;
        /* カテゴリーボタンより下に */
    }

    .main {
        width: 100%;
        /* アプリコンテナ内で全幅 */
        max-width: calc(100vw - 360px);
        /* 最大幅を制限 */
    }

    /* 検索ボックスのz-indexを確保 */
    .search-box-container {
        z-index: 1002;
        /* 最前面 */
    }

    /* 半径スライダーのz-indexを確保 */
    #category-radius-container {
        z-index: 1000;
    }
}

/* 広告プレースホルダースタイル */
.ad-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.ad-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ad-placeholder-text {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-placeholder-box {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 40px 20px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder-dimensions {
    font-size: 11px;
    color: #6c757d;
    font-family: monospace;
}

/* スマホ用広告FABボタン */
.ad-fab-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}

.ad-fab-button:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

/* PCではFABボタンを非表示 */
@media (min-width: 768px) {
    .ad-fab-button {
        display: none;
    }
}

/* ボトムシート */
.ad-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 50vh;
    overflow-y: auto;
}

.ad-bottom-sheet.active {
    transform: translateY(0);
}

.ad-bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    margin: 12px auto;
    cursor: grab;
}

.ad-bottom-sheet-content {
    padding: 20px;
}

/* PCではボトムシートを非表示 */
@media (min-width: 768px) {
    .ad-bottom-sheet {
        display: none;
    }
}

/* CTAトースト通知 */
.cta-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s ease;
    cursor: pointer;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}

.cta-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cta-toast:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

/* PCではCTAトーストの位置を調整 */
@media (min-width: 768px) {
    .cta-toast {
        bottom: 20px;
        right: 320px;
        /* サイドバーの左 */
        left: auto;
        transform: translateX(0) translateY(100px);
        max-width: 300px;
        /* 幅を制限 */
    }

    .cta-toast.show {
        transform: translateX(0) translateY(0);
    }

    .cta-toast:hover {
        transform: translateX(0) translateY(-2px);
    }
}

/* 既存のスタイルが続く... */
.toggle-label {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* 地図コンテナの調整 */
.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* PCでの地図コンテナ調整 */
@media (min-width: 768px) {
    .map-container {
        margin-right: 0;
        /* マージンは親要素で管理 */
    }

    /* 既存の操作パネルが広告と重ならないように */
    .radius-slider-container,
    .mode-segment-container {
        z-index: 1003;
        /* 広告より上に */
    }

    /* Mapboxのズームコントロールを調整 */
    .mapboxgl-ctrl-zoom {
        z-index: 1004 !important;
        /* 最前面に */
    }

    /* Mapboxのナビゲーションコントロールを調整 */
    .mapboxgl-ctrl {
        z-index: 1004 !important;
    }
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #007bff;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.convenience-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.convenience-btn:hover {
    background: #e55a2b;
}

.convenience-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.facility-search-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.facility-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.facility-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.facility-btn:hover {
    background: #e55a2b;
}

.facility-btn.clear-btn {
    background: #dc3545;
}

.facility-btn.clear-btn:hover {
    background: #c82333;
}

.facility-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.real-estate-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.real-estate-btn:hover {
    background: #218838;
}

.real-estate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 不動産ポップアップのスタイル */
.mapboxgl-popup.real-estate-popup .mapboxgl-popup-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.mapboxgl-popup.real-estate-popup .mapboxgl-popup-tip {
    border-top-color: #28a745;
}

.language-toggle {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.language-toggle:hover {
    background: #0056b3;
}

.main {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 100px);
    /* ヘッダーの高さを除く */
    border-radius: 0 0 12px 12px;
    /* 下部のみ角丸 */
}

.map-container {
    flex: 1;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.radius-slider-container {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 280px;
}

.radius-slider-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radius-slider-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.radius-slider-label span#radius-value {
    font-weight: 700;
    color: #007bff;
    min-width: 60px;
    text-align: center;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
}

.radius-slider {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

.radius-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.5);
    transform: scale(1.1);
}

.radius-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    border: none;
    transition: all 0.2s ease;
}

.radius-slider::-moz-range-thumb:hover {
    background: #0056b3;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.5);
    transform: scale(1.1);
}

.radius-slider-marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.info-panel {
    width: 360px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
    height: 100%;
    border-radius: 0 0 0 12px;
    /* 左下のみ角丸 */
}

.pin-sidebar {
    width: 360px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
    height: 100%;
    border-radius: 0 0 0 12px;
    /* 左下のみ角丸 */
}

/* ピンリストのスタイル */
.pin-list {
    margin-bottom: 1.5rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 0;
    /* スクロールバー分の余白を削除 */
    box-sizing: border-box;
    width: 100%;
}

.pin-list-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin-right: 0;
    /* リセット */
}

.pin-list-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    width: calc(100% - 4px);
    /* 移動分を考慮した幅 */
    margin-right: 4px;
    /* 移動分のスペースを確保 */
}

.pin-list-item:active {
    transform: translateX(2px);
    box-shadow: 0 1px 4px rgba(33, 150, 243, 0.2);
    width: calc(100% - 2px);
    /* 移動分を考慮した幅 */
    margin-right: 2px;
    /* 移動分のスペースを確保 */
}

/* ステータスドットのスタイル */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pin-list-item-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    flex: 1;
    display: flex;
    align-items: center;
}

.pin-list-item-radius {
    font-size: 0.8rem;
    color: #666;
    background: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.pin-list-empty {
    text-align: center;
    color: #999;
    padding: 2rem 1rem;
    font-style: italic;
}

.info-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}

.info-content ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.info-content li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #666;
}

.info-content li:last-child {
    border-bottom: none;
}

.stats {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    box-sizing: border-box;
    width: 100%;
    margin-left: 0;
    /* 確実に揃える */
    margin-right: 0;
    /* 確実に揃える */
}

#pin-count {
    font-weight: 600;
    color: #007bff;
}

/* Mapbox popup customization */
.mapboxgl-popup {
    font-size: 0.9rem;
}

.mapboxgl-popup-content {
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-width: none;
    min-width: 220px;
    background: #fff;
}

.mapboxgl-popup-close-button {
    width: 28px;
    height: 28px;
    font-size: 18px;
    font-weight: bold;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    margin: 8px;
}

.mapboxgl-popup-close-button:hover {
    color: #333;
    background: #f8f9fa;
    transform: scale(1.1);
}

.mapboxgl-popup-content * {
    box-sizing: border-box;
}

.popup-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-memo {
    font-weight: 500;
    color: #333;
}

.popup-coords {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.popup-radius-control {
    margin: 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.popup-color-control {
    margin: 0;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.popup-color-label {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.popup-color-switch {
    display: flex;
    gap: 8px;
}

.color-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
}

.color-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.color-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 3px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.color-btn[data-color="red"].active {
    background: #ff4444;
    border-color: #ff4444;
    box-shadow: 0 3px 12px rgba(255, 68, 68, 0.3);
}

.popup-radius-label {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.popup-radius-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 8px 0;
}

.popup-radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

.popup-radius-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.5);
    transform: scale(1.1);
}

.popup-radius-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    border: none;
    transition: all 0.2s ease;
}

.popup-radius-slider::-moz-range-thumb:hover {
    background: #0056b3;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.5);
    transform: scale(1.1);
}

.popup-radius-slider:hover::-webkit-slider-thumb {
    background: #0056b3;
}

.popup-radius-slider:hover::-moz-range-thumb {
    background: #0056b3;
}

/* モードセグメントコントロール */
.mode-segment-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.mode-segment {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-segment-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 500;
    color: #666;
    position: relative;
    overflow: hidden;
}

.mode-segment-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
    transform: translateY(-1px);
}

.mode-segment-btn.active {
    background: #2196f3;
    color: white;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transform: translateY(-1px);
}

.mode-segment-btn.active:hover {
    background: #1976d2;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.mode-segment-icon {
    font-size: 16px;
    line-height: 1;
}

.mode-segment-text {
    font-weight: 600;
    white-space: nowrap;
}

/* ピンの色選択パレット */
.pin-color-palette {
    position: absolute;
    bottom: 140px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pin-color-palette.visible {
    opacity: 1;
    visibility: visible;
}

.color-palette-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #555555;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.color-palette-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-palette-btn.active {
    transform: scale(1.05);
}

/* Blue active state */
.color-palette-btn[data-color="blue"].active {
    background: #007bff;
    color: #ffffff;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Red active state */
.color-palette-btn[data-color="red"].active {
    background: #ff4444;
    color: #ffffff;
    border-color: #cc0000;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

/* Yellow active state */
.color-palette-btn[data-color="yellow"].active {
    background: #ffc107;
    color: #333333;
    border-color: #d39e00;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* コンテキストメニューのスタイル */
.context-menu-popup {
    z-index: 1002;
}

.context-menu-container {
    padding: 0;
    margin: 0;
    min-width: 180px;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin: 0;
}

.context-menu-item:hover {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.context-menu-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.2);
}

/* 重なり判定ポップアップのスタイル */
.overlap-popup-container {
    min-width: 280px;
    max-width: 400px;
    padding: 0;
    margin: 0;
}

.overlap-popup-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
    margin: 0;
}

.overlap-popup-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    line-height: 1.4;
}

.overlap-popup-list {
    list-style: none;
    padding: 10px;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.overlap-popup-list li {
    margin: 0;
    padding: 0;
}

.overlap-pin-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    border: none;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-height: 44px;
}

.overlap-pin-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.overlap-pin-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(33, 150, 243, 0.2);
}

.overlap-pin-item:last-child {
    margin-bottom: 0;
}

.overlap-pin-name {
    display: block;
    font-weight: 500;
    color: #333;
    text-align: left;
    flex: 1;
}

.overlap-pin-radius {
    display: block;
    font-size: 11px;
    color: #666;
    background: #fff;
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    margin-top: 4px;
    text-align: center;
    font-weight: 500;
    width: fit-content;
}

/* サイドバーのハイライトスタイル */
.pin-list-item.highlighted {
    background: #fff3cd;
    border-color: #ffc107;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.pin-list-item.highlighted:hover {
    background: #ffeaa7;
    border-color: #ff9800;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.pin-list-item.highlighted .pin-list-item-name {
    color: #856404;
    font-weight: 700;
}

.pin-list-item.highlighted .pin-list-item-radius {
    background: #ffc107;
    color: white;
    border-color: #ffc107;
}

/* モード切り替えボタン */
.mode-toggle-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.mode-toggle-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.mode-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3, #004085);
}

.mode-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(0, 123, 255, 0.3);
}

.mode-toggle-btn.pin-mode {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
}

.mode-toggle-btn.pin-mode:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

#mode-icon {
    font-size: 18px;
    line-height: 1;
}

#mode-text {
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

/* モード切り替えアニメーション */
.mode-toggle-btn {
    animation: pulse 2s infinite;
}

.mode-toggle-btn.pin-mode {
    animation: pulse-green 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.6);
    }

    100% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(40, 167, 69, 0.6);
    }

    100% {
        box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    }
}

.popup-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.popup-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(220, 53, 69, 0.3);
}

/* Loading spinner */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .title {
        font-size: 1.2rem;
    }

    .pin-sidebar {
        width: 250px;
        padding: 1rem;
    }

    .language-toggle {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .zoom-display {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .main {
        flex-direction: column;
    }

    .map-container {
        flex: 1 1 60%;
        min-height: 0;
        height: 60%;
    }

    .pin-sidebar {
        width: 100%;
        flex: 0 0 40%;
        height: 40%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        border-radius: 0 0 12px 12px;
    }
}

/* フォルダ分けUI用スタイル */
.pin-folders {
    padding: 8px;
}

.folder-details {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.folder-summary {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: background-color 0.2s;
}

.folder-summary:hover {
    background: #e9ecef;
}

.folder-summary::-webkit-details-marker {
    display: none;
}

.folder-icon {
    margin-right: 8px;
    font-size: 16px;
}

.folder-name {
    flex: 1;
}

.folder-toggle-btn {
    margin-left: auto;
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: color 0.2s;
}

.folder-toggle-btn:hover {
    color: #007bff;
    background: #f0f8ff;
    border-radius: 4px;
}

.folder-delete-btn {
    margin-left: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.folder-delete-btn:hover {
    color: #dc3545;
    background: #fff5f5;
    border-radius: 4px;
    transform: scale(1.1);
}

.folder-radius-btn {
    margin-left: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.folder-radius-btn:hover {
    color: #28a745;
    background: #f0fff4;
    border-radius: 4px;
    transform: scale(1.1);
}

.folder-content {
    padding: 8px;
    background: #fafafa;
}

/* 重なり分析ポップアップのスタイル */
.overlap-popup .mapboxgl-popup-content {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

.overlap-popup .mapboxgl-popup-close-button {
    font-size: 16px;
    padding: 4px;
    color: #666;
}

.overlap-popup .mapboxgl-popup-close-button:hover {
    color: #333;
    background: #f5f5f5;
    border-radius: 4px;
}

/* ドラッグ＆ドロップ用スタイル */
.category-folder {
    transition: all 0.2s ease;
}

.category-folder.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.drag-handle {
    cursor: grab;
    user-select: none;
    color: #666;
    font-size: 14px;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #007bff;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-folder:hover {
    background: #f8f9fa;
    border-radius: 6px;
}

/* フォルダ内のピンリスト用調整 */
.folder-content .pin-list-item {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    padding: 12px 16px;
}

.folder-content .pin-list-item:last-child {
    border-bottom: none;
}

.folder-content .pin-list-item:hover {
    background: #f8f9fa;
}

.clear-all-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: none;
    border-radius: 6px;
    background: #dc3545;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-all-btn:hover {
    background: #c82333;
}