/* nx 새 화면 모양(nx1). 모든 규칙은 body[data-nx] 아래(스위치가 켜졌을 때만 붙는다) · 641px 이상에서만. 폰 화면은 건드리지 않는다.
   색은 ec.css 맨 위의 --ec-* 만 쓴다(새 색 없음). 칸 채움색 · 막대 없음. 움직임은 여기 두지 않는다(nx-motion.css). 기반 담당만 고친다. */
@media (min-width: 641px) {
  /* 새 표(.nx-t): 본문 12 · 머리 12 · 칩 12 · 줄 26px(2차 손질 11-11: 13 → 12 · 30 → 26). 12px 아래 글자 없음 */
  body[data-nx] .ec .nx-on { --ec-row: 26px; }
  body[data-nx] .ec table.dense.nx-t { font-variant-numeric: tabular-nums lining-nums; }
  body[data-nx] .ec table.dense.nx-t:not(.nx-fit) { font-size: 12px; }
  body[data-nx] .ec table.dense.nx-t th { font-size: 12px; }
  body[data-nx] .ec table.dense.nx-t th.grp { height: 26px; }
  body[data-nx] .ec table.dense.nx-t th.grp small { font-size: 12px; }
  body[data-nx] .ec table.dense.nx-t thead tr:nth-child(2) th { top: 26px; }
  body[data-nx] .ec table.dense.nx-t td.sub, body[data-nx] .ec table.dense.nx-t td.cat { font-size: 12px; }
  body[data-nx] .ec table.dense.nx-t .chip { font-size: 12px; height: 20px; line-height: 20px; border-radius: 10px; }
  /* 금액 · 수량은 오른쪽, 이름 · 글은 왼쪽 */
  body[data-nx] .ec table.dense.nx-t th.num, body[data-nx] .ec table.dense.nx-t td.num, body[data-nx] .ec table.dense.nx-t tfoot td.num { text-align: right; }
  body[data-nx] .ec table.dense.nx-t td.name, body[data-nx] .ec table.dense.nx-t td.pname { text-align: left; }
  body[data-nx] .ec table.dense.nx-t:not(.nx-fit) th.num, body[data-nx] .ec table.dense.nx-t:not(.nx-fit) td.num, body[data-nx] .ec table.dense.nx-t:not(.nx-fit) tfoot td.num { padding-right: 8px; }
  body[data-nx] .ec table.dense.nx-t:not(.nx-fit) td.name, body[data-nx] .ec table.dense.nx-t:not(.nx-fit) td.pname { padding-left: 8px; }
  /* .nx-fit = 새 표가 제 칸을 가로로 넘칠 때 nx-host 가 붙인다: 글자 크기 · 좌우 여백을 운영판 표와 같게 둬서 폭이 옛 화면과 같아진다(옛 화면에서 한눈에 보이던 표를 밀어서 보게 만들지 않는다) */
  /* 음수 = 빨강 굵게. 빨강 글자는 늘 굵게(색만으로 말하지 않음) */
  body[data-nx] .ec table.dense.nx-t td.neg { color: var(--ec-bad); font-weight: 700; }
  body[data-nx] .ec table.dense.nx-t td.bad { font-weight: 700; }
  body[data-nx] .ec table.dense.nx-t tr.rc-muted td.neg { color: var(--ec-muted); font-weight: 400; }
  /* 머리 오른쪽 끝의 옛 화면 · 새 화면 단추: 폭 61px 고정. 단추가 보이는 동안 검색 칸을 단추가 차지하는 만큼(61 + 틈 6 = 67px) 줄여 조회줄 폭을 옛 화면과 같게 둔다(머리줄이 두 줄로 접혀 표가 내려가지 않게) */
  body[data-nx] .ec #nx-oldBtn { flex: 0 0 61px; width: 61px; padding-left: 0; padding-right: 0; text-align: center; box-sizing: border-box; }
  body[data-nx] .ec #ec-q:has(> #nx-oldBtn:not([hidden])) > #ec-search { width: 103px; }
  /* 엑셀형 잠긴 시트(.nx-sheet, nx3): 운영판 표 자리에 놓인다. 위 띠 = 엑셀 메뉴 · 엑셀로 저장 · 이카운트 양식. 시트는 읽기 전용 */
  body[data-nx] .ec .nx-sheet { display: flex; flex-direction: column; min-width: 0; width: 100%; background: var(--ec-panel); }
  body[data-nx] .ec .nx-sbar { display: flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 8px; border-bottom: 1px solid var(--ec-line); }
  body[data-nx] .ec .nx-sbar .nx-sgrow { flex: 1 1 auto; }
  body[data-nx] .ec .nx-sbar .nx-sbtn[aria-pressed="true"] { background: var(--ec-hover); box-shadow: 0 0 0 1px var(--ec-line-strong); }
  body[data-nx] .ec .nx-sbox { position: relative; flex: none; min-height: 0; overflow: hidden; background: var(--ec-panel); }
  body[data-nx] .ec .nx-sbox .sh-gridhost { position: relative; }
  /* 시트 틀: 수식 입력줄 · 시트 탭 · 새 시트 단추는 숨기고(가로 스크롤 자리와 아래 상태 줄 = 칸 골라 합계 · 평균 · 개수는 남긴다). 리본의 파일 탭(열기 · 저장)도 숨긴다 */
  body[data-nx] .ec .nx-sbox .sh-formulabar { display: none; }
  body[data-nx] .ec .nx-sbox .sh-tabnav, body[data-nx] .ec .nx-sbox .sh-tablist, body[data-nx] .ec .nx-sbox .sh-tabadd, body[data-nx] .ec .nx-sbox .sh-tabsplit { display: none !important; }
  body[data-nx] .ec .nx-sbox .sh-rb-tab[data-tab="file"] { display: none !important; }
  /* 합계 띠: 거른 줄만 더한 합계 줄, 스크롤해도 맨 아래에 붙는다 */
  body[data-nx] .ec .nx-sumbar { position: absolute; left: 0; right: 12px; z-index: 3; height: 26px; background: var(--ec-head); border-top: 2px solid var(--ec-line-strong); border-bottom: 1px solid var(--ec-line); color: var(--ec-fg); font: 700 12px var(--ec-font); font-variant-numeric: tabular-nums lining-nums; pointer-events: none; overflow: hidden; }
  body[data-nx] .ec .nx-sumbar[hidden] { display: none; }
  body[data-nx] .ec .nx-sumbar .c { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 6px; white-space: nowrap; overflow: hidden; border-right: 1px solid var(--ec-line); }
  body[data-nx] .ec .nx-sumbar .c.r { justify-content: flex-end; } body[data-nx] .ec .nx-sumbar .c.m { justify-content: center; }
  body[data-nx] .ec .nx-sumbar .c.fz { background: var(--ec-head); z-index: 1; }
  /* 보기 시트의 가로 · 세로 막대: 합계 띠 바로 아래에 또렷이(띠는 막대 높이만큼 위에 선다 · sheetview.js sumBar). 막대 바탕은 표 머리 색, 손잡이는 표 글자 흐린 색(다크 · 라이트 모두 변수) */
  body[data-nx] .ec .nx-sbox .sh-sb-h { background: var(--ec-head); border-top: 1px solid var(--ec-line); box-sizing: border-box; }
  body[data-nx] .ec .nx-sbox .sh-sb i { background: var(--ec-muted); opacity: .85; }
  body[data-nx] .ec .nx-sbox .sh-sb-h i { top: 2px; height: 8px; border-radius: 4px; }
  body[data-nx] .ec .nx-sbox .sh-sb-v i { left: 2px; width: 8px; border-radius: 4px; }
  body[data-nx] .ec .nx-sbox .sh-sb:hover i, body[data-nx] .ec .nx-sbox .sh-sb.drag i { background: var(--ec-fg2); opacity: 1; }
  /* 시트가 든 상자: 얇은 선 · 둥근 모서리, 높이는 내용에 맞춘다(운영판 표 상자의 굵은 검은 선 · 남는 높이를 쓰지 않는다) */
  html body[data-nx] .ec.ec.ec .twrap:not(.split) > .tbox.tbox.tbox.nx-on.nx-on:has(> .nx-sheet):has(> .nx-sheet) { border: 1px solid var(--ec-line); border-radius: 6px; overflow: hidden; height: auto !important; min-height: 0 !important; max-height: none !important; flex: 0 0 auto !important; align-self: flex-start !important; width: 100%; }
  html body[data-nx] .ec .nx-rbwrap .sh-rb-tab[data-tab="file"] { display: none !important; }
  html body[data-nx] .ec .nx-rbwrap .sh-ribbon-host button, html body[data-nx] .ec .nx-rbwrap .sh-rb-label, html body[data-nx] .ec .nx-rbwrap .sh-rb-btn { line-height: 1.15; letter-spacing: 0; }
  html body[data-nx] .ec .nx-rbwrap .sh-rb-label, html body[data-nx] .ec .nx-rbwrap .sh-rb-btn span { white-space: nowrap; }
  body[data-nx] .ec .nx-sbar { background: var(--ec-panel); }
  body[data-nx] .ec .nx-sbar .nx-sbtn { height: 26px; min-height: 0; padding: 0 10px; font-size: 12px; }
  /* 리본 단추 글자: 겹치지 않게 한 줄 · 넘치면 자름 */
  body[data-nx] .ec .nx-sheet .sh-ribbon-host button, body[data-nx] .ec .nx-sheet .sh-ribbon-host .sh-rb-label { line-height: 1.2; letter-spacing: 0; }
  body[data-nx] .ec .nx-sheet .sh-ribbon-host .sh-rb-label, body[data-nx] .ec .nx-sheet .sh-ribbon-host button span { white-space: nowrap; overflow: hidden; text-overflow: clip; }
  /* 도구 단추(#nx-tools): 조회 줄 끝 한 개. 켜진 것(필터 · 서식)이 있으면 작은 점. 엑셀 메뉴 칸(.nx-rbwrap) · 고른 시트 표시 · 상태 줄은 고른 시트에만 */
  body[data-nx] .ec #nx-tools { flex: 0 0 auto; position: relative; padding-left: 12px; padding-right: 12px; }
  body[data-nx] .ec #nx-tools[hidden] { display: none; }
  body[data-nx] .ec #nx-tools.on::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--ec-brand, #ff7701); }
  body[data-nx] .ec #nx-tools[aria-expanded="true"] { background: var(--ec-hover); box-shadow: 0 0 0 1px var(--ec-line-strong); }
  body[data-nx] .ec .nx-rbwrap.sheet-app { height: auto; min-height: 0; overflow: visible; background: var(--ec-panel); border: 1px solid var(--ec-line); border-radius: 6px; margin-bottom: 8px; display: block; }
  body[data-nx] .ec .nx-rbwrap.sheet-app:not(:has(.sh-ribbon-host:not([hidden]))) { display: none; }
  /* 다시 그릴 때: 새 시트는 앞 시트(그림) 뒤에 숨겨 세우고, 다 그려지면 한 번에 바꾼다 */
  body[data-nx] .ec .nx-sheet.nx-pending { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
  body[data-nx] .ec .nx-sheet.nx-ghost { pointer-events: none; }
  /* 다시 그리는 동안 앞 모습 붙들기(nx-host.js veil): 새 시트가 다 그려질 때까지 앞 상자를 같은 자리에 그대로 둔다 */
  body[data-nx] .ec .nx-veil { position: absolute; z-index: 4; pointer-events: none; overflow: hidden; display: block; padding: 0; margin: 0; border: 0; background: transparent; }
  body[data-nx] .ec .nx-veil > .tbox { box-sizing: border-box; }
  /* 왼쪽 세부 메뉴 목록을 받는 동안의 "불러오는 중" 글은 안 보인다(자리만, 2026-11-13) */
  body[data-nx] #side [class$="-wait"], body[data-nx] #mside [class$="-wait"], body[data-nx] #side .dt-wait { visibility: hidden; }
  body[data-nx] .ec .nx-sheet.nx-active { box-shadow: inset 0 0 0 1px var(--ec-line-strong); }
  body[data-nx] .ec .nx-sheet.nx-inactive .sh-status { display: none; }
  /* 시트 아래 상태 줄: "준비" · 보기 단추 · 확대 막대 · 100% 는 숨기고 고른 칸의 합 · 개수만 남긴다 */
  body[data-nx] .ec .nx-sbox .sh-st-mode, body[data-nx] .ec .nx-sbox .sh-st-views, body[data-nx] .ec .nx-sbox .sh-st-zoom, body[data-nx] .ec .nx-sbox .sh-zoom-pct { display: none !important; }
  body[data-nx] .ec .nx-sbox .sh-status { height: 20px; font-size: 12px; }
  /* 빈 상태 줄은 숨긴다: 여러 칸을 골라 합 · 개수가 나올 때만 보인다(차장 2026-11-14 "밑단에 칸이 하나 더") */
  body[data-nx] .ec .nx-sbox .sh-status:not([data-has="1"]) { display: none; }
  /* 위아래로 바로 붙은 두 시트 사이 틈(전에는 빈 줄이 틈 노릇을 했다) */
  body[data-nx] .ec .dt.nx-on + .dt.nx-on { margin-top: 10px; }
  body[data-nx] .ec .nx-sbox .sh-st-stats { margin-right: 4px; }
  body[data-nx] .ec .nx-sheet .sh-tabs { display: none !important; }      /* 시트 탭 줄은 비어 있다(가로 막대는 격자가 직접 그린다) */
  body[data-nx] .ec .nx-rbwrap .nx-rb-off { opacity: .38; }
  html body[data-nx] .ec .nx-rbwrap .sh-rb-btn.sm .sh-rb-part, html body[data-nx] .ec .nx-rbwrap .sh-rb-btn.ic .sh-rb-part { flex-direction: row !important; }      /* 작은 리본 단추: 그림 옆에 글(운영판 글 규칙이 세로로 쌓던 것을 되돌림) */
}

/* 도구 메뉴(nx-boot 가 body 에 붙인다). 꺼진 상태(?nx=0)에서 새 화면으로 돌아오는 메뉴에도 쓰이므로 body[data-nx] 조건을 걸지 않는다 */
@media (min-width: 641px) {
  body .nx-tools-menu { position: fixed; z-index: 2000; min-width: 168px; padding: 4px; background: var(--ec-panel, #fff); border: 1px solid var(--ec-line-strong, #6f6a62); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); display: flex; flex-direction: column; gap: 1px; }
  body .nx-tools-menu button { display: block; width: 100%; text-align: left; height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ec-fg, inherit); font: 500 12px var(--ec-font, inherit); cursor: pointer; white-space: nowrap; }
  body .nx-tools-menu button:hover, body .nx-tools-menu button:focus-visible { background: var(--ec-hover, #efede9); outline: 0; }
  body .nx-tools-menu button:focus-visible { box-shadow: inset 0 0 0 1px var(--ec-line-strong, #6f6a62); }
  body .nx-tools-menu button.on { font-weight: 700; }
  body .nx-tools-menu button.on::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--ec-brand, #ff7701); vertical-align: middle; }
  body .nx-tools-menu .sep { height: 1px; margin: 3px 4px; background: var(--ec-line, #bdb8af); }
}

/* 글자 또렷하게(차장 2026-11-12 "글씨가 뿌옇다, 하얀색으로 명확하게"). 새 화면이 켜진 동안만, 회색 계열 글자 값(큰 메뉴 · 세부 메뉴 · 흐린 글 · 보조 글)을 한 자리에서 바꾼다.
   어둡게 = 본문 순수 흰색 · 회색도 밝게(명암비 7 이상) / 밝게 = 진한 글자색 · 회색도 진하게(명암비 5.5 이상). 값을 되돌리려면 이 블록만 지운다. 굵기 · 크기는 그대로 */
@media (min-width: 641px) {
  body[data-nx] { --ec-fg2: #141413; --ec-muted: #5f5c55; --ec-bar-dim: #e4e0d8; }
  body[data-nx] .ar-scope-card.on .asc-lbl { color: #a34700; }      /* 밝게: 주황 글자 명암비 2.4 → 5 */
}
@media (min-width: 641px) and (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body[data-nx] { --ec-fg2: #ffffff; --ec-muted: #c4c9d4; --ec-bar-dim: #dcdfe6; }
  html:not([data-theme="light"]) body[data-nx] .ar-scope-card.on .asc-lbl { color: var(--ec-brand, #ff7701); }
}
@media (min-width: 641px) {
  html[data-theme="dark"] body[data-nx] { --ec-fg2: #ffffff; --ec-muted: #c4c9d4; --ec-bar-dim: #dcdfe6; }
  html[data-theme="dark"] body[data-nx] .ar-scope-card.on .asc-lbl { color: var(--ec-brand, #ff7701); }
}
