/* =========================================
   Style01.css (完整版)
   ========================================= */

/* --- 1. 全域變數定義 (Theme Variables) --- */
:root {
    /* 色彩系統 (Slate & Blue Theme) */
    --bg-dark: #1e293b;
    /* 導航列深色背景 */
    --bg-light: #ffffff;
    /* 工具列與面板背景 */
    --bg-canvas: #e2e8f0;
    /* 畫布背景區 (淺灰) */

    --primary: #3b82f6;
    /* 主題藍色 */
    --primary-hover: #2563eb;
    --accent: #06b6d4;
    /* 強調色 (Cyan) */
    --success: #10b981;
    /* 綠色 (播放) */
    --danger: #ef4444;
    /* 紅色 (Live 標籤) */

    --text-main: #334155;
    /* 主要文字 */
    --text-muted: #64748b;
    /* 次要文字 */
    --text-inv: #f8fafc;
    /* 反白文字 */

    --border: #cbd5e1;
    /* 一般邊框 */
    --border-light: #e2e8f0;
    /* 淺色邊框 */

    /* 尺寸定義 */
    --h-nav: 50px;
    /* 頂部導航高度 */
    --h-toolbar: 52px;
    /* 工具列高度 */
    --w-sidebar: 340px;
    /* 側邊欄寬度 */
}

/* --- 2. 基礎重置 (Reset & Base) --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    height: 100vh;
    /* 佔滿視窗高度 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 防止 Body 捲動 */
}

/* --- 3. 頂部導航列 (Navbar - Dark) --- */
.app-navbar {
    height: var(--h-nav);
    background-color: var(--bg-dark);
    color: var(--text-inv);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.25rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline;
    color: #f8fafc;
}

.version-tag {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #94a3b8;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
    /* text-transform: uppercase; */
}

.global-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
    flex-shrink: 0;
}

/* 檔案按鈕樣式 (隱藏原始 input) */
input[type="file"] {
    display: none;
}

.control-group.file-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-input.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-input.primary:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.4);
}

.btn-input.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-input.secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.digital-twin-pill {
    height: 30px;
    padding: 0 10px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.digital-twin-pill:hover {
    background: rgba(6, 182, 212, 0.22);
    border-color: rgba(6, 182, 212, 0.5);
}

.digital-twin-pill .switch-label {
    color: #06b6d4;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ★★★ 多執行緒 Web Worker 狀態指示器 (Architecture A) ★★★ */
.worker-status-badge {
    height: 30px;
    padding: 0 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #10b981;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.worker-status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    filter: brightness(1.1);
}

.worker-status-badge .status-dot {
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.seed-settings {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.input-with-action {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    height: 30px;
}

.input-with-action input {
    background: transparent;
    border: none;
    color: white;
    width: 60px;
    padding: 0 4px;
    height: 100%;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
}

.input-with-action button {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    cursor: pointer;
    padding: 0 8px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.input-with-action button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.dropdown-dark {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

.dropdown-dark:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* --- 4. 工具列 (Toolbar - Clean & Polished) --- */
.app-toolbar {
    height: var(--h-toolbar);
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    z-index: 100;
    flex-shrink: 0;
    overflow: visible;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 垂直分隔線 */
.divider-v {
    width: 1px;
    height: 20px;
    background-color: var(--border-light);
    margin: 0 2px;
    flex-shrink: 0;
}

/* 播放控制 */
.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    min-width: 86px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
}

.play-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.35);
}

.play-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid var(--border);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.9;
}

.slider-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 8px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

#speedSlider {
    width: 60px;
    cursor: pointer;
    accent-color: var(--primary);
    margin: 0;
}

.icon-muted {
    color: #94a3b8;
    font-size: 0.85rem;
}

.value-badge {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.78rem;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    color: #475569;
    min-width: 28px;
    text-align: center;
}

/* 時間顯示 (Digital Chronometer) */
.time-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    background: #f8fafc;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    color: var(--text-main);
    white-space: nowrap;
    flex-shrink: 0;
}

.time-display .clock-icon {
    color: var(--primary);
    font-size: 0.82rem;
}

.time-display .label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.time-display .time-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e293b;
    min-width: 38px;
    text-align: right;
    white-space: nowrap;
}

.time-display .unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

/* ★★★ LUTI 控制群組 ★★★ */
.luti-control-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 4px 0 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.luti-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: #d97706;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.luti-select {
    height: 26px;
    padding: 0 4px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    background: #ffffff;
    color: #b45309;
    border: 1px solid #fcd34d;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    transition: border-color 0.2s;
}

.luti-select:hover {
    border-color: #f59e0b;
}

.tool-btn-luti {
    height: 26px;
    padding: 0 8px;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25);
}

.tool-btn-luti:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

.tool-btn-luti.active {
    background: #b45309;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 視圖切換按鈕 (Segmented Control) */
.segment-control {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 34px;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.segment-btn {
    border: none;
    background: transparent;
    height: 28px;
    padding: 0 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.segment-btn:hover:not(:disabled) {
    color: var(--text-main);
}

.segment-btn.is-active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

.segment-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 同步旋轉開關 */
.icon-toggle {
    height: 34px;
    width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: #f8fafc;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.icon-toggle input {
    display: none;
}

.icon-toggle label {
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.95rem;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin: 0;
}

.icon-toggle:hover {
    border-color: var(--border);
    background: #f1f5f9;
}

.icon-toggle:hover label {
    color: var(--text-main);
}

.icon-toggle input:checked + label {
    color: var(--primary);
    background: #eff6ff;
    border-radius: 7px;
}

/* 圖層控制 */
.dropdown-light {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    color: var(--text-main);
    font-size: 0.85rem;
    background-color: white;
}

.toggles-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mini-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
    white-space: nowrap;
    /* 強制不換行 */
    align-items: center;
}

.mini-switch:hover {
    color: var(--text-main);
}

.mini-switch input {
    accent-color: var(--primary);
    margin: 0;
}

/* --- 5. 主內容佈局 (Main Layout) --- */
main#main-content {
    flex: 1;
    /* 佔滿剩餘高度 */
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

/* 左側統計面板 */
#stats-panel {
    width: var(--w-sidebar);
    background: #f8fafc;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 5;
}

/* JS 控制隱藏時使用 */
#stats-panel.is-hidden {
    display: none;
}

.panel-header {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.panel-header h2 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.live-badge {
    font-size: 0.65rem;
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    animation: blink 2s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 統計卡片樣式 */
.chart-card,
.table-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.chart-card h3,
.table-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chart-box {
    height: 250px;
    /* [修改] 從 140px 改回 250px 以符合第一版高度 */
    width: 100%;
    position: relative;
}

/* 表格樣式 */
.table-wrapper {
    max-height: 250px;
    overflow-y: auto;
    border-top: 1px solid #f1f5f9;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

th {
    text-align: right;
    padding: 8px;
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 2;
}

td {
    text-align: right;
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-family: 'Roboto Mono', monospace;
}

/* --- 6. 右側畫布容器 (關鍵佈局) --- */
#canvas-container {
    flex: 1;
    /* 填滿剩餘空間 */
    display: flex;
    /* 啟動 Flexbox */
    overflow: hidden;
    position: relative;
    background: var(--bg-canvas);
    width: 100%;
    /* 確保寬度佔滿 */
}

/* 2D 和 3D 容器的共同樣式 */
#networkCanvas,
#threejs-container {
    /* Flex 屬性詳解：
       Grow=1, Shrink=1, Basis=0
       Basis=0 確保當兩者都存在時，忽略內容寬度，嚴格按比例均分 (1:1)
    */
    flex: 1 1 0;

    /* 強制 Canvas 允許縮小，不會被內部內容撐開 */
    min-width: 0;

    height: 100% !important;
    display: block;
    outline: none;
    position: relative;
}

/* 為 2D 畫布添加右邊框，區隔 3D 視窗 */
#networkCanvas {
    border-right: 1px solid var(--border);
}

/* 附註：
   當 JS 將其中一個設為 display: none 時，
   另一個元素的 flex: 1 會讓它自動佔滿 100% 空間。
*/

/* 載入前的空狀態提示 */
#placeholder-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-canvas);
    z-index: 0;
    /* 位於 Canvas 後方 */
    pointer-events: none;
}

.empty-state-content {
    text-align: center;
    color: #94a3b8;
}

.empty-state-content i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-content p {
    font-size: 1rem;
    font-weight: 500;
}

/* --- 7. RWD 響應式調整 --- */
@media (max-width: 1024px) {

    /* 平板模式：隱藏部分文字標籤 */
    .view-controls .segment-btn {
        padding: 5px 8px;
    }
}

@media (max-width: 768px) {

    /* 手機模式：調整版面 */
    .app-navbar {
        padding: 0 10px;
    }

    .brand-text,
    .version-tag {
        display: none;
    }

    /* 隱藏標題文字省空間 */

    .app-toolbar {
        height: auto;
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
    }

    .toolbar-section {
        flex: 1 1 auto;
        /* 自動換行並填滿 */
        justify-content: center;
    }

    .divider-v {
        display: none;
    }

    /* 手機版不需要分隔線 */

    /* 側邊欄改為覆蓋式 (Overlay) */
    #stats-panel {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    #stats-panel.is-active {
        transform: translateX(0);
    }
}

/* --- 新增：工具列按鈕文字堆疊樣式 --- */
.label-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
    /* 緊湊行距 */
    margin-left: 2px;
}

.label-stack .main-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
}

.label-stack .sub-text {
    font-size: 0.6rem;
    /* 小字 */
    color: var(--text-muted);
    transform: scale(0.9);
    /* 稍微再縮小一點 */
    transform-origin: left center;
    white-space: nowrap;
}

/* --- 偵測器群組樣式 (共用標籤) --- */
.detector-group {
    position: relative;
    /* 作為絕對定位子元素的參考點 */
    display: flex;
    align-items: center;
    /* 讓內部的 switch-pair 垂直置中 */
    /* 
       重要：不設定高度或讓它自然撐開，
       這樣它在父層 (.toggles-row) 中就會被視為與一般按鈕一樣高的物件
    */
}

.switch-pair {
    display: flex;
    gap: 12px;
    /* 兩個開關之間的間距 */
    /* 
       這裡不需要額外的 margin-bottom，
       確保它的中心點與左側的「無人機」按鈕中心點一致 
    */
}

/* 1. 上方的開關文字 (定點、區間) */
.tiny-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 400;
    /* [修改] 從 500 改為 400，去除粗體效果 */
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.2s;
}

/* 滑鼠滑過時變色 */
.tiny-switch:hover {
    color: var(--text-main);
}

/* 2. 下方的標籤文字 (偵測器) */
.group-caption {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;

    /* [修改] margin-top:
       原本是 -6px (很貼)，
       現在改為 -2px (微小下移 4px)，讓它與上方按鈕保持一點距離 
    */
    margin-top: -2px;

    text-align: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.8;
    white-space: nowrap;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.tiny-switch input {
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

/* [新增] 恢復偵測器圖表之間的間距 */
#meter-charts-container,
#section-meter-charts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* 圖表之間的間隔 */
}

/* --- Drive Mode HUD --- */
#drive-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* 讓滑鼠可以穿透點擊車輛 */
    z-index: 100;
}

.hud-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 8px;
    text-align: right;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hud-text {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 1);
    margin-bottom: 5px;
}

#drive-hud-speed {
    color: var(--accent);
    font-size: 1.2rem;
}

.hud-message {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px black;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
}

.hud-message.danger {
    color: #ff4444;
    border: 2px solid #ff4444;
    animation: pulse-red 0.5s infinite;
}

.hud-message.success {
    color: #44ff44;
}

.hud-message.info {
    color: #ffffff;
}

.hud-controls-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    color: #ccc;
    font-size: 0.8rem;
}

.btn-icon {
    display: inline-block;
    background: #333;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 0 4px;
    margin: 0 2px;
    font-weight: bold;
    color: white;
}

@keyframes pulse-red {
    0% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.1);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* --- Added for Police Mode --- */

/* 3x2 Grid for Mode Switches (Adjusted) */
.mode-grid {
    display: grid;
    /* 改為 3 列，讓第一排3個，第二排2個(員警+AI) */
    grid-template-columns: repeat(3, auto);
    gap: 4px 10px;
    align-items: center;
}

/* 確保 mini-switch 在 grid 內對齊 */
.mode-grid .mini-switch {
    margin: 0;
    justify-content: flex-start;
}

/* AI Switch specific tweaks */
.ai-switch {
    grid-column: auto;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* Training Panel - Top Right of Map */
.floating-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 320px; /* 稍微加寬一點點以容納捲軸 */
    background: rgba(255, 255, 255, 0.98); /* 稍微不透明一點，避免背景干擾文字 */
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 90;
    
    /* 關鍵佈局設定 */
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* 限制高度不超過視窗的 85% */
    overflow: hidden; /* 防止圓角被子元素切掉 */
}

/* 2. 頂部標題與底部按鈕：防止被壓縮 */
.panel-header-mini,
.panel-actions {
    flex-shrink: 0; /* 空間不足時，這兩區塊不准縮小 */
}

/* 3. 中間內容區：自動伸縮與捲動 */
.panel-options {
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-main);
    
    /* 關鍵捲動設定 */
    flex: 1;           /* 佔滿標題與底部之間的所有剩餘空間 */
    overflow-y: auto;  /* 內容過多時，垂直方向顯示捲軸 */
    min-height: 0;     /* Firefox Flexbox 巢狀捲動修復 */
}

/* (可選) 美化 Webkit 瀏覽器 (Chrome/Edge) 的捲軸 */
.panel-options::-webkit-scrollbar {
    width: 6px;
}
.panel-options::-webkit-scrollbar-track {
    background: transparent;
}
.panel-options::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}
.panel-options::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    margin: 0;
    accent-color: var(--accent);
    /* 使用青色作為強調色 */
    cursor: pointer;
}

.checkbox-label:hover {
    color: var(--primary);
}

.panel-header-mini {
    background: var(--bg-dark);
    color: white;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
}

.stats-info {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
}

.chart-container-mini {
    height: 120px;
    padding: 8px;
    background: #f8fafc;
    flex-shrink: 0;
    /* 防止圖表被壓縮 */
}

.panel-actions {
    padding: 8px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-light);
    background: white;
    flex-shrink: 0;
}

.btn-mini {
    flex: 1;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    color: var(--text-main);
    transition: all 0.2s;
}

.btn-mini:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Police HUD Specifics */
#police-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.police-panel {
    border-color: #44aaff;
    /* 藍色邊框區分員警模式 */
}

/* 確保 toggles-row 能容納 Grid */
.toggles-row {
    align-items: center;
}

/* Optimization Panel Specifics */
.checklist-container {
    max-height: 150px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background: #eff6ff;
}

.checklist-item input {
    margin-right: 8px;
    accent-color: #06b6d4;
    /* Cyan accent */
}

.checklist-item label {
    cursor: pointer;
    flex: 1;
    /* 讓文字區域佔滿剩餘空間，點文字也能觸發 */
    user-select: none;
}

/* --- Path Selector UI Optimization --- */

.path-selector-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.pick-btn {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

/* Hover Effect */
.pick-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

/* 狀態 1: 正在拾取中 (Picking Mode) */
.pick-btn.picking {
    background: #fffbeb;
    /* Light Yellow */
    border-color: #f59e0b;
    /* Amber */
    color: #b45309;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
    animation: pulse-picking 1.5s infinite;
}

.pick-btn.picking .icon-area {
    animation: spin-slow 2s infinite linear;
}

/* 狀態 2: 已選定 (Selected) */
.pick-btn.selected {
    background: #f0fdf4;
    /* Light Green */
    border-color: #22c55e;
    /* Green */
    color: #15803d;
}

.pick-btn .label-area {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pick-btn .label-title {
    font-size: 0.7rem;
    opacity: 0.8;
}

.pick-btn .label-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    font-size: 0.85rem;
}

/* 清除按鈕 (X) */
.btn-clear-selection {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 8px;
    color: #64748b;
    transition: all 0.2s;
    z-index: 2;
    /* 確保浮在按鈕點擊範圍之上 */
}

.btn-clear-selection:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #ef4444;
}

/* 動畫定義 */
@keyframes pulse-picking {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   下拉選單樣式 (Hover Dropdown - 遊戲選項)
   ========================================= */
.dropdown-hover {
    position: relative;
    display: inline-flex;
    white-space: nowrap;
    flex-shrink: 0;
}

.dropdown-btn {
    background-color: #f8fafc;
    color: var(--text-main);
    border: 1px solid var(--border-light);
    height: 34px;
    padding: 0 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    user-select: none;
}

.dropdown-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: var(--border);
}

.dropdown-btn .dd-arrow {
    font-size: 0.62rem;
    opacity: 0.5;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.dropdown-hover:hover {
    z-index: 1001;
}

.dropdown-hover:hover .dropdown-btn .dd-arrow {
    transform: rotate(180deg);
}

.dropdown-btn.toggle-btn {
    cursor: pointer;
}

.dropdown-btn.toggle-btn:hover {
    border-color: var(--primary);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px); 
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    min-width: 130px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    z-index: 1000;
    padding: 8px;
    flex-direction: column;
    gap: 8px;
}

/* ★★★ 解決消失問題的核心：建立透明橋樑 ★★★ */
.dropdown-content::after {
    content: '';
    position: absolute;
    bottom: 100%; /* 位於選單正上方 */
    left: -10%;
    width: 120%;  /* 稍微加寬，避免滑鼠斜向移動時超出範圍 */
    height: 10px; /* 覆蓋按鈕與選單之間的空隙 */
    background: transparent;
}

/* 產生頂部小箭頭 */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: white;
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
}

/* 滑鼠移過時顯示選單 */
.dropdown-hover:hover .dropdown-content {
    display: flex;
}

/* 選單內的按鈕排版調整 */
.dropdown-content .mini-switch {
    width: 100%;
    margin: 0;
    padding: 2px 4px;
    justify-content: flex-start;
    transition: color 0.2s;
}

.dropdown-content .mini-switch:hover {
    color: var(--primary);
}

/* =========================================
   圖層單選按鈕樣式 (Radio Label)
   ========================================= */
.dropdown-content .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
    white-space: nowrap;
    padding: 2px 4px;
    transition: color 0.2s;
}

.dropdown-content .radio-label:hover {
    color: var(--primary);
}

.dropdown-content .radio-label input[type="radio"] {
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ==========================================================================
   ★★★ [Milestone 4] LUTI 都市規劃與交通指標儀表板 (Analytics HUD) 樣式 ★★★
   ========================================================================== */
.luti-hud-panel {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 360px;
    max-height: 75vh;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.15);
    color: #f8fafc;
    z-index: 95;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: width 0.25s, height 0.25s, opacity 0.2s;
}

.luti-hud-panel.minimized .luti-hud-body,
.luti-hud-panel.minimized .luti-hud-footer {
    display: none !important;
}

.luti-hud-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 10px 14px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.luti-hud-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f59e0b;
}

.luti-hud-title-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.5);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.luti-hud-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
}

.hud-icon-btn:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

.luti-hud-body {
    padding: 12px 14px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.luti-hud-body::-webkit-scrollbar {
    width: 5px;
}
.luti-hud-body::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 3px;
}

/* 時段與 24H 演繹控制組 */
.luti-section {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px;
}

.luti-section-hdr {
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.luti-periods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.luti-period-btn {
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.luti-period-btn:hover {
    background: #1e293b;
    color: #f8fafc;
    border-color: #64748b;
}

.luti-period-btn.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.15));
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.luti-24h-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.luti-play-btn {
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.luti-play-btn:hover {
    background: #0369a1;
}

.luti-play-btn.playing {
    background: #ea580c;
}

.luti-clock-badge {
    background: #0284c7;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    white-space: nowrap;
}

/* 數據卡片網格 */
.luti-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.luti-kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.luti-kpi-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
}

.luti-kpi-box .val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    font-family: 'Roboto Mono', monospace;
}

.luti-kpi-box .lbl {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
}

.luti-kpi-box.highlight-amber .val { color: #f59e0b; }
.luti-kpi-box.highlight-blue .val { color: #38bdf8; }
.luti-kpi-box.highlight-green .val { color: #34d399; }
.luti-kpi-box.highlight-orange .val { color: #fb923c; }

/* 服務水準 (LOS) 標籤 */
.los-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    font-weight: 900;
    font-size: 0.85rem;
    color: white;
    letter-spacing: 0.5px;
}

.los-a { background: #10b981; }
.los-b { background: #22c55e; }
.los-c { background: #84cc16; color: #0f172a; }
.los-d { background: #f59e0b; }
.los-e { background: #f97316; }
.los-f {
    background: #ef4444;
    animation: losPulse 1.2s infinite;
}

@keyframes losPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.luti-alert-box {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    animation: alertBlink 1.5s ease-in-out infinite alternate;
}

@keyframes alertBlink {
    from { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.6); }
    to { background: rgba(239, 68, 68, 0.35); border-color: #ef4444; }
}

/* 運具分擔率視覺 */
.luti-chart-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    margin-top: 4px;
}

.luti-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.luti-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.luti-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* 沙盒調整控制組 */
.luti-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    margin-top: 6px;
}
.luti-slider-row label {
    width: 60px;
    color: #cbd5e1;
    font-weight: 600;
}
.luti-slider-row input[type="range"] {
    flex: 1;
    accent-color: #f59e0b;
}
.luti-slider-row span {
    width: 42px;
    text-align: right;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: #f59e0b;
}

.luti-quick-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.btn-scenario {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-scenario:hover {
    background: #334155;
    color: #f8fafc;
    border-color: #94a3b8;
}

.btn-scenario.surge:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fca5a5;
}

/* 底部操作按鈕 */
.luti-hud-footer {
    padding: 10px 14px;
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-hud-tool {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-hud-tool:hover {
    background: #334155;
    color: #fff;
}

.btn-hud-tool.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-primary-hud {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #f59e0b;
    color: white;
}

.btn-primary-hud:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* ==========================================================================
   ★★★ Embed Mode (首頁或第三方無縫嵌入模式) ★★★
   ========================================================================== */
body.embed-mode {
    height: 100vh !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f8fafc !important;
}

body.embed-mode .app-navbar,
body.embed-mode .app-toolbar,
body.embed-mode #stats-panel,
body.embed-mode #placeholder-text,
body.embed-mode #opt-panel,
body.embed-mode #police-panel,
body.embed-mode #flow-control-panel,
body.embed-mode #luti-hud-container {
    display: none !important;
}

body.embed-mode #main-content {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.embed-mode #canvas-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

body.embed-mode .embed-floating-controls {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 5px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    user-select: none;
}

body.embed-mode .embed-floating-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

body.embed-mode .embed-floating-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
}

body.embed-mode .embed-floating-btn.active {
    background: #eff6ff;
    color: #2563eb;
}



