/* hsmondisk 서버·디스크 모니터 - TV 다크 테마 (hsmon 해솔 모니터와 같은 색·글꼴·머리글)
   1920x1080 고정 캔버스(#tv)를 창 크기에 맞춰 통째로 축소/확대한다 (dash.js fit). 색은 아래 변수에서만 정한다
   카드 크기: 서버 612×308 (3×3), 디스크 924×308 (2×3). 알림 화면은 같은 카드를 transform 으로 확대 */
@font-face {
  font-family: "Pretendard Variable";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations"), url("../fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #070a10;
  --tv: #0b0f17;
  --panel: #121826;
  --panel-2: #182032;
  --line: #222b3c;
  --line-2: #2e3a50;
  --fg: #e8edf4;
  --fg-2: #c3cbd8;
  --muted: #8592a6;
  --accent: #4cc3ff;
  --accent-a: rgba(76, 195, 255, .14);
  --ok: #22c55e;
  --ok-a: rgba(34, 197, 94, .16);
  --warn: #f5b83d;
  --warn-a: rgba(245, 184, 61, .16);
  --bad: #ef4444;
  --bad-a: rgba(239, 68, 68, .18);
  --bad-fg: #ff7a7a;
  --spare: #60a5fa;
  --raid: #a78bfa;
  --na: #4b5568;
  --on-light: #0b0f17;
  --f-ui: "Pretendard Variable", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ══ TV 캔버스 (hsmon 과 같음) ══ */
body.tvbody { background: var(--bg); overflow: hidden; height: 100vh; touch-action: none; }
.tv { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: var(--tv); color: var(--fg);
      font: 500 18px/1.35 var(--f-ui); letter-spacing: -.01em; display: flex; flex-direction: column; overflow: hidden; }
.tv td, .tv .num { font-variant-numeric: tabular-nums; }
.tvh { position: relative; z-index: 3; flex: none; height: 84px; display: flex; align-items: center; gap: 28px; padding: 0 28px;
       background: linear-gradient(180deg, #131a29, #0f1522); border-bottom: 1px solid var(--line); }
.tvh.over { position: absolute; left: 0; right: 0; top: 0; background: rgba(8, 14, 26, .55); backdrop-filter: blur(6px); border-bottom-color: rgba(120, 170, 230, .22); }
.brand { display: flex; align-items: center; gap: 14px; flex: none; }
.brand img { width: 40px; height: auto; opacity: .9; }
.ttl { min-width: 0; }
.ttl h1 { margin: 0; font-size: 34px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.ttl p { margin: 2px 0 0; font-size: 16px; color: var(--muted); white-space: nowrap; }
.hx { flex: 1; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; flex: none; }
.clock b { font-size: 44px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.clock small { font-size: 14px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.ctrls { display: flex; gap: 8px; flex: none; }
.tv .ic { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); font-size: 16px;
          display: grid; place-items: center; cursor: pointer; padding: 0; }
.tv .ic:hover { border-color: var(--accent); }
.tv .ic.on { background: var(--warn); color: var(--on-light); border-color: var(--warn); }
.rot { position: relative; z-index: 3; flex: none; height: 4px; background: var(--line); }
.k-intro .rot { visibility: hidden; }
.rot i, .sp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #7c9cff); }
.rot i.paused, .sp-bar i.paused { background: var(--warn); }
.err { position: relative; z-index: 3; flex: none; margin: 12px 28px 0; padding: 10px 16px; border-radius: 10px; background: #3a1d22; color: #ffb3b1; font-size: 18px; }
#full-hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9; padding: 12px 22px; border-radius: 10px; background: var(--warn); color: var(--on-light);
             font: 700 20px var(--f-ui); box-shadow: 0 6px 24px rgba(0, 0, 0, .5); pointer-events: none; }
#offline-badge { position: fixed; right: 16px; bottom: 16px; z-index: 9; padding: 10px 16px; border-radius: 10px; background: #3a1d22; color: #ffb3b1; font: 600 18px var(--f-ui); }
.tvb { flex: 1; min-height: 0; padding: 16px 28px 22px; display: flex; flex-direction: column; gap: 14px; }

/* 머리글 요약 칩 */
.chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2);
        font-size: 16px; color: var(--fg-2); white-space: nowrap; }
.chip b { font-size: 24px; font-weight: 750; color: var(--fg); font-variant-numeric: tabular-nums; }
.chip.bad { background: var(--bad-a); border-color: rgba(239, 68, 68, .45); }
.chip.bad b { color: var(--bad-fg); }
.chip.warn { background: var(--warn-a); border-color: rgba(245, 184, 61, .45); }
.chip.warn b { color: var(--warn); }
.chip.ok b { color: var(--ok); }
.chip.info b { color: var(--spare); }
.chip.dim { opacity: .5; }
.s-disks .chip { gap: 6px; padding: 6px 11px; font-size: 15px; }   /* 디스크 머리글은 칩이 7개라 조금 작게 */
.s-disks .chip b { font-size: 22px; }

/* 글자 색 = judge 점수 색 */
.c-ok { color: var(--ok); }
.c-warn { color: var(--warn); }
.c-crit { color: var(--bad-fg); }
.c-na { color: var(--muted); font-weight: 600; }

@keyframes blink { 45% { opacity: .25; } }
@keyframes critbg { 50% { background: #3d1418; box-shadow: inset 0 0 0 2px rgba(239, 68, 68, .55); } }

/* ══ 카드 공통 ══ */
.scard, .dcard { position: relative; border-radius: 14px; background: linear-gradient(180deg, #141b2b, #111725); border: 1px solid var(--line-2); overflow: hidden; }
.scard.ok, .dcard.ok { border-color: rgba(34, 197, 94, .35); }
.scard.warn, .dcard.warn { border-color: rgba(245, 184, 61, .85); box-shadow: inset 0 0 0 1px rgba(245, 184, 61, .35), 0 0 18px rgba(245, 184, 61, .12); }
.scard.crit, .dcard.crit { border-color: var(--bad); animation: critbg 1.1s steps(1, end) infinite; }
.scard.down { border-color: var(--bad); background: #151922; }
.scard.down .sc-b { opacity: .55; filter: saturate(.5); }
.ecard { border-radius: 14px; border: 1px dashed var(--line); background: rgba(18, 24, 38, .35); }
.sc-h, .dc-h { flex: none; height: 26px; display: flex; align-items: center; gap: 8px; }
.nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
.nm b { font-weight: 750; }
.nm .sep { color: var(--muted); margin: 0 5px; }
.nm .sv { font-weight: 600; color: var(--fg-2); }
.nm .mk { margin-left: 8px; font-size: 13px; color: var(--muted); }
.ic16 { width: 15px; height: 15px; flex: none; color: var(--accent); vertical-align: -2px; margin-right: 5px; }
.badge { flex: none; padding: 2px 8px; border-radius: 6px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 800; }
.up { flex: none; display: flex; align-items: center; font-size: 15px; font-weight: 700; color: var(--fg-2); }
.up.c-warn { color: var(--warn); }
.up.c-crit { color: var(--bad-fg); }

/* ══ 서버 카드 612×308 ══ */
.sgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 612px); grid-template-rows: repeat(3, 308px); gap: 14px;
         justify-content: space-between; align-content: start; }
.scard { width: 612px; height: 308px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.sc-b { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.sc-l, .sc-r { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gz { flex: none; height: 96px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cpu, .mem { min-width: 0; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.gh { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gh b { font-size: 20px; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.gh b small { font-size: 12px; font-weight: 600; margin-left: 1px; }
.gh em { margin-left: auto; font-style: normal; font-size: 11px; }
.gh b.c-warn { color: var(--warn); }
.gh b.c-crit { color: var(--bad-fg); }
.spark { width: 100%; flex: 1; min-height: 0; margin-top: 2px; }
.spark .sa { fill: rgba(34, 197, 94, .14); }
.spark .sl { fill: none; stroke: var(--ok); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.spark .sp { fill: var(--ok); }
.spark .th { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 3; opacity: .7; }
.spark.warn .sa { fill: rgba(245, 184, 61, .14); }
.spark.warn .sl { stroke: var(--warn); }
.spark.warn .sp { fill: var(--warn); }
.spark.crit .sa { fill: rgba(239, 68, 68, .16); }
.spark.crit .sl { stroke: var(--bad); }
.spark.crit .sp { fill: var(--bad); }
.nodata { flex: 1; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.gw { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; }
.gauge { height: 100%; max-width: 100%; }
.gauge .gt { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 20; }
.gauge .gv { fill: none; stroke: var(--ok); stroke-width: 20; }
.gauge .gv.warn { stroke: var(--warn); }
.gauge .gv.crit { stroke: var(--bad); }
.gn { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.gn b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gn b small { font-size: 12px; }
.gn > small { margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.dks { flex: none; display: flex; flex-direction: column; gap: 4px; }
.dk { height: 22px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dk .dl { width: 24px; flex: none; font-weight: 700; color: var(--fg-2); }
.dk .db { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.dk .db i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.dk .db i.warn { background: var(--warn); }
.dk .db i.crit { background: var(--bad); }
.dk .dv { flex: none; min-width: 112px; text-align: right; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.dk.na .dv { flex: 1; text-align: left; color: var(--muted); }
.fx, .kr { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.fx { height: 22px; }
.kr { height: 26px; padding: 0 8px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.kl { flex: none; display: flex; align-items: center; color: var(--muted); }
.kl em { margin-left: 4px; font-style: normal; color: var(--accent); }
.kv { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv small { font-weight: 600; color: var(--muted); }
.kr.wide > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg-2); font-weight: 600; }
.dm { display: grid; grid-template-columns: repeat(4, 11px); gap: 3px 5px; }
.dm i { width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px rgba(34, 197, 94, .6); }
.dm i.off { background: var(--bad); box-shadow: 0 0 6px rgba(239, 68, 68, .7); }

/* ══ 디스크 카드 924×308 ══ */
.dgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, 924px); grid-template-rows: repeat(3, 308px); gap: 14px 16px;
         justify-content: space-between; align-content: start; }
.dcard { width: 924px; height: 308px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.dc-h .meta { flex: none; display: flex; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dc-h .meta .sep { margin: 0 6px; }
.ctl { flex: none; height: 26px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 8px; background: var(--panel-2);
       border: 1px solid var(--line); font-size: 13px; white-space: nowrap; overflow: hidden; }
.ctl .cn { min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: var(--fg-2); }
.ctl .ci { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--fg-2); }
.cs { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.cs i { width: 9px; height: 9px; border-radius: 50%; background: var(--na); }
.cs.ok i { background: var(--ok); }
.cs.warn { color: var(--warn); }
.cs.warn i { background: var(--warn); }
.ld { color: var(--raid); font-weight: 700; }
.ld.c-warn { color: var(--warn); }
.mt { display: inline-flex; align-items: center; color: var(--muted); }
.mt .ic16 { color: var(--muted); margin-right: 3px; }
.blk { flex: none; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: var(--bh, 74px); gap: 5px; }
.b { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px; border-radius: 8px; text-align: center;
     line-height: 1.1; background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .45); }
.b .bl { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.b .bc { font-size: 17px; font-weight: 800; }
.b .bi { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.b.spare { background: rgba(96, 165, 250, .13); border-color: rgba(96, 165, 250, .55); }
.b.spare .bi { color: var(--spare); }
.b.warn { background: rgba(245, 184, 61, .16); border-color: var(--warn); }
.b.crit { background: rgba(239, 68, 68, .22); border-color: var(--bad); animation: blink 1.1s steps(1, end) infinite; }
.blk.compact .bi { display: none; }
.alm { flex: none; margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--warn); background: rgba(245, 184, 61, .08); }
.alm.crit { border-color: var(--bad); background: rgba(239, 68, 68, .1); }
.ar { height: 22px; display: flex; align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; }
.ar b { color: var(--bad-fg); }
.alm.warn .ar b { color: var(--warn); }
.ar .as { font-weight: 700; }
.ar .am { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: var(--fg-2); }
.ar .az { font-weight: 800; }
.ar .az.guess { font-style: italic; color: var(--muted); }
.ar .ap { margin-left: auto; color: var(--accent); font-weight: 700; }

/* ══ 알림 풀화면: 같은 카드를 확대 (영역 1864×889: 서버 ×2.86, 디스크 ×2.0) ══ */
.alab { flex: none; align-self: center; display: inline-flex; align-items: baseline; gap: 14px; padding: 8px 28px; border-radius: 999px; font-size: 26px; font-weight: 800; }
.alab small { font-size: 18px; font-weight: 700; opacity: .8; }
.alab.crit { background: var(--bad); color: #fff; box-shadow: 0 0 30px rgba(239, 68, 68, .45); }
.alab.warn { background: var(--warn); color: var(--on-light); }
.zoom { flex: 1; min-height: 0; position: relative; }
.zoom > * { position: absolute; left: 50%; top: 50%; }
.zoom.zs > * { transform: translate(-50%, -50%) scale(2.86); }
.zoom.zd > * { transform: translate(-50%, -50%) scale(2); }

/* ══ 표지 ══ */
.splash { position: absolute; inset: 0; background: #05070c center / cover no-repeat; }
.splash::before { content: ""; position: absolute; inset: 0;
                  background: radial-gradient(ellipse at 50% 45%, rgba(5, 8, 14, .4), rgba(5, 8, 14, .88) 75%), linear-gradient(180deg, rgba(5, 8, 14, .25), rgba(5, 8, 14, .7)); }
.sp-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding-top: 70px; text-align: center; }
.sp-in .eyebrow { font-size: 22px; font-weight: 800; letter-spacing: .3em; color: var(--accent); }
.sp-in h2 { margin: 0; font-size: 96px; font-weight: 850; line-height: 1; letter-spacing: -.03em; text-shadow: 0 6px 40px rgba(0, 0, 0, .6); }
.sp-sub { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: .35em; color: var(--fg-2); }
.sum { display: flex; gap: 20px; margin-top: 30px; }
.sum .st { min-width: 180px; display: flex; flex-direction: column; align-items: center; padding: 18px 24px 16px; border-radius: 20px;
           background: rgba(14, 20, 33, .72); border: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.sum .st b { font-size: 100px; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.sum .st span { margin-top: 8px; font-size: 24px; font-weight: 700; color: var(--fg-2); white-space: nowrap; }
.sum .st.ok b { color: var(--ok); }
.sum .st.warn b { color: var(--warn); }
.sum .st.bad b { color: #ff5a5a; }
.sum .st.info b { color: var(--raid); }
.sum .st.spare b { color: var(--spare); }
.sum .st.zero { opacity: .45; }
.sp-bar { width: 520px; height: 6px; margin-top: 28px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.sp-clock { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sp-clock b { font-size: 54px; font-weight: 750; font-variant-numeric: tabular-nums; }
.sp-clock span { font-size: 22px; color: var(--muted); }

/* ══ 진입 애니메이션: 카드·표지 숫자가 차례로 (화면마다 #tv.anim 재시작) ══ */
#tv.anim .cards > *, #tv.anim .sum > * { animation: fadeup .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
#tv.anim .sp-in h2, #tv.anim .sp-sub { animation: rise 1.2s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #tv *, #tv.anim * { animation: none !important; }
}

/* ══ 로그인 (hsmon 과 같음) ══ */
body.page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 20%, #17223a, var(--bg) 70%); color: var(--fg); font: 500 16px/1.5 var(--f-ui); }
.login { width: min(440px, calc(100vw - 32px)); padding: 36px 32px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.login .eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .08em; }
.login .eyebrow img { width: 26px; }
.login h1 { margin: 10px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.login p { margin: 0 0 22px; color: var(--muted); }
.login label { display: block; font-size: 14px; color: var(--fg-2); margin-bottom: 6px; }
.login input { width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #0d1320; color: var(--fg); font: 600 18px var(--f-ui); }
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-a); }
.login .msg { margin: 10px 0 0; color: #ff9b9b; font-weight: 600; }
.login button { margin-top: 18px; width: 100%; height: 50px; border: 0; border-radius: 10px; background: linear-gradient(90deg, #3aaef5, #5b7cfa); color: #fff; font: 750 18px var(--f-ui); cursor: pointer; }
