:root{color-scheme:light;--ink:#18334a;--blue:#245cbd;--muted:#536d80;--line:#cad9e4;--base:#f0f5f8;--good:#136951;--warn:#835108;--bad:#a12942}*{box-sizing:border-box}body{margin:0;background:var(--base);color:var(--ink);font:17px/1.65 Geist,"Apple SD Gothic Neo","Malgun Gothic",sans-serif}header{display:flex;justify-content:space-between;align-items:center;gap:20px;background:white;border-bottom:1px solid var(--line);padding:22px max(24px,calc((100vw - 1120px)/2))}header h1{font-size:25px;margin:0;white-space:nowrap}header>div{display:flex;gap:18px;align-items:center;font-size:15px}main,footer{max-width:1120px;margin:auto;padding:32px 24px}h2{font-size:28px;line-height:1.4;margin:0 0 12px}h3{font-size:21px;margin:0 0 10px}.muted{color:var(--muted)}label{display:block;font-weight:650;margin:20px 0}input,select{display:block;width:100%;margin-top:7px;padding:12px;font:inherit;color:var(--ink);border:1px solid #8ca2b4;border-radius:6px;background:white}button{font:inherit;font-weight:650;padding:11px 20px;border:1px solid var(--blue);border-radius:6px;background:var(--blue);color:white;cursor:pointer}button.secondary{background:white;color:var(--blue)}button:disabled{background:#d0dbe5;border-color:#d0dbe5;color:#4d6578;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #ba690d;outline-offset:3px}.signin{max-width:560px;margin:32px auto;background:white;border:1px solid var(--line);border-radius:12px;padding:32px}form>button{width:100%;margin-top:10px}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}nav{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:30px}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:15px}dt{color:var(--muted)}dd{margin:0;overflow-wrap:anywhere}.route{padding:12px 15px;background:#e8f0fa;border-radius:5px;margin:16px 0}.good{color:var(--good);font-weight:650}.bad{color:var(--bad);font-weight:650}.pending{color:var(--warn);font-weight:650}.request-entry{display:flex;align-items:flex-end;gap:14px}.request-entry label{flex:1;margin:8px 0}.request-entry button{width:auto;margin:8px 0}#pairing-detail{background:white;padding:25px;border:1px solid var(--line);border-radius:10px;margin-top:24px}#pairing-facts{display:grid;grid-template-columns:140px 1fr;gap:10px}#pairing-facts dd{font-family:inherit;font-size:16px}.check{display:flex;align-items:flex-start;gap:10px;font-weight:500}.check input{width:20px;height:20px;flex:none;margin:5px 0 0}#message{min-height:32px;color:var(--bad);font-weight:600;white-space:pre-wrap}#totp-qr{display:block;margin:20px auto}#setup-key{overflow-wrap:anywhere;user-select:all}footer{font-size:14px;color:var(--muted)}[hidden]{display:none!important}@media(max-width:680px){header{align-items:flex-start;flex-direction:column;padding:18px 20px;gap:10px}main{padding:22px 16px}.signin{padding:24px 20px;margin-top:10px}.section-heading{align-items:flex-start;flex-direction:column;gap:0}.connection dl,#pairing-facts{grid-template-columns:1fr;gap:2px}.connection dd,#pairing-facts dd{margin-bottom:10px}.request-entry{align-items:stretch;flex-direction:column;gap:5px}nav{gap:8px}nav button{padding:10px 14px;font-size:16px}h2{font-size:25px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* 기본 목록은 접고 상세에서만 근거를 노출한다. native summary의 키보드 동작을 유지한다. */
.connection{background:white;border:1px solid var(--line);border-radius:8px;margin:12px 0;overflow:hidden}
.connection>summary{display:grid;grid-template-columns:minmax(245px,1fr) auto 20px;align-items:center;gap:18px;padding:18px 20px;cursor:pointer;list-style:none}
.connection>summary::-webkit-details-marker{display:none}
.connection>summary::after{content:"⌄";font-size:24px;color:var(--muted);justify-self:end}
.connection[open]>summary::after{content:"⌃"}
.connection>summary:hover{background:#f7faff}
.connection-identity{display:flex;gap:14px;align-items:center;min-width:0}
.workload-icon{display:grid;place-items:center;flex:0 0 40px;height:40px;font-size:28px;color:var(--blue);background:#edf3fc;border-radius:6px}
.connection-title{display:block;font-size:19px;line-height:1.45;margin:0;overflow-wrap:anywhere}
.connection-caption{display:block;margin:4px 0 0;font-size:14px;color:var(--muted)}
.connection-statuses{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;max-width:520px}
.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:15px;line-height:1.5;padding:4px 8px;background:#f1f5f8;border-radius:4px;white-space:nowrap}
.status-badge.good{background:#eaf5ef}.status-badge.pending{background:#fff4dd}
.connection-content{border-top:1px solid var(--line);padding:20px 24px 24px}
.connection-diagnostics{padding:14px 18px;background:#f2f6fb;border-left:3px solid #8ca8cc}
.connection-diagnostics h4{font-size:16px;margin:0 0 6px}
.connection-diagnostics ul{padding-left:18px;margin:0;font-size:15px}
.connection-diagnostics li+li{margin-top:6px}
.connection .route{font-size:15px;overflow-wrap:anywhere;background:#f1f5f9}
.connection-facts{display:grid;grid-template-columns:170px 1fr;gap:8px 18px;margin:20px 0 0;font-size:16px}
@media(max-width:1000px){.connection>summary{grid-template-columns:1fr 20px;gap:12px}.connection>summary::after{grid-column:2;grid-row:1}.connection-statuses{grid-column:1/-1;justify-content:flex-start;max-width:none}}
@media(max-width:680px){.connection>summary{padding:16px}.connection-content{padding:16px}.connection-facts{grid-template-columns:1fr;gap:2px}.connection-facts dd{margin-bottom:10px}.connection-title{display:block;font-size:18px}.status-badge{font-size:14px}.workload-icon{flex-basis:36px;height:36px}}

.observation-delayed .status-badge.good{color:var(--muted);background:#f1f5f8}

.refresh-hint{display:block;text-align:right;font-size:14px}@media(max-width:680px){.refresh-hint{text-align:left}}

/* 경로 블록만 둥글게 구분한다. 팝업은 줄 폭 안에 두어 좁은 화면에서도 정보가 잘리지 않게 한다. */
.route-components{list-style:none;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:18px;margin:2px 0 24px;padding:0}
.route-component{position:relative;min-width:0;text-align:center;color:#526575}
.route-component:not(:last-child)::after{content:'→';position:absolute;top:13px;right:-17px;color:#8193a2}
.route-component-button{font:inherit;font-weight:600;font-size:16px;width:100%;min-height:52px;padding:10px 8px;color:inherit;background:#f2f5f8;border:1px solid #c5d2dc;border-radius:14px;line-height:1.3;overflow-wrap:anywhere}
.route-component.good .route-component-button{background:#edf7f0;border-color:#5e9d79;color:#246142}
.route-component.pending .route-component-button{background:#fff6df;border-color:#c8a55b;color:#795700}
.route-component.error .route-component-button{background:#fff0ee;border-color:#b9675c;color:#96392d}
.route-component-status{display:block;font-size:12px;line-height:1.4;margin-top:6px}
.route-component-popup{position:absolute;z-index:4;top:calc(100% + 6px);left:0;width:280px;max-width:calc(100vw - 84px);text-align:left;background:white;border:1px solid #a9bece;border-radius:10px;box-shadow:0 8px 24px #18334a20;padding:14px;color:var(--ink)}
.route-component:nth-child(n+4) .route-component-popup{left:auto;right:0}
.route-component-popup dl{display:block;margin:0;font-size:14px;line-height:1.5}
.route-component-popup dt{color:var(--muted);font-size:12px;margin-top:8px}
.route-component-popup dt:first-child{margin-top:0}
.route-component-popup dd{margin:2px 0 0;overflow-wrap:anywhere}
@media(max-width:900px){.route-components{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:20px}.route-component:nth-child(3)::after{display:none}.route-component:nth-child(3n) .route-component-popup{left:auto;right:0}.route-component:nth-child(3n+1) .route-component-popup{left:0;right:auto}}
@media(max-width:440px){.route-components{grid-template-columns:repeat(2,minmax(0,1fr))}.route-component:nth-child(3)::after{display:block}.route-component:nth-child(even)::after{display:none}.route-component:nth-child(odd) .route-component-popup{left:0;right:auto}.route-component:nth-child(even) .route-component-popup{left:auto;right:0}}
.observation-delayed .route-component.good .route-component-button{color:var(--muted);background:#f2f5f8;border-color:#c5d2dc}

.route-component-popup::before{content:"";position:absolute;top:-8px;left:0;right:0;height:8px}

/* 범례는 보조 정보로 작게 두고 포인터가 설명으로 이동하는 동안에도 읽을 수 있게 한다. */
.status-legend{position:relative}.legend-toggle{padding:7px 10px;font-size:14px;white-space:nowrap;border-color:var(--line)!important;color:var(--muted)!important}.legend-dots{color:var(--good);letter-spacing:1px;margin-right:5px}.legend-popup{position:absolute;right:0;top:calc(100% + 8px);z-index:10;width:340px;max-width:calc(100vw - 40px);background:white;border:1px solid var(--line);border-radius:8px;padding:18px;box-shadow:0 8px 24px #18334a20;font-size:14px;line-height:1.5}.legend-popup::before{content:"";position:absolute;top:-10px;left:0;right:0;height:10px}.legend-popup dl{margin:12px 0 0}.legend-popup dt{margin-top:12px;font-weight:650}.legend-popup dd{margin:4px 0}.status-badge.bad{background:#fff0ee}
/* 포트 번호를 첫 열에 고정된 시각 축으로 두고 넓은 표의 스크롤은 페이지 안으로 제한한다. */
.port-search{max-width:440px;font-size:15px;margin:22px 0 14px}.port-summary{font-size:15px;color:var(--muted);margin:14px 0}.port-group{margin:24px 0 32px}.port-group h3{font-size:20px;margin:0;overflow-wrap:anywhere}.port-range{font-size:15px;color:var(--muted);margin:6px 0 12px}.port-table-scroll{overflow-x:auto;background:white;border:1px solid var(--line);border-radius:8px}.port-table{border-collapse:collapse;width:100%;min-width:1060px;font-size:15px;line-height:1.5;text-align:left}.port-table caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.port-table th{padding:13px 12px;background:#e9f0f7;color:var(--muted);font-size:14px;white-space:nowrap;border-bottom:1px solid var(--line)}.port-table td{padding:16px 12px;vertical-align:top;border-bottom:1px solid var(--line);overflow-wrap:anywhere;min-width:140px;max-width:235px}.port-table tbody tr:last-child td{border-bottom:0}.port-table td:first-child{min-width:135px}.port-table tbody tr:hover{background:#f8fbfd}.port-number{font-size:23px;line-height:1.3;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}.port-meta{color:var(--muted);font-size:13px;margin-top:6px}.port-destination+.port-destination{margin-top:6px}.port-table .status-badge{font-size:13px;white-space:normal}
@media(max-width:680px){header>div{flex-wrap:wrap;gap:12px;width:100%}.status-legend{margin-left:auto;order:3}.legend-popup{right:0}.port-search{max-width:none}.port-group h3{font-size:18px}}

/* 설명 대신 검색과 실제 할당 집계를 한 줄에 배치해 표를 먼저 볼 수 있게 한다. */
.port-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:20px 0 12px}.port-toolbar .port-search{flex:1;margin:0}.port-toolbar .port-summary{margin:0 0 10px;white-space:nowrap}.port-group{margin-top:20px}@media(max-width:680px){.port-toolbar{align-items:stretch;flex-direction:column;gap:10px}.port-toolbar .port-summary{margin:0}}

/* PC 식별 정보와 업무 이름을 분리해 승인·연결 목록에서 같은 장치를 찾는다. */
.connection-pc{display:block;font-size:15px;color:var(--ink);font-weight:500;overflow-wrap:anywhere}.pairing-list{display:grid;gap:8px;margin:14px 0}.pairing-list p{margin:0}.pairing-select{width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere;padding:14px 16px}.pairing-history{margin:20px 0}.pairing-history>summary{cursor:pointer;font-weight:650}#pairing-list-count{font-size:18px;margin-top:22px}#pairing-state{margin-bottom:20px}

/* 서버 예약과 PC 승인을 다른 단계로 보여주고 설치 코드는 기본 마스킹한다. */
.server-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:18px;margin:24px 0}.server-resource,.installation-job{background:white;border:1px solid var(--line);padding:22px;border-radius:8px;overflow-wrap:anywhere}.server-resource h3{font-size:20px}.installation-job p{margin:0 0 9px}#installation-code-panel{border-left:5px solid var(--blue);background:white;padding:24px;margin:24px 0}#installation-code{max-width:340px;letter-spacing:2px}

.workload-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:20px}.workload-controls>span{margin-right:auto}

/* 사용자 수가 늘어도 같은 열을 비교하도록 카드 대신 행과 선택 패널을 사용한다. */
.auth-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px}.auth-choices button{padding:12px}
.users-tabs{display:flex;gap:8px;border-bottom:1px solid var(--line);margin:20px 0 24px}.users-tabs button{border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;color:var(--muted);padding:12px 18px}.users-tabs button[aria-selected="true"]{border-bottom-color:var(--blue);color:var(--blue)}
.users-toolbar{display:flex;align-items:flex-end;gap:18px;margin-bottom:16px}.users-toolbar label{margin:0}.users-toolbar label:first-child{flex:1;max-width:400px}.users-toolbar>span{margin:0 0 10px auto;white-space:nowrap}
.users-table-wrap{overflow:auto;background:white;border:1px solid var(--line);border-radius:8px}.users-table{border-collapse:collapse;width:100%;font-size:15px;text-align:left;min-width:880px}.users-table th{background:#e8eff5;color:var(--muted);font-weight:650;white-space:nowrap}.users-table th,.users-table td{padding:14px 16px;border-bottom:1px solid var(--line);vertical-align:top}.users-table td{overflow-wrap:anywhere}.users-table td:first-child{min-width:210px}.users-table td:nth-child(4){max-width:240px}.users-table td:last-child{min-width:160px;white-space:nowrap}.users-table tbody tr:not(.user-history-row):hover{background:#f7fafc}.users-table button{font-size:14px;padding:6px 11px;margin-right:6px}.user-history-row{background:#f5f8fb}.user-history-row p{margin:6px 0}.users-table .user-history-row td{white-space:normal}
.user-access-form{max-width:760px;background:white;border:1px solid var(--line);border-radius:8px;padding:20px}.user-access-form label{margin:14px 0}.user-access-form fieldset{border:1px solid var(--line);border-radius:6px;margin:14px 0;padding:12px}.user-hospitals{display:flex;gap:10px 24px;flex-wrap:wrap}.user-access-form .actions button{width:auto}.edit-user-identity{font-size:20px;font-weight:650;overflow-wrap:anywhere}
@media(max-width:680px){.auth-choices{grid-template-columns:1fr}.users-toolbar{flex-wrap:wrap;gap:12px}.users-toolbar label:first-child{min-width:100%}.users-toolbar>span{margin-left:0}.user-access-form{padding:16px}.users-tabs button{padding:10px 12px}}

.crm-settings { margin-top: 1rem; border-top: 1px solid #cbd5e1; padding-top: .8rem; }
.crm-settings form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.crm-settings label { display: grid; gap: .35rem; flex: 1 1 14rem; }
/* 서버 기본 등록과 실제 준비 명세 적용을 분리해 등록만으로 실행 가능하다고 표시하지 않는다. */
.server-setup-panel { border: 1px solid var(--line, #d7e2df); border-radius: 12px; padding: 20px; margin: 18px 0; }
.server-registration-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.server-registration-form label { min-width: 0; }
.server-registration-form .full-width { grid-column: 1 / -1; }
.server-resource .registration-state { color: #8c611b; }
@media (max-width: 640px) { .server-registration-form { grid-template-columns: 1fr; } }
