﻿:root {
    /* ===== 諛곌꼍 ===== */
    --bg-dark: #0b0e14;
    --bg-sidebar: #131722;
    --bg-panel-rgb: 19, 23, 34;
    --bg-panel: rgba(var(--bg-panel-rgb), 0.95);
    --bg-subtle: rgba(255, 255, 255, 0.03);
    --bg-subtle-2: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --bg-inset: rgba(0, 0, 0, 0.3);
    --bg-accent-subtle: rgba(0, 242, 255, 0.05);
    --bg-nav-active: linear-gradient(90deg, rgba(0, 242, 255, 0.1), transparent);

    /* ===== ?띿뒪??===== */
    --text-primary: #ffffff;
    --text-secondary: #8b9bb4;
    --text-muted: #666;

    /* ===== 媛뺤“ ===== */
    --accent-blue: #00f2ff;
    --accent-dark-blue: #0051ff;

    /* ===== ?곹깭 (?뚮쭏 遺덈?) ===== */
    --status-ok: #00d2ff;
    --status-warn: #ffb800;
    --status-danger: #ff3b30;
    --status-normal: #00c853;

    /* ===== 蹂대뜑 ===== */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* ===== Scrollbar ===== */
    --sb-track: transparent;
    --sb-thumb: rgba(255, 255, 255, 0.1);
    --sb-thumb-hover: rgba(255, 255, 255, 0.2);

    /* ===== 洹몃┝??===== */
    --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-modal: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 242, 255, 0.2);
    --shadow-btn: 0 2px 10px rgba(0, 0, 0, 0.3);

    /* ===== 移대뱶 / 紐⑤떖 / 李⑦듃 ===== */
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --modal-bg: rgba(11, 14, 20, 0.98);
    --chart-bg: rgba(0, 0, 0, 0.2);

    /* ===== ?됰㈃??===== */
    --fp-bg: rgba(11, 14, 20, 0.85);
    --fp-header-bg: rgba(11, 14, 20, 0.9);
    --fp-border: rgba(0, 242, 255, 0.4);

    /* ===== ?뚮┝ ===== */
    --noti-bg: rgba(19, 23, 34, 0.95);

    /* ===== 湲濡쒖슦 ===== */
    --logo-glow: rgba(255, 59, 48, 0.5);

    /* ===== ?됰㈃???쇱꽌 留덉빱 ===== */
    --fp-icon-color: #fff;
    --fp-icon-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);

    /* ===== ?고듃 ===== */
    --font-main: 'Noto Sans KR', sans-serif;
    --font-num: 'Orbitron', monospace;

    /* ===== ?좎뒪???뚮┝ (Dark Default) ===== */
    --toast-bg: linear-gradient(135deg, #1a1a1a 0%, #2d1a1a 100%);
    --toast-border: rgba(255, 59, 48, 0.5);
    --toast-header-border: rgba(255, 255, 255, 0.1);
    --toast-title: #ffdce0;
    --toast-subtitle: #aaa;
    --toast-body-bg: rgba(0, 0, 0, 0.2);
    --toast-text: #fff;
    --toast-icon-bg: rgba(255, 59, 48, 0.2);
    --toast-close: #666;
    --toast-close-hover: #fff;

    /* ===== ?덉씠?꾩썐 ===== */
    --sidebar-mini-width: 70px;
    --sidebar-full-width: 260px;

    /* ===== ?곹깭 ?좊땲硫붿씠??===== */
    @keyframes status-blink {
        0% {
            opacity: 1;
        }

        50% {
            opacity: 0.4;
        }

        100% {
            opacity: 1;
        }
    }

    .blink {
        animation: status-blink 1s infinite;
    }
}

/* ===== ?쇱씠???뚮쭏 ===== */
body.light-theme {
    --bg-dark: #f0f2f5;
    --bg-sidebar: #ffffff;
    --bg-panel-rgb: 255, 255, 255;
    --bg-panel: rgba(var(--bg-panel-rgb), 0.97);
    --bg-subtle: rgba(0, 0, 0, 0.02);
    --bg-subtle-2: rgba(0, 0, 0, 0.04);
    --bg-hover: rgba(0, 132, 255, 0.06);
    --bg-inset: rgba(0, 0, 0, 0.06);
    --bg-accent-subtle: rgba(0, 132, 255, 0.05);
    --bg-nav-active: linear-gradient(90deg, rgba(0, 132, 255, 0.08), transparent);

    --text-primary: #1a1a2e;
    --text-secondary: #5a6478;
    --text-muted: #999;

    --accent-blue: #0084ff;
    --accent-dark-blue: #0051cc;

    --border-color: rgba(0, 0, 0, 0.1);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 132, 255, 0.2);

    /* ===== Scrollbar (Light) ===== */
    --sb-thumb: rgba(0, 0, 0, 0.1);
    --sb-thumb-hover: rgba(0, 0, 0, 0.2);

    --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 10px rgba(0, 132, 255, 0.1);
    --shadow-btn: 0 2px 10px rgba(0, 0, 0, 0.1);

    --card-bg: rgba(0, 0, 0, 0.06);
    /* 0.03 -> 0.06 ?鍮?媛뺥솕 */
    --card-border: rgba(0, 0, 0, 0.12);
    --modal-bg: rgba(255, 255, 255, 0.98);
    --chart-bg: rgba(0, 0, 0, 0.04);

    --fp-bg: rgba(255, 255, 255, 0.95);
    --fp-header-bg: rgba(255, 255, 255, 0.97);
    --fp-border: rgba(0, 132, 255, 0.3);

    --noti-bg: rgba(255, 255, 255, 0.97);

    --logo-glow: rgba(255, 59, 48, 0.3);

    /* ===== ?좎뒪???뚮┝ (Light) ===== */
    --toast-bg: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    --toast-border: rgba(255, 59, 48, 0.3);
    --toast-header-border: rgba(255, 59, 48, 0.1);
    --toast-title: #c41c00;
    --toast-subtitle: #666;
    --toast-body-bg: rgba(255, 59, 48, 0.05);
    --toast-text: #333;
    --toast-icon-bg: rgba(255, 59, 48, 0.1);
    --toast-close: #999;
    --toast-close-hover: #c41c00;

    --fp-icon-color: #222;
    --fp-icon-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

/* ===== ?뚮쭏 ?좉? 踰꾪듉 ?ㅽ???蹂댁젙 ===== */
.theme-toggle-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
}

/* ===== 援ъ뿭 ??쒕낫??寃뚯씠吏 洹몃━??(醫뚯륫 ?⑤꼸?? ===== */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
}

.sensor-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sensor-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sensor-card .sensor-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.sensor-card .sensor-value-box {
    text-align: center;
}

.sensor-card .sensor-value {
    font-family: var(--font-num);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sensor-card .sensor-unit {
    font-size: 10px;
    margin-left: 2px;
}

.sensor-card.danger {
    border-color: var(--status-danger);
    background: rgba(255, 59, 48, 0.08);
    box-shadow: inset 0 0 15px rgba(255, 59, 48, 0.2), 0 0 10px rgba(255, 59, 48, 0.1);
    animation: card-pulse-danger 2s infinite;
}

.sensor-card.warning {
    border-color: var(--status-warn);
    background: rgba(255, 184, 0, 0.08);
    box-shadow: inset 0 0 15px rgba(255, 184, 0, 0.1);
}

@keyframes card-pulse-danger {
    0% {
        border-color: var(--status-danger);
        box-shadow: inset 0 0 15px rgba(255, 59, 48, 0.2);
    }

    50% {
        border-color: #ff807a;
        box-shadow: inset 0 0 25px rgba(255, 59, 48, 0.4), 0 0 15px rgba(255, 59, 48, 0.3);
    }

    100% {
        border-color: var(--status-danger);
        box-shadow: inset 0 0 15px rgba(255, 59, 48, 0.2);
    }
}

/* ===== ????됰㈃???ㅻ쾭?덉씠 (3???꾨━誘몄뾼 ?덉씠?꾩썐) ===== */
.floorplan-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    /* 留덉뒪???쒓굅 */
    backdrop-filter: none;
    /* 釉붾윭 ?쒓굅 */
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.floorplan-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.floorplan-window {
    width: 95vw;
    height: 90vh;
    background: var(--bg-panel);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.floorplan-overlay.show .floorplan-window {
    transform: scale(1) translateY(0);
}

.floorplan-header {
    height: 60px;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-accent-subtle);
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    /* ?쒕옒洹?媛???쒖떆 */
    user-select: none;
    /* ?띿뒪???좏깮 諛⑹? */
}

.floorplan-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.floorplan-main-wrap {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* ?ъ씠???⑤꼸 (怨듯넻) */
.insight-panel {
    width: 420px;
    min-width: 420px;
    background: var(--bg-inset);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: width 0.3s ease;
}

.insight-panel.ai-panel {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.insight-panel .panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.insight-panel .panel-header h2 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-blue);
}

.insight-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 以묒븰 ?됰㈃???곸뿭 */
.floorplan-container {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.floorplan {
    flex: 1;
    position: relative;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: default;
}

/* ?섎떒 沅뚭퀬?ы빆 ?⑤꼸 */
.action-panel {
    height: 120px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--status-danger);
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

.action-panel.normal {
    border-top-color: var(--status-ok);
}

.action-panel.warning {
    border-top-color: var(--status-warn);
}

.action-panel h4 {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--status-danger);
}

.action-panel.normal h4 {
    color: var(--status-ok);
}

.action-panel.warning h4 {
    color: var(--status-warn);
}

/* 踰붾? */
.floorplan-legend {
    position: absolute;
    bottom: 20px;
    right: 440px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    gap: 15px;
    font-size: 12px;
    z-index: 100;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-item.normal i {
    color: var(--status-ok);
}

.legend-item.warning i {
    color: var(--status-warn);
}

.legend-item.danger i {
    color: var(--status-danger);
}

/* 留덉빱 諛??댄똻 */
.markers-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.fp-sensor {
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--bg-panel);
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

.fp-sensor:hover {
    transform: scale(1.2);
    z-index: 1000;
}

.fp-sensor.danger {
    border-color: var(--status-danger);
    color: var(--status-danger);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
    animation: marker-pulse-danger 1.5s infinite;
}

.fp-sensor.warning {
    border-color: var(--status-warn);
    color: var(--status-warn);
    box-shadow: 0 0 15px rgba(255, 184, 0, 0.4);
}

@keyframes marker-pulse-danger {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 59, 48, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* ===== 怨듯넻 ?ш컖???좉? 踰꾪듉 ?ㅽ???(?뚮쭏 ?곕룞) ===== */
.square-toggle {
    width: 52px;
    height: 52px;
    background: var(--bg-panel);
    border-radius: 8px;
    box-shadow: var(--shadow-btn);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.square-toggle:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.floorplan-main-wrap {
    flex: 1;
    display: flex;
    flex-direction: row;
    /* 醫? 以묒븰, ??媛濡?諛곗튂 */
    align-items: stretch;
    /* ?믪씠 留욎땄 */
    position: relative;
    /*overflow: hidden;*/
    /* ?섏튂??遺遺??④? */
    padding: 10px;

}

.data-panel,
.ai-panel,
.action-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.data-panel {
    width: 480px;
    min-width: 480px;
    max-width: 480px;
}

.ai-panel {
    width: 480px !important;
    min-width: 480px !important;
    max-width: 480px !important;
    flex: none !important;
}

.action-panel {
    width: 800px;
    /* 怨좎젙 ?덈퉬 */
    min-width: 600px;
    max-width: 900px;
}

/* ?④? ?곹깭 */
.data-panel.hidden,
.ai-panel.hidden,
.action-panel.hidden {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    /* ?대┃ ?대깽??諛⑹? */
}

.square-toggle .thumb {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    transition: all 0.3s;
}

/* 媛쒕퀎 踰꾪듉蹂??뱀쭠 */
.theme-toggle-btn.square-toggle .thumb {
    font-size: 22px;
}

.light-theme .theme-toggle-btn.square-toggle .thumb {
    color: #efa900;
}

.fullscreen-toggle-btn.square-toggle .thumb {
    font-size: 18px;
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Sidebar (Premium Glass Style) */
.sidebar {
    width: var(--sidebar-mini-width);
    background: rgba(19, 23, 34, 0.7);
    /* Deep transparency */
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    transition: var(--sidebar-transition);
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    backdrop-filter: blur(25px);
    /* Strong blur for premium feel */
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
}

/* Light theme support */
body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.75);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar:hover {
    width: var(--sidebar-full-width);
    background: rgba(19, 23, 34, 0.9);
}

body.light-theme .sidebar:hover {
    background: rgba(255, 255, 255, 0.95);
}

.logo-area {
    padding: 35px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-subtle);
    min-width: var(--sidebar-full-width);
}

.logo-area i {
    font-size: 32px;
    color: var(--accent-blue);
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.5));
}

.logo-area h2 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    letter-spacing: 0.5px;
}

body.light-theme .logo-area h2 {
    color: var(--text-primary);
}

.sidebar:hover .logo-area h2 {
    opacity: 1;
}

.nav-menu {
    list-style: none;
    padding: 30px 0;
    flex: 1;
    min-width: var(--sidebar-full-width);
}

.nav-menu li {
    height: 65px;
    padding: 0 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.nav-menu li i {
    font-size: 22px;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s;
}

.nav-menu li span.menu-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.3s;
}

.sidebar:hover .nav-menu li span.menu-text {
    opacity: 1;
    transform: translateX(0);
}

.nav-menu li:hover {
    color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.03);
}

.nav-menu li.active {
    color: var(--accent-blue);
    background: var(--bg-nav-active);
}

.nav-menu li.active i {
    filter: drop-shadow(0 0 10px var(--accent-blue));
}

.nav-menu li.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 3px;
    background: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue);
    border-radius: 0 2px 2px 0;
}

/* Badge (Glass optimized) */
.nav-menu li .badge {
    position: absolute;
    top: 12px;
    left: 36px;
    padding: 3px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.danger {
    background: var(--status-danger);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 59, 48, 0.5);
}

.sidebar:hover .nav-menu li .badge {
    position: static;
    margin-left: auto;
}

.system-status {
    padding: 30px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    min-width: var(--sidebar-full-width);
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar:hover .system-status {
    opacity: 1;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.status-item .value.ok {
    color: var(--status-ok);
}

.time-display {
    margin-top: 10px;
    text-align: center;
    font-family: var(--font-num);
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Map Container */
#map-container {
    flex: 1;
    height: 100%;
    z-index: 0;
    background-color: #0d1117;
    /* Map load placeholder */
}

/* Map Controls Side-by-side Container */
.map-tools-top {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

/* [?좉퇋] ?앺솢?섍꼍 ?붿빟 ?⑤꼸 Container (?대컮 醫뚯륫 諛곗튂) */
.env-summary-wrapper {
    position: absolute;
    top: 20px;
    right: 220px;
    /* ?대컮 ?덈퉬 怨좊젮 */
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: auto;
}

.env-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--status-ok);
    /* 苡뚯쟻??泥?줉?????좎? */
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
    padding-left: 5px;
}

.env-cards {
    display: flex;
    gap: 10px;
}

.env-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 140px;
    /* ?덈퉬 ?뺤옣 */
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    /* ?붿궡??諛곗튂瑜??꾪븿 */
}

.env-card.clickable {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.env-card.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.env-card .env-label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.env-card.good .env-label {
    color: var(--status-ok);
}

.env-card.moderate .env-label {
    color: var(--text-primary);
}

.env-card.bad .env-label {
    color: #ff9f0a;
    /* ?ㅻ젋吏???댁븙 ?곹깭 */
}

/* env-value-row ?쒓굅 諛?env-value ?⑤룆 ?ㅽ???*/
.env-value {
    font-family: var(--font-num);
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    padding-right: 15px;
    /* ?붿궡???щ텇 怨듦컙 */
}

.env-card.good .env-value {
    color: var(--status-ok);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

.env-card.moderate .env-value {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.env-card.bad .env-value {
    color: #ff9f0a;
    text-shadow: 0 0 8px rgba(255, 159, 10, 0.4);
}

.env-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.env-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* [?좉퇋] ?붾컮?댁뒪 ?섍꼍 ?붿빟 ?⑤꼸 (醫뚯륫 ?섎떒, .main-content ?대? - ?ъ씠?쒕컮 ?낅┰) */
.device-summary-wrapper {
    position: absolute;
    bottom: 25px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 嫄대Ъ 媛곸떎 ?곸꽭 ?⑤꼸???대━硫??⑤꼸 ?곗륫?쇰줈 20px 媛꾧꺽???먭퀬 遺숈쓬 */
.device-summary-wrapper.panel-docked {
    left: 370px;
}

.device-cards {
    display: flex;
    gap: 10px;
}

.device-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 120px;
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.device-card.clickable {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-card.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.device-card .device-label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.device-card.issue .device-value {
    color: #ffd60a;
    text-shadow: 0 0 8px rgba(255, 214, 10, 0.4);
}

.device-card.battery .device-value {
    color: #ff9f0a;
    text-shadow: 0 0 8px rgba(255, 159, 10, 0.4);
}

.device-value {
    font-family: var(--font-num);
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    padding-right: 15px;
}

/* 移대뱶 怨듯넻 ?붿궡???ㅽ???*/
.card-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 11px;
    /* ?ш린 異뺤냼 */
    font-weight: 900;
    opacity: 0.4;
    /* ?щ챸?꾨? ??떠 ?댁쭩 ?대몼寃?議곗젙 */
    transition: all 0.2s ease;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.clickable:hover .card-arrow {
    opacity: 1;
    transform: translate(3px, -50%);
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Custom Map Type Toggle Button */
.custom-map-type-btn {
    width: 52px;
    height: 52px;
    background: var(--bg-panel);
    border-radius: 8px;
    box-shadow: var(--shadow-btn);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(8px);
}

.custom-map-type-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.custom-map-type-btn .thumb {
    flex: 1;
    background-size: cover;
    background-position: center;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.custom-map-type-btn:hover .thumb {
    opacity: 1;
}

/* ?몃꽕???대?吏 (濡쒖뺄 而ㅼ뒪? ?꾩씠肄? */
.custom-map-type-btn .thumb.skyview-thumb {
    background-image: url('../img/satellite_thumb.png');
}

.custom-map-type-btn .thumb.map-thumb {
    background-image: url('../img/map_thumb.png');
}

/* Main Content Overlay */
.main-content {
    position: absolute;
    top: 0;
    left: var(--sidebar-mini-width);
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 500;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ?곸꽭李??뺣젹 ?ㅽ????쒓굅 (?곷떒 移대뱶? ?쇱튂?섎룄濡?湲곕낯 ?ㅼ젙 ?좎?) */
.detail-panel {
    margin-left: 0;
}



/* Top Summary Panel */
.top-panel {
    display: flex;
    gap: 15px;
    pointer-events: auto;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 8px;
    min-width: 160px;
    /* ?덈퉬 ?뺤옣 */
    box-shadow: var(--shadow-panel);
    height: 84px;
    /* ?믪씠瑜?紐낆떆?곸쑝濡?怨좎젙?섏뿬 ?쇱껜媛??뺣낫 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.summary-card.clickable {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-card.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.summary-card h3 {
    font-size: 13px;
    /* ?댁쭩 ?ㅼ? */
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.summary-card .value {
    font-family: var(--font-num);
    font-size: 24px;
    font-weight: 700;
    text-align: right;
    padding-right: 20px;
    /* ?붿궡???щ텇 怨듦컙 */
}

.summary-card.total .value {
    color: var(--text-primary);
}

.summary-card.normal .value {
    color: var(--status-ok);
}

.summary-card.warning .value {
    color: var(--status-warn);
}

.summary-card.danger .value {
    color: var(--status-danger);
}

/* 湲곗〈 stat-view-btn ??젣 */

/* Weather & AQI Widget (Top Center) */
.weather-widget {
    grid-column: 2;
    /* ?섎떒 而⑦듃濡?以묒븰 諛곗튂 */
    justify-self: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* 媛꾧꺽 ?댁쭩 異뺤냼 */
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    z-index: 1000;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
    /* 怨좎젙 ?믪씠 ?쒓굅?섏뿬 ?좎뿰?섍쾶 */
    min-height: 70px;
    justify-content: center;
}

/* ?됰㈃???ㅽ뵂 ???좎뵪 ?꾩젽???됰㈃???덈룄???곷떒 諛붽묑??遺숈쓬 (DOM ?щ같移?諛⑹떇) */
.weather-widget.fp-docked {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -100%);
    margin: 0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    z-index: 402;
    pointer-events: auto;
}

/* 1?? ?좎뵪 ?꾧킅??*/
.weather-top-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 2?? ?湲곗쭏(AQI) ?꾧킅??*/
.weather-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 5px;
    border-top: 1px dashed var(--border-color);
}

/* ?좎뵪 媛쒕퀎 ?붿냼??*/
.weather-widget .weather-location {
    font-weight: 700;
    font-size: 15px;
    /* ?ш린 利앸? */
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
}

.weather-widget .weather-temp {
    font-size: 17px;
    /* ?ш린 利앸? */
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-num);
}

.weather-widget .weather-temp #weather-desc {
    font-family: var(--font-main);
    font-size: 15px;
    /* ?ш린 利앸? */
    font-weight: 500;
}

.weather-widget .weather-detail {
    font-size: 14px;
    /* ?ш린 利앸? */
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-subtle-2);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ?湲곗쭏 吏???꾩씠??*/
.aqi-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    /* ?ш린 利앸? */
}

.aqi-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.aqi-val {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-num);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    /* ?뷀뤃???④? */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    width: 600px;
    max-width: 90%;
    position: relative;
    box-shadow: var(--shadow-panel);
}

.modal-content.full-modal {
    width: 90%;
    height: 90%;
}

.modal-content h2 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* [?좉퇋] ?뚮쭏 ?곗떆??而ㅼ뒪? ?뚮┝ 紐⑤떖 (Custom Alert) */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000000 !important;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-alert-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.light-theme .custom-alert-box {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.custom-alert-overlay.show {
    opacity: 1;
}

.custom-alert-overlay.show .custom-alert-box {
    transform: scale(1) translateY(0);
}

.custom-alert-icon {
    font-size: 40px;
    color: var(--status-warning);
    margin-bottom: 20px;
}

.custom-alert-icon.success {
    color: var(--status-normal);
}

.custom-alert-icon.warning {
    color: var(--status-warning);
}

.custom-alert-icon.danger {
    color: var(--status-danger);
}

.custom-alert-box h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.custom-alert-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
    word-break: keep-all;
}

.custom-alert-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.custom-alert-actions .btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-alert-actions .btn-primary:hover {
    background: #00d2ff;
}

/* Summary Card: value + 蹂닿린 踰꾪듉 媛濡?諛곗튂 */
.value-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.stat-view-btn {
    background: var(--bg-subtle-2);
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 7px;
    transition: all 0.2s;
    line-height: 1;
}

.stat-view-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.stat-view-btn.warning-btn:hover {
    border-color: var(--status-warn);
    color: var(--status-warn);
    box-shadow: 0 0 8px rgba(255, 184, 0, 0.3);
}

.stat-view-btn.danger-btn:hover {
    border-color: var(--status-danger);
    color: var(--status-danger);
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.3);
}

/* Detail Panel for Apartment/Unit */
.floorplan-container {
    flex: 1;
    /* 媛蹂 ?곸뿭: 醫뚯슦 ?⑤꼸???쒖쇅???섎㉧吏 怨듦컙 紐⑤몢 李⑥? */
    min-width: 900px;
    /* 理쒖냼 ?덈퉬 蹂댁옣 */

    /* [?덈줈??媛?대뱶 諛뺤뒪 ?붿옄???곸슜] */
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-panel);
    margin: 0 10px;
    /* 醫뚯슦 ?⑤꼸怨쇱쓽 媛꾧꺽 ?꾩? */
    padding: 15px;
    /* ?대? ?щ갚 */

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    /* ?몃줈 ?뺣젹 (?됰㈃??+ ?섎떒 沅뚭퀬 ?⑤꼸) */
    transition: all 0.3s ease;
}

.detail-panel {
    position: relative;
    overflow: visible;
    width: 340px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    box-shadow: var(--shadow-panel);
    height: calc(100% - 100px);
    /* Adjust based on top panel */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    opacity: 1;
}

.detail-panel.hidden {
    transform: translateX(-20px);
    opacity: 0;
    pointer-events: none;
    display: none;
    /* simple hide */
}

/* AI Insight Panel & Raw Data Panel (Shared Styles) */
.insight-panel {
    position: relative;
    width: 480px;
    /* ?뺣컯 諛⑹?瑜??꾪븯??420 -> 350px 異뺤냼 */
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    height: 100%;
    /* 遺紐?floorplan-main-wrap) ?믪씠 苑?梨꾩? */
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, padding 0.4s ease, margin 0.4s ease;
    opacity: 1;
    z-index: 1002;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;
    /* [異붽?] ?좊땲硫붿씠?????대? ?띿뒪??以꾨컮轅?諛⑹? */
}

/* 醫뚯륫 ?곗씠???⑤꼸 ?꾩슜 ?띿꽦 */
.insight-panel.data-panel {
    border-right: 1px solid var(--border-color);
}

/* ?곗륫 AI ?⑤꼸 ?꾩슜 ?띿꽦 */
.insight-panel.ai-panel {
    border-left: 1px solid var(--border-color);
}

.insight-panel.hidden {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    padding: 0;
    margin: 0;
    border: none;
    pointer-events: none;
}

/* [異붽?] ?⑤꼸 ?좉? 踰꾪듉 ?ㅽ???(?곕え 紐⑤떖 踰꾪듉 ?④낵 ?댁식) */
.panel-toggle-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.panel-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

.panel-toggle-btn:active {
    transform: translateY(0) scale(0.95);
}

/* [?섏젙] ?묓삍?????섑????붿빟 ?덉씠釉??ㅽ???(?곷떒 媛濡쒗삎 ???붿옄??+ ?뚮쭏 ?곕룞) */
.collapsed-label {
    position: absolute;
    top: 15px;
    background: rgba(var(--bg-panel-rgb), 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1010;
    font-size: 13px;
    font-weight: 700;
    display: none;
    /* JS?먯꽌 flex濡??꾪솚??*/
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 0 rgba(0, 242, 255, 0);
    opacity: 0.9;
}

.collapsed-label:hover {
    background: var(--accent-blue);
    color: #fff;
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 255, 0.5);
}

.collapsed-label:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.collapsed-label.left {
    left: 20px;
}

.collapsed-label.right {
    right: 20px;
}

/* ?됰㈃???덈룄??媛蹂 ??吏??*/
.floorplan-window {
    position: relative;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.05s linear, width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 401;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: visible;
    width: 1950px;
    /* 湲곕낯媛?*/
    max-width: 95vw;
    height: 950px;
}

.insight-panel .panel-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-accent-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.insight-panel .panel-header h2 {
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    /* [異붽?] ?ㅻ뜑 ?띿뒪??以꾨컮轅?諛⑹? */
}

/* [異붽?] Action Recommendation Panel (?섎떒 ?뚮줈???쒓굅 -> ?됰㈃???꾨옒 遺꾨━ 諛곗튂) */
.action-panel {
    position: relative;
    margin-top: 20px;
    width: 800px;
    background: var(--bg-panel);
    border: 2px solid var(--status-danger);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1005;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;

}

.action-panel.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.action-panel h4 {
    color: var(--status-danger);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-panel p {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.5;
}

/* 由ы룷???대? ?ㅽ??쇰쭅 */
.report-section {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* [異붽?] 媛濡??ㅽ겕濡?諛⑹? */
}

.ai-summary-box {
    padding: 10px 12px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-accent-subtle);
    border-bottom: 1px solid var(--border-color);
}

.ai-summary-box h3 {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.report-group {
    padding: 0 8px;
    /* 醫뚯슦 ?щ갚 異뺤냼 (10px -> 8px) */
}

.report-group h4 {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sensor-mini-card.normal {
    border-color: rgba(0, 242, 255, 0.1);
}

.sensor-mini-card.warning {
    border-color: var(--status-warning);
    background: rgba(255, 159, 10, 0.05);
    animation: sensor-pulse-warning 2s infinite ease-in-out;
}

.sensor-mini-card.danger {
    border-color: var(--status-danger);
    background: rgba(255, 59, 48, 0.05);
    animation: sensor-pulse-danger 1.5s infinite ease-in-out;
}

/* ?쇱꽌 移대뱶 寃쎈낫 ?좊땲硫붿씠??*/
@keyframes sensor-pulse-warning {
    0% {
        background: rgba(255, 159, 10, 0.05);
        box-shadow: none;
    }

    50% {
        background: rgba(255, 159, 10, 0.15);
        box-shadow: 0 0 15px rgba(255, 159, 10, 0.2);
    }

    100% {
        background: rgba(255, 159, 10, 0.05);
        box-shadow: none;
    }
}

@keyframes sensor-pulse-danger {
    0% {
        background: rgba(255, 59, 48, 0.05);
        box-shadow: none;
    }

    50% {
        background: rgba(255, 59, 48, 0.2);
        box-shadow: 0 0 20px rgba(255, 59, 48, 0.3);
    }

    100% {
        background: rgba(255, 59, 48, 0.05);
        box-shadow: none;
    }
}

.sensor-detail-box {
    background: var(--bg-inset);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 15px;
}

.light-theme .sensor-detail-box {
    background: #ffffff;
    /* ?쇱씠???뚮쭏?먯꽌 諛뺤뒪 遺媛?*/
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* [?좉퇋] 媛꾨왂 ?띿뒪???앹뾽 (Hover ???몄텧) */
.fp-brief-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 200;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fp-brief-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fp-brief-tooltip .integrated-vals {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

.fp-brief-tooltip .val-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.fp-brief-tooltip .val-label {
    color: var(--accent-blue);
    opacity: 0.8;
}

/* 湲곗닠 ?ъ뼇 諛뺤뒪 */
.tech-spec-box {
    background: var(--bg-accent-subtle);
    border: 1px solid var(--border-hover);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tech-spec-box h3 {
    font-size: 13px;
    color: var(--accent-blue);
    margin-bottom: 8px;
    font-weight: 700;
}

/* AI 遺꾩꽍 濡쒓렇 諛뺤뒪 */
.analysis-log-box {
    background: var(--bg-inset);
    padding: 15px;
    border-radius: 10px;
}

.light-theme .analysis-log-box {
    background: rgba(0, 0, 0, 0.04);
}

.analysis-log-box h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* [異붽?] XAI ?꾪뿕 媛먯? ??꾨씪??(Vertical Event Log) */
.xai-timeline-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 59, 48, 0.15);
}

.xai-timeline-container h4 {
    font-size: 13px;
    color: var(--status-danger);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.xai-timeline {
    position: relative;
    padding-left: 20px;
    margin: 0;
    list-style: none;
}

/* ?섏쭅 湲곕뫁(?? */
.xai-timeline::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 0;
    left: 6px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.xai-node {
    position: relative;
    margin-bottom: 12px;
    padding: 10px 12px;
    margin-left: -12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.xai-node:hover {
    opacity: 0.8;
}

.xai-node:active {
    transform: scale(0.98);
}

.light-theme .xai-node:hover {
    opacity: 0.8;
}

.xai-node:last-child {
    margin-bottom: 0;
}

/* ??꾨씪????(Node) */
.xai-node::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    border: 2px solid var(--bg-panel);
    z-index: 1;
}

.xai-node.danger::before {
    background: var(--status-danger);
    box-shadow: 0 0 8px var(--status-danger);
    animation: pulse-danger 1.5s infinite;
}

.xai-node.warning::before {
    background: var(--status-warning);
    box-shadow: 0 0 8px var(--status-warning);
}

.xai-node-time {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    font-weight: 600;
}

.xai-node-desc {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: keep-all;
}

.xai-node-desc strong {
    color: var(--status-danger);
}

@keyframes pulse-danger {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }

    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 6px rgba(255, 59, 48, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* 沅뚭퀬?ы빆 諛뺤뒪 (AI 由ы룷???섎떒) */
.ai-recommendation-box {
    margin-top: 20px;
    padding: 12px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-inset);
    transition: all 0.3s ease;
}

.light-theme .ai-recommendation-box {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-subtle);
}

.ai-recommendation-box h4 {
    font-size: 12px;
    color: var(--status-normal);
    margin-bottom: 6px;
    font-weight: 700;
}

.ai-recommendation-box p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-chart-container {
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.1));
}

.back-btn:hover {
    background: rgba(0, 242, 255, 0.1);
    border-radius: 50%;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-subtle);
}

.panel-header h2 {
    font-size: 16px;
    flex: 1;
    color: var(--accent-blue);
}

/* ?⑤꼸 二쇱냼 ?쒕툕?ㅻ뜑 */
.panel-address {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-subtle);
}

.panel-address i {
    color: var(--status-warn);
    margin-right: 4px;
}

.back-btn,
.close-btn,
.fp-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover,
.close-btn:hover,
.fp-toggle-btn:hover {
    color: var(--text-primary);
}

.fp-toggle-btn {
    position: absolute;
    left: calc(100% + 12px);
    top: 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--accent-blue);
    width: 42px;
    height: 42px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fp-toggle-btn i {
    font-size: 18px;
}

.fp-toggle-btn svg {
    width: 24px;
    height: 24px;
}

.fp-toggle-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}

.fp-toggle-btn:hover svg text {
    fill: #fff;
}

.fp-toggle-btn:active {
    transform: scale(0.95);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* List Items in Panel */
.list-group {
    list-style: none;
}

.list-item {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    margin-bottom: 8px;
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.list-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.list-item.danger {
    border-left: 4px solid var(--status-danger);
    background: rgba(255, 59, 48, 0.1);
}

.list-item.warning {
    border-left: 4px solid var(--status-warn);
    background: rgba(255, 184, 0, 0.05);
}

.item-name {
    font-weight: 500;
}

.item-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-inset);
}

/* Unit Grid Layout (4 Columns) */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.unit-grid .list-item {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 10px 5px;
    margin-bottom: 0;
    /* Remove list margin */
    height: 70px;
    /* Fixed height for uniformity */
}

.unit-grid .list-item .item-name {
    font-size: 13px;
    margin-bottom: 5px;
}

.unit-grid .list-item .item-status {
    font-size: 10px;
    padding: 2px 6px;
}

/* Sensor Grid in Detail View */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sensor-mini-card {
    position: relative;
    background: var(--card-bg);
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    overflow: hidden;
}

.sensor-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-blue);
    background: var(--bg-accent-subtle);
}

.sensor-mini-card::after {
    content: '\f054';
    /* fa-chevron-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    /* ?ш린 蹂듦뎄 */
    color: #ffffff;
    opacity: 0.4;
    /* ?щ챸?꾨? ??떠 ?붿궡?쒕? ?댁쭩 ?대몼寃?議곗젙 */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.sensor-mini-card:hover::after {
    opacity: 1;
    color: #ffffff;
    right: 8px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.light-theme .sensor-mini-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-theme .sensor-mini-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    background: #fdfdfd;
}

.sensor-mini-card.danger {
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.5);
    box-shadow: inset 0 0 15px rgba(255, 59, 48, 0.1);
}

/* ?쇱꽌 ?곹깭 ?붿빟 諛?*/
.sensor-summary-bar {
    background: var(--bg-inset);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 0;
}

.summary-line {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    gap: 6px;
}

.summary-line.warning {
    background: rgba(255, 184, 0, 0.08);
}

.summary-line.danger {
    background: rgba(255, 59, 48, 0.1);
}

.sl-icon {
    font-size: 8px;
}

.sl-name {
    color: var(--text-secondary);
    min-width: 55px;
}

.sl-val {
    color: var(--text-primary);
    font-family: var(--font-main);
    /* ?띿뒪??媛?낆꽦???꾪빐 硫붿씤 ?고듃 ?ъ슜 */
    font-size: 12px;
    margin-left: auto;
    text-align: right;
}

.sensor-mini-card.warning {
    background: rgba(255, 184, 0, 0.1);
    border-color: rgba(255, 184, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 184, 0, 0.05);
}

/* ?됰㈃???쇱꽌 hover ??醫뚯륫 移대뱶 ?섏씠?쇱씠??*/
.sensor-mini-card.fp-highlight {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4), inset 0 0 10px rgba(0, 210, 255, 0.1) !important;
    transform: scale(1.03);
    transition: all 0.2s;
}

.sensor-mini-card h4 {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.sensor-mini-card .val {
    font-family: var(--font-num);
    font-size: 16px;
    font-weight: bold;
}

/* Leaflet Custom Marker Styles (Deprecated) -> Now Kakao Custom Overlay */

/* New Marker Style: Name Card + Building Icon */
.custom-overlay-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transform: translateY(-50px);
    /* Adjust so the icon bottom touches the coord */
    transition: transform 0.2s;
}

.custom-overlay-marker:hover {
    transform: translateY(-55px) scale(1.05);
    /* Lift up slightly */
    z-index: 9999;
}

/* Name Card (Balloon) */
.marker-label {
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 5px 10px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    margin-bottom: 5px;
    /* Space between label and icon */
}

/* Color Bar on Left */
.marker-label::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #555;
    /* Default */
    box-shadow: 0 0 5px currentColor;
}

/* Tail of the balloon */
.marker-label::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(10, 15, 30, 0.9);
}

/* Building Icon Below */
.marker-icon {
    font-size: 30px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.8));
    text-shadow: 0 0 2px #000;
}

/* Status Styles */
.custom-overlay-marker.normal .marker-label {
    border-color: var(--status-ok);
}

.custom-overlay-marker.normal .marker-label::before {
    background-color: var(--status-ok);
    box-shadow: 0 0 8px var(--status-ok);
}

.custom-overlay-marker.normal .marker-icon {
    color: var(--status-ok);
}

.custom-overlay-marker.warning .marker-label {
    border-color: var(--status-warn);
    color: var(--status-warn);
}

.custom-overlay-marker.warning .marker-label::before {
    background-color: var(--status-warn);
    box-shadow: 0 0 8px var(--status-warn);
}

.custom-overlay-marker.warning .marker-icon {
    color: var(--status-warn);
}

.custom-overlay-marker.danger .marker-label {
    border-color: var(--status-danger);
    background-color: rgba(255, 59, 48, 0.2);
    color: #fff;
    animation: marker-bounce-glow 1s infinite alternate;
}

.custom-overlay-marker.danger .marker-label::before {
    background-color: var(--status-danger);
    box-shadow: 0 0 10px var(--status-danger);
}

.custom-overlay-marker.danger .marker-icon {
    color: var(--status-danger);
    animation: icon-shake 0.5s infinite;
}

/* Popover Modal (Tooltip Style) */
.modal-backdrop {
    /* Transparent full screen overlay */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1500;
    display: none;
    pointer-events: none;
    /* ?대┃???꾨옒 ?붿냼濡??ш낵??*/
}

.modal-content {
    position: absolute;
    /* Positioned dynamically via JS */
    background: var(--modal-bg);
    width: 320px;
    border-radius: 8px;
    border: 1px solid var(--accent-blue);
    box-shadow: var(--shadow-modal);
    padding: 0;
    pointer-events: auto;
    overflow: visible;
    /* ?붿궡???쒖떆瑜??꾪빐 */
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 紐⑤떖 ?대? ?곸뿭 */
.modal-body-scroll {
    padding: 16px;
    overflow: visible;
}

/* Arrow pointing LEFT (placed at left side of modal) */
.modal-content::before {
    content: '';
    position: absolute;
    left: -10px;
    /* Position at LEFT side */
    top: var(--arrow-top, 50px);
    /* Dynamic Vertical Position */
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--accent-blue);
    /* Pointing Left */
    border-left: none;
    transition: top 0.2s ease-out;
    /* Smooth movement */
}

/* Arrow pointing UP (placed at top of modal, for popups below the card) */
.modal-content.top-arrow::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -10px;
    bottom: auto;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--accent-blue);
    border-top: none;
    transition: left 0.2s ease-out;
}

/* New: Arrow pointing DOWN (placed at bottom of modal) */
.modal-content.bottom-arrow::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    top: auto;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--accent-blue);
    border-bottom: none;
    transition: left 0.2s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: var(--bg-accent-subtle);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 13px;
    color: var(--accent-blue);
    margin: 0;
}

.modal-body {
    padding: 10px 15px;
}

/* Make Chart Fill Container */
#modal-chart-container {
    width: 100% !important;
    height: auto !important;
    min-height: 100px;
    background: var(--chart-bg);
    border-radius: 4px;
    margin-bottom: 8px;
}

.ai-analysis-box {
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-color);
    padding: 10px 0 0 0;
    margin-top: 5px;
}

/* Animations */
@keyframes marker-bounce-glow {
    0% {
        transform: translateY(0);
        box-shadow: 0 0 10px var(--status-danger);
        border-color: rgba(255, 59, 48, 0.5);
    }

    100% {
        transform: translateY(-3px);
        box-shadow: 0 0 25px var(--status-danger);
        border-color: #fff;
    }
}

@keyframes icon-shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes text-blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.5;
    }
}

/* Notification (Toast) Styles */
.notification-container {
    position: absolute;
    top: 110px;
    /* ?앺솢?섍꼍 ?붿빟 移대뱶???寃뱀묠 諛⑹? (湲곗〈 80px -> 110px) */
    right: 20px;
    width: 320px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Let clicks pass trough container */
}

.notification-card {
    background: var(--noti-bg);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-left: 4px solid var(--status-danger);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-primary);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    cursor: pointer;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-card.show {
    transform: translateX(0);
}

.notification-card:hover {
    transform: scale(1.02);
    border-color: #ff3b30;
    background: rgba(40, 0, 0, 0.9);
    /* 醫 ??吏꾪븳 諛곌꼍?쇰줈 媛뺤“ */
    box-shadow: 0 8px 30px rgba(255, 59, 48, 0.2);
}

.noti-icon {
    background: rgba(255, 59, 48, 0.1);
    color: var(--status-danger);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    flex-shrink: 0;
    animation: icon-shake 1s infinite;
}

.noti-content {
    flex: 1;
}

.noti-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.noti-msg {
    font-size: 12px;
    color: var(--text-secondary);
}

.noti-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 5px;
    text-align: right;
}

/* ===== Floor Plan Overlay ===== */
.floorplan-overlay {
    position: absolute;
    top: 90px;
    left: 250px;
    /* sidebar width */
    right: 0;
    bottom: 0;
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    padding: 30px;
}

.floorplan-window {
    position: relative;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.05s linear;
    z-index: 401;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: visible;
    /* ?좎뵪 ?꾩젽???덈룄???꾩뿉 ?쒖떆?섎룄濡??덉슜 */
    width: 1950px;
    max-width: 95vw;
    height: 950px;
}

.floorplan-main-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-radius: 0 0 16px 16px;
    /* ?섎떒 ?쇱슫???좎? */
}

.floorplan-window.dragging {
    transition: none;
    opacity: 0.8;
    /* ?꾩껜 ?щ챸??0.8 */
    cursor: move;
    z-index: 1000;
}

.floorplan-header {
    background: var(--fp-header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: move;
    user-select: none;
    border-radius: 16px 16px 0 0;
}

.floorplan-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-blue);
}

#floorplan-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.floorplan-header .header-left i {
    font-size: 18px;
    filter: drop-shadow(0 0 5px rgba(0, 242, 255, 0.3));
}

.floorplan-header .panel-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pin {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pin:hover {
    color: var(--accent-blue);
    transform: scale(1.1);
}

.btn-pin.pinned {
    color: #ff9f0a;
    /* ?ㅻ젋吏?됱쑝濡?怨좎젙 ?쒖떆 */
    text-shadow: 0 0 10px rgba(255, 159, 10, 0.4);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.header-actions .close-btn {
    position: static;
    /* ?뚮젆???덉씠?꾩썐 李몄뿬瑜??꾪빐 ?덈? 諛곗튂 ?댁젣 */
    padding: 5px;
}




.floorplan-header .close-btn {
    position: static;
    /* 遺紐?flex ?덉씠?꾩썐 李몄뿬 */
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
    line-height: 1;
}

.floorplan-header .close-btn:hover {
    color: var(--accent-red);
}


.floorplan {
    position: relative;
    width: 100%;
    aspect-ratio: 923 / 676;
    border: none;
    /* ?뚮몢由??쒓굅濡?源붾걫???붿옄??援ы쁽 */
    border-radius: 4px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 吏???섎떒 而⑦듃濡??곸뿭 (寃??+ 紐⑤땲?곕쭅 ?щ’) */
.map-controls-bottom {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* 醫뚯슦 怨듦컙???쒖꽕?쇳븯寃?諛곕텇?섏뿬 以묒븰 而щ읆 怨좎젙 */
    align-items: center;
    padding: 0 30px;
    pointer-events: none;
}

/* 寃?됰컮 而⑦뀒?대꼫 (以묒븰 湲곗?) */
.map-search-container {
    width: 250px;
    /* 醫뚯륫 ?⑤꼸??留욎떠 ?덈퉬 異뺤냼 */
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    margin-bottom: 0;
    /* gap(10px)?쇰줈 ?泥?*/
}

/* ?듭뒳濡?而⑦뀒?대꼫 (寃?됰컮 ?곗륫???섎???諛곗튂) */
.watchlist-container {
    grid-column: 3;
    /* ?곗륫 而щ읆 李⑥? */
    justify-self: start;
    margin-left: 30px;
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.map-search-container:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 25px rgba(0, 210, 255, 0.2);
    width: 280px;
    /* ?ъ빱?????댁쭩 ?뺤옣 */
}

.search-icon {
    color: var(--text-muted);
    font-size: 16px;
}

#map-search-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    width: 100%;
    outline: none;
    padding-right: 30px;
    /* 痍⑥냼 踰꾪듉 怨듦컙 ?뺣낫 */
}

/* [?좉퇋] 寃?됯린 痍⑥냼 踰꾪듉 ?꾨━誘몄뾼 ?ㅽ???*/
#btn-search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: -25px;
    /* ?낅젰李??대? ?곗륫 諛곗튂 */
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0.7;
}

#btn-search-clear:hover {
    color: var(--accent-blue);
    transform: scale(1.1);
    opacity: 1;
}

#map-search-input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

/* 媛먯떆 紐⑸줉 ?щ’ (Watchlist) */
.watchlist-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.watchlist-slot {
    position: relative;
    width: 160px;
    /* ?뺣낫瑜????닿린 ?꾪빐 ?쎄컙 ???뺤옣 */
    height: 70px;
    /* ?섏쭅 2?⑥쓣 ?꾪빐 ?믪씠 議곗젅 */
    background: rgba(15, 20, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    /* ?섏쭅 2??諛곗뿴 */
    align-items: stretch;
    justify-content: center;
    padding: 8px 12px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    overflow: visible;
}

/* ?쇱씠???뚮쭏 ???*/
.light-theme .watchlist-slot {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.light-theme .watchlist-slot.empty {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .watchlist-slot.empty i {
    color: rgba(0, 0, 0, 0.2);
}

.watchlist-slot:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(0, 210, 255, 0.5);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.2);
}

.watchlist-slot.empty {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    cursor: default;
}

.watchlist-slot.empty:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.watchlist-slot.empty i {
    color: rgba(255, 255, 255, 0.15);
    font-size: 20px;
}

/* ?щ’ ?대? 2???덉씠?꾩썐 */
.slot-header {
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 4px;
}

.light-theme .slot-header {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.slot-complex-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
    /* 諛쒖쟾?뚮챸????媛뺤“ */
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.light-theme .slot-complex-name {
    color: #0056b3;
}

.slot-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.slot-unit-name {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.light-theme .slot-unit-name {
    background: rgba(40, 50, 60, 0.9);
}

.slot-score {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
    padding-right: 4px;
    /* ?곗륫 ?щ갚 ?뺣낫 */
}

.light-theme .slot-score {
    color: #007aff;
    text-shadow: none;
}

.watchlist-slot.warning .slot-score {
    color: var(--status-warn);
}

.watchlist-slot.danger .slot-score {
    color: var(--status-danger);
}

/* ?щ’ ?꾪뿕 ?좊땲硫붿씠??*/
.watchlist-slot.danger {
    border-color: rgba(255, 59, 48, 0.6);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.4);
    animation: slot-danger-pulse 1.5s infinite;
}

@keyframes slot-danger-pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 59, 48, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
    }
}

/* ?щ’ ??젣 踰꾪듉 */
.btn-slot-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #333;
    border: 1px solid #444;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.watchlist-slot:hover .btn-slot-remove {
    display: flex;
}

.btn-slot-remove:hover {
    background: #ff3b30;
    border-color: #ff3b30;
    transform: scale(1.1);
}

/* ?щ’ ?꾩슜 ?댄똻 */
.watchlist-slot[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
}

.watchlist-slot:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.search-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    display: none;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: var(--accent-red);
}

.search-results-list {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(var(--bg-panel-rgb), 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    z-index: 2000;
}

.search-results-list li {
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-results-list li:hover {
    background: rgba(var(--accent-blue-rgb), 0.2);
}

.search-results-list li .res-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 2px;
}

.search-results-list li .res-addr {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.search-results-list li.no-result {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
}

.search-results-list::-webkit-scrollbar {
    width: 6px;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ?쇱꽌 ?꾩씠肄?*/
.fp-sensor {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* [?좉퇋] ?됰㈃???쇱꽌 ?쒖꽦???곹깭 (Active / Focus) */
.fp-sensor.active {
    z-index: 100;
    transform: translate(-50%, -50%) scale(1.15);
    /* ?ш린 議곗젅 異뺤냼 */
    border-color: #fff;
    border-width: 2px;
    /* ?뚮몢由?媛뺤“ */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px currentColor;
    /* ????愿묓쐶 */
}

/* [?좉퇋] ?됰㈃???쇱꽌 ?몃쾭 ?곹깭 (Hover / Glow) */
.fp-sensor.hovered {
    z-index: 90;
    transform: translate(-50%, -50%) scale(1.1);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px currentColor;
}

/* [湲곗〈 Ripple ?쒓굅] */

/* [湲곗〈 ?ъ빱???붾컢 ?쒓굅 - ?ъ슜???붿껌] */
/* 
.floorplan.dimmed .fp-sensor:not(.active) {
    opacity: 0.65;
    filter: saturate(0.8);
    pointer-events: none;
}
*/

/* [?좉퇋] 吏?ν삎 ?댄똻 (Compact Version) */
.fp-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(10, 15, 25, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    color: #fff;
    z-index: 105;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s ease-out;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 120px;
}

.fp-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(10, 15, 25, 0.95);
}

.fp-tooltip .tt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 3px;
    margin-bottom: 2px;
}

.fp-tooltip .tt-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-blue);
    opacity: 0.9;
}

.fp-tooltip .tt-status {
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 800;
}

.tt-status.normal {
    color: var(--status-normal);
}

.tt-status.warning {
    color: var(--status-warning);
}

.tt-status.danger {
    color: var(--status-danger);
}

.fp-tooltip .tt-body {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 4px;
}

.fp-tooltip .tt-value {
    font-size: 16px;
    font-weight: 900;
    font-family: var(--font-num);
}

.fp-tooltip .tt-unit {
    font-size: 10px;
    color: var(--text-secondary);
}

.fp-tooltip .tt-trend {
    font-size: 11px;
    margin-left: auto;
}

.tt-trend.up {
    color: #ff3b30;
}

.tt-trend.down {
    color: #007aff;
}

.tt-trend.stable {
    color: #4cd964;
}

/* 湲곗〈 ?댄똻 ?④? (?쒖꽦???먮뒗 ?몃쾭 ??JS ?댄똻怨?寃뱀묠 諛⑹?) */
.fp-sensor.active[data-tooltip]::after,
.fp-sensor.active[data-tooltip]::before,
.fp-sensor.hovered[data-tooltip]::after,
.fp-sensor.hovered[data-tooltip]::before {
    display: none !important;
}

/* 而ㅼ뒪? ?댄똻 ?ㅽ???*/
.fp-sensor[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #000;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.fp-sensor[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 5px solid transparent;
    border-top-color: #000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
    z-index: 100;
}

.fp-sensor[data-tooltip]:hover::after,
.fp-sensor[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fp-sensor:hover {
    z-index: 1000;
    /* ?몃쾭 ??媛???꾨줈 */
}

/* ?듯빀?쇱꽌 留덉빱: ?쇱슫???ш컖?뺤쑝濡?援щ텇 */
.fp-sensor.fp-integrated {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
}

.fp-sensor.normal {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 210, 255, 0.9);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.fp-sensor:hover,
.fp-sensor.hovered {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.8);
    z-index: 1000;
}

.fp-sensor.warning {
    background: rgba(255, 184, 0, 0.9);
    /* 寃?뺤뿉???몃???諛곌꼍?쇰줈 蹂寃?*/
    border: 2px solid rgba(255, 255, 255, 0.8);
    /* ?뚮몢由щ? ?곗깋怨꾩뿴濡?蹂寃쏀븯??諛곌꼍怨??鍮?*/
    color: #000;
    /* ?몃? 諛곌꼍?먮뒗 寃???꾩씠肄섏씠 ????蹂댁엫 */
    box-shadow: 0 0 15px rgba(255, 184, 0, 0.6);
    animation: fp-pulse-warn 1.5s ease-in-out infinite alternate;
}

.fp-sensor.danger {
    background: rgba(255, 59, 48, 0.9);
    /* 寃?뺤뿉??鍮④컙??諛곌꼍?쇰줈 蹂寃?*/
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    /* 鍮④컙 諛곌꼍?먮뒗 ?곗깋 ?꾩씠肄??좎? */
    box-shadow: 0 0 25px rgba(255, 59, 48, 0.8);
    animation: fp-pulse-danger 0.8s ease-in-out infinite alternate;
}

.fp-sensor.danger i {
    animation: fp-icon-shake 0.4s ease-in-out infinite;
}

/* Marker Hover linkage styles integrated into bottom of file */

/* ?쇱꽌 ?쇰꺼 (hover ???쒖떆) */
.fp-sensor::after {
    content: attr(title);
    position: absolute;
    bottom: -20px;
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.fp-sensor:hover::after {
    opacity: 1;
}

@keyframes fp-pulse-warn {
    from {
        box-shadow: 0 0 8px rgba(255, 184, 0, 0.2);
    }

    to {
        box-shadow: 0 0 18px rgba(255, 184, 0, 0.5);
    }
}

@keyframes fp-pulse-danger {
    from {
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.3);
    }

    to {
        box-shadow: 0 0 25px rgba(255, 59, 48, 0.7);
    }
}

/* 踰붾? */
.floorplan-legend {
    pointer-events: auto;
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 8px;
}

.legend-item {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-item.normal i {
    color: var(--status-ok);
    font-size: 8px;
}

.legend-item.warning i {
    color: var(--status-warn);
    font-size: 8px;
}

.legend-item.danger i {
    color: var(--status-danger);
    font-size: 8px;
}

/* ===== 諛⑸퀎 ?듯빀?쇱꽌 移대뱶 ===== */
.room-card {
    position: relative;
}

.room-card h4 small {
    font-size: 10px;
    font-weight: 400;
}

.room-sensor-icons {
    display: flex;
    gap: 8px;
    margin: 6px 0 4px;
}

.room-sensor-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.room-s-normal {
    background: rgba(0, 200, 83, 0.15);
    color: var(--status-normal);
}

.room-s-warning {
    background: rgba(255, 171, 0, 0.2);
    color: var(--status-warn);
    animation: pulse-warn 2s ease-in-out infinite;
}

.room-s-danger {
    background: rgba(255, 23, 68, 0.25);
    color: var(--status-danger);
    animation: pulse-danger 1s ease-in-out infinite;
}

@keyframes pulse-warn {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes pulse-danger {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ===== ?앹뾽 ??4遺꾪븷 李⑦듃 洹몃━??===== */
.room-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.room-chart-item {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 4px;
}

.room-chart-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2px;
    font-weight: 500;
}

.room-sensor-info {
    margin-top: 8px;
}

.ai-analysis-box {
    font-size: 11px;
    line-height: 1.5;
}

.ai-analysis-box p {
    margin: 4px 0;
}

/* ?듯빀?쇱꽌 ?앹뾽: 2횞2 李⑦듃 洹몃━??*/
.room-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.room-detail-sensor {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 6px 8px;
}

.room-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-detail-label span {
    font-size: 12px;
    font-weight: 700;
}

/* ===== Keyframe Animations ===== */

/* ?됰㈃??留덉빱: 二쇱쓽 留μ떆??*/
@keyframes fp-pulse-warn {
    0% {
        box-shadow: 0 0 8px rgba(255, 184, 0, 0.4);
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        box-shadow: 0 0 22px rgba(255, 184, 0, 0.8);
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ?됰㈃??留덉빱: ?꾪뿕 留μ떆??*/
@keyframes fp-pulse-danger {
    0% {
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        box-shadow: 0 0 30px rgba(255, 59, 48, 1);
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* ?됰㈃??留덉빱: ?꾪뿕 ?꾩씠肄??붾뱾由?*/
@keyframes fp-icon-shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(8deg);
    }
}

/* ?쇱꽌 移대뱶: 二쇱쓽 ?곹깭 */
@keyframes card-pulse-warn {
    0% {
        border-color: rgba(255, 184, 0, 0.3);
    }

    100% {
        border-color: rgba(255, 184, 0, 0.8);
    }
}

/* ?쇱꽌 移대뱶: ?꾪뿕 ?곹깭 */
@keyframes card-pulse-danger {
    0% {
        box-shadow: 0 0 5px rgba(255, 59, 48, 0.3);
        border-color: rgba(255, 59, 48, 0.5);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 59, 48, 0.6);
        border-color: rgba(255, 59, 48, 1);
    }
}

/* ?쇱꽌 移대뱶: ?꾪뿕 ?꾩씠肄??붾뱾由?*/
@keyframes icon-shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

/* ?띿뒪??源쒕묀??*/
@keyframes text-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Modal Z-Index Fix */
.modal-backdrop {
    z-index: 2100;
}

/* ===== Danger Countdown Toast ===== */
.notification-card.danger-toast {
    background: var(--toast-bg);
    border: 1px solid var(--toast-border);
    border-left: 4px solid #ff3b30;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 15px rgba(255, 59, 48, 0.1);
    flex-direction: column;
    padding: 0;
    width: 340px;
    gap: 0;
    overflow: hidden;
}

.danger-toast .noti-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    width: 100%;
    border-bottom: 1px solid var(--toast-header-border);
}

.danger-toast .noti-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.danger-toast .noti-icon-fire {
    width: 32px;
    height: 32px;
    background: var(--toast-icon-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ff3b30;
    font-size: 16px;
    animation: icon-shake 1s infinite;
}

.danger-toast .noti-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.danger-toast .noti-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--toast-title);
}

.danger-toast .noti-subtitle {
    font-size: 11px;
    color: var(--toast-subtitle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.danger-toast .noti-close {
    background: transparent;
    border: none;
    color: var(--toast-close);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.danger-toast .noti-close:hover {
    color: var(--toast-close-hover);
}

.danger-toast .noti-body {
    width: 100%;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    /* ?묒そ ?뺣젹 */
    align-items: center;
    background: var(--toast-body-bg);
}

.danger-toast .noti-cause {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.danger-toast .cause-label {
    font-size: 11px;
    color: var(--toast-subtitle);
    margin-bottom: 2px;
}

.danger-toast .cause-value {
    font-size: 14px;
    font-weight: 700;
    color: #ff3b30;
    text-shadow: 0 0 5px rgba(255, 59, 48, 0.3);
}

.danger-toast .noti-timer-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.danger-toast .timer-arrow {
    color: #ff3b30;
    font-size: 18px;
    font-weight: bold;
    margin-right: 8px;
    animation: pulse-arrow 1s infinite alternate;
}

.danger-toast .timer-val {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 700;
    color: #ff9f0a;
    /* Orange */
    text-shadow: 0 0 10px rgba(255, 159, 10, 0.4);
    background: -webkit-linear-gradient(#ff3b30, #ff9f0a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.danger-toast .timer-unit {
    font-size: 14px;
    color: #aaa;
    font-weight: 500;
}

.danger-toast.expired {
    border-color: #666;
    filter: grayscale(0.8);
}

.danger-toast.expired .timer-val {
    background: none;
    -webkit-text-fill-color: #666;
    color: #666;
    text-shadow: none;
}

@keyframes pulse-arrow {
    from {
        transform: translateX(0);
        opacity: 0.6;
    }

    to {
        transform: translateX(5px);
        opacity: 1;
    }
}

/* ==========================================================
   [DEMO] Sensor Positioning Editor Styles
   ========================================================== */

/* Demo Window Width Optimization (AI Panel excluded, so reduced by ~480px) */
.floorplan-window.demo-window {
    max-width: 1470px !important;
    /* 1950px - 480px */
    width: 90vw !important;
}

/* Header Actions for buttons */
.floorplan-header .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.floorplan-header .btn-save {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.floorplan-header .btn-save:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Demo Sidebar (Left Panel) */
.demo-sidebar {
    width: 320px !important;
    background: var(--bg-panel-darker, #111) !important;
}

.demo-sidebar .panel-content {
    padding: 20px;
    overflow-y: auto;
}

.demo-section h4 {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
    border-left: 3px solid var(--accent-blue);
    padding-left: 8px;
    margin-top: 15px;
}

.demo-section:first-child h4 {
    margin-top: 0;
}

/* Sensor Picker Grid */
.sensor-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sensor-pick-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sensor-pick-item:hover {
    background: var(--bg-accent-subtle);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.sensor-pick-item i {
    font-size: 18px;
    color: var(--accent-blue);
}

.sensor-pick-item span {
    font-size: 11px;
    color: var(--text-main);
}

/* Floorplan Picker List */
.fp-picker-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.fp-pick-item {
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
}

.fp-pick-item label {
    display: block;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
}

.fp-pick-item small {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
}

.fp-pick-item:hover,
.fp-pick-item.active {
    background: var(--bg-accent-subtle);
    border-color: var(--accent-blue);
}

.fp-pick-item.active label {
    color: var(--accent-blue);
    font-weight: 700;
}

/* Workspace & Canvas */
.demo-workspace {
    flex: 1;
    position: relative !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 20px !important;
    pointer-events: auto !important;
}

.demo-workspace-hint {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    color: #ffd60a;
    z-index: 10;
    border: 1px solid rgba(255, 214, 10, 0.3);
}

.demo-canvas {
    position: relative;
    width: 923px;
    height: 676px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #1a1a1a;
    border: none;
}








/* Draggable Sensor Node */
.demo-sensor-node {
    position: absolute;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 210, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: move;
    z-index: 100;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.demo-sensor-node.integrated {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
}

.demo-sensor-node:hover {
    transform: scale(1.1);
    background: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue);
}

.demo-sensor-node.dragging {
    opacity: 0.8;
    transform: scale(1.2);
    z-index: 1000;
    cursor: grabbing;
}

.demo-sensor-node .sensor-label {
    position: absolute;
    bottom: -18px;
    white-space: nowrap;
    font-size: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 1px 4px;
    border-radius: 4px;
}

.demo-sensor-node .btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: #ff3b30;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    display: none;
}

.demo-sensor-node:hover .btn-remove {
    display: flex;
}

/* Light Theme Overrides for Demo */
.light-theme .demo-window {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.light-theme .demo-window .floorplan-header {
    background: #fff !important;
    border-bottom: 1px solid #eee !important;
}

.light-theme .demo-sidebar {
    background: #fff !important;
    border-right: 1px solid #eee !important;
}

.light-theme .demo-sidebar .panel-header h2 {
    color: #333 !important;
}

.light-theme .sensor-pick-item {
    background: #f1f3f5;
    border-color: #e9ecef;
}

.light-theme .sensor-pick-item span {
    color: #495057;
}

.light-theme .fp-pick-item {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.light-theme .fp-pick-item label {
    color: #343a40;
}

.light-theme .demo-workspace {
    background-color: #f1f3f5 !important;
}

.light-theme .demo-sensor-node {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 122, 255, 0.8) !important;
    color: #000 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.light-theme .demo-sensor-node .sensor-label {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 1px solid #ddd;
}

/* Light Theme Overrides for Demo Buttons */
.light-theme .btn-clear {
    background: rgba(255, 59, 48, 0.05);
    border-color: rgba(255, 59, 48, 0.2) !important;
}

.light-theme .btn-clear:hover {
    background: #ff3b30 !important;
    color: #fff !important;
}


/* Window Focus Management */
.floorplan-overlay.z-front {
    z-index: 500 !important;
    /* 占썩본 400占쏙옙占쏙옙 占쏙옙占?*/
}

.demo-actions-bottom {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
    padding: 10px;
}

.demo-actions-bottom button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    /* Sensor Card Style Implementation */
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(10px);
}

.demo-actions-bottom .btn-save:hover {
    border-color: var(--accent-blue) !important;
    background: var(--bg-hover) !important;
    transform: translateY(-1px);
}

.demo-actions-bottom .btn-clear {
    opacity: 0.8;
}

.demo-actions-bottom .btn-clear:hover {
    border-color: #ff3b30 !important;
    background: rgba(255, 59, 48, 0.1) !important;
    color: #ff3b30 !important;
    transform: translateY(-1px);
}

/* Light Theme Font Color (Strict Enforcement) */
.light-theme .demo-actions-bottom button {
    color: #000 !important;
    background: #fff !important;
    border-color: #ddd !important;
}

.light-theme .demo-actions-bottom .btn-save:hover {
    border-color: var(--accent-blue) !important;
    background: var(--bg-accent-subtle) !important;
}

/* [?좉퇋] ?띿뒪???섑븨 諛??섏묠 諛⑹? (Text Wrap & Overflow Fix) */
.report-section,
.ai-summary-box,
.data-summary-box,
.analysis-log-box {
    overflow-wrap: break-word !important;
    word-break: keep-all !important;
    white-space: normal !important;
    max-width: 100%;
}

.report-section p,
.ai-summary-box p,
.data-summary-box div {
    overflow-wrap: break-word;
    word-break: keep-all;
    line-height: 1.6;
}

/* ===== 而ㅼ뒪? 留덉빱 ?ㅽ???(Power Plant) ===== */
.custom-marker-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-marker-wrapper:hover {
    transform: scale(1.1) translateY(-5px);
    z-index: 100;
}

.marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    background: var(--accent-blue);
}

.marker-pin i {
    transform: rotate(45deg);
    color: #fff;
    font-size: 14px;
}

.custom-marker-wrapper .marker-label {
    margin-bottom: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.02em;
}

/* ?곹깭蹂??ㅽ???*/
.custom-marker-wrapper.danger .marker-pin {
    background-color: var(--status-danger) !important;
    animation: marker-pulse-danger 1.5s infinite;
}

.custom-marker-wrapper.warning .marker-pin {
    background-color: var(--status-warn) !important;
}

@keyframes marker-pulse-danger {
    0% {
        transform: rotate(-45deg) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }

    70% {
        transform: rotate(-45deg) scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
    }

    100% {
        transform: rotate(-45deg) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* ===== ?곸꽭 ?⑤꼸 ?붿옄??怨좊룄??(Premium Detail Panel) ===== */
.plant-info-brief {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-item.full {
    grid-column: 1 / -1;
}

.info-item .label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-item .value {
    font-size: 12px;
    color: var(--text-main);
    font-weight: 600;
}

.panel-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-blue);
    margin: 20px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.3), transparent);
}

.facility-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.facility-item {
    background: rgba(var(--bg-panel-rgb), 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.facility-item:hover,
.facility-item.hovered {
    background: rgba(var(--accent-blue), 0.15) !important;
    border-color: var(--accent-blue) !important;
    transform: translateX(6px);
    box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.1);
}

.facility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.facility-header .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

/* --- 異붽???3?④퀎 ?쒕┫?ㅼ슫 UI ?ㅽ???--- */
.room-summary {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.room-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-ok);
    box-shadow: 0 0 4px rgba(48, 209, 88, 0.4);
}

.room-dot.warning {
    background: var(--status-warning);
    box-shadow: 0 0 4px rgba(255, 184, 0, 0.4);
}

.room-dot.danger {
    background: var(--status-danger);
    box-shadow: 0 0 4px rgba(255, 59, 48, 0.4);
}

.sensor-mini-list {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.sensor-tag {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: color 0.2s;
}

#btn-back:hover {
    color: var(--accent-blue);
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

/* --- 援ъ뿭 ?곸꽭 ?앹삤踰?(Room Detail Popover - fire_dashboard Style) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1500;
    display: none;
    pointer-events: none;
}

.modal-content {
    position: absolute;
    background: var(--bg-panel);
    width: 480px;
    border-radius: 12px;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    padding: 0;
    pointer-events: auto;
    overflow: visible;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Arrow pointing LEFT by default */
/* --- 3???덉씠?꾩썐 & ?됰㈃???ㅻ쾭?덉씠 (fire_dashboard Style) --- */
.fp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    /* JS?먯꽌 ?쒖뼱 */
    align-items: center;
    justify-content: center;
}

.fp-window {
    width: 95%;
    max-width: 1600px;
    height: 85vh;
    background: rgba(15, 20, 35, 0.95);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 242, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fpFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fpFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.fp-header {
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fp-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-blue);
    letter-spacing: 1px;
}

.fp-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ?ъ씠???⑤꼸 (?붿빟 & 遺꾩꽍) */
.fp-side {
    width: 350px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.fp-side h4 {
    padding: 15px 20px;
    margin: 0;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    color: #8b9bb4;
}

.summary-scroll,
.analysis-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* ?됰㈃??硫붿씤 */
.fp-main {
    flex: 1;
    background: #0a0c14;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 30px;
}

.fp-map-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.fp-map-wrapper img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
    opacity: 0.9;
}

/* ?쇱꽌 留덉빱 (?꾨㈃ ?? */
.markers-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sensor-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background: rgba(0, 242, 255, 0.2);
    border: 2px solid #00f2ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
}

.sensor-marker.warning {
    border-color: #ffb800;
    box-shadow: 0 0 15px rgba(255, 184, 0, 0.4);
    background: rgba(255, 184, 0, 0.2);
}

.sensor-marker.danger {
    border-color: #ff3b30;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.4);
    background: rgba(255, 59, 48, 0.2);
    animation: markerPulse 1.5s infinite;
}

@keyframes markerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 25px rgba(255, 59, 48, 0.9);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
    }
}

/* 醫뚯륫 ?⑤꼸 寃뚯씠吏 洹몃━??*/
.gauge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 10px;
}

.gauge-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
}

.gauge-card h5 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #8b9bb4;
    width: 100%;
    text-align: center;
}

.gauge-container {
    flex: 1;
    width: 100%;
}

/* ?곹깭 ?붿빟 ?꾩씠??*/
.summary-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #00f2ff;
}

.summary-item.warning {
    border-left-color: #ffb800;
}

.summary-item.danger {
    border-left-color: #ff3b30;
}

.summary-item .label {
    font-size: 0.85rem;
    color: #8b9bb4;
}

.summary-item .value {
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
    font-family: 'Orbitron';
}

/* AI 遺꾩꽍 諛뺤뒪 (?ㅻ쾭?덉씠 ?대?) */
.fp-analysis p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.fp-analysis strong {
    color: var(--accent-blue);
}

/* 酉?而⑦뀒?대꼫 */
.view-container {
    width: 100%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

.modal-content::before {
    content: '';
    position: absolute;
    left: -10px;
    top: var(--arrow-top, 50px);
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--accent-blue);
    border-left: none;
    transition: top 0.2s ease-out;
}

/* Arrow pointing UP */
.modal-content.top-arrow::before {
    left: 50%;
    top: -10px;
    bottom: auto;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--accent-blue);
    border-top: none;
}

/* Arrow pointing DOWN */
.modal-content.bottom-arrow::before {
    left: 50%;
    bottom: -10px;
    top: auto;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--accent-blue);
    border-bottom: none;
}

.modal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 14px;
    color: var(--accent-blue);
    margin: 0;
    font-weight: 700;
}

.modal-body-scroll {
    padding: 18px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Chart Grid */
.room-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.room-detail-sensor {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
}

.room-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.room-chart-container {
    width: 100%;
    height: 80px;
}

/* AI Analysis Box */
.ai-analysis-box {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.ai-analysis-box h4 {
    font-size: 13px;
    color: var(--status-ok);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#ai-analysis-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detected-issues-box {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.summary-line:last-child {
    margin-bottom: 0;
}

.summary-line.danger {
    color: #ff3b30;
}

.summary-line.warning {
    color: #ffb800;
}

.status-badge.normal {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.status-badge.warning {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
    border: 1px solid rgba(255, 159, 10, 0.3);
    animation: text-blink 1.5s infinite;
}

.status-badge.danger {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
    animation: text-blink 1s infinite;
}

.room-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.room-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #333;
}

.room-dot.normal {
    background: #34c759;
    box-shadow: 0 0 5px rgba(52, 199, 89, 0.5);
}

.room-dot.warning {
    background: #ff9f0a;
    box-shadow: 0 0 5px rgba(255, 159, 10, 0.5);
}

.room-dot.danger {
    background: #ff3b30;
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.8);
}

/* ?쇱꽌 洹몃━??諛?諛뺤뒪 ?ㅽ???*/
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sensor-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sensor-box .label {
    font-size: 11px;
    color: var(--text-muted);
}

.sensor-box .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue);
}

/* ?됰㈃????猷?留덉빱 ?쇰꺼 */
.room-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #34c759;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-marker.warning {
    background: #ff9f0a;
}

.room-marker.danger {
    background: #ff3b30;
    animation: marker-pulse-danger 1s infinite;
}

.room-marker .marker-label {
    position: absolute;
    top: -20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
}

/* Floating Modal 스타일 */
.floating-modal {
    position: fixed;
    top: 124px;
    left: 450px;
    /* 사이드바 패널 오른쪽 */
    width: 960px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-modal.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.floating-modal .modal-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-modal .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.floating-modal .header-left i {
    color: var(--accent-blue);
    font-size: 18px;
}

.floating-modal .header-left span {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.floating-modal .modal-body {
    padding: 20px;
    flex: 1;
}

.site-map-container {
    position: relative;
    width: 100%;
    min-height: 300px;
    /* height는 JS에서 이미지 비율에 맞춰 동적 설정 */
    background-color: #0c1425;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* 건물 마커 스타일 */
.building-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    z-index: 10;
}

.building-marker:hover,
.building-marker.hovered,
.building-marker.active {
    background: var(--accent-blue) !important;
    color: #000 !important;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 20px var(--accent-blue), 0 0 10px rgba(0, 0, 0, 0.5);
    border-color: #fff !important;
    z-index: 100;
}

.building-marker.warning {
    border-color: var(--status-warning);
}

.building-marker.danger {
    border-color: var(--status-danger);
}

.building-marker::after {
    content: attr(data-name);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.building-marker:hover::after,
.building-marker.hovered::after,
.building-marker.active::after {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 101;
    /* 다른 요소보다 항상 위에 뜨도록 보장 */
}

/* 패널 우측 돌출형 전체 배치도 재호출 플로팅 버튼 */
.floating-layout-btn {
    position: absolute;
    right: -56px;
    top: 15px;
    /* 타이틀 높이와 중앙 정렬 등 적절히 조절 */
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-blue);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.floating-layout-btn:hover {
    background: rgba(15, 23, 42, 1);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 255, 0.4);
    border-color: rgba(0, 242, 255, 0.6);
}

.floating-layout-btn.tooltip-btn {
    position: absolute;
    overflow: visible;
}

/* 평면도 버튼은 건물 아이콘 버튼 아래에 배치 */
.fp-toggle-btn.floating-layout-btn {
    top: 65px;
}

/* 말풍선 툴팁 (아래 방향 고정) */
.floating-layout-btn.tooltip-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    margin-top: 10px;
}

/* 말풍선 꼬리표 (아래 방향) */
.floating-layout-btn.tooltip-btn::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: -2px;
}

.floating-layout-btn.tooltip-btn:hover::after,
.floating-layout-btn.tooltip-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(10px);
}

/* ============================================
   라이트 테마: 전체 건물(시설) 배치도 관련
   ============================================ */

/* 배치도 모달 배경 */
.light-theme .floating-modal {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* 모달 헤더 */
.light-theme .floating-modal .modal-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.light-theme .floating-modal .header-left span {
    color: #1a1a2e;
}

.light-theme .floating-modal .close-btn {
    color: #5a6478;
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .floating-modal .close-btn:hover {
    color: #c41c00;
    background: rgba(255, 59, 48, 0.08);
}

/* 배치도 이미지 컨테이너 */
.light-theme .site-map-container {
    background-color: #e8ecf0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 건물 마커 */
.light-theme .building-marker {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--accent-blue);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.light-theme .building-marker:hover,
.light-theme .building-marker.hovered,
.light-theme .building-marker.active {
    background: var(--accent-blue) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.4);
    border-color: #fff;
}

.light-theme .building-marker.warning {
    border-color: var(--status-warning);
}

.light-theme .building-marker.danger {
    border-color: var(--status-danger);
}

/* 마커 말풍선 툴팁 */
.light-theme .building-marker::after {
    background: rgba(30, 30, 50, 0.9);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 플로팅 배치도 버튼 */
.light-theme .floating-layout-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.light-theme .floating-layout-btn:hover {
    background: #fff;
    color: var(--accent-blue);
    box-shadow: 0 6px 20px rgba(0, 132, 255, 0.25);
    border-color: rgba(0, 132, 255, 0.4);
}

/* 플로팅 버튼 말풍선 (라이트) */
.light-theme .floating-layout-btn.tooltip-btn::after {
    background: rgba(30, 30, 50, 0.9);
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.light-theme .floating-layout-btn.tooltip-btn::before {
    border-color: transparent transparent rgba(30, 30, 50, 0.9) transparent;
}

/* 시설 목록 항목 호버 (라이트) */
.light-theme .facility-item:hover,
.light-theme .facility-item.hovered {
    background: rgba(0, 132, 255, 0.08) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: inset 0 0 10px rgba(0, 132, 255, 0.05);
}