@font-face {
    font-family: "AppSans";
    src:
        local("Pretendard Variable"),
        local("Pretendard"),
        local("Noto Sans KR"),
        local("Malgun Gothic"),
        url("/font/AppSans.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Digital;
    src: url("/font/DS-DIGI.TTF") format("truetype");
}

:root {
    --page-bg: #14222d;
    --panel-bg: #223643;
    --panel-bg-2: #263d4c;
    --panel-head: #1a2a35;
    --line: #466070;
    --line-soft: rgba(185, 203, 216, 0.24);
    --text: #edf5f8;
    --muted: #a9bac5;
    --blue: #58a6ff;
    --green: #27d17f;
    --yellow: #f5bf3d;
    --red: #ff6b7a;
    --card-radius: 0.42vh;
    --radius-xs: 0.28vh;
    --radius-sm: 0.38vh;
    --radius-md: 0.52vh;
    --radius-lg: 0.72vh;
    --font-sans: "AppSans", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Arial, sans-serif;
    --font-number: Digital, "AppSans", "Segoe UI", monospace;
    --shadow-panel: 0 0.55vh 1.45vh rgba(0, 0, 0, 0.2);
    --shadow-floating: 0 1.6vh 4vh rgba(0, 0, 0, 0.38);
    --focus-ring: 0 0 0 0.22vh rgba(88, 166, 255, 0.22);
}

* {
    box-sizing: border-box;
}
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
body {
    background: var(--page-bg);
    color: var(--text);
    font-family: var(--font-sans);
}
button,
input,
select {
    font-family: inherit;
}
.integration-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.integration-header {
    height: 7.5vh;
    min-height: 7.5vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2vh;
    background: #1f2e38;
    border-bottom: 0.1vh solid var(--line);
}
.header-content {
    display: flex;
    align-items: center;
    height: 100%;
}
.header-content.left {
    width: 58%;
    justify-content: flex-start;
}
.header-content.right {
    width: 42%;
    justify-content: flex-end;
    gap: 1.5vh;
}
.logo {
    display: flex;
    align-items: center;
    margin-right: 4vh;
}
.logo img {
    height: 4.7vh;
    width: auto;
    display: block;
}
.integration-menu {
    display: flex;
    align-items: center;
    gap: 1vh;
    height: 100%;
}
.menu-link {
    height: 4.4vh;
    min-width: 14vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8vh;
    color: var(--muted);
    text-decoration: none;
    font-size: 1.6vh;
    border: 0.1vh solid transparent;
    border-radius: 2.5vh;
    background: transparent;
}
.menu-link img {
    width: 2.1vh;
    height: 2.1vh;
    object-fit: contain;
    opacity: 0.75;
}
.menu-link.active {
    color: var(--text);
    background: #334855;
    border-color: #59717f;
}
.header-status {
    font-size: 1.45vh;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.6vh;
    white-space: nowrap;
}
.state-dot {
    display: inline-block;
    width: 0.9vh;
    height: 0.9vh;
    border-radius: 50%;
    background: var(--green);
}
.state-dot.warn {
    background: var(--yellow);
}
.admin-selector {
    height: 3.4vh;
    background: #324651;
    color: var(--text);
    border: 0.1vh solid #617684;
    border-radius: 0.5vh;
    padding: 0 1vh;
}
.clock {
    font-family: Digital, monospace;
    font-size: 2.8vh;
    min-width: 12vh;
    text-align: right;
    color: #f8fafc;
}

.content_body {
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 1vh;
    background: var(--page-bg);
}
.monitoring-layout {
    display: flex;
    gap: 1vh;
}
.side_control {
    width: 25%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1vh;
}
.body_info {
    width: calc(75% - 1vh);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1vh;
}

.ctrl_box,
.info,
.air_info,
.rack_info_container,
.unity-panel,
.operation-panel,
.diagnosis-layout article {
    background: var(--panel-bg);
    border: 0.1vh solid var(--line-soft);
    border-radius: var(--card-radius);
    box-shadow: 0 0.5vh 1.5vh rgba(0, 0, 0, 0.12);
}
.ctrl_box {
    position: relative;
    height: calc((100% - 2vh) / 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 1.2vh;
}
.init {
    width: 90%;
    min-height: 3vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.85vh;
    color: #f8fafc;
}
.init > .title_con {
    display: flex;
    align-items: center;
    gap: 0.9vh;
}
.init img {
    width: 1.6vh;
    height: 1.6vh;
    opacity: 0.8;
}
.init_btn {
    position: absolute;
    top: 1vh;
    right: 1vh;
    width: 6vh;
    height: 2.5vh;
    border: 0;
    background: #9b3c49;
    color: var(--text);
    font-size: 1.2vh;
    border-radius: 1.5vh;
    cursor: pointer;
}

input[type="button"],
.set_btn,
.selInputCon button {
    min-width: 6.5vh;
    height: 3vh;
    border: none;
    font-size: 1.25vh;
    margin: 0.35vh;
    cursor: pointer;
    border-radius: 1.6vh;
    color: #fff;
    background: #60727d;
}
input[type="button"].drive {
    background: var(--green);
}
input[type="button"].stop {
    background: var(--yellow);
    color: #27323a;
}
input[type="button"].e-stop {
    background: var(--red);
}
input[type="button"].a-drive {
    background: var(--blue);
}
.set_btn {
    background: #617684;
}

.pcs_state {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ctrl_row {
    display: flex;
    justify-content: center;
    align-items: center;
}
.ctrl_box .ctrl_row > div:not(.b) {
    height: 4vh;
    width: 8.8vh;
    border: 0.1vh solid var(--line);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25vh;
    color: var(--text);
}
.ctrl_row.data_h > div {
    background: var(--panel-head);
    color: var(--muted);
}
.four_btn {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.bms_con {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5vh;
}
.bms {
    width: 18vh;
    height: 15vh;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}
.bms_conn_state {
    display: flex;
    gap: 1vh;
    align-items: center;
    font-size: 1.35vh;
}
.bms-img {
    width: 4.5vh;
    height: auto;
}
.ver_line {
    width: 0.1vh;
    height: 14vh;
    background: var(--line);
}
.limit-row {
    gap: 0.4vh;
    font-size: 1.35vh;
    margin-bottom: 1.2vh;
}
.limit-row input {
    width: 5vh;
    height: 2.4vh;
    text-align: center;
    color: var(--text);
    background: #2b3c46;
    border: 0.1vh solid #667b88;
    border-radius: 0.4vh;
}
.schedule {
    display: table;
    width: 90%;
}
.schedule_row {
    display: table-row;
}
.schedule_cell {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    height: 4.6vh;
    font-size: 1.55vh;
}
.schedule_cell input {
    width: 13vh;
    height: 2.8vh;
    text-align: right;
    background: #2b3c46;
    border: 0.1vh solid #667b88;
    border-radius: 0.4vh;
    color: var(--text);
    padding: 0 0.8vh;
}

.site-n-air {
    height: 14%;
    display: flex;
    gap: 1vh;
}
.site_select {
    flex: 1;
    background: #2f414d;
    border: 0.1vh solid var(--line-soft);
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    overflow: hidden;
}
#select_site_name {
    width: 14vh;
    height: 4.8vh;
    margin: 1vh;
    border: 0.1vh solid #657987;
    border-radius: 0.8vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8vh;
    color: #f8fafc;
    background: #344956;
}
.site_container {
    height: 100%;
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
}
#site_select {
    display: flex;
    align-items: center;
    gap: 1vh;
}
#site_select input[type="radio"] {
    display: none;
}
#site_select label.site > div {
    min-width: 12vh;
    height: 5vh;
    padding: 0 1.8vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.1vh solid #637985;
    border-radius: 2.6vh;
    color: var(--muted);
    font-size: 1.55vh;
    cursor: pointer;
    background: #344956;
}
#site_select input[type="radio"]:checked + label.site > div {
    background: #dfe7ec;
    color: #263744;
    border-color: #dfe7ec;
    font-weight: 700;
}
.btn {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.btn-img {
    width: 4.2vh;
    height: auto;
    opacity: 0.75;
}
.air_info {
    width: 32%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.air_info .init {
    display: none;
}
.air_info_con {
    width: calc(100% - 3vh);
    height: 70%;
    display: flex;
    gap: 1vh;
}
.air_info_item {
    width: 50%;
    display: flex;
    flex-direction: column;
}
.air_info_row {
    flex: 1;
    display: flex;
}
.air_info_cell {
    width: 50%;
    border: 0.1vh solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.28vh;
    color: var(--text);
}
.air_info_row:first-child .air_info_cell {
    background: var(--panel-head);
    color: var(--muted);
}

.main-dashboard-row {
    height: 33%;
    display: flex;
    gap: 1vh;
}
.unity-panel {
    width: 68%;
    padding: 1vh;
    display: grid;
    grid-template-rows: 3.4vh 1fr;
}
.unity-panel iframe {
    width: 100%;
    height: 100%;
    border: 0.1vh solid #536977;
    border-radius: 0.4vh;
    background: #111827;
}
.operation-panel {
    flex: 1;
    padding: 1vh;
    display: grid;
    grid-template-rows: 3.4vh 6vh 1fr 4vh;
    gap: 0.8vh;
}
.power-flow {
    display: grid;
    grid-template-columns: 1fr 3vh 1fr 3vh 1fr;
    align-items: center;
    gap: 0.6vh;
}
.flow-node {
    height: 5.2vh;
    border: 0.1vh solid var(--line);
    border-radius: 0.6vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #2f414d;
}
.flow-node b {
    font-size: 1.25vh;
    color: var(--muted);
}
.flow-node span {
    font-size: 1.8vh;
    color: #f8fafc;
}
.flow-arrow {
    color: var(--muted);
    text-align: center;
    font-size: 2vh;
}
#miniTrendChart {
    width: 100%;
    height: 100%;
}
.status-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8vh;
}
.status-summary div {
    border: 0.1vh solid var(--line);
    border-radius: 0.4vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1vh;
    font-size: 1.25vh;
}
.status-summary b,
.good-text {
    color: #4ade80;
}
.warn-text {
    color: var(--yellow);
}

.info_collection {
    height: 30%;
    display: flex;
    gap: 1vh;
}
.info {
    width: calc(100% / 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 1vh;
}
.info_table {
    display: table;
    width: 88%;
    margin-top: 1.5vh;
}
.info_row {
    display: table-row;
}
.blank {
    display: table-cell;
    width: 4%;
}
.info_cell {
    display: table-cell;
    height: 3.35vh;
    border-top: 0.1vh solid #748794;
    font-size: 1.16vh;
    vertical-align: middle;
    text-align: right;
    padding-right: 0.8vh;
    white-space: nowrap;
}
.info_row:last-child .info_cell {
    border-bottom: 0.1vh solid #748794;
}
.info_cell.head {
    color: var(--muted);
    text-align: center;
    padding-right: 0;
}
.f-list {
    width: 90%;
    margin-top: 1.4vh;
    font-size: 1.05vh;
}
.f-head,
.f-row {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 2.1fr;
    align-items: center;
    min-height: 3.2vh;
    border-bottom: 0.1vh solid #657987;
}
.f-head {
    color: var(--muted);
    border-top: 0.1vh solid #657987;
    background: var(--panel-head);
}
.f-head p {
    margin: 0;
    text-align: center;
}
.f-row > div {
    padding: 0 0.5vh;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
#f-body {
    height: 13.5vh;
    overflow: hidden;
}

.rack_info_container {
    height: 20%;
    display: flex;
    align-items: center;
    padding: 1vh;
}
.rack_info_container .conconcon {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1vh;
    overflow: hidden;
}
.rack_info {
    min-width: 26vh;
    height: 100%;
    background: #2f414d;
    border: 0.1vh solid var(--line);
    border-radius: 0.6vh;
    padding: 0.8vh;
}
.rack_head {
    height: 2.5vh;
    font-size: 1.35vh;
    color: #f8fafc;
    border-bottom: 0.1vh solid var(--line);
}
.rack_body {
    height: calc(100% - 2.5vh);
    display: flex;
    align-items: center;
}
.rack_body .ver_line {
    height: 10vh;
}
.rack_col {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}
.rack_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15vh;
    padding: 0 0.7vh;
}
.rack_key {
    color: var(--muted);
}
.rack_value {
    color: var(--text);
}

.diagnosis-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1vh;
}
.diagnosis-layout > section {
    min-height: 0;
    display: grid;
    gap: 1vh;
}
.diagnosis-layout > section:nth-of-type(1) {
    grid-template-rows: 1fr 1fr 1fr;
}
.diagnosis-layout > section:nth-of-type(2) {
    grid-template-rows: 14% 1fr 1fr;
}
.diagnosis-layout > section:nth-of-type(3) {
    grid-template-rows: 1fr 1fr;
}
.diagnosis-layout article {
    display: grid;
    grid-template-rows: 4vh 1fr;
    min-height: 0;
    overflow: hidden;
}
.art_t {
    height: 4vh;
    display: flex;
    align-items: center;
    padding: 0 1vh;
    font-size: 1.65vh;
    background: var(--panel-head);
    border-bottom: 0.1vh solid var(--line-soft);
    position: relative;
}
.art_t:before {
    content: "";
    width: 1.5vh;
    height: 1.5vh;
    margin-right: 0.8vh;
    background: url("/images/menu_icon.png") center/contain no-repeat;
    opacity: 0.8;
}
.art_c {
    min-height: 0;
    padding: 1vh;
}
#server_resource_con {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1vh;
}
#server_resource_con > div {
    display: grid;
    grid-template-rows: 2vh 1fr;
    align-items: center;
    text-align: center;
    min-width: 0;
}
#server_resource_con > div > p {
    margin: 0;
    font-size: 1.15vh;
    color: var(--muted);
}
#server_resource_con canvas {
    width: 8.6vh;
    height: 8.6vh;
}
#server_resource_con > div > div {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
#server_resource_con > div > div > p {
    position: absolute;
    margin: 0;
    font-size: 1.1vh;
    color: #f8fafc;
}
.label_class_con:before {
    content: attr(data-state);
    display: inline-flex;
    height: 3vh;
    padding: 0 2vh;
    align-items: center;
    justify-content: center;
    background: var(--green);
    border-radius: 2vh;
    font-size: 1.35vh;
    color: white;
}
.svgCon img {
    width: 6vh;
    height: 6vh;
    opacity: 0.8;
    filter: invert(1);
}
#now_fault_hist {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.9vh;
}
.nfhRows {
    height: 4.6vh;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.2fr 2fr;
    gap: 0.5vh;
    align-items: center;
}
.nfhRows p {
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.1vh solid var(--line);
    border-radius: 0.4vh;
    background: #2f414d;
    font-size: 1.2vh;
}
.nfhRows p:after {
    content: attr(data-cap);
    color: var(--muted);
    margin-left: 0.3vh;
    font-size: 0.9vh;
}
#newest_fault_feedback {
    height: 100%;
    display: grid;
    grid-template-rows: 5vh 1fr 1fr;
    gap: 0.8vh;
}
#newest_fault_feedback section {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 1fr;
    gap: 0.8vh;
}
#newest_fault_feedback section div,
.nff_context,
.nff_feedback {
    border: 0.1vh solid var(--line);
    background: #2f414d;
    border-radius: 0.4vh;
    padding: 0.8vh;
    font-size: 1.18vh;
    line-height: 1.45;
    overflow: hidden;
}
#newest_fault_feedback [data-t]:before {
    content: attr(data-t) " : ";
    color: var(--muted);
    display: block;
}
.diagnosis-layout .site-n-air {
    height: 100%;
}
.diagnosis-layout .site_select.wide {
    width: 100%;
}
#featureChart,
#yearFaultCountChart {
    width: 100%;
    height: 100%;
}
#fault_table_con {
    display: grid;
    grid-template-rows: 3.5vh 1fr;
    padding: 0;
}
.ftHead,
.ftRow {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 2.5fr 1fr 1fr;
    align-items: center;
}
.ftHead {
    color: var(--muted);
    background: var(--panel-head);
    border-bottom: 0.1vh solid var(--line);
    font-size: 1.15vh;
}
.ftHead div,
.ftRow div {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ftBody {
    min-height: 0;
    overflow: hidden;
}
.ftRow {
    height: 4.25vh;
    border-bottom: 0.1vh solid #536977;
    font-size: 1.12vh;
}
.ftrH:before,
.ftrH:after {
    display: inline-flex;
    width: 4.6vh;
    height: 2vh;
    border-radius: 1vh;
    align-items: center;
    justify-content: center;
    background: #748794;
    color: #263744;
    margin: 0 0.2vh;
    font-size: 1vh;
}
.ftrH:before {
    content: "설비";
}
.ftrH:after {
    content: "AI";
}
.ftrH.f:before,
.ftrH.a:after {
    background: var(--yellow);
    color: #263744;
}
.selInputCon {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6vh;
}
.yearSelInput,
.monthSelInput {
    height: 2.6vh;
    min-width: 8vh;
    border: 0.1vh solid var(--line);
    border-radius: 0.4vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2vh;
    color: var(--muted);
}
#month_fault_root_con {
    display: grid;
    grid-template-columns: 7vh 1fr;
    align-items: center;
}
#month_fault_root_con > div {
    display: flex;
    flex-direction: column;
    gap: 1vh;
}
#month_fault_root_con p {
    margin: 0;
    height: 3vh;
    border-radius: 1.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2f414d;
    font-size: 1.15vh;
}
#monthFaultRootChart {
    width: 100%;
    height: 100%;
}

@media (max-aspect-ratio: 16/9) {
    .menu-link {
        min-width: 12vh;
    }
    #site_select label.site > div {
        min-width: 10vh;
    }
    .info_cell {
        font-size: 1.05vh;
    }
}

/* ------------------------------------------------------------------
   admin_twin2.ejs 기준 모니터링 화면
   - 기존 설비 제어 화면 구조가 아니라, 좌측 설비 목록 / 중앙 Unity / 우측 정보 패널 구조
   - 1920x1080 고정형 관제 대시보드 느낌을 유지하면서 색만 차분하게 정리
------------------------------------------------------------------ */
.monitoring-twin-page .twin2-layout {
    display: grid;
    grid-template-columns: 2fr 8fr 3fr;
    grid-template-rows: 12vh 1fr;
    gap: 1vh;
    padding: 1vh;
    min-height: 0;
}

.monitoring-twin-page .contentbox {
    background: var(--panel-bg);
    border: 0.1vh solid var(--line-soft);
    border-radius: 0.8vh;
    box-shadow: 0 0.6vh 1.6vh rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.monitoring-twin-page #siteCompSelector {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding: 1vh;
    overflow-y: auto;
}

.monitoring-twin-page #siteCompSelector::-webkit-scrollbar,
.monitoring-twin-page .mr::-webkit-scrollbar,
.monitoring-twin-page #localDataContainer::-webkit-scrollbar {
    width: 0.5vh;
}

.monitoring-twin-page #siteCompSelector::-webkit-scrollbar-thumb,
.monitoring-twin-page .mr::-webkit-scrollbar-thumb,
.monitoring-twin-page #localDataContainer::-webkit-scrollbar-thumb {
    background-color: #7d919e;
    border-radius: 0.4vh;
}

.monitoring-twin-page #siteCompSelector::-webkit-scrollbar-track,
.monitoring-twin-page .mr::-webkit-scrollbar-track,
.monitoring-twin-page #localDataContainer::-webkit-scrollbar-track {
    background-color: #2f414d;
}

.monitoring-twin-page ul,
.monitoring-twin-page li {
    list-style: none;
}

.monitoring-twin-page .isList {
    margin: 0;
    padding: 0;
    width: 100%;
}

.monitoring-twin-page #siteCompSelector li {
    display: flex;
    align-items: center;
    margin-bottom: 1vh;
}

.monitoring-twin-page #siteCompSelector input[type="radio"] {
    display: none;
}

.monitoring-twin-page #siteCompSelector input[type="radio"] + label {
    width: 100%;
    min-height: 4.8vh;
    display: flex;
    align-items: center;
    padding: 0 1.4vh;
    border: 0.1vh solid #667b88;
    border-radius: 0.6vh;
    color: var(--muted);
    background: #2f414d;
    font-size: 1.55vh;
    cursor: pointer;
}

.monitoring-twin-page #siteCompSelector input[type="radio"]:checked + label,
.monitoring-twin-page #siteCompSelector input[type="radio"] + label:hover {
    color: #263744;
    background: #e5eaee;
    border-color: #e5eaee;
    font-weight: 700;
}

.monitoring-twin-page #siteSelectContainer {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 1vh;
    padding: 1vh;
}

.monitoring-twin-page #siteSelectContainer > input[type="radio"] {
    display: none;
}

.monitoring-twin-page #siteSelectContainer > input[type="radio"] + label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 0.1vh solid #6f8492;
    border-radius: 0.6vh;
    color: var(--muted);
    background: #2f414d;
    font-size: 1.45vh;
    letter-spacing: 0.03em;
}

.monitoring-twin-page #siteSelectContainer > input[type="radio"]:checked + label {
    background: #e5eaee;
    color: #263744;
    border-color: #e5eaee;
    font-weight: 700;
}

.monitoring-twin-page #siteSubTypeSelectCon {
    grid-column: span 2;
    display: flex;
    gap: 1vh;
}

.monitoring-twin-page #siteSubTypeSelectCon button {
    flex: 1;
    border: 0.1vh solid #6f8492;
    border-radius: 0.6vh;
    background: #2f414d;
    color: var(--muted);
    cursor: pointer;
}

.monitoring-twin-page #siteSubTypeSelectCon button.active {
    background: #dfe7ec;
    color: #263744;
    border-color: #dfe7ec;
    font-weight: 700;
}

.monitoring-twin-page #siteGlobalStatus {
    grid-column: 3;
    grid-row: 1;
    padding: 1vh;
}

.monitoring-twin-page #localDataContainer {
    grid-column: 3;
    grid-row: 2;
    padding: 1vh;
    display: grid;
    grid-template-rows: 4.8vh 1fr;
    gap: 1vh;
    min-height: 0;
}

.monitoring-twin-page #mainUnityViewer {
    grid-column: 2;
    grid-row: 2;
    padding: 1vh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.monitoring-twin-page #mainUnityViewer iframe {
    width: 100%;
    height: 100%;
    border: 0.1vh solid #536977;
    border-radius: 0.5vh;
    background: #111827;
}

.monitoring-twin-page #dataCategorySelectCon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8vh;
}

.monitoring-twin-page #dataCategorySelectCon input[type="radio"] {
    display: none;
}

.monitoring-twin-page #dataCategorySelectCon input[type="radio"] + label {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.1vh solid #6f8492;
    border-radius: 0.6vh;
    color: var(--muted);
    background: #2f414d;
    cursor: pointer;
    font-size: 1.35vh;
}

.monitoring-twin-page #dataCategorySelectCon input[type="radio"]:checked + label {
    background: #e5eaee;
    color: #263744;
    border-color: #e5eaee;
    font-weight: 700;
}

.monitoring-twin-page .subInfo {
    min-height: 0;
    overflow-y: auto;
}

.monitoring-twin-page .siteStatusRow {
    width: 100%;
    min-height: 4.4vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8vh;
    margin-bottom: 0.8vh;
}

.monitoring-twin-page .siteStatusCell {
    border: 0.1vh solid #657987;
    border-radius: 0.7vh;
    background: #2f414d;
    overflow: hidden;
    display: grid;
    grid-template-rows: 1.7vh 1fr;
}

.monitoring-twin-page .siteStatusCell .title {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 1.05vh;
    background: var(--panel-head);
}

.monitoring-twin-page .siteStatusCell .content {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    font-family: Digital, Arial, "Malgun Gothic", sans-serif;
    font-size: 1.95vh;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.monitoring-twin-page .siteStatusCell .content.good {
    color: #4ade80;
}

.monitoring-twin-page #siteFaultInfo {
    padding-right: 0.4vh;
}

.monitoring-twin-page .siteFaultRow {
    margin-bottom: 1vh;
    border: 0.1vh solid #657987;
    border-radius: 0.7vh;
    background: #2f414d;
    overflow: hidden;
}

.monitoring-twin-page .siteFaultRowCheck {
    display: none;
}

.monitoring-twin-page .siteFaultRow label {
    display: block;
    padding: 1.1vh;
    color: #f8fafc;
    font-size: 1.22vh;
    line-height: 1.45;
    cursor: pointer;
    border-bottom: 0.1vh solid var(--line-soft);
}

.monitoring-twin-page .siteFaultRow p {
    margin: 0;
    padding: 1vh;
    color: var(--muted);
    font-size: 1.12vh;
    line-height: 1.45;
}

.monitoring-twin-page .siteFaultRow button {
    float: right;
    height: 2.4vh;
    padding: 0 1.2vh;
    border: 0;
    border-radius: 1.2vh;
    background: #dfe7ec;
    color: #263744;
    font-size: 1.05vh;
    cursor: pointer;
}

@media (max-width: 1400px) {
    .monitoring-twin-page .twin2-layout {
        grid-template-columns: 2.2fr 7.2fr 3.2fr;
    }
    .monitoring-twin-page .siteStatusCell .content {
        font-size: 1.65vh;
    }
}
#mainUnityViewer {
    position: relative;
    overflow: hidden;
}

#unity-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #111827;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #111827;
}

#unity-loading-bar {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 220px;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 10;
}

#unity-progress-bar-empty {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: #2f80ed;
}

#unity-footer,
#unity-warning,
#unity-logo,
#unity-webgl-logo {
    display: none;
}

.unity-fallback-message {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
    color: #334155;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.unity-fallback-message strong {
    font-size: 18px;
    color: #b91c1c;
}

.unity-fallback-message p {
    margin: 0;
    font-size: 13px;
}

/* siteSubTypeSelectCon now uses input + label, not button. */
.monitoring-twin-page #siteSubTypeSelectCon input[type="radio"] {
    display: none;
}

.monitoring-twin-page #siteSubTypeSelectCon label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.1vh solid #6f8492;
    border-radius: 0.6vh;
    background: #2f414d;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.3vh;
}

.monitoring-twin-page #siteSubTypeSelectCon input[type="radio"]:checked + label {
    background: #dfe7ec;
    color: #263744;
    border-color: #dfe7ec;
    font-weight: 700;
}

/* ------------------------------------------------------------------
   진단정보 페이지 챗봇 모달
   - 실제 AI 연동 없이 화면 내 더미 진단 데이터를 기반으로 응답하는 데모 UI
------------------------------------------------------------------ */
.chatbot-open-button {
    position: fixed;
    right: 2vh;
    bottom: 2vh;
    z-index: 60;
    height: 5.4vh;
    min-width: 15vh;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8vh;
    border: 0.1vh solid #8aa1af;
    border-radius: 3vh;
    background: #e5eaee;
    color: #263744;
    font-size: 1.45vh;
    font-weight: 700;
    box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.24);
    cursor: pointer;
}

.chatbot-open-button:hover {
    background: #f8fafc;
}

.chatbot-open-icon {
    width: 3.1vh;
    height: 3.1vh;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2f80ed;
    color: #fff;
    font-size: 1.1vh;
    letter-spacing: 0.03em;
}

.chatbot-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.chatbot-modal.is-open {
    display: block;
}

.chatbot-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 18, 26, 0.58);
}

.chatbot-window {
    position: absolute;
    right: 2vh;
    bottom: 8.6vh;
    width: 46vh;
    height: 68vh;
    display: grid;
    grid-template-rows: 7.2vh 7.8vh 1fr auto 5.8vh;
    overflow: hidden;
    border: 0.1vh solid #7b909d;
    border-radius: 1vh;
    background: #344956;
    color: var(--text);
    box-shadow: 0 2vh 4vh rgba(0, 0, 0, 0.34);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1vh 1.4vh;
    background: #253642;
    border-bottom: 0.1vh solid var(--line-soft);
}

.chatbot-kicker {
    margin: 0 0 0.2vh;
    color: var(--muted);
    font-size: 1.05vh;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chatbot-header h2 {
    margin: 0;
    font-size: 1.8vh;
    color: #f8fafc;
}

.chatbot-close-button {
    width: 3.4vh;
    height: 3.4vh;
    border: 0.1vh solid #708895;
    border-radius: 50%;
    background: #2f414d;
    color: #f8fafc;
    font-size: 2.2vh;
    line-height: 1;
    cursor: pointer;
}

.chatbot-status-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    gap: 0.8vh;
    padding: 1vh;
    background: #2f414d;
    border-bottom: 0.1vh solid var(--line-soft);
}

.chatbot-status-strip div {
    min-width: 0;
    display: grid;
    grid-template-rows: 1.6vh 1fr;
    align-items: center;
    border: 0.1vh solid #657987;
    border-radius: 0.6vh;
    padding: 0.55vh;
    background: #344956;
}

.chatbot-status-strip span {
    color: var(--muted);
    font-size: 0.95vh;
}

.chatbot-status-strip strong {
    overflow: hidden;
    color: #f8fafc;
    font-size: 1.18vh;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chatbot-messages {
    min-height: 0;
    overflow-y: auto;
    padding: 1.2vh;
    background: #304550;
}

.chatbot-message {
    display: flex;
    gap: 0.8vh;
    margin-bottom: 1.1vh;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-avatar {
    width: 3vh;
    height: 3vh;
    flex: 0 0 3vh;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2f80ed;
    color: #fff;
    font-size: 1vh;
    font-weight: 700;
}

.chatbot-message.user .chatbot-avatar {
    order: 2;
    background: #60727d;
}

.chatbot-bubble {
    max-width: 35vh;
    padding: 1vh 1.1vh;
    border: 0.1vh solid #627985;
    border-radius: 1vh;
    background: #253642;
    color: #e7edf1;
    font-size: 1.18vh;
    line-height: 1.55;
    white-space: pre-line;
}

.chatbot-message.user .chatbot-bubble {
    background: #e5eaee;
    color: #263744;
}

.chatbot-quick-questions {
    display: flex;
    gap: 0.6vh;
    padding: 0.9vh 1vh;
    overflow-x: auto;
    border-top: 0.1vh solid var(--line-soft);
    background: #2f414d;
}

.chatbot-quick-questions button {
    flex: 0 0 auto;
    height: 3vh;
    padding: 0 1vh;
    border: 0.1vh solid #708895;
    border-radius: 1.5vh;
    background: #344956;
    color: var(--text);
    font-size: 1.05vh;
    cursor: pointer;
}

.chatbot-quick-questions button:hover {
    background: #435b68;
}

.chatbot-input-row {
    display: grid;
    grid-template-columns: 1fr 7vh;
    gap: 0.8vh;
    padding: 1vh;
    background: #253642;
    border-top: 0.1vh solid var(--line-soft);
}

.chatbot-input-row input {
    min-width: 0;
    height: 3.6vh;
    border: 0.1vh solid #708895;
    border-radius: 0.6vh;
    background: #1f2e38;
    color: #f8fafc;
    padding: 0 1vh;
    font-size: 1.2vh;
}

.chatbot-input-row button {
    height: 3.6vh;
    border: 0;
    border-radius: 0.6vh;
    background: #2f80ed;
    color: #fff;
    font-size: 1.2vh;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .chatbot-window {
        width: 42vw;
        min-width: 380px;
    }
}

/* ------------------------------------------------------------------
   UI polish v2
   - 챗봇은 진단정보 화면 위에 뜨는 모달 느낌을 강화
   - 기존 대시보드 색감은 유지하되 선/여백/텍스트 대비만 정리
------------------------------------------------------------------ */
.diagnosis-page .diagnosis-layout article {
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 0.8vh 1.8vh rgba(0, 0, 0, 0.14);
}

.diagnosis-page .art_t {
    background: #263946;
    color: #f8fafc;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.diagnosis-page .site_select.wide {
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 0.8vh 1.8vh rgba(0, 0, 0, 0.14);
}

.chatbot-open-button {
    right: 2.2vh;
    bottom: 2.1vh;
    height: 5.2vh;
    min-width: 16.2vh;
    padding: 0 1.6vh;
    border: 0.1vh solid rgba(226, 232, 240, 0.86);
    border-radius: 999px;
    background: #f8fafc;
    color: #1f2e38;
    font-size: 1.35vh;
    letter-spacing: -0.01em;
    box-shadow: 0 1.1vh 2.4vh rgba(0, 0, 0, 0.28);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.chatbot-open-button:hover {
    background: #ffffff;
    transform: translateY(-0.2vh);
    box-shadow: 0 1.3vh 2.8vh rgba(0, 0, 0, 0.34);
}

.chatbot-open-icon {
    width: 3.2vh;
    height: 3.2vh;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: inset 0 -0.2vh 0.5vh rgba(0, 0, 0, 0.16);
}

.chatbot-modal-backdrop {
    background: rgba(8, 18, 28, 0.42);
    backdrop-filter: blur(0.35vh);
}

.chatbot-window {
    right: 50%;
    bottom: 50%;
    width: 58vh;
    height: 71vh;
    max-width: calc(100vw - 4vh);
    max-height: calc(100vh - 4vh);
    transform: translate(50%, 50%);
    grid-template-rows: 7.6vh 7.2vh minmax(0, 1fr) 5.4vh 6.2vh;
    border: 0.1vh solid rgba(185, 203, 216, 0.48);
    border-radius: 1.2vh;
    background: #314753;
    box-shadow: 0 2.4vh 6vh rgba(0, 0, 0, 0.45);
}

.chatbot-header {
    padding: 1.2vh 1.6vh;
    background: #223441;
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.chatbot-kicker {
    margin-bottom: 0.35vh;
    color: #93a8b6;
    font-size: 0.95vh;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.chatbot-header h2 {
    font-size: 1.95vh;
    letter-spacing: -0.02em;
}

.chatbot-close-button {
    width: 3.6vh;
    height: 3.6vh;
    border-color: rgba(203, 213, 225, 0.42);
    background: #314753;
    color: #f8fafc;
    transition:
        background 0.16s ease,
        border-color 0.16s ease;
}

.chatbot-close-button:hover {
    background: #405866;
    border-color: rgba(226, 232, 240, 0.72);
}

.chatbot-status-strip {
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 0.9vh;
    padding: 1vh 1.2vh;
    background: #314753;
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

.chatbot-status-strip div {
    border-color: rgba(148, 163, 184, 0.36);
    border-radius: 0.65vh;
    background: #385260;
    padding: 0.65vh 0.75vh;
}

.chatbot-status-strip span {
    color: #b4c3cc;
    font-size: 0.95vh;
}

.chatbot-status-strip strong {
    font-size: 1.22vh;
    color: #ffffff;
}

.chatbot-messages {
    padding: 1.4vh 1.6vh;
    background: #2b404c;
    scrollbar-width: thin;
    scrollbar-color: #78909c #243744;
}

.chatbot-messages::-webkit-scrollbar {
    width: 0.55vh;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #243744;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #78909c;
    border-radius: 999px;
}

.chatbot-message {
    gap: 0.9vh;
    margin-bottom: 1.2vh;
}

.chatbot-avatar {
    width: 3.2vh;
    height: 3.2vh;
    flex-basis: 3.2vh;
    background: #3b82f6;
    font-size: 0.95vh;
    box-shadow: 0 0.35vh 0.9vh rgba(0, 0, 0, 0.18);
}

.chatbot-message.user .chatbot-avatar {
    background: #64748b;
}

.chatbot-bubble {
    max-width: 42vh;
    padding: 1.1vh 1.25vh;
    border-color: rgba(148, 163, 184, 0.34);
    border-radius: 1.15vh;
    background: #223441;
    color: #f8fafc;
    font-size: 1.2vh;
    line-height: 1.62;
    box-shadow: 0 0.4vh 1vh rgba(0, 0, 0, 0.12);
}

.chatbot-message.user .chatbot-bubble {
    border-color: rgba(226, 232, 240, 0.8);
    background: #f8fafc;
    color: #21313c;
}

.chatbot-quick-questions {
    align-items: center;
    gap: 0.7vh;
    padding: 1vh 1.2vh;
    border-top-color: rgba(148, 163, 184, 0.18);
    background: #314753;
}

.chatbot-quick-questions button {
    height: 3.1vh;
    padding: 0 1.15vh;
    border-color: rgba(148, 163, 184, 0.5);
    border-radius: 999px;
    background: #385260;
    color: #e8eef2;
    font-size: 1.05vh;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease;
}

.chatbot-quick-questions button:hover {
    background: #e5eaee;
    border-color: #e5eaee;
    color: #263744;
}

.chatbot-input-row {
    grid-template-columns: 1fr 7.4vh;
    gap: 0.9vh;
    padding: 1.15vh 1.2vh;
    background: #223441;
    border-top-color: rgba(148, 163, 184, 0.22);
}

.chatbot-input-row input {
    height: 3.8vh;
    border-color: rgba(148, 163, 184, 0.48);
    border-radius: 0.75vh;
    background: #182934;
    color: #ffffff;
    padding: 0 1.15vh;
    font-size: 1.18vh;
    outline: none;
}

.chatbot-input-row input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.22vh rgba(96, 165, 250, 0.16);
}

.chatbot-input-row input::placeholder {
    color: #8095a3;
}

.chatbot-input-row button {
    height: 3.8vh;
    border-radius: 0.75vh;
    background: #3b82f6;
    color: #fff;
    font-size: 1.16vh;
    transition: background 0.16s ease;
}

.chatbot-input-row button:hover {
    background: #2563eb;
}

@media (max-width: 1200px) {
    .chatbot-window {
        width: min(58vh, calc(100vw - 3vh));
        min-width: 360px;
    }
}

/* ------------------------------------------------------------------
   UI theme polish v3
   - 레이아웃/기능은 그대로 두고 색상, 폰트, 모서리, hover/focus 표현만 정리
   - 폰트 교체: public/font/AppSans.woff2 파일을 넣고 아래 @font-face src만 바꾸면 전체 변경
------------------------------------------------------------------ */
:root {
    --page-bg: #14222d;
    --panel-bg: #223643;
    --panel-bg-2: #263d4c;
    --panel-head: #1a2a35;
    --line: #466070;
    --line-soft: rgba(185, 203, 216, 0.24);
    --text: #edf5f8;
    --muted: #a9bac5;
    --blue: #58a6ff;
    --green: #27d17f;
    --yellow: #f5bf3d;
    --red: #ff6b7a;
    --card-radius: 0.42vh;
    --radius-xs: 0.28vh;
    --radius-sm: 0.38vh;
    --radius-md: 0.52vh;
    --radius-lg: 0.72vh;
    --font-sans: "AppSans", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Arial, sans-serif;
    --font-number: Digital, "AppSans", "Segoe UI", monospace;
    --shadow-panel: 0 0.55vh 1.45vh rgba(0, 0, 0, 0.2);
    --shadow-floating: 0 1.6vh 4vh rgba(0, 0, 0, 0.38);
    --focus-ring: 0 0 0 0.22vh rgba(88, 166, 255, 0.22);
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--font-sans);
    letter-spacing: -0.015em;
}

body {
    background: var(--page-bg);
    color: var(--text);
    font-weight: 500;
}

.integration-header {
    background: #111d27;
    border-bottom-color: rgba(185, 203, 216, 0.18);
    box-shadow: 0 0.45vh 1.2vh rgba(0, 0, 0, 0.16);
}

.logo img {
    filter: drop-shadow(0 0.2vh 0.45vh rgba(0, 0, 0, 0.25));
}

.menu-link {
    border-radius: var(--radius-md);
    color: #b7c7d1;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.menu-link:hover {
    color: #ffffff;
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.28);
}

.menu-link.active {
    color: #f8fbfc;
    background: #263d4c;
    border-color: #587082;
    box-shadow: inset 0 0 0 0.1vh rgba(255, 255, 255, 0.03);
}

.menu-link img {
    opacity: 0.82;
}

.header-status {
    color: #b8c7d0;
}

.state-dot {
    box-shadow: 0 0 0 0.25vh rgba(39, 209, 127, 0.14);
}

.admin-selector {
    background: #1a2a35;
    color: #eef6f9;
    border-color: #496678;
    border-radius: var(--radius-sm);
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.admin-selector:hover,
.admin-selector:focus {
    border-color: var(--blue);
    box-shadow: var(--focus-ring);
}

.clock,
.monitoring-twin-page .siteStatusCell .content {
    font-family: var(--font-number);
    letter-spacing: 0.02em;
}

.content_body {
    background: var(--page-bg);
}

.ctrl_box,
.info,
.air_info,
.rack_info_container,
.unity-panel,
.operation-panel,
.diagnosis-layout article,
.monitoring-twin-page .contentbox,
.diagnosis-page .site_select.wide {
    background: var(--panel-bg);
    border-color: var(--line-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-panel);
}

.art_t,
.diagnosis-page .art_t,
.ctrl_row.data_h > div,
.air_info_row:first-child .air_info_cell,
.f-head,
.ftHead,
.monitoring-twin-page .siteStatusCell .title {
    background: var(--panel-head);
    color: #c2d1da;
    font-weight: 700;
}

.art_t:before {
    opacity: 0.72;
}

input[type="button"],
.set_btn,
.selInputCon button,
.monitoring-twin-page #siteCompSelector input[type="radio"] + label,
.monitoring-twin-page #siteSelectContainer > input[type="radio"] + label,
.monitoring-twin-page #siteSubTypeSelectCon label,
.monitoring-twin-page #dataCategorySelectCon input[type="radio"] + label,
#site_select label.site > div,
.yearSelInput,
.monthSelInput {
    border-radius: var(--radius-sm);
    border-color: #4a6576;
    background: #243947;
    color: #b8c7d0;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

input[type="button"]:hover,
.set_btn:hover,
.selInputCon button:hover,
.monitoring-twin-page #siteCompSelector input[type="radio"] + label:hover,
.monitoring-twin-page #siteSelectContainer > input[type="radio"] + label:hover,
.monitoring-twin-page #siteSubTypeSelectCon label:hover,
.monitoring-twin-page #dataCategorySelectCon input[type="radio"] + label:hover,
#site_select label.site > div:hover {
    background: #2d4656;
    border-color: #6d8798;
    color: #f8fbfc;
}

.monitoring-twin-page #siteCompSelector input[type="radio"]:checked + label,
.monitoring-twin-page #siteSelectContainer > input[type="radio"]:checked + label,
.monitoring-twin-page #siteSubTypeSelectCon input[type="radio"]:checked + label,
.monitoring-twin-page #dataCategorySelectCon input[type="radio"]:checked + label,
#site_select input[type="radio"]:checked + label.site > div {
    background: #edf5f8;
    color: #162631;
    border-color: #edf5f8;
    font-weight: 800;
    box-shadow: 0 0.35vh 0.9vh rgba(0, 0, 0, 0.14);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.monitoring-twin-page label:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

input[type="button"].drive,
.label_class_con:before,
.status-summary b,
.good-text {
    color: #60f0a2;
}

input[type="button"].drive {
    background: #168b66;
}

input[type="button"].stop {
    background: #c99823;
    color: #162631;
}

input[type="button"].e-stop {
    background: #c94e5d;
}

input[type="button"].a-drive,
.chatbot-input-row button,
.chatbot-avatar,
.chatbot-open-icon {
    background: #3178d8;
}

.warn-text {
    color: var(--yellow);
}

.air_info_cell,
.ctrl_box .ctrl_row > div:not(.b),
.status-summary div,
.info_cell,
.f-head,
.f-row,
.rack_info,
.nfhRows p,
#newest_fault_feedback section div,
.nff_context,
.nff_feedback,
.siteStatusCell,
.monitoring-twin-page .siteStatusCell,
.monitoring-twin-page .siteFaultRow,
.ftRow,
.ftHead {
    border-color: rgba(185, 203, 216, 0.26);
}

.flow-node,
.rack_info,
.nfhRows p,
#newest_fault_feedback section div,
.nff_context,
.nff_feedback,
.monitoring-twin-page .siteStatusCell,
.monitoring-twin-page .siteFaultRow,
.ftrH:before,
.ftrH:after {
    border-radius: var(--radius-sm);
    background: #1d303c;
}

.rack_head,
.f-head,
.ftHead,
.info_row:last-child .info_cell,
.f-row,
.ftRow {
    border-color: rgba(185, 203, 216, 0.22);
}

#unity-container,
#unity-canvas,
.monitoring-twin-page #mainUnityViewer,
.unity-panel iframe {
    border-radius: var(--radius-sm);
    background: #0f1922;
}

.monitoring-twin-page #siteCompSelector::-webkit-scrollbar-thumb,
.monitoring-twin-page .mr::-webkit-scrollbar-thumb,
.monitoring-twin-page #localDataContainer::-webkit-scrollbar-thumb,
.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: #6d8494;
    border-radius: 999px;
}

.monitoring-twin-page #siteCompSelector::-webkit-scrollbar-track,
.monitoring-twin-page .mr::-webkit-scrollbar-track,
.monitoring-twin-page #localDataContainer::-webkit-scrollbar-track,
.chatbot-messages::-webkit-scrollbar-track {
    background-color: #172631;
}

.chatbot-open-button {
    border-radius: var(--radius-md);
    background: #edf5f8;
    color: #162631;
    border-color: rgba(237, 245, 248, 0.9);
    box-shadow: var(--shadow-floating);
}

.chatbot-open-button:hover {
    background: #ffffff;
    transform: translateY(-0.18vh);
}

.chatbot-modal-backdrop {
    background: rgba(8, 16, 24, 0.54);
    backdrop-filter: blur(0.45vh);
}

.chatbot-window {
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
    border-color: rgba(185, 203, 216, 0.42);
    box-shadow: var(--shadow-floating);
}

.chatbot-header,
.chatbot-input-row {
    background: #172631;
}

.chatbot-status-strip,
.chatbot-quick-questions {
    background: #1e323f;
}

.chatbot-status-strip div,
.chatbot-bubble,
.chatbot-input-row input,
.chatbot-quick-questions button,
.chatbot-close-button {
    border-radius: var(--radius-sm);
    border-color: rgba(185, 203, 216, 0.32);
}

.chatbot-status-strip div,
.chatbot-quick-questions button {
    background: #263d4c;
}

.chatbot-bubble {
    background: #172631;
    color: #eef6f9;
}

.chatbot-message.user .chatbot-bubble {
    background: #edf5f8;
    color: #162631;
}

.chatbot-input-row input {
    background: #101d27;
    color: #ffffff;
    outline: none;
}

.chatbot-input-row input:focus {
    border-color: var(--blue);
    box-shadow: var(--focus-ring);
}

.chatbot-quick-questions button:hover {
    background: #edf5f8;
    border-color: #edf5f8;
    color: #162631;
}

.chatbot-close-button:hover {
    background: #2f4a5b;
    border-color: rgba(237, 245, 248, 0.7);
}

#ultra_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: #fff; */
    pointer-events: none;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#ultra_popup::before {
    content: "DEMO PAGE";
    font-size: 200px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 5px;
}
/* =========================================================
   Mobile Responsive Patch
   - 기존 PC 관제형 레이아웃은 유지
   - 768px 이하에서 세로 스크롤 + 카드형 스택 구조로 전환
   - 이 코드는 반드시 기존 CSS 맨 아래에 추가
========================================================= */

@media screen and (max-width: 768px) {
    html,
    body {
        width: 100%;
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body {
        font-size: 14px;
    }

    .integration-content {
        min-height: 100vh;
        height: auto;
        overflow: visible;
    }

    .content_body {
        height: auto;
        min-height: auto;
        padding: 10px;
        overflow: visible;
    }

    /* =====================================================
       Header
    ===================================================== */
    .integration-header {
        height: auto;
        min-height: auto;
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-content {
        width: 100% !important;
        height: auto;
        min-height: auto;
    }

    .header-content.left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-content.right {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo {
        margin-right: 0;
    }

    .logo img {
        height: 34px;
    }

    .integration-menu {
        width: 100%;
        height: auto;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .menu-link {
        flex: 0 0 auto;
        min-width: auto;
        height: 34px;
        padding: 0 12px;
        gap: 6px;
        font-size: 13px;
        border-radius: 8px;
        white-space: nowrap;
    }

    .menu-link img {
        width: 18px;
        height: 18px;
    }

    .header-status {
        font-size: 12px;
    }

    .state-dot {
        width: 8px;
        height: 8px;
    }

    .admin-selector {
        height: 32px;
        font-size: 12px;
    }

    .clock {
        min-width: auto;
        font-size: 24px;
    }

    /* =====================================================
       Common Panel
    ===================================================== */
    .ctrl_box,
    .info,
    .air_info,
    .rack_info_container,
    .unity-panel,
    .operation-panel,
    .diagnosis-layout article,
    .monitoring-twin-page .contentbox,
    .diagnosis-page .site_select.wide {
        border-radius: 8px;
    }

    .art_t {
        height: 40px;
        padding: 0 12px;
        font-size: 15px;
    }

    .art_t::before {
        width: 14px;
        height: 14px;
        margin-right: 8px;
    }

    .art_c {
        padding: 10px;
    }

    /* =====================================================
       Main Monitoring Layout
       - 좌측 제어 / 우측 정보 영역을 세로 배치
    ===================================================== */
    .monitoring-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
        height: auto;
        min-height: auto;
    }

    .side_control,
    .body_info {
        width: 100%;
        height: auto;
        min-height: auto;
        gap: 10px;
    }

    .ctrl_box {
        height: auto;
        min-height: 180px;
        padding: 14px;
        justify-content: flex-start;
        gap: 12px;
    }

    .init {
        width: 100%;
        min-height: 32px;
        font-size: 15px;
    }

    .init img {
        width: 16px;
        height: 16px;
    }

    .init_btn {
        top: 10px;
        right: 10px;
        width: auto;
        min-width: 58px;
        height: 28px;
        padding: 0 10px;
        font-size: 12px;
        border-radius: 14px;
    }

    input[type="button"],
    .set_btn,
    .selInputCon button {
        min-width: 60px;
        height: 30px;
        margin: 3px;
        font-size: 12px;
        border-radius: 15px;
    }

    .ctrl_row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .ctrl_box .ctrl_row > div:not(.b) {
        width: 72px;
        height: 34px;
        font-size: 12px;
    }

    .bms_con {
        flex-direction: column;
        gap: 10px;
    }

    .bms {
        width: 100%;
        height: auto;
        min-height: 120px;
    }

    .bms_conn_state {
        font-size: 13px;
    }

    .bms-img {
        width: 42px;
    }

    .ver_line {
        display: none;
    }

    .limit-row {
        font-size: 13px;
        flex-wrap: wrap;
    }

    .limit-row input {
        width: 52px;
        height: 28px;
    }

    .schedule {
        display: block;
        width: 100%;
    }

    .schedule_row {
        display: grid;
        grid-template-columns: 70px 1fr 1fr 70px;
        gap: 6px;
        align-items: center;
        margin-bottom: 6px;
    }

    .schedule_cell {
        display: flex;
        height: auto;
        min-height: 34px;
        align-items: center;
        justify-content: center;
        font-size: 13px;
    }

    .schedule_cell input {
        width: 100%;
        height: 30px;
        font-size: 13px;
    }

    /* =====================================================
       Site / Air / Main Dashboard
    ===================================================== */
    .site-n-air {
        height: auto;
        flex-direction: column;
        gap: 10px;
    }

    .site_select {
        min-height: 92px;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    #select_site_name {
        width: 100%;
        height: 38px;
        margin: 0 0 8px;
        font-size: 15px;
    }

    .site_container {
        width: 100%;
        height: auto;
        overflow-x: auto;
    }

    .slide-left,
    .slide-right {
        display: none;
    }

    #site_select {
        gap: 8px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
        width: 100%;
        height: 100%;
    }

    #site_select label.site {
        height: 100%;
    }

    #site_select label.site > div {
        min-width: 92px;
        height: 100%;
        padding: 0 12px;
        font-size: 13px;
        border-radius: 18px;
    }

    .btn-img {
        width: 34px;
    }

    .air_info {
        width: 100%;
        min-height: 120px;
        padding: 10px;
    }

    .air_info_con {
        width: 100%;
        height: auto;
        flex-direction: column;
    }

    .air_info_item {
        width: 100%;
    }

    .air_info_cell {
        min-height: 32px;
        font-size: 12px;
    }

    .main-dashboard-row {
        height: auto;
        flex-direction: column;
        gap: 10px;
    }

    .unity-panel {
        width: 100%;
        min-height: 360px;
        padding: 10px;
        grid-template-rows: 38px 1fr;
    }

    .unity-panel iframe {
        min-height: 300px;
    }

    .operation-panel {
        min-height: 360px;
        padding: 10px;
        grid-template-rows: 38px auto 1fr auto;
        gap: 10px;
    }

    .power-flow {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .flow-node {
        height: 54px;
    }

    .flow-node b {
        font-size: 12px;
    }

    .flow-node span {
        font-size: 18px;
    }

    .flow-arrow {
        transform: rotate(90deg);
        font-size: 20px;
    }

    .status-summary {
        grid-template-columns: 1fr;
    }

    .status-summary div {
        min-height: 34px;
        font-size: 12px;
    }

    /* =====================================================
       Info / Rack
    ===================================================== */
    .info_collection {
        height: auto;
        flex-direction: column;
        gap: 10px;
    }

    .info {
        width: 100%;
        min-height: 240px;
        padding: 10px;
    }

    .info_table {
        width: 100%;
        margin-top: 10px;
    }

    .info_cell {
        height: 30px;
        font-size: 12px;
    }

    .f-list {
        width: 100%;
        font-size: 11px;
    }

    .f-head,
    .f-row {
        grid-template-columns: 1.2fr 1fr 1fr 1.6fr;
        min-height: 34px;
    }

    #f-body {
        height: auto;
        max-height: 180px;
        overflow-y: auto;
    }

    .rack_info_container {
        height: auto;
        min-height: 180px;
        padding: 10px;
        overflow-x: auto;
    }

    .rack_info_container .conconcon {
        height: auto;
        min-height: 150px;
        align-items: stretch;
        overflow-x: auto;
    }

    .rack_info {
        min-width: 240px;
        height: auto;
        min-height: 150px;
    }

    .rack_head {
        height: 30px;
        font-size: 13px;
    }

    .rack_body {
        height: auto;
        min-height: 110px;
    }

    .rack_row {
        font-size: 12px;
    }

    /* =====================================================
       Diagnosis Page
       - 3열 진단정보 화면을 1열로 전환
    ===================================================== */
    .diagnosis-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        height: auto;
        min-height: auto;
    }

    .diagnosis-layout > section,
    .diagnosis-layout > section:nth-of-type(1),
    .diagnosis-layout > section:nth-of-type(2),
    .diagnosis-layout > section:nth-of-type(3) {
        display: grid;
        grid-template-rows: none;
        grid-auto-rows: minmax(220px, auto);
        gap: 10px;
        min-height: auto;
    }

    .diagnosis-layout article {
        min-height: 220px;
        grid-template-rows: 40px minmax(0, 1fr);
        overflow: visible;
    }

    #server_resource_con {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        gap: 10px;
    }

    #server_resource_con > div {
        grid-template-rows: 24px 1fr;
    }

    #server_resource_con > div > p {
        font-size: 12px;
    }

    #server_resource_con canvas {
        width: 86px;
        height: 86px;
    }

    #server_resource_con > div > div > p {
        font-size: 12px;
    }

    .label_class_con::before {
        height: 30px;
        padding: 0 18px;
        font-size: 13px;
        border-radius: 15px;
    }

    .svgCon img {
        width: 52px;
        height: 52px;
    }

    .nfhRows {
        height: auto;
        min-height: 46px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .nfhRows p {
        min-height: 36px;
        font-size: 12px;
    }

    .nfhRows p::after {
        font-size: 10px;
    }

    #newest_fault_feedback {
        grid-template-rows: auto auto auto;
    }

    #newest_fault_feedback section {
        grid-template-columns: 1fr;
    }

    #newest_fault_feedback section div,
    .nff_context,
    .nff_feedback {
        min-height: 54px;
        font-size: 12px;
        overflow: visible;
    }

    .ftHead,
    .ftRow {
        grid-template-rows: repeat(2, 1fr);
        grid-template-columns: repeat(3, 1fr);
        /* min-width: 620px; */
    }

    #fault_table_con {
        overflow-x: auto;
        grid-template-rows: 7vh 1fr;
    }

    .ftHead {
        height: calc(36px + 36px);
        font-size: 12px;
    }

    .ftRow {
        height: calc(38px + 38px);
        font-size: 12px;
    }

    .selInputCon {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .yearSelInput,
    .monthSelInput {
        height: 28px;
        min-width: 72px;
        font-size: 12px;
    }

    #month_fault_root_con {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #month_fault_root_con > div {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #month_fault_root_con p {
        height: 30px;
        min-width: 72px;
        font-size: 12px;
    }

    /* =====================================================
       Twin Monitoring Page
       - 좌측/중앙/우측 고정 그리드를 모바일 1열로 전환
    ===================================================== */
    .monitoring-twin-page .twin2-layout {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-rows: auto;
        gap: 10px;
        padding: 10px;
        min-height: auto;
    }

    .monitoring-twin-page #siteCompSelector,
    .monitoring-twin-page #siteSelectContainer,
    .monitoring-twin-page #siteGlobalStatus,
    .monitoring-twin-page #localDataContainer,
    .monitoring-twin-page #mainUnityViewer {
        grid-column: auto;
        grid-row: auto;
    }

    .monitoring-twin-page #siteCompSelector {
        max-height: 220px;
        padding: 10px;
    }

    .monitoring-twin-page #siteCompSelector input[type="radio"] + label {
        min-height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }

    .monitoring-twin-page #siteSelectContainer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        padding: 10px;
    }

    .monitoring-twin-page #siteSelectContainer > input[type="radio"] + label {
        min-height: 38px;
        font-size: 13px;
    }

    .monitoring-twin-page #siteSubTypeSelectCon {
        grid-column: 1 / -1;
        min-height: 38px;
    }

    .monitoring-twin-page #siteSubTypeSelectCon label,
    .monitoring-twin-page #siteSubTypeSelectCon button {
        min-height: 34px;
        font-size: 12px;
    }

    .monitoring-twin-page #mainUnityViewer {
        min-height: 380px;
        padding: 10px;
    }

    #unity-container,
    #unity-canvas {
        min-height: 340px;
    }

    .monitoring-twin-page #siteGlobalStatus {
        padding: 10px;
    }

    .monitoring-twin-page #localDataContainer {
        min-height: 420px;
        padding: 10px;
        grid-template-rows: auto 1fr;
    }

    .monitoring-twin-page #dataCategorySelectCon {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .monitoring-twin-page #dataCategorySelectCon input[type="radio"] + label {
        min-height: 34px;
        font-size: 12px;
    }

    .monitoring-twin-page .siteStatusRow {
        grid-template-columns: 1fr;
    }

    .monitoring-twin-page .siteStatusCell {
        min-height: 50px;
    }

    .monitoring-twin-page .siteStatusCell .title {
        font-size: 11px;
    }

    .monitoring-twin-page .siteStatusCell .content {
        font-size: 20px;
    }

    .monitoring-twin-page .siteFaultRow label {
        padding: 10px;
        font-size: 13px;
    }

    .monitoring-twin-page .siteFaultRow p {
        padding: 10px;
        font-size: 12px;
    }

    .monitoring-twin-page .siteFaultRow button {
        height: 28px;
        padding: 0 12px;
        font-size: 11px;
        border-radius: 14px;
    }

    /* =====================================================
       Chatbot
    ===================================================== */
    .chatbot-open-button {
        right: 14px;
        bottom: 14px;
        height: 44px;
        min-width: 132px;
        padding: 0 14px;
        gap: 8px;
        font-size: 13px;
        border-radius: 10px;
    }

    .chatbot-open-icon {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }

    .chatbot-window {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        max-width: none;
        max-height: none;
        min-width: 0;
        transform: none;
        grid-template-rows: 64px 72px minmax(0, 1fr) auto 58px;
        border-radius: 12px;
    }

    .chatbot-header {
        padding: 10px 12px;
    }

    .chatbot-kicker {
        font-size: 10px;
    }

    .chatbot-header h2 {
        font-size: 17px;
    }

    .chatbot-close-button {
        width: 34px;
        height: 34px;
        font-size: 22px;
    }

    .chatbot-status-strip {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px;
        overflow-y: auto;
    }

    .chatbot-status-strip div {
        grid-template-rows: auto auto;
        padding: 6px 8px;
    }

    .chatbot-status-strip span {
        font-size: 10px;
    }

    .chatbot-status-strip strong {
        font-size: 12px;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .chatbot-avatar {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 10px;
    }

    .chatbot-bubble {
        max-width: calc(100vw - 96px);
        padding: 10px 12px;
        font-size: 13px;
        line-height: 1.55;
    }

    .chatbot-quick-questions {
        padding: 8px;
        gap: 6px;
    }

    .chatbot-quick-questions button {
        height: 30px;
        padding: 0 10px;
        font-size: 11px;
    }

    .chatbot-input-row {
        grid-template-columns: 1fr 64px;
        gap: 8px;
        padding: 10px;
    }

    .chatbot-input-row input,
    .chatbot-input-row button {
        height: 38px;
        font-size: 13px;
    }

    /* =====================================================
       Demo Watermark
    ===================================================== */

    #ultra_popup {
        position: fixed;
    }

    #ultra_popup::before {
        font-size: clamp(44px, 15vw, 120px);
        text-align: center;
        letter-spacing: 2px;
    }
}
