/* 2.92.0 관제센터 > 자원(web/js/shell/control_res.js)과 터미널 글자색(web/js/core/termcolor.js).
   마감: 유리 카드(위쪽 옅은 빛 테두리, 부드러운 그라데이션, 깊은 그림자), 그라데이션 숫자, 빛나는 게이지·막대, 경고 칩 빛, 깊은 로그 칸.
   열: 카드 폭으로 잰다(container query). 좁음 2열(디테일 4열), 중간 4열(8열), 넓음 6열(12열) — 앱(아이폰 2→4, 아이패드 4→8·6→12)과 같은 비율.
   동작 줄이기면 그리기·자라기·깜빡임을 모두 멈춘다. */
.ap-ctl .res-card {
  --rw-bg: linear-gradient(160deg, rgba(255,255,255,.95), rgba(246,246,250,.9) 45%, rgba(236,236,242,.92));
  --rw-line: rgba(0,0,0,.07); --rw-hi: rgba(255,255,255,.9); --rw-sh: 0 10px 26px -18px rgba(20,20,40,.45);
  --rw-track: rgba(120,120,128,.16); --rw-ctl: rgba(120,120,128,.1); --rw-ctl-line: rgba(0,0,0,.08);
  --rw-num: linear-gradient(180deg, #1d1d1f, #4a4c5c);
  --tc-bg: linear-gradient(180deg, #07080b, #0b0c11);
}
:root[data-look="macos"][data-theme="dark"] .ap-ctl .res-card { --rw-bg: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015) 40%, rgba(0,0,0,.25)); --rw-line: rgba(255,255,255,.07); --rw-hi: rgba(255,255,255,.06); --rw-sh: 0 10px 30px -18px rgba(0,0,0,.9); --rw-track: rgba(255,255,255,.07); --rw-ctl: rgba(255,255,255,.06); --rw-ctl-line: rgba(255,255,255,.08); --rw-num: linear-gradient(180deg, #fff, #b9bccb); }
@media (prefers-color-scheme: dark) { :root[data-look="macos"]:not([data-theme="light"]) .ap-ctl .res-card { --rw-bg: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015) 40%, rgba(0,0,0,.25)); --rw-line: rgba(255,255,255,.07); --rw-hi: rgba(255,255,255,.06); --rw-sh: 0 10px 30px -18px rgba(0,0,0,.9); --rw-track: rgba(255,255,255,.07); --rw-ctl: rgba(255,255,255,.06); --rw-ctl-line: rgba(255,255,255,.08); --rw-num: linear-gradient(180deg, #fff, #b9bccb); } }

.ap-ctl .res-card h3 { align-items: center; }
.ap-ctl .res-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--green); white-space: nowrap; }
.ap-ctl .res-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: respulse 1.6s ease-in-out infinite; }
.ap-ctl .res-live.off { color: var(--red); } .ap-ctl .res-live.off i { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }
.ap-ctl .res-mode { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--rw-ctl); border: 1px solid var(--rw-ctl-line); backdrop-filter: blur(10px); }
.ap-ctl .res-mode button { border: 0; background: none; color: var(--t2); font: inherit; font-size: 11.5px; font-weight: 500; padding: 3px 7px; border-radius: 7px; cursor: default; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.ap-ctl .res-mode button.on { color: var(--t1); font-weight: 600; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.12); }

/* ---- 격자 */
.ap-ctl .res-body { container-type: inline-size; container-name: res; }
.ap-ctl .res-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); grid-auto-flow: row dense; gap: 10px; }
.ap-ctl .res-card[data-mode="detail"] .res-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
@container res (min-width: 560px) {
  .ap-ctl .res-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .ap-ctl .res-card[data-mode="detail"] .res-grid { grid-template-columns: repeat(8, minmax(0,1fr)); }
}
@container res (min-width: 960px) {
  .ap-ctl .res-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .ap-ctl .res-card[data-mode="detail"] .res-grid { grid-template-columns: repeat(12, minmax(0,1fr)); }
}
.ap-ctl .res-w { grid-column: span 1; min-width: 0; position: relative; overflow: hidden; padding: 12px; border-radius: 18px; background: var(--rw-bg); border: 1px solid var(--rw-line); box-shadow: var(--rw-sh), inset 0 1px 0 var(--rw-hi); animation: resin .5s ease-out both; }
.ap-ctl .res-w.s2 { grid-column: span 2; } .ap-ctl .res-w.s4 { grid-column: span 4; } .ap-ctl .res-w.sF { grid-column: 1 / -1; }
.ap-ctl .res-w[hidden] { display: none; }
@container res (max-width: 559px) { .ap-ctl .res-card:not([data-mode="detail"]) .res-w.s4 { grid-column: 1 / -1; } }
/* 위젯 하나만 크게(디테일 모드) */
.ap-ctl .res-card[data-mode="detail"] .res-w.big.s1 { grid-column: span 2; }
.ap-ctl .res-card[data-mode="detail"] .res-w.big.s2 { grid-column: span 4; }
.ap-ctl .res-card[data-mode="detail"] .res-w.big.s4 { grid-column: 1 / -1; }
.ap-ctl .res-wh { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--t2); min-width: 0; }
.ap-ctl .res-wt { flex: 1; min-width: 0; font-weight: 600; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-wm { flex: none; max-width: 60%; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-wbig { display: none; flex: none; width: 14px; height: 14px; padding: 0; border: 1px solid var(--rw-ctl-line); border-radius: 4px; background: var(--rw-ctl); cursor: default; }
.ap-ctl .res-wbig::after { content: ""; display: block; width: 6px; height: 6px; margin: 3px; border: 1.2px solid var(--t2); border-radius: 1px; }
.ap-ctl .res-w.big .res-wbig::after { width: 4px; height: 4px; margin: 4px; }
.ap-ctl .res-card[data-mode="detail"] .res-w:hover .res-wbig, .ap-ctl .res-card[data-mode="detail"] .res-wbig:focus-visible { display: block; }

/* 공통 조각 */
.ap-ctl .res-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ap-ctl .res-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-ctl .res-bigw { display: flex; align-items: baseline; gap: 2px; }
.ap-ctl .res-big { font-size: 34px; font-weight: 700; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--t1); }
.ap-ctl .res-bigw small { font-size: 13px; color: var(--t2); }
.ap-ctl .res-kvs { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px 10px; }
.ap-ctl .res-kvs .res-kv { flex-direction: column; align-items: flex-start; }
.ap-ctl .res-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 11.5px; line-height: 1.55; min-width: 0; }
.ap-ctl .res-kv > span { color: var(--t2); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-kv b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; box-shadow: 0 0 6px -1px currentColor; }
.ap-ctl .res-mini { font-size: 11px; color: var(--t2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-mini.c { text-align: center; }
.ap-ctl .res-cap { font-size: 10px; color: var(--t3); text-align: right; margin-top: 1px; }
.ap-ctl .res-note { font-size: 11px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-note.bad { color: var(--red); }
.ap-ctl .res-sp { flex: 1; }
.ap-ctl .res-empty { font-size: 12px; color: var(--t2); padding: 8px 2px; }
.ap-ctl .res-hbar { height: 6px; border-radius: 3px; background: var(--rw-track); overflow: hidden; }
.ap-ctl .res-hbar i { display: block; height: 100%; border-radius: 3px; transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* SVG 게이지·고리·스파크라인 */
.ap-ctl .res-gauge { display: block; width: 100%; max-width: 150px; margin: 0 auto; overflow: visible; }
.ap-ctl .res-gauge .tr, .ap-ctl .res-ring .tr { stroke: var(--rw-track); }
.ap-ctl .res-gauge .va { filter: drop-shadow(0 0 4px rgba(255,159,10,.45)); }
.ap-ctl .res-gauge .va.hot { filter: drop-shadow(0 0 6px var(--red)); animation: resglow 1.4s ease-in-out infinite; }
.ap-ctl .res-gauge .tk line { filter: drop-shadow(0 0 2px currentColor); }
.ap-ctl .res-gw { position: relative; width: 100%; max-width: 150px; margin: 0 auto; }
.ap-ctl .res-gc { position: absolute; left: 0; right: 0; top: 40%; display: flex; flex-direction: column; align-items: center; line-height: 1.1; pointer-events: none; }
.ap-ctl .res-gc .gvl { display: flex; align-items: baseline; gap: 1px; }
.ap-ctl .res-gc .gv { font-size: 22px; font-weight: 700; color: var(--t1); letter-spacing: -.5px; }
.ap-ctl .res-gc .gv .rn-c, .ap-ctl .res-gc .gv .rn-s > span, .ap-ctl .res-rc .rv .rn-c, .ap-ctl .res-rc .rv .rn-s > span { background: var(--rw-num); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ap-ctl .res-gc .gu { font-size: 11px; font-weight: 500; color: var(--t2); }
.ap-ctl .res-gc .gs { font-size: 10px; color: var(--t2); white-space: nowrap; }
.ap-ctl .res-rw { position: relative; flex: none; width: 76px; height: 76px; margin: 0 auto; }
.ap-ctl .res-ring { display: block; width: 100%; height: 100%; overflow: visible; }
.ap-ctl .res-rc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; pointer-events: none; }
.ap-ctl .res-ring .va { filter: drop-shadow(0 0 3px rgba(191,90,242,.4)); transition: stroke .6s; }
.ap-ctl .res-rc .rv { font-size: 14px; font-weight: 700; color: var(--t1); }
.ap-ctl .res-rc .rs { font-size: 9px; color: var(--t2); max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-ctl .res-dw { width: 92px; height: 92px; margin: 0; }
.ap-ctl .res-spark { display: block; width: 100%; overflow: visible; margin-top: 4px; }
.ap-ctl .res-spark .l { stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 3px currentColor); }

/* CPU 코어 막대 */
.ap-ctl .res-cores { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0,1fr)); gap: 3px; height: 62px; margin-top: 10px; }
.ap-ctl .res-core { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.ap-ctl .res-core small { font-size: 9px; color: var(--t3); font-variant-numeric: tabular-nums; }
.ap-ctl .res-ct, .ap-ctl .res-vbt { flex: 1; width: 100%; display: flex; align-items: flex-end; border-radius: 3px; background: var(--rw-track); overflow: hidden; }
.ap-ctl .res-ct i, .ap-ctl .res-vbt i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; background-image: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0)); box-shadow: 0 0 8px -2px currentColor; transition: height .7s cubic-bezier(.2,.8,.2,1), background-color .6s; transform-origin: bottom; animation: resgrow .8s ease-out both; }
/* 세로 막대(부하, 디스크 읽기쓰기) */
.ap-ctl .res-vb { display: flex; gap: 8px; align-items: stretch; height: 92px; padding: 2px 4px; }
.ap-ctl .res-vb > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ap-ctl .res-vb b { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-ctl .res-vb small { font-size: 9.5px; color: var(--t2); }
.ap-ctl .res-vb.io { height: 76px; width: 96px; flex: none; }
/* 칸 막대(전력, VM vCPU) */
.ap-ctl .res-blk { display: flex; gap: 2px; margin: 6px 0 4px; }
.ap-ctl .res-blk i { flex: 1; height: 6px; border-radius: 2px; background: var(--rw-track); transition: background .5s, opacity .5s; }
.ap-ctl .res-blk i.on { box-shadow: 0 0 6px -1px currentColor; }
/* 메모리 */
.ap-ctl .res-stack { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--rw-track); margin-bottom: 4px; }
.ap-ctl .res-stack i { display: block; height: 100%; transition: width .8s cubic-bezier(.2,.8,.2,1); background-image: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.2)); }
/* 네트워크·디스크 목록 */
.ap-ctl .res-leg { display: flex; gap: 12px; font-size: 11px; color: var(--t2); margin-top: 4px; }
.ap-ctl .res-leg > span { display: inline-flex; align-items: center; gap: 5px; }
.ap-ctl .res-leg b { color: var(--t1); font-weight: 600; font-variant-numeric: tabular-nums; }
.ap-ctl .res-list { display: flex; flex-direction: column; margin-top: 6px; }
.ap-ctl .res-li { display: flex; align-items: baseline; gap: 8px; font-size: 11px; line-height: 1.6; border-top: 1px solid var(--rw-line); min-width: 0; }
.ap-ctl .res-li .n { flex: 1; min-width: 0; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-li b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-ctl .res-li small { color: var(--t3); white-space: nowrap; }
.ap-ctl .res-li.down .n { text-decoration: line-through; color: var(--t3); }
.ap-ctl .res-rings { flex: 1; min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.ap-ctl .res-dr .res-rw { width: 58px; height: 58px; } .ap-ctl .res-dr .rv { font-size: 12px; }
.ap-ctl .res-sens { margin-top: 4px; }
/* 경고 띠 */
.ap-ctl .res-w.res-alerts { padding: 8px 12px; }
.ap-ctl .res-alerts .res-wh { display: none; }
.ap-ctl .res-al { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-ctl .res-alc { --c: var(--green); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.ap-ctl .res-alc i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.ap-ctl .res-alc[data-level="warn"] { --c: var(--orange); box-shadow: 0 0 12px -4px var(--c); }
.ap-ctl .res-alc[data-level="crit"] { --c: var(--red); box-shadow: 0 0 14px -4px var(--c); }
.ap-ctl .res-alc[data-level="warn"] i, .ap-ctl .res-alc[data-level="crit"] i { animation: respulse 1.4s ease-in-out infinite; }
.ap-ctl .res-w.warn { box-shadow: var(--rw-sh), inset 0 1px 0 var(--rw-hi), 0 0 0 1px color-mix(in srgb, var(--orange) 35%, transparent); }
.ap-ctl .res-w.crit { animation: resin .5s ease-out both, rescrit 1.6s ease-in-out infinite; }

/* 도구 줄(프로세스, 명령) */
.ap-ctl .res-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; min-width: 0; }
.ap-ctl .res-q, .ap-ctl .res-sel, .ap-ctl .res-form input:not([type="checkbox"]) { height: 26px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--rw-ctl-line); background: var(--rw-ctl); color: var(--t1); font: inherit; font-size: 12px; outline: none; min-width: 0; box-sizing: border-box; }
.ap-ctl .res-q { width: 200px; } .ap-ctl .res-find { width: 140px; }
.ap-ctl .res-q:focus-visible, .ap-ctl .res-sel:focus-visible, .ap-ctl .res-form input:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 40%, transparent); }
.ap-ctl .res-tg { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--rw-ctl-line); background: var(--rw-ctl); color: var(--t2); font: inherit; font-size: 11.5px; white-space: nowrap; cursor: default; }
.ap-ctl .res-tg.on { color: var(--blue); background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 30%, transparent), color-mix(in srgb, var(--blue) 14%, transparent)); border-color: color-mix(in srgb, var(--blue) 50%, transparent); }
.ap-ctl .res-tg.danger { color: var(--red); }
.ap-ctl .res-tg.erronly.on { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.ap-ctl .res-badge { height: 20px; padding: 0 8px; border-radius: 10px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); font-variant-numeric: tabular-nums; }
/* 프로세스 표 */
.ap-ctl .res-ptbl { font-size: 12px; font-variant-numeric: tabular-nums; max-height: 420px; overflow: auto; }
.ap-ctl .res-pr { display: grid; grid-template-columns: 64px 84px 110px 56px 64px 48px 64px minmax(0,1fr); gap: 6px; align-items: center; padding: 3px 4px; border-top: 1px solid var(--rw-line); white-space: nowrap; }
.ap-ctl .res-pr > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ap-ctl .res-ph { position: sticky; top: 0; z-index: 1; border-top: 0; font-size: 11px; color: var(--t2); background: var(--card); }
.ap-ctl .res-ph .sortable { cursor: default; } .ap-ctl .res-ph .sortable.on { color: var(--blue); font-weight: 600; }
.ap-ctl .res-ph .sortable.on::after { content: " ▾"; }
.ap-ctl .res-pr .c-pid { color: var(--t3); } .ap-ctl .res-pr .c-user { color: var(--t2); }
.ap-ctl .res-pr .c-cpu { display: flex; align-items: center; gap: 6px; }
.ap-ctl .res-pr .c-cpu em { font-style: normal; width: 42px; text-align: right; flex: none; }
.ap-ctl .res-pbar { flex: 1; height: 4px; border-radius: 2px; background: var(--rw-track); overflow: hidden; }
.ap-ctl .res-pbar b { display: block; height: 100%; border-radius: 2px; box-shadow: 0 0 6px -1px currentColor; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.ap-ctl .res-pr .c-name { font-family: var(--mono); font-size: 11.5px; white-space: pre; }
.ap-ctl .res-pr.run .c-status { color: var(--green); }
.ap-ctl .res-prs .res-pr:hover { background: var(--rw-ctl); }

/* 명령 결과 */
.ap-ctl .res-cmdsel { max-width: 220px; }
.ap-ctl .res-cmdline { display: block; font-family: var(--mono); font-size: 11.5px; color: #8fcf5a; padding: 4px 8px; margin-bottom: 6px; border-radius: 7px; background: rgba(0,0,0,.45); border: 1px solid rgba(182,224,110,.2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-look="macos"][data-theme="dark"] .ap-ctl .res-cmdline { color: #B6E06E; }
.ap-ctl .res-lhist { display: flex; align-items: flex-end; gap: 2px; height: 18px; margin-bottom: 6px; }
.ap-ctl .res-lhist i { flex: 1; border-radius: 2px 2px 0 0; background: var(--rw-track); transition: height .6s; }
.ap-ctl .res-lhist i[data-lv="info"] { background: #5CC4B6; } .ap-ctl .res-lhist i[data-lv="warn"] { background: #E0B45E; box-shadow: 0 0 6px -1px #E0B45E; } .ap-ctl .res-lhist i[data-lv="err"] { background: #F06A5C; box-shadow: 0 0 6px -1px #F06A5C; }
.ap-ctl .res-sheet { position: absolute; inset: 8px; z-index: 3; overflow: auto; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(18px); border: 1px solid var(--rw-line); box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); animation: resin .25s ease-out both; }
.ap-ctl .res-sheet[hidden] { display: none; }
.ap-ctl .res-sh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.ap-ctl .res-cl { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ap-ctl .res-ci { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--rw-ctl); }
.ap-ctl .res-cim { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; }
.ap-ctl .res-cim code { font-family: var(--mono); font-size: 11px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-cim small { font-size: 10.5px; color: var(--t3); }
.ap-ctl .res-form { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.ap-ctl .res-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-ctl .res-f > span { color: var(--t2); font-size: 11px; }
.ap-ctl .res-f small { color: var(--t3); font-size: 10.5px; }
.ap-ctl .res-form input.mono { font-family: var(--mono); }
.ap-ctl .res-frow { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.ap-ctl .res-chk { display: flex; align-items: center; gap: 6px; }
.ap-ctl .res-fbtn { display: flex; justify-content: flex-end; gap: 6px; }

/* ---- 터미널 칸(테마와 상관없이 짙게) */
.tc-box { font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; line-height: 1.55; color: #d8d8de; background: var(--tc-bg, #0b0c11); border: 1px solid rgba(255,255,255,.05); box-shadow: inset 0 0 30px rgba(0,0,0,.6); border-radius: 12px; padding: 8px 0; height: 300px; overflow: auto; overscroll-behavior: contain; }
.tc-line { padding: 0 10px; white-space: pre-wrap; word-break: break-all; min-height: 1.55em; }
.tc-err-row { background: linear-gradient(90deg, rgba(240,106,92,.18), rgba(240,106,92,0)); }
.tc-warn-row { background: linear-gradient(90deg, rgba(224,180,94,.07), rgba(224,180,94,0)); }
.tc-empty { padding: 10px 12px; color: rgba(235,235,245,.5); font-family: inherit; }
.tc-err { color: #F06A5C; font-weight: 700; } .tc-warn { color: #E0B45E; font-weight: 700; } .tc-info { color: #5CC4B6; } .tc-debug { color: #8A8A96; }
.tc-ts { color: #6b6b74; } .tc-src { color: #A98BF5; } .tc-str { color: #E8C27A; } .tc-ip { color: #7FB8FF; } .tc-path { color: #B6E06E; } .tc-num { color: #F2A0E0; }
.tc-mark { background: rgba(255,214,10,.32); color: inherit; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,214,10,.5); }
.tc-sys { color: #F06A5C; }

/* ---- 디테일 모드: 작은 고정폭 글꼴, 좁은 칸 */
.ap-ctl .res-card[data-mode="detail"] .res-w { padding: 6px 7px; border-radius: 11px; font-family: var(--mono); }
.ap-ctl .res-card[data-mode="detail"] .res-wh { font-size: 9.5px; margin-bottom: 3px; gap: 4px; }
.ap-ctl .res-card[data-mode="detail"] .res-wm { font-size: 9.5px; }
.ap-ctl .res-card[data-mode="detail"] .res-big { font-size: 20px; }
.ap-ctl .res-card[data-mode="detail"] .res-bigw small, .ap-ctl .res-card[data-mode="detail"] .res-kv, .ap-ctl .res-card[data-mode="detail"] .res-mini, .ap-ctl .res-card[data-mode="detail"] .res-li, .ap-ctl .res-card[data-mode="detail"] .res-leg, .ap-ctl .res-card[data-mode="detail"] .res-note { font-size: 9.5px; }
.ap-ctl .res-card[data-mode="detail"] .res-cores { height: 40px; gap: 2px; margin-top: 4px; }
.ap-ctl .res-card[data-mode="detail"] .res-core small { font-size: 7px; }
.ap-ctl .res-card[data-mode="detail"] .res-vb { height: 56px; gap: 4px; } .ap-ctl .res-card[data-mode="detail"] .res-vb b { font-size: 9px; } .ap-ctl .res-card[data-mode="detail"] .res-vb small { font-size: 8px; }
.ap-ctl .res-card[data-mode="detail"] .res-vb.io { width: 60px; height: 48px; }
.ap-ctl .res-card[data-mode="detail"] .res-rw { width: 54px; height: 54px; } .ap-ctl .res-card[data-mode="detail"] .res-rc .rv { font-size: 11px; } .ap-ctl .res-card[data-mode="detail"] .res-rc .rs { font-size: 7.5px; } .ap-ctl .res-card[data-mode="detail"] .res-gc .gv { font-size: 15px; } .ap-ctl .res-card[data-mode="detail"] .res-gc .gs, .ap-ctl .res-card[data-mode="detail"] .res-gc .gu { font-size: 8px; }
.ap-ctl .res-card[data-mode="detail"] .res-dr .res-rw { width: 40px; height: 40px; } .ap-ctl .res-card[data-mode="detail"] .res-dr .rv { font-size: 9px; }
.ap-ctl .res-card[data-mode="detail"] .res-dw { width: 56px; height: 56px; }
.ap-ctl .res-card[data-mode="detail"] .res-row { gap: 6px; }
.ap-ctl .res-card[data-mode="detail"] .res-kvs { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 6px; }
.ap-ctl .res-card[data-mode="detail"] .res-tools { gap: 4px; margin-bottom: 4px; }
.ap-ctl .res-card[data-mode="detail"] .res-tg, .ap-ctl .res-card[data-mode="detail"] .res-q, .ap-ctl .res-card[data-mode="detail"] .res-sel { height: 20px; font-size: 10px; padding: 0 7px; }
.ap-ctl .res-card[data-mode="detail"] .res-ptbl { font-size: 10px; max-height: 360px; }
.ap-ctl .res-card[data-mode="detail"] .res-pr { grid-template-columns: 48px 60px 84px 40px 48px 34px 40px minmax(0,1fr); gap: 4px; padding: 1px 3px; }
.ap-ctl .res-card[data-mode="detail"] .res-pr .c-name { font-size: 10px; }
.ap-ctl .res-card[data-mode="detail"] .tc-box { font-size: 9.5px; line-height: 1.45; height: 220px; padding: 4px 0; border-radius: 8px; }
.ap-ctl .res-card[data-mode="detail"] .tc-line { padding: 0 6px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.ap-ctl .res-card[data-mode="detail"] .res-cmdline { font-size: 9.5px; padding: 2px 6px; margin-bottom: 3px; }
.ap-ctl .res-card[data-mode="detail"] .res-lhist { height: 12px; margin-bottom: 3px; }
.ap-ctl .res-card[data-mode="detail"] .res-alc { height: 18px; font-size: 9.5px; padding: 0 7px; }
@container res (max-width: 559px) { .ap-ctl .res-pr .c-user, .ap-ctl .res-pr .c-rss, .ap-ctl .res-pr .c-threads, .ap-ctl .res-pr .c-status { display: none; } .ap-ctl .res-pr { grid-template-columns: 56px 100px 48px minmax(0,1fr) !important; } }

@keyframes respulse { 50% { opacity: .3; } }
@keyframes resglow { 50% { opacity: .65; } }
@keyframes rescrit { 50% { box-shadow: var(--rw-sh), inset 0 1px 0 var(--rw-hi), 0 0 0 1px color-mix(in srgb, var(--red) 55%, transparent), 0 0 18px -6px var(--red); } }
@keyframes resgrow { from { transform: scaleY(0); } }
@keyframes resin { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .ap-ctl .res-w, .ap-ctl .res-w.crit, .ap-ctl .res-sheet, .ap-ctl .res-live i, .ap-ctl .res-alc i, .ap-ctl .res-gauge .va.hot, .ap-ctl .res-ct i, .ap-ctl .res-vbt i { animation: none !important; }
  .ap-ctl .res-ct i, .ap-ctl .res-vbt i, .ap-ctl .res-stack i, .ap-ctl .res-hbar i, .ap-ctl .res-pbar b, .ap-ctl .res-lhist i, .ap-ctl .res-blk i, .ap-ctl .res-ring .va { transition: none !important; }
}

/* ---- 굴러가는 숫자(web/js/core/rollnum.js) */
.rn { display: inline-flex; align-items: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; position: relative; }
.rn-a { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.rn-c { display: inline-block; white-space: pre; }
.rn-d { display: inline-block; height: 1.2em; line-height: 1.2em; overflow: hidden; vertical-align: bottom; }
.rn-s { display: block; will-change: transform; }
.rn-s > span { display: block; height: 1.2em; line-height: 1.2em; text-align: center; }
.ap-ctl .res-big .rn-c, .ap-ctl .res-big .rn-s > span { background: var(--rw-num); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@media (prefers-reduced-motion: reduce) { .rn-s { transition: none !important; } }
.ap-ctl .res-badge[hidden] { display: none; }
.ap-ctl .res-badge.run { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.ap-ctl .res-badge.run::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; animation: respulse 1.4s ease-in-out infinite; }
.ap-ctl .res-badge.to { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.ap-ctl .res-na { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; text-align: center; font-size: 15px; font-weight: 600; color: var(--t2); }
.ap-ctl .res-na small { font-size: 10.5px; font-weight: 400; color: var(--t3); }
.ap-ctl .res-na[hidden], .ap-ctl .res-gw[hidden], .ap-ctl .res-blk[hidden], .ap-ctl .res-mini[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ap-ctl .res-badge.run::before { animation: none; } }
.ap-ctl .res-leg { min-width: 0; overflow: hidden; }
.ap-ctl .res-leg > span { white-space: nowrap; min-width: 0; }
.ap-ctl .res-card[data-mode="detail"] .res-leg { gap: 6px; }
.ap-ctl .res-card[data-mode="detail"] .res-leg > span > span { display: none; }
.ap-ctl .res-card[data-mode="detail"] .res-na { font-size: 11px; min-height: 60px; }
.ap-ctl .res-card[data-mode="detail"] .res-na small { display: none; }

/* ---- 2.92.3 위젯 이름(늘 보이는 이름 + 좁으면 먼저 숨는 덧말), GPU 위젯, 좁은 칸 규칙 */
.ap-ctl .res-wtn { color: var(--t1); }
.ap-ctl .res-wtx { color: var(--t2); font-weight: 500; }
.ap-ctl .res-gpurow { align-items: center; }
.ap-ctl .res-gpug { flex: 0 0 46%; max-width: 150px; margin: 0; }
.ap-ctl .res-gpurow .res-col { gap: 4px; }
.ap-ctl .res-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; min-width: 0; }
.ap-ctl .res-chip { display: inline-flex; align-items: baseline; gap: 4px; max-width: 100%; padding: 1px 7px; border-radius: 9px; font-size: 11px; background: var(--rw-ctl); border: 1px solid var(--rw-ctl-line); white-space: nowrap; overflow: hidden; }
.ap-ctl .res-chip[hidden] { display: none; }
.ap-ctl .res-chip small { color: var(--t2); font-size: 10px; }
.ap-ctl .res-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ap-ctl .res-card[data-mode="detail"] .res-chip { font-size: 9px; padding: 0 5px; } .ap-ctl .res-card[data-mode="detail"] .res-chip small { font-size: 8px; }
.ap-ctl .res-card[data-mode="detail"] .res-gpug { flex-basis: 42%; }
.ap-ctl .res-memline { display: none; }
.ap-ctl .res-gc .gs { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* 코어 번호: 막대보다 넓으면 넷마다 하나, 더 좁으면 숨김(JS 가 data-lbl 을 정한다) */
.ap-ctl .res-core small { white-space: nowrap; line-height: 1; }
.ap-ctl .res-cores[data-lbl="q"] .res-core:not(:nth-child(4n+1)) small { visibility: hidden; }
.ap-ctl .res-cores[data-lbl="none"] .res-core small { display: none; }
/* 위젯마다 자기 폭으로 잰다: 좁으면 덧말 → 머리 오른쪽 값 순서로 숨기고, 이름과 핵심 숫자는 남긴다 */
.ap-ctl .res-w { container-type: inline-size; container-name: rw; }
@container rw (max-width: 260px) {
  .ap-ctl .res-wtx { display: none; }
  .ap-ctl .res-w[data-w="mem"] .res-row { flex-direction: column; }
  .ap-ctl .res-w[data-w="mem"] .res-row > .res-col { display: none; }
  .ap-ctl .res-w[data-w="mem"] .res-dw { margin: 0 auto; }
  .ap-ctl .res-w[data-w="mem"] .res-memline { display: block; }
  .ap-ctl .res-w[data-w="disk"] .res-vb.io, .ap-ctl .res-w[data-w="disk"] .res-list { display: none; }
  .ap-ctl .res-w[data-w="disk"] .res-rings { justify-content: center; }
  .ap-ctl .res-w[data-w="net"] .res-leg > span > span, .ap-ctl .res-li small { display: none; }
  .ap-ctl .res-w[data-w="net"] .res-leg { flex-direction: column; gap: 0; }
  .ap-ctl .res-w[data-w="gpu"] .res-gpurow { flex-direction: column; align-items: stretch; }
  .ap-ctl .res-w[data-w="gpu"] .res-gpug { flex-basis: auto; width: 100%; max-width: 120px; margin: 0 auto; }
  .ap-ctl .res-w[data-w="gpu"] .res-gprocs { display: none; }
  .ap-ctl .res-w[data-w="vm"] .res-row { flex-direction: column; align-items: stretch; }
  .ap-ctl .res-kvs { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ap-ctl .res-wm { max-width: 55%; }
}
@container rw (max-width: 150px) {
  .ap-ctl .res-wm { display: none; }
  .ap-ctl .res-kvs { grid-template-columns: minmax(0,1fr); }
  .ap-ctl .res-w[data-w="temp"] .res-sens { display: none; }
}
