/* Contents from C:\Users\azulc\GeminiProjects\tower_tool\css\style.css */
:root {
            --bg-main: #1E1E1E;
            --bg-panel: #2D2D2D;
            --bg-panel-light: #3a3a3a;
            --bg-hover: #444444;
            --border-color: #444444;
            --border-color-light: #555555;
            --primary-accent: #70F0E0;
            --primary-accent-dark: #4faba0;
            --text-main: #F0F0F0;
            --text-subtle: #9E9E9E;
            --text-disabled: #6c6c6c;
            --rush-color: #B3B3B5;
            --counter-color: #F36C21;
            --burst-color: #5BC0DE;
            --font-main: 'Noto Sans JP', sans-serif;
            --danger-color: #e53e3e;
            --success-color: #48bb78;
            --warning-color: #ecc94b;
            --info-color: #3182ce;

            /* Node Colors */
            --node-color-battle: #e53e3e;
            --node-color-battle-rgb: 229, 62, 62;
            --node-color-start: #9a7fcc;
            --node-color-start-rgb: 154, 127, 204;
            --node-color-boss: #83477c;
            --node-color-boss-rgb: 131, 71, 124;
            --node-color-random: #f0f0f0;
            --node-color-random-rgb: 240, 240, 240;
            --node-color-tower-power: #00793D;
            --node-color-tower-power-rgb: 00, 121, 61;
            --node-color-recovery-r: #B3B3B5;
            --node-color-recovery-r-rgb: 179, 179, 181;
            --node-color-recovery-c: #F36C21;
            --node-color-recovery-c-rgb: 243, 108, 33;
            --node-color-recovery-b: #5BC0DE;
            --node-color-recovery-b-rgb: 91, 192, 222;
        }
        *, *::before, *::after { box-sizing: border-box; }
        html { color-scheme: dark; }
        body {
            background-color: var(--bg-main);
            color: var(--text-main);
            font-family: var(--font-main);
            margin: 0;
            padding: 0;
            font-size: 14px;
            line-height: 1.6;
        }
        #root {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }
        .app-wrapper {
            display: flex;
            flex-direction: column;
            padding: 16px;
            height: 100%;
        }
        .main-header {
            display: flex;
            justify-content: space-between; /* Re-add for right-alignment */
            align-items: center;
            padding: 0 24px 16px 24px; /* Add horizontal padding */
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
        }
        .main-header h1 {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-main);
            margin: 0;
        }
        .main-content {
            padding: 1rem;
            flex-grow: 1;
            overflow: hidden;
        }

        .desktop-grid-container {
            display: flex;
            gap: 1rem;
            height: calc(100vh - 130px); /* Adjust based on header/footer height */
        }

        .left-panel {
            flex: 0 0 400px; /* Fixed width */
            min-width: 0; /* Prevents overflow issues with flexbox */
            overflow-y: auto;
            background-color: var(--bg-panel);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1rem;
        }

        .right-panel {
            flex: 1; /* Takes remaining space */
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .dashboard-container {
            flex-shrink: 0;
            background-color: var(--bg-panel);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1rem;
            overflow-y: auto;
        }

        .details-container {
            flex-grow: 1;
            background-color: var(--bg-panel);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1rem;
            overflow-y: auto;
        }

        /* Override for mobile */
        .mobile-view-container .left-panel {
            background-color: transparent;
            border: none;
            padding: 0;
        }

        .map-area {
            background-color: var(--bg-panel);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 16px;
            overflow-y: auto;
            flex-grow: 1;
        }
        .card {
            background-color: var(--bg-panel-light);
            border: 1px solid var(--border-color-light);
            border-radius: 6px;
            padding: 16px;
            margin-bottom: 16px;
        }
        .card-header {
            font-size: 1.2em;
            font-weight: 700;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }
        /* Component Styles */
        .tabs { display: flex; gap: 8px; }
        .tab-button {
            font-family: var(--font-main);
            font-size: 1.2rem; /* Match mega menu title size */
            font-weight: 500;
            padding: 8px 16px;
            border: 1px solid var(--border-color);
            background-color: var(--bg-panel);
            color: var(--text-subtle);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .tab-button.active,
        .tab-button:hover {
            background-color: var(--primary-accent);
            color: var(--bg-main);
            border-color: var(--primary-accent);
            font-weight: 700;
        }
        .btn {
            font-family: var(--font-main);
            font-size: 14px;
            font-weight: 500;
            padding: 10px 16px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            text-align: center;
        }
        .btn-primary {
            background-color: var(--primary-accent);
            color: var(--bg-main);
            font-weight: 700;
        }
        .btn-primary:hover { background-color: var(--primary-accent-dark); }
        .btn-secondary {
            background-color: var(--bg-panel-light);
            color: var(--text-main);
            border: 1px solid var(--border-color-light);
        }
        .btn-secondary:hover { background-color: var(--bg-hover); }
        .btn-danger { background-color: var(--danger-color); color: white; }
        .btn-success { background-color: var(--success-color); color: white; }
        .btn-warning { background-color: var(--warning-color); color: var(--bg-main); }
        .btn-ghost {
            background-color: transparent;
            color: var(--text-subtle);
            border: 1px solid var(--border-color-light);
        }
        .btn-ghost:hover {
            background-color: var(--bg-hover);
            color: var(--text-main);
            border-color: var(--border-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        .btn:disabled {
            background-color: #4a5568;
            color: #a0aec0;
            cursor: not-allowed;
        }
        .input-field, .select-field {
            width: 100%;
            background-color: var(--bg-main);
            border: 1px solid var(--border-color-light);
            border-radius: 4px;
            padding: 8px 12px;
            color: var(--text-main);
            font-family: var(--font-main);
            font-size: 14px;
            transition: all 0.2s ease;
        }
        .input-field:focus, .select-field:focus {
            outline: none;
            border-color: var(--primary-accent);
            box-shadow: 0 0 0 2px rgba(112, 240, 224, 0.3);
        }
        .select-field:hover {
            border-color: var(--primary-accent-dark);
            transform: scale(1.02);
        }
        .label {
            display: block;
            font-weight: 500;
            margin-bottom: 8px;
            color: var(--text-subtle);
        }
        /* Style-specific colors */
        .rush-text { color: var(--rush-color); }
        .counter-text { color: var(--counter-color); }
        .burst-text { color: var(--burst-color); }
        .rush-bg { background-color: var(--rush-color); color: var(--bg-main); }
        .counter-bg { background-color: var(--counter-color); color: white; }
        .burst-bg { background-color: var(--burst-color); color: var(--bg-main); }
        /* Map Styles */
        .floor-grid { margin-bottom: 24px; }
        .floor-header {
            font-size: 1.5em;
            font-weight: 700;
            padding-bottom: 8px;
            margin-bottom: 16px;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-main);
        }
        .floor-header span { font-size: 0.7em; color: var(--text-subtle); font-weight: 400; }
        .map-node-container {
            position: relative; /* For memo tooltip positioning */
            display: flex;
            align-items: center;
            justify-content: center;
            height: 48px;
        }
        .memo-tooltip {
            visibility: hidden;
            opacity: 0;
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            margin-bottom: 8px;
            background-color: var(--bg-main);
            color: var(--text-main);
            border: 1px solid var(--border-color-light);
            border-radius: 6px;
            padding: 8px 12px;
            font-size: 12px;
            width: 200px;
            white-space: pre-wrap; /* メモの改行を反映 */
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            z-index: 10;
            transition: opacity 0.2s, visibility 0.2s;
        }
        .map-node-container:hover .memo-tooltip {
            visibility: visible;
            opacity: 1;
        }
        .map-node {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 3px solid transparent;
            background-clip: content-box;
            padding: 2px;
            position: relative;
        }
        .map-node:hover { 
            transform: scale(1.15); 
            box-shadow: 0 0 15px rgba(112, 240, 224, 0.5); 
        }
        .map-node-icon {
            width: 100%;
            height: 100%;
            background-size: 60%;
            background-position: center;
            background-repeat: no-repeat;
            border-radius: 50%;
        }
        .node-color-start { background-color: var(--node-color-start); }
        .node-color-battle { background-color: var(--node-color-battle); }
        .node-color-boss { background-color: var(--node-color-boss); }
        .node-color-recovery-RANDOM { background-color: var(--node-color-random); }
        .node-color-tower-power { background-color: var(--node-color-tower-power); }
        .node-color-recovery-R { background-color: var(--node-color-recovery-r); }
        .node-color-recovery-C { background-color: var(--node-color-recovery-c); }
        .node-color-recovery-B { background-color: var(--node-color-recovery-b); }
        .node-color-tower-power { background-color: var(--node-color-tower-power); }
        .node-color-attack-buff, .node-color-defense-buff, .node-color-hp-buff, .node-color-status-buff { background-color: var(--node-color-random); }

        .map-node.current-position .map-node-icon {
            background-color: transparent !important; /* アイコン背景の塗りつぶしを強制的に解除 */
        }
        .map-node.current-position {
            border: 3px solid var(--primary-accent) !important; /* 枠線を強調 */
            transform: scale(1.1);
            animation: pulse-border 2s infinite;
        }
        @keyframes pulse-border {
            0% {
                box-shadow: 0 0 0 0 rgba(112, 240, 224, 0.7);
            }
            70% {
                box-shadow: 0 0 0 6px rgba(112, 240, 224, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(112, 240, 224, 0);
            }
        }

        .node-state-cleared { opacity: 0.5; }
        .node-state-planned { border-color: var(--success-color); }
        .node-state-inaccessible { opacity: 0.3; cursor: not-allowed; }
        .node-state-inaccessible:hover { transform: none; box-shadow: none; }

        @keyframes pulse-border-cleared {
            0% {
                border-color: var(--primary-accent-dark);
            }
            50% {
                border-color: var(--primary-accent);
            }
            100% {
                border-color: var(--primary-accent-dark);
            }
        }

        .node-cleared {
            border: 3px solid var(--primary-accent-dark);
            animation: pulse-border-cleared 2.5s infinite;
        }
        .node-accessible {
            border: 3px dashed var(--primary-accent);
            animation: pulse-border-accessible 2.5s infinite;
        }
        .node-inaccessible {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .node-inaccessible:hover { 
            transform: none; 
            box-shadow: none; 
        }

        @keyframes pulse-border-accessible {
            0% {
                border-color: var(--primary-accent);
            }
            50% {
                border-color: var(--primary-accent-dark);
            }
            100% {
                border-color: var(--primary-accent);
            }
        }

        .map-line { stroke: var(--border-color); stroke-width: 1.5; }
        .line-cleared { 
            stroke: var(--primary-accent-dark);
            stroke-width: 2.5;
        }
        .line-plan {
            stroke: var(--info-color);
            stroke-width: 2.5;
            stroke-dasharray: 5, 5;
        }
        .line-traversed {
            stroke: white;
            stroke-width: 3;
            stroke-linecap: round;
        }

        .floor-highlight { background-color: rgba(112, 240, 224, 0.05); }
        /* Resource Dashboard (Footer) */
        .resource-dashboard {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: rgba(45, 45, 45, 0.9);
            backdrop-filter: blur(5px);
            border-top: 1px solid var(--border-color);
            border-radius: 8px 8px 0 0;
            transition: transform 0.3s ease-in-out;
            z-index: 100;
        }
        .resource-dashboard.is-collapsed {
            transform: translateY(calc(100% - 50px)); /* ヘッダーの高さだけ見えるように */
        }
        .dashboard-header {
            display: flex;
            justify-content: center; /* 中央揃え */
            align-items: center;
            padding: 12px 16px;
            cursor: pointer;
            position: relative;
            height: 50px;
        }
        .dashboard-header h3 { 
            margin: 0;
            font-size: 1.2em;
            font-weight: 700;
        }
        .dashboard-toggle {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 24px;
            font-weight: bold;
            color: var(--text-subtle);
        }
        .dashboard-content {
            padding: 0 16px 16px 16px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
        }
        .fatigue-group .progress-bar {
            width: 100%;
            height: 8px;
            background-color: var(--bg-main);
            border-radius: 4px;
            overflow: hidden;
            margin-top: 4px;
        }
        .fatigue-group .progress-bar-inner {
            height: 100%;
            border-radius: 4px;
            transition: width 0.3s ease;
        }
        .fatigue-list {
            font-size: 12px;
            max-height: 100px;
            overflow-y: auto;
            padding-right: 8px;
        }
        .fatigue-list::-webkit-scrollbar { width: 4px; }
        .fatigue-list::-webkit-scrollbar-thumb { background: var(--border-color-light); border-radius: 2px; }
        /* Modal */
        dialog {
            background-color: var(--bg-panel);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            color: var(--text-main);
            padding: 40px;
            width: 95%;
            max-width: 1100px;
        }
        dialog::backdrop {
            background-color: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(3px);
        }
        .modal-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 16px;
            max-height: 60vh;
            overflow-y: auto;
            padding: 16px;
        }
        .plan-megido-slot {
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 4px;
            transition: all 0.2s ease;
            cursor: pointer;
            border-radius: 6px;
        }
        .plan-megido-slot.empty {
            border: 2px solid var(--primary-accent);
            color: var(--primary-accent);
            background-color: transparent;
        }
        .plan-megido-slot.empty:hover {
            background-color: var(--primary-accent);
            color: var(--bg-main);
            border-color: var(--primary-accent);
        }
        .plan-megido-slot.filled {
            background-color: var(--bg-panel-light);
            border: 1px solid var(--border-color-light);
        }
        .plan-megido-slot.filled:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            border-color: var(--primary-accent);
        }
        .modal-item-btn {
            background-color: var(--bg-panel-light);
            border: 1px solid var(--border-color-light);
            border-radius: 4px;
            padding: 12px 8px;
            text-align: center;
            transition: all 0.2s ease;
            cursor: pointer;
        }
        .modal-item-btn:hover {
            background-color: var(--primary-accent);
            color: var(--bg-panel);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        .modal-item-btn:hover .rush-text,
        .modal-item-btn:hover .counter-text,
        .modal-item-btn:hover .burst-text,
        .modal-item-btn:hover p {
            color: var(--bg-panel);
        }
        .modal-item-btn.selected {
            background-color: var(--primary-accent-dark);
            color: var(--bg-main);
            border-color: var(--primary-accent);
        }
        .modal-item-btn.selected:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 4px 12px rgba(112, 240, 224, 0.4);
        }
        .modal-item-btn:disabled {
            background-color: var(--bg-main);
            color: var(--text-disabled);
            cursor: not-allowed;
            opacity: 0.7;
            transform: none;
            box-shadow: none;
        }

        /* Ownership Table Adjustments */
        .ownership-table th {
            font-size: 12px; /* Smaller header font */
        }
        .ownership-table .select-field,
        .ownership-table .input-field {
            font-size: 12px; /* Smaller font for inputs */
            padding: 4px 6px; /* Adjust padding */
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: var(--primary-accent);
            color: var(--bg-main);
            padding: 12px 24px;
            border-radius: 6px;
            font-weight: 700;
            z-index: 1000;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            white-space: pre-wrap; /* Add this */
            text-align: center; /* Maybe add this for better multi-line display */
        }
        /* --- Formation Manager --- */
        .formation-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        /* Misc */
        .placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            height: 100%;
            color: var(--text-subtle);
        }
        .form-section {
            margin-bottom: 20px;
        }
        .table-container {
            flex-grow: 1;
            overflow-y: auto;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            padding: 10px;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }
        thead th {
            background-color: var(--bg-panel-light);
            position: sticky;
            top: 0;
        }
        tbody tr:hover {
            background-color: var(--bg-hover);
        }
        /* Selected Node Style */
        .map-node.node-state-selected {
            border-color: var(--primary-accent); /* 強調色で枠をハイライト */
            box-shadow: 0 0 10px rgba(112, 240, 224, 0.7); /* 光るようなエフェクト */
            transform: scale(1.1); /* 少し拡大 */
        }

        /* Enemy Detail Overlay */
        .enemy-detail-overlay {
            position: absolute;
            top: 16px;
            left: 16px;
            right: 16px;
            bottom: 16px;
            background-color: rgba(30, 30, 30, 0.95);
            backdrop-filter: blur(8px);
            z-index: 50;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
        }

        /* Small Filter Controls */
        .filter-controls-small .input-field,
        .filter-controls-small .select-field {
            font-size: 12px;
            padding: 4px 8px;
        }
        .filter-controls-small .label {
            font-size: 12px;
            margin-bottom: 0;
        }
        .filter-controls-small > div {
            gap: 8px !important;
        }

        /* Tag Button */
        .tag-button-item {
            font-size: 11px;
            background-color: var(--bg-main);
            color: var(--primary-accent);
            padding: 2px 8px;
            border-radius: 12px;
            border: 1px solid var(--primary-accent);
            transition: all 0.2s ease;
        }
        .tag-button-item:hover {
            background-color: var(--primary-accent-dark);
            color: var(--bg-main);
            transform: scale(1.05);
            cursor: pointer;
        }

/* --- Mega Menu --- */
.mega-menu-container {
    position: absolute; /* Changed for relative positioning */
    z-index: 200;
}

.mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Opacity changed to 0.5 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mega-menu-panel {
    position: absolute; /* Changed for relative positioning */
    top: 10px; /* Position below the trigger */
    left: 0;
    z-index: 201;
    background-color: var(--bg-panel); /* チャコールグレー */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 900px; /* Width adjusted for 2 columns */
    max-width: 900px; /* Width adjusted for 2 columns */
    padding: 16px;
    display: flex; /* Use flex for columns */
    flex-direction: row; /* Arrange columns horizontally */
    gap: 16px; /* Gap between columns */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.mega-menu-column {
    display: flex;
    flex-direction: column;
    flex: 1; /* Each column takes up equal space */
    gap: 12px; /* Gap between items in a column */
}

.mega-menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.mega-menu-item:hover {
    background-color: var(--bg-panel-light);
}

.mega-menu-item.active {
    background-color: rgba(112, 240, 224, 0.1);
    border-color: var(--primary-accent);
}

.mega-menu-icon {
    width: 40px;
    height: 40px;
    margin-right: 20px;
    flex-shrink: 0;
}

.mega-menu-text {
    display: flex;
    flex-direction: column;
}

.mega-menu-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-main); /* オフホワイト */
}

.mega-menu-description {
    font-size: 0.85rem;
    color: var(--text-subtle); /* グレー */
}


/* --- Header Mode Selector --- */
.mode-selector-wrapper {
    position: relative; /* Anchor for the absolute menu */
}

.mode-selector {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 14px; /* Adjusted padding for vertical alignment */
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.mode-selector:hover {
    background-color: var(--bg-hover);
}

.mode-selector-icon {
    width: 36px; /* Made icon bigger */
    height: 36px; /* Made icon bigger */
    margin-right: 12px;
}

.mode-selector-name {
    font-size: 1.4rem; /* Made text bigger */
    font-weight: 700;
    color: var(--primary-accent); /* Use accent color */
}

.mode-selector-arrow {
    margin-left: 12px;
    font-size: 1.6rem; /* Made arrow bigger */
    color: var(--text-subtle);
    transition: transform 0.2s ease;
}

.mode-selector.open .mode-selector-arrow {
    transform: rotate(180deg);
}

.btn-ghost.record {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}
.btn-ghost.record:hover {
    background-color: var(--primary-accent);
    color: var(--bg-main);
}

.btn-ghost.retire {
    border-color: var(--danger-color);
    color: var(--danger-color);
}
.btn-ghost.retire:hover {
    background-color: var(--danger-color);
    color: var(--bg-main);
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Ghost button style for empty megido slots */
.megido-slot-empty {
    border: 2px solid var(--primary-accent);
    background-color: transparent;
    color: var(--primary-accent);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.megido-slot-empty:hover {
    background-color: var(--primary-accent);
    color: var(--bg-main);
}

/* Ghost button for Win */
.btn-ghost-win {
    background-color: transparent;
    border: 1px solid var(--primary-accent);
    color: var(--primary-accent);
}
.btn-ghost-win:hover {
    background-color: var(--primary-accent);
    color: var(--bg-main);
}

/* Ghost button for Lose */
.btn-ghost-lose {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}
.btn-ghost-lose:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Ghost button for Retire */
.btn-ghost-retire {
    background-color: transparent;
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}
.btn-ghost-retire:hover {
    background-color: var(--warning-color);
    color: var(--bg-main);
}

.fatigue-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.node-planned {
    border: 2px solid #FDFC00 !important;
    border-radius: 50%;
}

.enemy-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background-color: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    width: max-content; /* Adjust width to content */
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
    transition: opacity 0.2s, visibility 0.2s;
}

.map-node-container:hover .enemy-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Disable animations for past floors */
.past-floor .map-node,
.past-floor .map-node-icon {
    animation: none !important;
}

.btn-icon {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


/* Settings Modal */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    backdrop-filter: blur(4px);
}

.settings-modal {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.settings-content {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.settings-sidebar {
    flex: 0 0 200px;
    padding: 16px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-tab-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-tab-button:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.settings-tab-button.active {
    background-color: var(--primary-accent);
    color: var(--bg-main);
    font-weight: 700;
}

.settings-main {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
}

.settings-actions {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

/* Achievement List */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background-color: var(--bg-main);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.achievement-item.unlocked {
    opacity: 1;
    border-color: var(--primary-accent);
    box-shadow: 0 0 10px rgba(112, 240, 224, 0.3);
}

.achievement-icon {
    font-size: 28px;
}

.achievement-name {
    margin: 0 0 4px 0;
    font-weight: 700;
    color: var(--text-main);
}

.achievement-item.unlocked .achievement-name {
    color: var(--primary-accent);
}

.achievement-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-subtle);
}

.light-mode {
    --bg-main: #F0F0F0; /* Adjusted as requested */
    --bg-panel: #F8F8F8; /* Slightly lighter for panels */
    --bg-panel-light: #FFFFFF;
    --bg-hover: #E9ECEF;
    --border-color: #DCDCDC; /* Adjusted for new background */
    --border-color-light: #EAEAEA;
    --primary-accent: #007BFF;
    --primary-accent-dark: #0056b3;
    --text-main: #212529;
    --text-subtle: #6C757D;
    --text-disabled: #ADB5BD;
}

.light-mode .btn-icon img {
    filter: invert(1); /* Invert icon in light mode */
}

.light-mode .mega-menu-overlay {
    background-color: rgba(255, 255, 255, 0.5);
}

.achievement-item.secret {
    background-color: #000;
    border-color: var(--border-color-light);
}

.about-section {
    margin-bottom: 24px;
}
.about-section h4 {
    font-weight: 700;
    color: var(--primary-accent);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.about-section p, .about-section ul {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-subtle);
}
.about-section a {
    color: var(--primary-accent);
    text-decoration: none;
}
.about-section a:hover {
    text-decoration: underline;
}

.mail-subject-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.mail-subject-selector label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.about-section ul {
    padding-left: 20px;
}
.toast-simple {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-accent);
    color: var(--bg-main);
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    white-space: pre-wrap; /* Add this */
    text-align: center; /* Maybe add this for better multi-line display */
}

.select-field-btn {
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--primary-accent);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--primary-accent);
    font-family: var(--font-main);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-field-btn:hover {
    background-color: var(--primary-accent);
    color: var(--bg-main);
}

/* === Achievement Toast === */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2000;
  animation: slideInAndFadeIn 0.5s ease, fadeOut 0.5s ease 4s forwards;
}

.toast-content {
  display: flex;
  align-items: center;
  background-color: var(--bg-panel-raised, #333);
  padding: 12px 20px;
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  min-width: 300px;
  max-width: calc(100vw - 40px);
  border: 1px solid var(--border-color);
}

.toast-icon {
  margin-right: 15px;
}

.toast-icon img {
  width: 32px;
  height: 32px;
}

.toast-text {
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-size: 16px;
  font-weight: bold;
}

.toast-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

@keyframes slideInAndFadeIn {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* --- Formation Editor: Megido Slot (Base) --- */
.megido-slot-name { font-size: 10px; font-weight: 700; cursor: pointer; margin: 0; line-height: 1.2; margin-bottom: 4px; }
.megido-slot-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 4px; font-size: 6px; }
.megido-slot-stat-select { padding: 0; font-size: 6px; width: 100%; }
.megido-slot-orb-btn { width: 100%; text-align: left; padding: 4px 6px; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.megido-slot-reishou-label { font-weight: 500; margin: 0; font-size: 8px; }
.reishou-chip { display: inline-block; padding: 1px 4px; margin: 1px; border-radius: 8px; background-color: var(--bg-main); font-size: 6px; border: 1px solid var(--border-color); white-space: nowrap; cursor: pointer; }
.megido-slot-reishou-none { color: var(--text-subtle); margin: 0; font-size: 8px; text-align: center; }

/* --- Formation Editor: Megido Slot (Desktop) --- */
@media (min-width: 769px) {
    .megido-slot-editor-desktop .card {
        min-height: 260px;
    }
    .megido-slot-editor-desktop .megido-slot-name {
        font-size: 16px;
        line-height: 1.2;
    }
    .megido-slot-editor-desktop .megido-slot-stats {
        font-size: 12px;
    }
    .megido-slot-editor-desktop .megido-slot-stat-select {
        font-size: 12px;
    }
    .megido-slot-editor-desktop .megido-slot-orb-btn {
        font-size: 14px;
        padding: 6px 8px;
    }
    .megido-slot-editor-desktop .megido-slot-reishou-label {
        font-size: 14px;
    }
    .megido-slot-editor-desktop .reishou-chip {
        font-size: 12px;
        padding: 2px 6px;
    }
    .megido-slot-editor-desktop .megido-slot-reishou-none {
        font-size: 14px;
    }
}

.desktop-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
}

.desktop-nav-tabs, .desktop-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.desktop-dashboard-footer {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 450px;
    z-index: 900;
}

/* 汎用モーダルスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100; /* 他のUIより手前に表示 */
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 800px; /* MapSearchModalに合わせて調整 */
    max-height: 80vh; /* MapSearchModalに合わせて調整 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* MapSearchModal Specific Styles */
.map-search-controls {
    margin-bottom: 1.5rem;
}

.map-search-controls .free-text-search {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.map-search-controls .free-text-search input {
    flex-grow: 1;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color-light);
    background-color: var(--bg-main);
    color: var(--text-main);
}

.map-search-controls .free-text-search button {
    flex-shrink: 0;
}

.map-search-controls .predefined-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#map-search-results {
    flex-grow: 1;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.search-result-floor-group {
    margin-bottom: 1.5rem;
}

.search-result-floor-group h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-accent);
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.search-result-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.search-result-item {
    background-color: var(--bg-panel-light);
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative; /* For overlay */
    overflow: hidden;
}

.search-result-item:hover {
    background-color: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.search-result-item.highlight-rush {
    background-color: rgba(var(--node-color-recovery-r-rgb), 0.2);
    border-color: var(--node-color-recovery-r);
}
.search-result-item.highlight-counter {
    background-color: rgba(var(--node-color-recovery-c-rgb), 0.2);
    border-color: var(--node-color-recovery-c);
}
.search-result-item.highlight-burst {
    background-color: rgba(var(--node-color-recovery-b-rgb), 0.2);
    border-color: var(--node-color-recovery-b);
}
.search-result-item.highlight-random {
    background-color: rgba(var(--node-color-random-rgb), 0.1);
    border-color: var(--node-color-random);
}
.search-result-item.highlight-tower-power {
    background-color: rgba(var(--node-color-tower-power-rgb), 0.2);
    border-color: var(--node-color-tower-power);
}

.search-result-item .floor-info {
    font-size: 0.8em;
    color: var(--text-subtle);
    margin-bottom: 4px;
}

.search-result-item .square-type {
    font-weight: 700;
    margin-bottom: 4px;
}

.search-result-item .square-details {
    font-size: 0.9em;
    color: var(--text-subtle);
}

.search-result-item .formation-name {
    font-weight: 500;
    color: var(--primary-accent);
    margin-top: 4px;
}

.search-result-item .enemy-name {
    font-size: 0.9em;
    color: var(--danger-color);
}

.search-result-item .megido-names {
    font-size: 0.8em;
    color: var(--text-main);
    margin-top: 4px;
}

.search-result-item .tags {
    font-size: 0.7em;
    color: var(--info-color);
    margin-top: 4px;
}

.search-result-item .share-image-button {
    margin-top: 8px;
    padding: 4px 8px;
    font-size: 0.8em;
    background-color: var(--primary-accent);
    color: var(--bg-main);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item .share-image-button:hover {
    background-color: var(--primary-accent-dark);
}


/* Contents from C:\Users\azulc\GeminiProjects\tower_tool\css\guidance.css */

@keyframes subtle-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--animation-color-rgb), 0.1);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(var(--animation-color-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--animation-color-rgb), 0);
    }
}

@keyframes strong-pulse {
    0% {
        box-shadow: 0 0 2px 0 rgba(var(--animation-color-rgb), 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 10px 12px rgba(var(--animation-color-rgb), 0);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 2px 0 rgba(var(--animation-color-rgb), 0);
        transform: scale(1);
    }
}

.node-candidate .map-node-icon {
    animation: subtle-pulse 4s infinite;
    animation-delay: calc(var(--animation-rand, 0.1) * 4s);
}

.node-recommended .map-node-icon {
    animation: strong-pulse 2s infinite;
    border: 1px solid rgba(255, 215, 0, 0.7);
}

.line-candidate {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    animation: dash-flow 20s linear infinite;
}

.line-recommended {
    stroke: rgba(255, 215, 0, 0.7);
    stroke-width: 3;
    stroke-dasharray: 8, 4;
    animation: dash-flow 15s linear infinite;
}

@keyframes dash-flow {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Footer Glow --- */
@keyframes footer-breath {
    0% {
        border-top-color: rgba(217, 83, 79, 0.2);
    }
    50% {
        border-top-color: rgba(217, 83, 79, 0.8);
    }
    100% {
        border-top-color: rgba(217, 83, 79, 0.2);
    }
}

.footer-glow-1 {
    animation: footer-breath 5s ease-in-out infinite;
}

.footer-glow-2 {
    animation: footer-breath 3s ease-in-out infinite;
}

.footer-glow-3 {
    animation: footer-breath 1.5s ease-in-out infinite;
}

/* --- Coordinated Signs --- */
.desaturate-panel {
    filter: saturate(0.97);
    transition: filter 0.5s ease-in-out;
}

.footer-recovery-glow {
    border-top-color: rgba(112, 240, 224, 0.7) !important; /* Use primary accent color, toned down */
    animation-duration: 1.2s !important; /* Speed up animation slightly less aggressively */
}

/* Contents from C:\Users\azulc\GeminiProjects\tower_tool\css\mobile.css */
@media (max-width: 767px) {
    /* for Mobile Layout */

    /* The mobile-view class is added to the body via JS */
    body.mobile-view .main-content {
        /* PCでは横並びのレイアウトを、スマホでは縦積みに変更 */
        flex-direction: column !important;
        /* スマホでは不要な余白を削除 */
        padding-top: 101px !important; /* Offset for fixed header */
        gap: 0 !important;
    }

    body.mobile-view .left-panel {
        /* 親要素いっぱいに広がるように設定 */
        flex: 1 1 auto !important;
        width: 100% !important;
        /* 高さはコンテンツに応じて自動調整 */
        height: auto !important;
        /* パネル内のスクロールではなく、ページ全体のスクロールを有効にする */
        overflow-y: visible !important;
    }

    body.mobile-view .right-panel {
        /* 右側の詳細パネルは非表示にする */
        display: none;
    }

    /* --- Resource Dashboard (Mobile) --- */
    body.mobile-view .resource-dashboard {
        border-bottom: 1px solid var(--border-color, #ccc);
        background-color: var(--bg-panel, #fff);
    }

    body.mobile-view .dashboard-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        cursor: pointer;
    }

    body.mobile-view .dashboard-summary-info {
        display: flex;
        align-items: center;
        gap: 1rem;
        font-size: 0.9rem;
    }

    body.mobile-view .fatigue-summary {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    body.mobile-view .summary-style-r { color: var(--rush-color, #d9534f); font-weight: 500; }
    body.mobile-view .summary-style-c { color: var(--counter-color, #5bc0de); font-weight: 500; }
    body.mobile-view .summary-style-b { color: var(--burst-color, #f0ad4e); font-weight: 500; }

    body.mobile-view .dashboard-toggle {
        font-size: 1.5rem;
        line-height: 1;
    }

    body.mobile-view .dashboard-content {
        padding: 0.5rem 1rem 1rem 1rem;
        border-top: 1px solid var(--border-color-light, #eee);
    }

    /* --- Footer --- */
    /* フッター分のスペースを確保 */
    body.mobile-view .main-content {
        padding-bottom: 70px !important; /* フッターの高さ分 */
    }

    /* フッター本体 */
    body.mobile-view .resource-dashboard-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        border-top: 1px solid var(--border-color, #ccc);
        background-color: var(--bg-panel, #fff);
    }


    /* --- Slide-up Panel (replaces old modal) --- */
    body.mobile-view .mobile-panel-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        display: flex;
        /* パネルを画面下部に配置 */
        align-items: flex-end;
        justify-content: center;
        z-index: 1000;
    }

    body.mobile-view .mobile-panel-content {
        position: relative;
        background: var(--bg-panel, #fff);
        /* 上部の角だけ丸める */
        border-radius: 16px 16px 0 0;
        width: 95%;
        /* フッターの上に配置 */
        margin-bottom: 70px; 
        max-height: 70vh;
        overflow-y: auto;
        border: 1px solid var(--border-color, #ccc);
        border-bottom: none;
        padding: 1.5rem;
        /* 下からスライドしてくるアニメーション */
        animation: slide-up 0.3s ease-out;
    }

    @keyframes slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    /* Modal for mobile view */
    body.mobile-view .mobile-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    body.mobile-view .mobile-modal-content {
        position: relative; /* For close button positioning */
        background: var(--bg-panel, #fff);
        padding: 1.5rem;
        border-radius: 8px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        border: 1px solid var(--border-color, #ccc);
    }

    body.mobile-view .mobile-panel-content .btn-close-modal,
    body.mobile-view .mobile-modal-content .btn-close-modal {
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        right: auto;

        background-color: var(--bg-hover);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        color: var(--text-subtle);
        font-size: 1rem;
        font-weight: 500;
        line-height: 1;
        padding: 0.5rem 1.5rem;
        cursor: pointer;
        width: 80%;
        max-width: 400px;
    }

    body.mobile-view .mobile-panel-content,
    body.mobile-view .mobile-modal-content {
        /* Add padding to the bottom to make space for the new close button */
        padding-bottom: 4rem;
    }


    /* --- Formation Manager --- */
    body.mobile-view .formation-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    body.mobile-view .formation-card-menu-btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        line-height: 1;
        padding: 0.5rem;
        margin: -0.5rem; /* Adjust hit area */
        cursor: pointer;
        color: var(--text-subtle);
    }

    body.mobile-view .formation-card-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
        background-color: var(--bg-main);
        border-radius: 8px;
        margin-top: 8px;
    }

    body.mobile-view .formation-card-actions .btn {
        width: 100%;
        text-align: left;
        padding: 8px 12px;
    }

    body.mobile-view .fab-add-formation {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background-color: #3B82F6; /* Brighter blue */
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        cursor: pointer;
    }

    body.mobile-view .fab-container {
        position: fixed;
        bottom: 85px; /* Footer height + margin */
        right: 20px;
        z-index: 800;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    body.mobile-view .fab-text {
        color: #f0f0f0;
        font-size: 10px;
        font-weight: 500;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    }


    /* --- Ownership Manager --- */
    body.mobile-view .ownership-table th,
    body.mobile-view .ownership-table td {
        padding: 12px 8px; /* Increase vertical padding */
        vertical-align: middle;
    }

    body.mobile-view .ownership-table input[type="checkbox"] {
        width: 24px; /* Increase size */
        height: 24px;
        cursor: pointer;
    }

    body.mobile-view .ownership-table .select-field,
    body.mobile-view .ownership-table .input-field {
        padding: 8px; /* Increase padding */
        min-height: 40px; /* Ensure decent tap height */
    }

    /* --- Mobile Header --- */
    .mobile-header-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 950; /* Ensure it's above content but below modals */
        background-color: var(--bg-panel);
        border-bottom: 1px solid var(--border-color);
        padding-top: env(safe-area-inset-top);
    }

    .mobile-header-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 12px;
        height: 56px;
    }

    .mobile-header-title {
        font-size: 1rem;
        font-weight: 600;
        margin: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
    }

    .header-target-floor-btn {
        background: none;
        border: none;
        color: var(--primary-color);
        font-weight: 600;
        text-decoration: underline;
        cursor: pointer;
        padding: 2px 4px;
    }

    .mobile-header-actions {
        position: relative;
        width: 40px; /* Match settings button */
        display: flex;
        justify-content: flex-end;
    }

    .mobile-header-actions .btn-icon {
        font-size: 1.5rem;
        font-weight: bold;
    }

    .mobile-actions-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1100;
    }

    .mobile-actions-menu {
        position: absolute;
        top: 45px;
        right: 8px;
        background-color: var(--bg-panel-raised);
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        z-index: 1101;
        border: 1px solid var(--border-color);
        overflow: hidden;
    }

    .mobile-actions-menu-item {
        display: block;
        width: 100%;
        padding: 12px 16px;
        background: none;
        border: none;
        text-align: left;
        color: var(--text-main);
        font-size: 1rem;
        white-space: nowrap;
    }

    .mobile-actions-menu-item:hover {
        background-color: var(--bg-hover);
    }

    .mobile-actions-menu-item.danger {
        color: var(--danger-color);
    }

    .mobile-header-tabs {
        display: flex;
        width: 100%;
        border-top: 1px solid var(--border-color);
    }

    .mobile-tab-button {
        flex: 1;
        padding: 12px 8px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        color: var(--text-subtle);
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.2s ease-in-out;
    }

    .mobile-tab-button.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

    .floor-selection-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .floor-selection-list .modal-item-btn {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 12px;
    }

    .floor-selection-list .modal-item-btn.selected {
        background-color: var(--primary-accent-dark);
        border-color: var(--primary-accent);
    }

    /* --- Mobile Map Adjustments --- */
    body.mobile-view .map-node-container {
        height: 40px;
    }

    body.mobile-view .map-node {
        width: 40px;
        height: 40px;
    }

    body.mobile-view .floor-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    /* Map Search Modal */
    body.mobile-view .map-search-controls .predefined-search {
        justify-content: center;
    }

    body.mobile-view .predefined-search .btn {
        font-size: 12px;
        padding: 4px 8px;
    }
}