: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;
    --sidebar-transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

/* ===== 라이트 테마 ===== */
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;
}

/* ===== Custom Scrollbar (Global) ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--sb-track);
}

::-webkit-scrollbar-thumb {
    background: var(--sb-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-hover);
}

/* Firefox Support */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
}

/* ===== 공통 사각형 토글 버튼 스타일 (테마 연동) ===== */
.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: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 세대 상세 패널이 열리면 패널 우측으로 10px 간격을 두고 붙음 */
.device-summary-wrapper.panel-docked {
    left: 420px;
}

.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: -5px;
    /* 사이드바와 붙어 보이도록 살짝 겹침 */
    border-left: none;
    /* 사이드바 경계선과 겹치므로 제거 */
    border-top-left-radius: 0;
    border-bottom-left-radius: 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 {
    width: 400px;
    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;
}

.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: 5px;
    /* 디바이스 카드와의 간격 */
}

/* 퀵슬롯 컨테이너 (검색바 우측에 나란히 배치) */
.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% + 15px);
    /* 여유 공간 확보 */
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    padding: 8px 0;
    list-style: none;
    z-index: 1000;
}

.search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item i {
    font-size: 14px;
    color: var(--accent-blue);
}

.search-result-item .result-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.search-result-item .result-type {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

/* 스크롤바 커스텀 */
.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.7);
    border: 2px solid rgba(0, 210, 255, 0.9);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.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;
}

.fp-sensor:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

/* 센서 라벨 (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;
}