        :root {
            --primary-color: #007BFF; --primary-hover: #0056b3;
            --danger-color: #dc3545; --danger-hover: #c82333;
            --success-color: #28a745; --success-hover: #218838;
            --info-color: #17a2b8; --info-hover: #138496;
            --media-color: #6f42c1; --media-hover: #5a32a3;
            --light-gray: #f8f9fa; --border-color: #dee2e6;
            --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        /* ボックス全体：標準的な入力欄と同じ見た目 */
        .custom-file-box {
            display: flex;
            align-items: center;
            gap: 8px;
            border: 1px solid #dee2e6 !important; /* 薄いグレー */
            border-radius: 4px;
            padding: 3px 5px;
            background-color: #fff !important; /* 白背景 */
            height: 35px;
            width: 100%;
            box-sizing: border-box;
        }

        /* 選択ボタン：グレー */
        .file-btn {
            background-color: #6c757d !important;
            color: white !important;
            padding: 4px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.85em;
            font-weight: normal;
            white-space: nowrap;
            line-height: 1.5;
            display: inline-block;
        }
        .file-btn:hover { 
            background-color: #5a6268 !important; 
        }

        /* ファイル名テキスト：通常の黒文字 */
        .file-text {
            font-size: 0.8em;
            color: #555;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-grow: 1;
        }
        
        /* デフォルトのファイル入力を確実に隠す */
        .custom-file-box input[type="file"], input[type="file"] {
            display: none !important;
        }
        /* ▲▲▲ カスタムデザインここまで ▲▲▲ */

        body { font-family: var(--font-family); margin: 0; background-color: var(--light-gray); color: #212529; }
        
        /* 全体レイアウト */
        .main-container { 
            display: flex; 
            flex-direction: column; 
            height: 100vh; 
            overflow: hidden;
        }

        /* 操作ボタンエリア */
        .controls { 
            flex-shrink: 0;
            display: flex; 
            gap: 10px; 
            align-items: center; 
            padding: 10px 15px; 
            border-bottom: 1px solid var(--border-color); 
            background-color: #fff; 
            z-index: 20;
            flex-wrap: wrap;
        }
        button, .file-input-label, select { padding: 8px 12px; border-radius: 5px; border: 1px solid #ccc; background-color: #fff; color: #333; cursor: pointer; transition: background-color 0.2s; white-space: nowrap; font-size: 14px;}
        button { border: none; color: white; }
        .file-input-label { background-color: var(--primary-color); display: inline-block; color: white; border: none;}
        .file-input-label:hover { background-color: var(--primary-hover); }
        
        .export-btn { background-color: var(--success-color); margin-left: auto; }
        .export-btn:hover { background-color: var(--success-hover); }
		
		/* 右寄せ用のクラス */
        .push-right {
            margin-left: auto;
        }

        /* Googleフォームボタンのスタイル */
        .google-form-btn {
            background-color: #673ab7; /* Googleフォームっぽい紫色 */
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            text-decoration: none; /* リンクの下線を消す */
            display: inline-flex;
            align-items: center;
            white-space: nowrap;
        }

        .google-form-btn:hover {
            background-color: #5e35b1;
        }
        
        #new-course-btn { background-color: var(--info-color); }
        #new-course-btn:hover { background-color: var(--info-hover); }

        #media-file-list { display: none !important; }
		
		/* ▼▼▼ 追加: アプリタイトルのスタイル ▼▼▼ */
        .app-title {
            font-size: 1.2em;
            font-weight: bold;
            color: #333;
            margin-right: 20px; /* ボタンとの距離 */
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap; /* 折り返し防止 */
        }
        /* アイコン画像（もしあれば） */
        .app-logo {
            width: 24px;
            height: 24px;
            object-fit: contain;
        }
        /* ▲▲▲ 追加ここまで ▲▲▲ */

        /* パネルヘッダー */
        .panel-header { 
            flex-shrink: 0;
            padding: 8px 15px; 
            background-color: #f7f7f7; 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            border-bottom: 1px solid #ddd; 
            border-top: 1px solid #ddd; 
            cursor: pointer;
            user-select: none;
            font-weight: bold;
            color: #555;
        }
        .panel-header:hover { background-color: #eee; }
        .panel-header h2 { margin: 0; font-size: 1em; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 10px; }
        
        .toggle-icon { transition: transform 0.3s ease; display:inline-block; margin-right:5px;}
        .panel-header.collapsed .toggle-icon { transform: rotate(-90deg); }

        /* コース情報エリア */
        .panel-content { 
            flex-shrink: 0; 
            padding: 15px; 
            overflow-y: auto; 
            max-height: 30vh; 
            background-color: #fff;
            transition: max-height 0.3s ease, padding 0.3s ease;
        }
        .panel-content.collapsed {
            max-height: 0;
            padding-top: 0; 
            padding-bottom: 0; 
            overflow: hidden;
            border-bottom: none;
        }

        /* 地図パネル */
        .map-panel { 
            position: relative; 
            height: 35vh; 
            min-height: 150px;
            flex-shrink: 0; 
            background-color: #e9ecef;
            transition: height 0.3s ease;
            border-bottom: 1px solid var(--border-color);
        }
        #map { width: 100%; height: 100%; }

        /* スポット一覧エリア */
        .table-wrapper { 
            flex: 1; 
            overflow: auto; 
            background-color: #fff;
            transition: flex-grow 0.3s ease;
        }
        .table-wrapper.collapsed {
            flex: 0 0 0; 
            min-height: 0;
            overflow: hidden;
        }

        /* フォーム部品 */
        .form-group { margin-bottom: 15px; }
        .form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9em; }
        .form-group input[type="text"], .form-group input[type="number"] { width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; box-sizing: border-box; }
        .form-group input[type="color"] { width: 100%; height: 40px; border: 1px solid var(--border-color); border-radius: 4px; padding: 2px; cursor: pointer; }

        /* テーブルスタイル */
        table { width: 100%; border-collapse: collapse; }
        th, td { border: 1px solid var(--border-color); padding: 8px; text-align: left; font-size: 0.9em; min-width: 100px; vertical-align: middle; }
        th { background-color: #e9ecef; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
        
        /* 削除列の余白を0に */
        th:first-child, td:first-child { padding-left: 0; padding-right: 0; text-align: center; }
        td[contenteditable="true"]:focus { outline: 2px solid var(--primary-color); background-color: #eef8ff; }
        td.checkbox-cell { text-align: center; }
        td.checkbox-cell input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; }

		/* 列幅調整 */
        /* ▼▼▼ 修正: cursor: grab; を {} の中に入れます ▼▼▼ */
        .id-cell { 
            min-width: 100px !important; 
            width: 120px; 
            max-width: 120px; 
            font-size: 0.85em; 
            overflow: hidden; 
            text-overflow: ellipsis; 
            white-space: nowrap; 
            
            cursor: grab; /* ← ここに追加 */
        }

        /* ドラッグ中の見た目（少し浮いているように見せる） */
        .sortable-ghost {
            opacity: 0.4;
            background-color: #c8ebfb;
        }

        .coord-cell { 
    min-width: 65px !important; 
    width: 65px; 
    max-width: 65px; 
    font-size: 0.8em; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    text-align: center;
}
        
		/* プレビュー画像 */
        .inline-preview {
            height: 30px; width: auto; vertical-align: middle; margin-right: 8px;
            border: 1px solid #ddd; border-radius: 4px; background-color: #fff; cursor: pointer; transition: transform 0.2s ease;
        }
        .inline-preview:hover {
            border-color: var(--primary-color);
            opacity: 0.9;
            transform: scale(1.1); /* 少しだけ大きくして「触れる」感を出す */
        }
        td.media-cell { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

        .delete-btn { background-color: var(--danger-color); padding: 3px 6px; font-size: 11px; border:none; color:white; border-radius:3px; white-space: nowrap;}
        .delete-btn:hover { background-color: var(--danger-hover); }
        .delete-btn:disabled { background-color: #ccc; cursor: not-allowed; }
        .table-wrapper tr.highlighted { background-color: #fff3cd; }

        /* モード切替ボタン */
        .mode-switcher-container { 
            position: absolute; top: 10px; left: 10px; z-index: 100;
            display: flex; gap: 0; 
            background-color: rgba(255, 255, 255, 0.95);
            border-radius: 4px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            padding: 2px;
            border: 1px solid rgba(0,0,0,0.1);
        }
        .mode-btn { 
            padding: 6px 12px; border: 1px solid transparent; background: transparent; 
            cursor: pointer; font-size: 13px; color: #333; border-radius: 3px;
        }
        .mode-btn:hover { background-color: #eee; }
        .mode-btn.active { background-color: var(--primary-color); color: #fff; }
        
        /* ▼▼▼ 修正: 地図サイズ変更ボタン（右上配置・視認性向上） ▼▼▼ */
        #map-resize-btn { 
            position: absolute;
            top: 10px;
            right: 50px; /* ズームボタン(右端)の隣に配置 */
            z-index: 100;
            
            background-color: #fff;
            border: 2px solid #ccc; /* 枠線を少し太く */
            border-radius: 4px;
            padding: 5px 10px;
            
            font-size: 0.85em;
            font-weight: bold;
            color: #333;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 5px;
        }
        #map-resize-btn:hover { 
            background-color: #f8f9fa; 
            border-color: #999;
        }
        /* ▲▲▲ 修正ここまで ▲▲▲ */

/* --- 左側3列（ID、No.、説明）を固定するスタイル --- */
.sticky-col-1 {
    position: sticky;
    left: 45px; /* 削除列(45px)の直後に配置 */
    z-index: 10;
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6 !important;
}

.sticky-col-2 {
    position: sticky;
    left: 165px; /* 削除列(45px) + ID列(120px)の直後に配置 */
    z-index: 10;
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6 !important;
    width: 40px !important; /* 幅を狭く設定 */
    min-width: 40px !important;
    text-align: center;
}

.sticky-col-3 {
    position: sticky;
    left: 205px; /* 削除列(45px) + ID(120px) + No(40px) の直後に配置 */
    z-index: 10;
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6 !important;
}

.sticky-col-4 {
    position: sticky;
    left: 305px; /* 削除列(45px) + ID(120px) + No(40px) + 名称(100px) の直後に配置 */
    z-index: 10;
    background-color: #f8f9fa !important;
    border-right: 2px solid #dee2e6 !important;
}

/* ヘッダー部分はデータセルより前面に出す */
th.sticky-col-1, th.sticky-col-2, th.sticky-col-3, th.sticky-col-4 {
    z-index: 20;
    background-color: #e9ecef !important;
}

/* --- 説明文の省略表示用スタイル --- */
.desc-cell {
    max-width: 200px; /* 必要に応じて調整 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ドラッグハンドルアイコンのスタイル */
.drag-handle-icon {
    display: inline-block;
    cursor: grab;
    margin-right: 8px;
    color: #6c757d;
    font-size: 1.2em;
    user-select: none;
}

.id-cell:active {
    cursor: grabbing;
}
        
        /* 地図スタイル選択プルダウン */
        #map-style-select { 
            border: none;
            background: transparent;
            font-size: 13px;
            color: #333;
            cursor: pointer;
            padding: 0 8px;
            border-right: 1px solid #ccc; 
            border-radius: 3px 0 0 3px;
            outline: none;
            height: auto;
            margin-right: 0;
        }
        #map-style-select:hover { background-color: #eee; }

        /* 軌跡編集コントロール */
        .plotting-controls { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 10; background: rgba(255,255,255,0.85); padding: 10px; border-radius: 30px; box-shadow: 0 2px 10px rgba(0,0,0,0.2); display: flex; gap: 15px; align-items: center; }
        .plotting-controls button { width: 44px; height: 44px; border-radius: 50%; display: flex; justify-content: center; align-items: center; padding: 0; border: none; }
        .plotting-controls button svg { width: 24px; height: 24px; }
        .toggle-switch-container { display: flex; flex-direction: column; align-items: center; gap: 2px; }
        .toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
        .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: var(--success-color); }
        input:checked + .slider:before { transform: translateX(20px); }
        .toggle-label { font-size: 10px; font-weight: bold; color: var(--info-color); }

        /* モーダル */
        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 2000; display: none; justify-content: center; align-items: center; }
        .modal-content { background-color: #fff; padding: 20px; border-radius: 8px; width: 500px; max-width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 15px rgba(0,0,0,0.2); display: flex; flex-direction: column; }
        .modal-header { font-size: 1.2em; font-weight: bold; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
        
        .quiz-form-group { margin-bottom: 12px; }
        .quiz-form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9em; }
        .quiz-form-group input, .quiz-form-group textarea, .quiz-form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
        .quiz-btn { background-color: #ff9800; padding: 4px 8px; font-size: 12px; margin-right: 5px; border: none; color: white; border-radius:3px;}
        .quiz-btn:hover { background-color: #e68900; }
        .quiz-btn.has-data { background-color: #28a745; }
        .modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; border-top: 1px solid #eee; padding-top: 15px; }
        .btn-secondary { background-color: #6c757d; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer;}
        .btn-primary { background-color: #007bff; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer;}
        .btn-danger { background-color: #dc3545; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer;}

        .manual-content { width: 700px; } 
        .manual-body { line-height: 1.6; font-size: 0.95em; overflow-y: auto; padding-right: 5px; }
        .manual-body h3 { border-left: 4px solid var(--primary-color); padding-left: 10px; margin-top: 20px; margin-bottom: 10px; font-size: 1.1em; color: #333; }
        .manual-body ul { padding-left: 20px; margin-bottom: 15px; }
        .close-icon-btn { background: none; border: none; font-size: 1.5em; color: #aaa; cursor: pointer; padding: 0; line-height: 1; }
        .close-icon-btn:hover { color: #333; }

        #toast { visibility: hidden; min-width: 250px; margin-left: -125px; background-color: rgba(51, 51, 51, 0.9); color: #fff; text-align: center; border-radius: 50px; padding: 16px; position: fixed; z-index: 3000; left: 50%; bottom: 30px; font-size: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
        #toast.show { visibility: visible; opacity: 1; bottom: 50px; }

        .input-with-preview { display: flex; align-items: center; gap: 10px; }
        
        /* 認証モーダルのスタイル */
        .auth-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 10000;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .auth-modal-content {
            background-color: #fff;
            padding: 40px;
            border-radius: 12px;
            width: 400px;
            max-width: 90%;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }
        
        .auth-modal-content h2 {
            margin-top: 0;
            margin-bottom: 10px;
            color: #333;
            font-size: 1.5em;
        }
        
        .auth-form-group {
            margin-bottom: 20px;
        }
        
        .auth-form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: #555;
            font-size: 0.9em;
        }
        
        .auth-form-group input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 1em;
            box-sizing: border-box;
            transition: border-color 0.2s;
        }
        
        .auth-form-group input:focus {
            outline: none;
            border-color: #007BFF;
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
        }
        
        .auth-error-message {
            background-color: #f8d7da;
            color: #721c24;
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 20px;
            font-size: 0.9em;
            border: 1px solid #f5c6cb;
        }
        
        .auth-form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        
        .auth-btn {
            padding: 12px 24px;
            border: none;
            border-radius: 6px;
            font-size: 1em;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.2s;
        }
        
        .auth-btn-primary {
            background-color: #007BFF;
            color: white;
        }
        
        .auth-btn-primary:hover {
            background-color: #0056b3;
        }
        
        .auth-btn-primary:active {
            transform: translateY(1px);
        }

        #mobile-warning-overlay { display: none; }
        @media (max-width: 768px) { 
            #mobile-warning-overlay { 
                display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
                background: rgba(0,0,0,0.85); color: #fff; z-index: 9999; 
                justify-content: center; align-items: center; flex-direction: column; 
                padding: 20px; text-align: center; 
            } 
        }
    
        /* --- コース情報コンパクト化スタイル --- */
        
        .compact-row {
            display: flex;
            gap: 10px;
            margin-bottom: 8px;
            align-items: flex-end;
        }
        #course-info-content .form-group { margin-bottom: 0; }
        #course-info-content label { font-size: 0.8em; margin-bottom: 2px; color: #555; }
        #course-info-content input[type="text"] { padding: 4px 6px; font-size: 0.9em; height: 30px; }
		
		/* ▼▼▼ 変更: 背景画像管理用のスタイル ▼▼▼ */
        /* リスト表示テキスト */
        #random-bg-list { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; }
        #random-bg-list:hover { color: #0056b3; }

        /* モーダル内のリストアイテム */
        .bg-manager-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 10px;
            border-bottom: 1px solid #eee;
            font-size: 0.9em;
        }
        .bg-manager-item:last-child { border-bottom: none; }
        .bg-manager-item:hover { background-color: #f9f9f9; }
        
        /* サムネイル画像（あると分かりやすいので追加） */
        .bg-manager-thumb {
            width: 40px; height: 40px; object-fit: cover; border-radius: 3px; margin-right: 10px;
            border: 1px solid #ddd;
            vertical-align: middle;
        }
        
        /* リスト表示エリアをクリック可能に */
        #random-bg-list { cursor: pointer; text-decoration: underline; text-decoration-style: dotted;}
        #random-bg-list:hover { color: #0056b3; }
        /* ▲▲▲ 追加ここまで ▲▲▲ */
		
		/* --- ▼▼▼ 追加: 説明セルのスタイル（幅広・省略・クリック可） ▼▼▼ --- */
        .desc-cell {
            max-width: 300px; /* セル幅を広げる */
            min-width: 200px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis; /* 文字があふれたら「...」にする */
            cursor: pointer;
            color: #007BFF; /* リンクっぽく青色に */
        }
        .desc-cell:hover {
            background-color: #f0f8ff;
            text-decoration: underline;
        }
		
		/* --- ▼▼▼ 追加: URLセルのスタイル（省略・クリック可） ▼▼▼ --- */
        .url-cell {
            max-width: 150px; /* URLは長いので幅制限 */
            min-width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis; /* 文字あふれを「...」に */
            cursor: pointer;
            color: #007BFF;
        }
        .url-cell:hover {
            background-color: #f0f8ff;
            text-decoration: underline;
    }
	
	/* --- ▼▼▼ 追加: SNS投稿文とハッシュタグセルのスタイル ▼▼▼ --- */
        #sns-post-text-cell, #hashtags-cell {
            transition: background-color 0.2s, border-color 0.2s;
        }
        #sns-post-text-cell:hover, #hashtags-cell:hover {
            background-color: #f0f8ff;
            border-color: #007bff;
        }
	
	/* ▼▼▼ 追加: メディア列のファイル名省略用 ▼▼▼ */
        .media-filename {
            display: inline-block;
            max-width: 90px; /* ファイル名の表示幅を制限 */
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            vertical-align: middle;
            color: #555;
        }
		
		/* ▼▼▼ テーブル列幅調整用 ▼▼▼ */
    th.narrow-col, td.narrow-col {
    width: 1%;           /* コンテンツ幅に合わせる最小指定 */
    white-space: nowrap; /* 勝手な改行を防ぐ */
    padding: 4px 2px;    /* 左右の余白を極限まで削る */
    font-size: 0.85rem;  /* 文字を少し小さくして収まりを良くする */
    text-align: center;  /* 中央揃え */
    }
	
	/* --- ロゲイニングモード専用UI --- */

/* 1. スタート地点の行 (1行目) */
#spots-table tbody tr[data-index="0"] {
    background-color: #f0fff0; /* 薄い緑色 */
    border-left: 5px solid #28a745;
}

/* 2. ゴール地点の行 (最終行) */
#spots-table tbody tr:last-child {
    background-color: #fff0f0; /* 薄い赤色 */
    border-left: 5px solid #dc3545;
}

/* 3. マウスオーバー時のハイライトを無効にする（システム行を区別） */
#spots-table tbody tr[data-index="0"]:hover,
#spots-table tbody tr:last-child:hover {
    background-color: #f0fff0;
}

/* --- マーカーの基本構造（MapLibreの位置制御を邪魔しない） --- */
.custom-marker {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    /* MapLibreが内部的に transform を使用して位置を決めるため、ここには transform を書かない */
}

/* 内部のピン型デザイン（ここでお絵かきナビ本来の形と色を制御） */
.marker-pin {
    width: 100%;
    height: 100%;
    border: 2px solid white;
    border-radius: 50% 50% 50% 0; /* しずく型を作るマジックナンバー */
    transform: rotate(-45deg); /* 斜めにしてピン状にする */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    /* 滑らかな拡大のための設定（点滅を防ぐ） */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, filter 0.2s;
}

.marker-number {
    transform: rotate(45deg); /* 数字だけを水平に戻す */
    color: white;
    font-weight: bold;
    font-size: 14px;
    pointer-events: none;
}

/* --- ホバー強調設定（点滅と位置ズレを解消） --- */
/* 表の行をホバーした際、マーカー内のピンを大きくします */
.marker-hover-effect .marker-pin {
    transform: rotate(-45deg) scale(1.4); /* 1.4倍に滑らかに拡大 */
    box-shadow: 0 0 20px rgba(247, 139, 39, 0.9);
    filter: brightness(1.2);
}

/* マーカー自体は最前面に出すだけ（位置情報は書き換えない） */
.marker-hover-effect {
    z-index: 999 !important;
}

/* ⚠️ 点滅と位置ズレを防ぐため、@keyframes と animation 指定は不要なため削除しました */

/* spot_editor_style.css に追加 */
#all-spot-ai-modal .modal-content {
    /* 既存のモーダルと同じスタイルを適用 */
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%; /* 幅を指定 */
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* --- ヘッダーレイアウト（モダンUI刷新版） --- */

/* コントロールバー全体 */
.controls {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03); /* わずかに影をつけて立体感を */
    flex-wrap: wrap;
    gap: 15px;
}

/* 左側：タイトル＋基本ボタン */
.app-header-left {
    flex-shrink: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 12px; /* タイトルとボタンの間隔 */
}

.app-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    margin-right: 5px;
}

/* 右側：ツールバー */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* 各グループ間の間隔を広めに */
    flex-wrap: wrap;
    justify-content: flex-end;
}

/*ボタングループ*/
.btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
/* グループの区切り線（視覚的な整理） */
.btn-group:not(:last-child)::after {
    content: "";
    display: block;
    width: 1px;
    height: 20px;
    background-color: #ddd;
    margin-left: 12px;
    margin-right: 6px;
}

/* --- ボタン共通スタイル --- */

/* 共通ベース */
.btn-main, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px; /* 角丸を少し柔らかく */
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}
.btn-main:active, .btn-sm:active {
    transform: translateY(1px); /* クリック時の沈み込み */
}

/* メインボタン（読込・保存）: 大きく強調 */
.btn-main {
    padding: 0 20px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    height: 40px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* サブボタン（その他）: 少し小さく */
.btn-sm {
    padding: 0 12px !important;
    font-size: 13px !important;
    height: 32px;
}

/* --- 配色バリエーション (UI Color Scheme) --- */

/* 1. Primary (読込): 安心感のある濃い青 */
.btn-primary { 
    background-color: #0069d9; 
}
.btn-primary:hover { background-color: #0056b3; box-shadow: 0 4px 8px rgba(0,105,217,0.3); }

/* 2. Success (保存): 達成感のある緑 */
.btn-success { 
    background-color: #28a745; 
}
.btn-success:hover { background-color: #218838; box-shadow: 0 4px 8px rgba(40,167,69,0.3); }

/* 3. AI Special (AI一括): 特別なグラデーション */
.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 紫〜青のグラデ */
    color: white;
    font-weight: bold !important;
    border: 1px solid transparent;
}
.btn-ai:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); /* 逆方向へ変化 */
    box-shadow: 0 3px 8px rgba(118, 75, 162, 0.4);
}

/* 4. Secondary (ツール系): 落ち着いたスレートグレー */
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover { background-color: #5a6268; }

/* 5. Light (タイトル横): 邪魔しない白ベース */
.btn-light {
    background-color: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
}
.btn-light:hover { background-color: #e2e6ea; color: #333; }

/* 6. Outline (Excel入力): 控えめな枠線のみ */
.btn-outline {
    background-color: transparent;
    color: #0069d9;
    border: 1px solid #0069d9;
}
.btn-outline:hover { background-color: #f0f7ff; }

/* 7. Danger Outline (提出): 間違って押さないよう控えめに */
.btn-danger-outline {
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}
.btn-danger-outline:hover { background-color: #fff5f5; color: #a71d2a; }


/* --- レスポンシブ対応 --- */
@media (max-width: 1100px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .app-header-left {
        width: 100%;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
        justify-content: space-between; /* タイトルとボタンを左右に離す */
    }
    .toolbar-actions {
        width: 100%;
        justify-content: space-between; /* 均等配置 */
    }
    .btn-group:not(:last-child)::after {
        display: none; /* 狭い画面では区切り線を消す */
    }
}

/* --- ヘッダーレイアウト（モダンUI刷新版） --- */

/* コントロールバー全体 */
.controls {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03); /* わずかに影をつけて立体感を */
    flex-wrap: wrap;
    gap: 15px;
}

/* 左側：タイトル＋基本ボタン */
.app-header-left {
    flex-shrink: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 12px; /* タイトルとボタンの間隔 */
}

.app-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    margin-right: 5px;
}

/* 右側：ツールバー */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* 各グループ間の間隔を広めに */
    flex-wrap: wrap;
    justify-content: flex-end;
}

/*ボタングループ*/
.btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
/* グループの区切り線（視覚的な整理） */
.btn-group:not(:last-child)::after {
    content: "";
    display: block;
    width: 1px;
    height: 20px;
    background-color: #ddd;
    margin-left: 12px;
    margin-right: 6px;
}

/* --- ボタン共通スタイル --- */

/* 共通ベース */
.btn-main, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px; /* 角丸を少し柔らかく */
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}
.btn-main:active, .btn-sm:active {
    transform: translateY(1px); /* クリック時の沈み込み */
}

/* メインボタン（読込・保存）: 大きく強調 */
.btn-main {
    padding: 0 20px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    height: 40px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* サブボタン（その他）: 少し小さく */
.btn-sm {
    padding: 0 12px !important;
    font-size: 13px !important;
    height: 32px;
}

/* --- 配色バリエーション (UI Color Scheme) --- */

/* 1. Primary (読込): 安心感のある濃い青 */
.btn-primary { 
    background-color: #0069d9; 
}
.btn-primary:hover { background-color: #0056b3; box-shadow: 0 4px 8px rgba(0,105,217,0.3); }

/* 2. Success (保存): 達成感のある緑 */
.btn-success { 
    background-color: #28a745; 
}
.btn-success:hover { background-color: #218838; box-shadow: 0 4px 8px rgba(40,167,69,0.3); }

/* 3. AI Special (AI一括): 特別なグラデーション */
.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 紫〜青のグラデ */
    color: white;
    font-weight: bold !important;
    border: 1px solid transparent;
}
.btn-ai:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); /* 逆方向へ変化 */
    box-shadow: 0 3px 8px rgba(118, 75, 162, 0.4);
}

/* 4. Secondary (ツール系): 落ち着いたスレートグレー */
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover { background-color: #5a6268; }

/* 5. Light (タイトル横): 邪魔しない白ベース */
.btn-light {
    background-color: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
}
.btn-light:hover { background-color: #e2e6ea; color: #333; }

/* 6. Outline (Excel入力): 控えめな枠線のみ */
.btn-outline {
    background-color: transparent;
    color: #0069d9;
    border: 1px solid #0069d9;
}
.btn-outline:hover { background-color: #f0f7ff; }

/* 7. Danger Outline (提出): 間違って押さないよう控えめに */
.btn-danger-outline {
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}
.btn-danger-outline:hover { background-color: #fff5f5; color: #a71d2a; }


/* --- レスポンシブ対応 --- */
@media (max-width: 1100px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .app-header-left {
        width: 100%;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
        justify-content: space-between; /* タイトルとボタンを左右に離す */
    }
    .toolbar-actions {
        width: 100%;
        justify-content: space-between; /* 均等配置 */
    }
    .btn-group:not(:last-child)::after {
        display: none; /* 狭い画面では区切り線を消す */
    }
}