/* Nesting viewer shell (specs/029-nesting-viewer): design tokens, theme, page layout, header, left
   panel (판 · 부품 · 결맞춤), right panel, status bar, edited-layout band, empty state, drop zone,
   progress, toasts, menus, dialogs and the print sheet. The sheet stylesheet (nesting_viewer_sheet.css)
   styles its own internals with the --nv-* tokens defined here. The shell sets <html data-theme>
   before the sheet mounts; dark values are keyed on :root[data-theme="dark"]. Same design language
   as /nc-viewer (44 px header, 28 px buttons, 12 px minimum Korean text). */

:root {
  color-scheme: light;
  --nv-bg: #eef2f6;
  --nv-panel: #ffffff;
  --nv-panel-2: #f5f7fa;
  --nv-border: #d8e0e9;
  --nv-border-soft: #e8edf3;
  /* Inputs and segmented controls: >= 3:1 against panels. */
  --nv-border-strong: #7d8799;
  --nv-text: #172033;
  --nv-text-dim: #566377;
  --nv-accent: #0d73d9;
  --nv-accent-strong: #0a5fb4;
  --nv-accent-soft: rgba(13, 115, 217, 0.11);
  --nv-accent-contrast: #ffffff;
  --nv-selected: rgba(13, 115, 217, 0.16);
  --nv-hover: rgba(23, 32, 51, 0.055);
  --nv-on-fill: #ffffff;
  --nv-danger: #c62f3a;
  --nv-warning: #8f5400;
  --nv-warning-soft: rgba(240, 165, 0, 0.14);
  --nv-success: #127556;
  /* The 판 화면 background around the cream sheet. */
  --nv-stage-bg: #e4e8ee;
  --nv-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --nv-mono: "SF Mono", SFMono-Regular, Menlo, Consolas, D2Coding, "Liberation Mono", monospace;
  /* Type scale: Korean text >= 12px; micro (11px) only for Latin / number chips. */
  --nv-fs-micro: 11px;
  --nv-fs-sm: 12px;
  --nv-fs-md: 13px;
  --nv-fs-lg: 14px;
  --nv-fs-xl: 18px;
  --nv-fw-regular: 400;
  --nv-fw-medium: 500;
  --nv-fw-semibold: 600;
  --nv-fw-bold: 700;
  --nv-radius: 6px;
  --nv-header-h: 44px;
  --nv-band-h: 36px;
  --nv-status-h: 26px;
  --nv-left-w: 300px;
  --nv-right-w: 300px;
  --nv-shadow: 0 10px 28px rgba(15, 23, 42, 0.14), 0 1px 3px rgba(15, 23, 42, 0.08);
  --nv-focus-color: var(--nv-accent);
  /* Sheet colours echoed in the help legend (nv/model COLORS; the sheet itself never changes colour). */
  --nv-sheet-cream: #fff2d4;
  --nv-part-tan: #e3b98a;
  --nv-cut-green: #14853b;
  --nv-origin-red: #d42a2a;
  /* D2 §4.2: panel-saw tag colour (cards · sheet tag · legend), the neutral yield bar, playback
     yellow (same values as /nc-viewer PLAYBACK_COLORS) and 「드래그 안함」 off (끌어 옮길 수 있음). */
  --nv-saw: #5b4a32;
  --nv-util: color-mix(in srgb, var(--nv-text-dim) 70%, transparent);
  --nv-play: #f5b700;
  --nv-play-outline: #111827;
  --nv-unlocked: #a84c00;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --nv-bg: #0c1016;
  --nv-panel: #141a22;
  --nv-panel-2: #19202a;
  --nv-border: #29323e;
  --nv-border-soft: #1f2731;
  --nv-border-strong: #5d6b7e;
  --nv-text: #e1e7ef;
  --nv-text-dim: #95a1b2;
  --nv-accent: #3d95f2;
  --nv-accent-strong: #6aaff5;
  --nv-accent-soft: rgba(61, 149, 242, 0.17);
  --nv-accent-contrast: #0b1220;
  --nv-selected: rgba(61, 149, 242, 0.24);
  --nv-hover: rgba(255, 255, 255, 0.055);
  --nv-on-fill: #0b1220;
  --nv-danger: #f06a74;
  --nv-warning: #f0b03c;
  --nv-warning-soft: rgba(240, 176, 60, 0.14);
  --nv-success: #3ccb92;
  --nv-stage-bg: #10151c;
  --nv-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
  --nv-saw: #e6c47a;
  --nv-play: #ffd23f;
  --nv-unlocked: #f0a050;
}

/* ------------------------------------------------------------------ base */

html,
body.nesting-viewer {
  height: 100%;
  margin: 0;
}

body.nesting-viewer {
  overflow: hidden;
  background: var(--nv-bg);
  color: var(--nv-text);
  font: var(--nv-fs-md)/1.45 var(--nv-font);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Menus and dialogs live on <body>, outside #nv-app: the base rules cover them too. */
body.nesting-viewer *,
body.nesting-viewer *::before,
body.nesting-viewer *::after {
  box-sizing: border-box;
}
body.nesting-viewer [hidden] {
  display: none !important;
}
body.nesting-viewer :focus-visible {
  outline: 2px solid var(--nv-focus-color);
  outline-offset: 2px;
}
body.nesting-viewer ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
body.nesting-viewer ::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 10px;
  background: color-mix(in srgb, var(--nv-text-dim) 60%, transparent) padding-box;
}
body.nesting-viewer ::-webkit-scrollbar-track {
  background: transparent;
}

.nv-mono {
  font-family: var(--nv-mono);
  font-size: var(--nv-fs-sm);
  font-variant-numeric: tabular-nums;
}
.nv-muted {
  color: var(--nv-text-dim);
}
.nv-small {
  font-size: var(--nv-fs-sm);
}
.nv-nowrap {
  white-space: nowrap;
}

.nv-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  line-height: 0;
}
.nv-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- layout */

#nv-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
}

#nv-main {
  position: relative;
  display: grid;
  grid-template-columns: var(--nv-left-w) 4px minmax(0, 1fr) 4px var(--nv-right-w);
  min-width: 0;
  min-height: 0;
}
/* Explicit columns: a folded panel (display: none) must not shift the others. */
#nv-left {
  grid-column: 1;
}
#nv-left-resizer {
  grid-column: 2;
}
#nv-stage {
  grid-column: 3;
}
#nv-right-resizer {
  grid-column: 4;
}
#nv-right {
  grid-column: 5;
}
#nv-main[data-left="collapsed"] {
  grid-template-columns: 0 0 minmax(0, 1fr) 4px var(--nv-right-w);
}
#nv-main:is([data-right="collapsed"], [data-right="drawer"]) {
  grid-template-columns: var(--nv-left-w) 4px minmax(0, 1fr) 0 0;
}
#nv-main[data-left="collapsed"]:is([data-right="collapsed"], [data-right="drawer"]) {
  grid-template-columns: 0 0 minmax(0, 1fr) 0 0;
}
#nv-main[data-left="collapsed"] :is(#nv-left, #nv-left-resizer),
#nv-main[data-right="collapsed"] :is(#nv-right, #nv-right-resizer),
#nv-main[data-right="drawer"] #nv-right-resizer {
  display: none;
}
/* Narrow windows: the right panel opens over the stage (the sheet keeps its size and place). */
#nv-main[data-right="drawer"] #nv-right {
  position: absolute;
  z-index: 25;
  top: 0;
  right: 0;
  bottom: 0;
  grid-column: 1 / -1;
  width: min(var(--nv-right-w), calc(100% - 48px));
  border-left: 1px solid var(--nv-border);
  box-shadow: var(--nv-shadow);
}

#nv-left,
#nv-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--nv-panel);
}

#nv-stage {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--nv-stage-bg);
}
#nv-sheet {
  position: absolute;
  inset: 0;
}
#nv-app[data-state="empty"] #nv-sheet {
  visibility: hidden;
}

#nv-left-resizer,
#nv-right-resizer {
  position: relative;
  z-index: 5;
  cursor: col-resize;
  touch-action: none;
  background: linear-gradient(to right, transparent 1.5px, var(--nv-border) 1.5px, var(--nv-border) 2.5px, transparent 2.5px);
  transition: background-color 0.12s;
}
/* The line stays 4px; the grab area is 12px. */
#nv-left-resizer::before,
#nv-right-resizer::before {
  content: "";
  position: absolute;
  inset: 0 -4px;
}
#nv-left-resizer:hover,
#nv-right-resizer:hover,
#nv-left-resizer.is-dragging,
#nv-right-resizer.is-dragging,
#nv-left-resizer:focus-visible,
#nv-right-resizer:focus-visible {
  background: var(--nv-accent);
  outline-offset: -2px;
}
body.nv-resizing,
body.nv-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* ---------------------------------------------------------------- header */

#nv-header {
  position: relative;
  z-index: 30;
  min-width: 0;
  background: var(--nv-panel);
  border-bottom: 1px solid var(--nv-border);
}

.nv-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--nv-header-h);
  padding: 0 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.nv-toolbar::-webkit-scrollbar {
  display: none;
}
.nv-toolbar-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.nv-brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 4px;
  border-radius: var(--nv-radius);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.nv-brand:hover .nv-brand-prisme {
  color: var(--nv-accent-strong);
}
.nv-brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--nv-border);
}
.nv-brand-name {
  font-size: var(--nv-fs-lg);
  font-weight: var(--nv-fw-semibold);
  letter-spacing: -0.01em;
}
.nv-brand-prisme {
  font-weight: var(--nv-fw-bold);
  letter-spacing: 0.01em;
}
.nv-env {
  flex: none;
  padding: 1px 7px;
  border: 1px solid var(--nv-border-strong);
  border-radius: 999px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
  white-space: nowrap;
}
.nv-env:not([data-environment="production"]) {
  border-color: color-mix(in srgb, var(--nv-warning) 55%, transparent);
  background: color-mix(in srgb, var(--nv-warning) 12%, transparent);
  color: var(--nv-warning);
}

.nv-toolgroup {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--nv-border);
}
.nv-brand + .nv-toolgroup,
.nv-env + .nv-toolgroup,
.nv-toolgroup-end {
  padding-left: 0;
  border-left: 0;
}
.nv-toolgroup-label {
  margin-right: 2px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  white-space: nowrap;
}

.nv-btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  min-width: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--nv-radius);
  background: transparent;
  color: var(--nv-text);
  font: inherit;
  font-weight: var(--nv-fw-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.1s, border-color 0.1s, color 0.1s;
}
.nv-btn:hover:not(:disabled) {
  background: var(--nv-hover);
}
.nv-btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--nv-text) 10%, transparent);
}
.nv-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.nv-btn[aria-expanded="true"] {
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
}
.nv-btn:not(:has(.nv-btn-label)) {
  width: 28px;
  padding: 0;
}
.nv-btn-primary {
  border-color: var(--nv-accent);
  background: var(--nv-accent);
  color: var(--nv-accent-contrast);
}
.nv-btn-primary:hover:not(:disabled) {
  border-color: var(--nv-accent-strong);
  background: var(--nv-accent-strong);
}
.nv-btn-primary[aria-expanded="true"] {
  background: var(--nv-accent-strong);
  color: var(--nv-accent-contrast);
}
.nv-btn-primary .nv-btn-caret {
  color: inherit;
}
.nv-btn-danger {
  border-color: var(--nv-danger);
  background: var(--nv-danger);
  color: var(--nv-on-fill);
}
.nv-btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--nv-danger) 85%, #000);
}
.nv-btn-ghost {
  border-color: var(--nv-border);
}
.nv-btn-sm {
  height: 24px;
  min-width: 24px;
  padding: 0 8px;
  font-size: var(--nv-fs-sm);
}
.nv-btn-lg {
  height: 36px;
  padding: 0 16px;
  font-size: var(--nv-fs-lg);
}
.nv-btn-link {
  height: auto;
  min-height: 24px;
  padding: 2px 4px;
  color: var(--nv-accent-strong);
  font-weight: var(--nv-fw-medium);
  white-space: normal;
  text-align: left;
}
.nv-btn-link:hover:not(:disabled) {
  background: var(--nv-accent-soft);
}
.nv-btn-caret {
  width: 13px;
  height: 13px;
  margin-left: -2px;
  color: var(--nv-text-dim);
}
.nv-btn-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--nv-panel);
  border-radius: 50%;
  background: var(--nv-accent);
}
.nv-btn-renest.is-dirty {
  border-color: color-mix(in srgb, var(--nv-accent) 55%, transparent);
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
}

.nv-segmented {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--nv-border-strong);
  border-radius: var(--nv-radius);
  overflow: hidden;
}
.nv-segmented .nv-btn {
  height: 26px;
  border: 0;
  border-radius: 0;
}
.nv-segmented .nv-btn + .nv-btn {
  border-left: 1px solid var(--nv-border);
}
.nv-segmented .nv-btn.is-on {
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
  font-weight: var(--nv-fw-semibold);
}
/* Before a job the 조작 group is off: no mode looks chosen yet (D2-10). */
.nv-segmented .nv-btn.is-on:disabled {
  background: transparent;
  color: var(--nv-text);
  font-weight: var(--nv-fw-medium);
}
/* 「드래그 안함」 (D2-10): a switch after a divider, not a third 「chosen」 mode. On (locked, the
   default): closed lock, quiet grey dot; off: open lock and an orange dot — parts can be dragged. */
.nv-toolsep {
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 6px 4px;
  background: var(--nv-border);
}
.nv-btn-lock {
  gap: 6px;
  padding-left: 8px;
  border-color: var(--nv-border-strong);
  background: var(--nv-panel-2);
  color: var(--nv-text);
}
.nv-btn-lock .nv-lock-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nv-text-dim);
}
.nv-btn-lock.is-unlocked {
  border-color: color-mix(in srgb, var(--nv-unlocked) 55%, transparent);
  background: transparent;
}
.nv-btn-lock.is-unlocked .nv-lock-dot {
  background: var(--nv-unlocked);
}
.nv-btn-lock.is-unlocked .nv-icon {
  color: var(--nv-unlocked);
}
.nv-btn-lock svg .nv-shackle-open,
.nv-btn-lock.is-unlocked svg .nv-shackle-closed {
  display: none;
}
.nv-btn-lock.is-unlocked svg .nv-shackle-open {
  display: inline;
}
.nv-btn-zoom {
  min-width: 58px;
  padding: 0 6px;
  font-family: var(--nv-mono);
  font-size: var(--nv-fs-sm);
  font-variant-numeric: tabular-nums;
}

/* Compact steps (fitHeader): labels give way when the bar overflows — the 조작 모드 caption first,
   then 전체 맞춤 · 인쇄, the mode labels, 다시 배치 · 설정, and last the brand words and 드래그 안함.
   「CSV」 keeps its word (a bare download arrow does not say 「배치 CSV」, D1-25). */
.nv-toolbar:not([data-compact="0"]) .nv-toolgroup-label,
.nv-toolbar:is([data-compact="2"], [data-compact="3"], [data-compact="4"], [data-compact="5"]) :is(.nv-btn-fit, .nv-btn-print) :is(.nv-btn-label, .nv-btn-caret),
.nv-toolbar:is([data-compact="3"], [data-compact="4"], [data-compact="5"]) .nv-btn-seg .nv-btn-label,
.nv-toolbar:is([data-compact="4"], [data-compact="5"]) :is(.nv-btn-renest, .nv-btn-settings) .nv-btn-label,
.nv-toolbar[data-compact="5"] :is(.nv-brand-name, .nv-btn-lock .nv-btn-label) {
  display: none;
}
.nv-toolbar:is([data-compact="2"], [data-compact="3"], [data-compact="4"], [data-compact="5"]) :is(.nv-btn-fit, .nv-btn-print) {
  width: 28px;
  padding: 0;
}

/* Edited-layout band under the toolbar. */
.nv-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 12px;
  border-top: 1px solid color-mix(in srgb, var(--nv-warning) 35%, transparent);
  background: var(--nv-warning-soft);
  color: var(--nv-text);
  font-weight: var(--nv-fw-medium);
}
.nv-banner-icon {
  color: var(--nv-warning);
}
.nv-banner-sep {
  color: var(--nv-text-dim);
}
.nv-banner-issues {
  color: var(--nv-warning);
  font-weight: var(--nv-fw-semibold);
}
.nv-banner-issues.is-error {
  color: var(--nv-danger);
}
.nv-banner-ok {
  color: var(--nv-success);
  font-weight: var(--nv-fw-semibold);
}
/* A check answered: the band blinks once (no toast). */
.nv-banner.is-flash {
  animation: nv-banner-flash 0.9s ease-out;
}
@keyframes nv-banner-flash {
  0% {
    background: color-mix(in srgb, var(--nv-warning) 34%, transparent);
  }
}
.nv-banner .nv-btn {
  margin-left: 6px;
  border-color: var(--nv-border-strong);
  background: var(--nv-panel);
}
/* 「오류 N ›」 · 「경고 M ›」: each press goes to the next problem part. */
.nv-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 12px;
  background: var(--nv-panel);
  font: inherit;
  font-weight: var(--nv-fw-semibold);
  cursor: pointer;
}
.nv-banner-link:hover {
  background: color-mix(in srgb, currentColor 10%, var(--nv-panel));
}
.nv-banner-next {
  font-weight: var(--nv-fw-bold);
}
.nv-banner-spacer {
  flex: 1 1 auto;
}
.nv-banner .nv-banner-undo {
  margin-left: 0;
  font-weight: var(--nv-fw-semibold);
}

/* ---------------------------------------------------------------- menus */

.nv-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 4px;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
  color: var(--nv-text);
  font: var(--nv-fs-md)/1.4 var(--nv-font);
}
.nv-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nv-menu-item:hover,
.nv-menu-item:focus-visible {
  background: var(--nv-accent-soft);
  outline-offset: -2px;
}
.nv-menu-label {
  flex: 1 1 auto;
}
.nv-menu-hint {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}

/* ---------------------------------------------------------------- left panel */

.nv-tabs {
  display: flex;
  flex: none;
  height: var(--nv-band-h);
  padding: 0 6px;
  border-bottom: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
}
.nv-tabs-row {
  display: flex;
  flex: none;
  align-items: stretch;
  border-bottom: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
}
.nv-tabs-row .nv-tabs {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
}
.nv-panel-collapse {
  flex: none;
  align-self: center;
  width: 28px;
  margin-right: 6px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--nv-text-dim);
}
.nv-panel-collapse:hover:not(:disabled) {
  color: var(--nv-text);
}
.nv-tab {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--nv-text-dim);
  font: inherit;
  font-weight: var(--nv-fw-semibold);
  cursor: pointer;
}
.nv-tab:hover {
  color: var(--nv-text);
}
.nv-tab[aria-selected="true"] {
  color: var(--nv-accent-strong);
}
.nv-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--nv-accent);
}
.nv-tab:focus-visible {
  outline-offset: -3px;
}
.nv-tab-count {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-micro);
  font-weight: var(--nv-fw-medium);
  font-variant-numeric: tabular-nums;
}
.nv-tab-count:empty {
  display: none;
}

.nv-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.nv-panel-tools {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--nv-border-soft);
}
.nv-empty-note {
  margin: 0;
  padding: 16px 12px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  text-align: center;
}

/* 판 */
.nv-sheet-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  container-type: inline-size;
}
/* A narrow left panel (240 px at <= 1280): smaller thumbnails leave the card text its room. */
@container (max-width: 250px) {
  .nv-sheet-card {
    gap: 8px;
  }
  .nv-sheet-card .nv-thumb {
    width: 84px;
  }
}
.nv-sheet-group + .nv-sheet-group {
  margin-top: 12px;
}
/* RD-B-05: the material head stays at the top of the list while its sheets scroll under it (the list's
   8 px top padding is the -8 px). */
.nv-sheet-group-title {
  position: sticky;
  top: -8px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
  margin: 0 0 6px;
  padding: 6px 2px 4px;
  background: var(--nv-panel);
  box-shadow: 0 1px 0 var(--nv-border);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-regular);
}
.nv-sheet-group-name {
  font-size: var(--nv-fs-md);
  font-weight: var(--nv-fw-semibold);
}
.nv-sheet-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* A card scrolled into view (the open sheet, ↑↓) clears the sticky material head above it. */
.nv-sheet-group-body > .nv-sheet-card {
  scroll-margin-top: 44px;
}
.nv-sheet-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  background: var(--nv-panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nv-sheet-card:hover {
  border-color: var(--nv-border-strong);
}
.nv-sheet-card.is-active {
  border-color: var(--nv-accent);
  background: var(--nv-accent-soft);
  box-shadow: inset 0 0 0 1px var(--nv-accent);
}
/* A card with hand-edit problems: a coloured edge (and the yield bar takes that colour too). */
.nv-sheet-card.has-issues {
  box-shadow: inset 3px 0 0 var(--nv-warning);
}
.nv-sheet-card.has-errors {
  box-shadow: inset 3px 0 0 var(--nv-danger);
}
.nv-sheet-card.is-active.has-issues {
  box-shadow: inset 0 0 0 1px var(--nv-accent), inset 4px 0 0 var(--nv-warning);
}
.nv-sheet-card.is-active.has-errors {
  box-shadow: inset 0 0 0 1px var(--nv-accent), inset 4px 0 0 var(--nv-danger);
}
.nv-card-issues {
  color: var(--nv-warning);
  font-weight: var(--nv-fw-semibold);
}
.nv-card-issues.is-error {
  color: var(--nv-danger);
}
.nv-thumb {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-height: 40px;
  border-radius: 4px;
  background: var(--nv-stage-bg);
  overflow: hidden;
}
.nv-thumb svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.nv-sheet-card-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  container-type: inline-size;
}
/* Narrow cards: 「2440 × 1220 · 무늬 없음」 on one line (the full text is the line's title). */
@container (max-width: 170px) {
  .nv-card-unit {
    display: none;
  }
}
.nv-sheet-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--nv-fw-semibold);
}
/* 「16번 판」: the whole-job number, the one written everywhere (D1-15). */
.nv-sheet-card-no {
  font-size: var(--nv-fs-lg);
  font-weight: var(--nv-fw-bold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 「보르떼 화이트 18T · 7/9」: the name takes up to two lines and gives way (…) before the thickness and the
   count do (RD-B-05 · RD-A-11: 「소재 미확인 · 도어」 keeps its role, 「라임스톤베이지 바… 18T」 its thickness). */
.nv-sheet-card-material {
  display: flex;
  align-items: last baseline;
  min-width: 0;
  font-size: var(--nv-fs-sm);
  white-space: nowrap;
}
.nv-sheet-card-material-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nv-sheet-card-thickness {
  flex: none;
  margin-left: 0.3em;
  font-variant-numeric: tabular-nums;
}
.nv-sheet-card-material-no {
  flex: none;
  color: var(--nv-text-dim);
  font-variant-numeric: tabular-nums;
}
/* RD-B-01 · VR-14: 「결 정보 없음」 on a card is grey small text (the card line's own); the material head says it once in
   orange (.nv-sheet-group-grain). */
.nv-card-grain.is-assumed {
  color: var(--nv-text-dim);
  font-weight: var(--nv-fw-regular);
}
.nv-sheet-group-grain.is-assumed {
  display: inline-block;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--nv-warning-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-warning) 45%, transparent);
  color: var(--nv-warning);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
  line-height: 18px;
  white-space: nowrap;
}
/* A sheet the last re-nest changed, until it is opened (D1-06). */
.nv-sheet-changed {
  display: none;
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--nv-accent);
  box-shadow: 0 0 0 2px var(--nv-accent-soft);
}
.nv-sheet-card.is-changed .nv-sheet-changed {
  display: inline-block;
}
/* 「판넬쏘」 sheet cards, 「옛」 (old Connector group name) groups. */
.nv-tag.nv-tag-saw,
.nv-tag.nv-tag-legacy {
  flex: none;
  margin-left: 2px;
  font-weight: var(--nv-fw-medium);
  line-height: 16px;
}
.nv-tag.nv-tag-legacy {
  margin: 0 4px 0 0;
  padding: 0 5px;
}
.nv-hint.nv-hint-warning {
  border-color: color-mix(in srgb, var(--nv-warning) 40%, transparent);
  background: var(--nv-warning-soft);
  color: var(--nv-text);
}
.nv-tag.nv-tag-saw {
  background: color-mix(in srgb, #7a5a14 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #7a5a14 40%, transparent);
  color: #6d4f10;
}
:root[data-theme="dark"] .nv-tag.nv-tag-saw {
  color: #e6c47a;
}
.nv-util {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nv-util-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 3px;
  background: var(--nv-border);
  overflow: hidden;
}
/* Yield is neutral; only problems colour it (D2-11). */
.nv-util-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--nv-util);
}
.nv-sheet-card.has-issues .nv-util-fill {
  background: var(--nv-warning);
}
.nv-sheet-card.has-errors .nv-util-fill {
  background: var(--nv-danger);
}
.nv-util-text {
  flex: none;
  min-width: 46px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.nv-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
}
.nv-card-warning {
  border-color: color-mix(in srgb, var(--nv-warning) 45%, transparent);
  background: var(--nv-warning-soft);
}
.nv-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--nv-fw-semibold);
}
.nv-card-warning .nv-card-title .nv-icon {
  color: var(--nv-warning);
}
.nv-card-text {
  margin: 0;
  font-size: var(--nv-fs-sm);
}
.nv-card .nv-btn-link {
  align-self: flex-start;
}

/* tables (부품 · 결맞춤 · 설정) */
.nv-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.nv-group-wrap {
  flex: 1 1 40%;
}
.nv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nv-fs-sm);
}
.nv-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 5px 6px;
  border-bottom: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
  color: var(--nv-text-dim);
  font-weight: var(--nv-fw-semibold);
  text-align: left;
  white-space: nowrap;
}
.nv-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--nv-border-soft);
  vertical-align: middle;
}
.nv-table tbody tr[tabindex] {
  cursor: pointer;
}
.nv-table tbody tr[tabindex]:hover {
  background: var(--nv-hover);
}
.nv-table tbody tr.is-selected {
  background: var(--nv-selected);
}
.nv-table tbody tr:focus-visible {
  outline-offset: -2px;
}
.nv-table .nv-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.nv-table .nv-center {
  text-align: center;
}
.nv-table .nv-name {
  max-width: 140px;
  font-weight: var(--nv-fw-medium);
}
.nv-table .nv-dim-text {
  overflow: hidden;
  color: var(--nv-text-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--nv-accent);
  cursor: pointer;
}
.nv-part-table {
  table-layout: fixed;
}
.nv-part-table .nv-col-order {
  width: 50px; /* room for 「12-34」 and the two-pass 「2」 (REV-FU-13) */
}
.nv-part-table .nv-col-size {
  width: 72px;
}
.nv-part-table .nv-col-status {
  width: 62px;
}
.nv-part-table .nv-order {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Sortable headers. */
.nv-sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.nv-num .nv-sort {
  justify-content: flex-end;
  width: 100%;
}
.nv-sort:hover,
.nv-sort.is-on {
  color: var(--nv-accent-strong);
}
.nv-sort-mark {
  font-size: 9px;
}
.nv-part-table th,
.nv-part-table td {
  padding-right: 4px;
  padding-left: 4px;
}
.nv-part-table .nv-name {
  max-width: none;
}
.nv-group-table {
  table-layout: fixed;
}
.nv-group-table .nv-col-no {
  width: 30px;
}
.nv-group-table .nv-col-prefix {
  width: 46px;
}
.nv-group-table .nv-col-cells {
  width: 24px;
}
.nv-group-table .nv-col-status {
  width: 60px;
}
.nv-group-table .nv-col-keep {
  width: 36px;
}
.nv-group-table th,
.nv-group-table td {
  padding-right: 4px;
  padding-left: 4px;
}
.nv-group-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-group-table .nv-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* One-cell groups: after a divider, dimmed (nothing to keep together). */
.nv-group-table tr.nv-group-sep td {
  padding-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
}
.nv-group-table tr.is-single td {
  color: var(--nv-text-dim);
}
.nv-group-table tr.is-single .nv-tag {
  opacity: 0.8;
}
.nv-name-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}
.nv-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-name-sub {
  display: block;
  overflow: hidden;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-name-wrap .nv-cell-badge {
  flex: none;
  margin-right: 0;
}
.nv-part-table tr.is-problem td:first-child {
  box-shadow: inset 3px 0 0 var(--nv-warning);
}
.nv-status-cell .nv-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-status-ok {
  display: inline-flex;
  color: var(--nv-text-dim);
}
.nv-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--nv-panel-2);
  box-shadow: inset 0 0 0 1px var(--nv-border);
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  line-height: 18px;
  white-space: nowrap;
}
.nv-tag.is-warning {
  background: var(--nv-warning-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-warning) 40%, transparent);
  color: var(--nv-warning);
}
.nv-tag.is-error {
  background: color-mix(in srgb, var(--nv-danger) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-danger) 40%, transparent);
  color: var(--nv-danger);
}
.nv-tag.is-ok {
  background: color-mix(in srgb, var(--nv-success) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-success) 35%, transparent);
  color: var(--nv-success);
}
.nv-cell-badge {
  display: inline-block;
  margin: 0 4px;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, #a0523c 55%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, #f6e3cf 70%, transparent);
  color: #137a2f;
  font-size: var(--nv-fs-micro);
  font-weight: var(--nv-fw-bold);
  line-height: 16px;
}
:root[data-theme="dark"] .nv-cell-badge {
  background: rgba(60, 203, 146, 0.12);
  color: #5fd39a;
}

.nv-search-wrap {
  position: relative;
  flex: 1 1 100%;
}
.nv-search-icon {
  position: absolute;
  top: 50%;
  left: 8px;
  margin-top: -8px;
  color: var(--nv-text-dim);
}
.nv-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--nv-border-strong);
  border-radius: var(--nv-radius);
  background: var(--nv-panel);
  color: var(--nv-text);
  font: inherit;
}
.nv-input:focus-visible {
  outline-offset: 0;
}
.nv-search {
  width: 100%;
  padding-left: 30px;
}
.nv-input[aria-invalid="true"] {
  border-color: var(--nv-danger);
  box-shadow: 0 0 0 1px var(--nv-danger);
}
.nv-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  cursor: pointer;
  user-select: none;
}
.nv-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--nv-accent);
}

.nv-hint {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 8px 10px 0;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--nv-accent) 35%, transparent);
  border-radius: 7px;
  background: var(--nv-accent-soft);
  font-size: var(--nv-fs-sm);
}

/* 결맞춤 preview */
.nv-group-preview {
  flex: none;
  max-height: 55%;
  padding: 10px;
  border-top: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
  overflow-y: auto;
}
.nv-group-preview .nv-empty-note {
  padding: 8px 4px;
}
.nv-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-bottom: 6px;
}
.nv-preview-figure {
  display: flex;
  justify-content: center;
  padding: 6px;
  border: 1px solid var(--nv-border);
  border-radius: 6px;
  background: var(--nv-stage-bg);
}
.nv-preview-figure:empty {
  display: none;
}
.nv-preview-figure svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.nv-verdict {
  margin: 8px 0 4px;
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
}
.nv-verdict.is-ok {
  color: var(--nv-success);
}
.nv-verdict.is-warning {
  color: var(--nv-warning);
}
.nv-cell-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--nv-fs-sm);
}
.nv-cell-list li {
  padding: 1px 0;
}
.nv-cell-list .nv-cell-badge {
  margin-left: 0;
}
/* Each cell goes to its part on the sheet. */
.nv-cell-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  width: 100%;
  min-height: 26px;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nv-cell-item:hover {
  background: var(--nv-hover);
}
.nv-cell-item.is-selected {
  background: var(--nv-selected);
}
.nv-cell-where {
  margin-left: auto;
  color: var(--nv-accent-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* What 결맞춤 is for, under the 정면 · 판 위 views. */
.nv-preview-caption {
  margin: 6px 2px 0;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  line-height: 1.45;
}
/* Read out, not shown (the group verdict's live line). */
.nv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- right panel */

.nv-right-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: var(--nv-band-h);
  padding: 6px 6px 6px 12px;
  border-bottom: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
}
.nv-right-heading {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.nv-right-head .nv-panel-collapse {
  margin-right: 0;
}
.nv-right-title {
  margin: 0;
  overflow: hidden;
  font-size: var(--nv-fs-lg);
  font-weight: var(--nv-fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-right-sub {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  overflow-wrap: anywhere;
}
.nv-right-sub:empty {
  display: none;
}
.nv-right-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 12px 16px;
  overflow-y: auto;
}
.nv-right-tools {
  padding-top: 6px;
}
.nv-loading-sequence {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0;
}
.nv-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--nv-border-soft);
}
.nv-section:last-child {
  border-bottom: 0;
}
.nv-section-title {
  margin: 4px 0 6px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
  letter-spacing: 0.02em;
}
.nv-props {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: var(--nv-fs-md);
}
.nv-props dt {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  line-height: 1.6;
}
.nv-props dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.nv-props dd .nv-btn-link {
  margin: -2px -4px;
}
.nv-material-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nv-material-list li {
  padding: 2px 0;
}
.nv-material-list li + li {
  margin-top: 2px;
}
/* 「던 오크 18T 7장」: goes to that material's first sheet. */
.nv-material-link {
  display: inline;
  margin: 0 -4px;
  padding: 1px 4px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--nv-accent-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nv-material-link:hover {
  background: var(--nv-accent-soft);
}
.nv-material-sub {
  display: block;
}

/* Job summary head (D2-09): 2 × 2 tiles, numbers first. */
.nv-summary-head {
  padding-top: 10px;
}
.nv-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.nv-kpi {
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  background: var(--nv-panel-2);
  color: inherit;
  font: inherit;
  text-align: left;
}
.nv-kpi.is-link {
  cursor: pointer;
}
.nv-kpi.is-link:hover {
  border-color: var(--nv-border-strong);
}
/* RD-B-11: a long value in a narrow tile (「17개 · 14.5 m²」 at 1440 × 900) wraps between words instead of losing its unit. */
.nv-kpi-value {
  overflow: hidden;
  font-size: var(--nv-fs-xl);
  font-weight: var(--nv-fw-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  text-wrap: balance;
}
.nv-kpi-label {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-kpi.is-warning {
  border-color: color-mix(in srgb, var(--nv-warning) 45%, transparent);
  background: var(--nv-warning-soft);
}
.nv-kpi.is-warning .nv-kpi-value {
  color: var(--nv-warning);
}
.nv-kpi.is-error {
  border-color: color-mix(in srgb, var(--nv-danger) 45%, transparent);
  background: color-mix(in srgb, var(--nv-danger) 9%, var(--nv-panel));
}
.nv-kpi.is-error .nv-kpi-value {
  color: var(--nv-danger);
}
.nv-summary-state {
  margin: 8px 0 0;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}

/* 「파일 정보」: CSV · 커넥터 · 가공 파일 · 건너뛴 파일, folded. */
.nv-file-info {
  padding: 4px 0;
}
.nv-file-info-summary {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 0 6px 18px;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.nv-file-info-summary::-webkit-details-marker {
  display: none;
}
.nv-file-info-summary::before {
  content: "▸";
  position: absolute;
  top: 7px;
  left: 2px;
  color: var(--nv-text-dim);
}
.nv-file-info[open] > .nv-file-info-summary::before {
  content: "▾";
}
.nv-file-info-title {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
}
.nv-file-info-sub {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  overflow-wrap: anywhere;
}
.nv-file-info > .nv-section:last-child {
  border-bottom: 0;
}
.nv-skipped-list li > .nv-muted.nv-small {
  display: block;
}

/* An unplaced part's second line (why, and what helps). */
.nv-unplaced-note {
  margin: 0 0 4px;
}

/* 「톱 절단 순서」 of the panel-saw sheet on screen (U-05). */
.nv-saw-note {
  margin: 0 0 6px;
}
.nv-saw-wrap {
  max-height: 340px;
  border: 1px solid var(--nv-border);
  border-radius: 6px;
  overflow-y: auto;
}
.nv-saw-table {
  width: 100%;
  table-layout: fixed;
}
.nv-saw-table .nv-col-saw-no {
  width: 40px;
}
.nv-saw-table .nv-col-saw-cut {
  width: 58%;
}
.nv-saw-table td {
  vertical-align: top;
}
.nv-saw-table tbody tr {
  cursor: pointer;
}
.nv-saw-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 11px;
  background: var(--nv-saw-color, var(--nv-saw));
  color: #ffffff;
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-bold);
  font-variant-numeric: tabular-nums;
}
.nv-saw-cut {
  display: block;
  font-weight: var(--nv-fw-medium);
  white-space: nowrap;
}
.nv-saw-sub {
  display: block;
  white-space: nowrap;
}
.nv-saw-freed {
  overflow-wrap: anywhere;
}
.nv-saw-part {
  display: block;
  margin: 0 -3px;
  padding: 0 3px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--nv-accent-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nv-saw-part:hover {
  background: var(--nv-accent-soft);
}
.nv-saw-part-name {
  font-weight: var(--nv-fw-medium);
}

/* Which settings made the layout: 「커넥터 설정」 (the job's output_options.json) or 「뷰어 설정」. */
.nv-source-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--nv-panel-2);
  box-shadow: inset 0 0 0 1px var(--nv-border);
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
  line-height: 18px;
  white-space: nowrap;
}
.nv-source-badge.is-connector {
  background: var(--nv-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-accent) 45%, transparent);
  color: var(--nv-accent-strong);
}
.nv-connector-settings {
  margin-bottom: 8px;
  padding: 8px 9px;
  border: 1px solid var(--nv-border-soft);
  border-radius: 7px;
  background: var(--nv-panel-2);
}
.nv-connector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.nv-connector-settings p {
  margin: 2px 0 0;
}
.nv-settings-source {
  margin: 0 0 10px;
}
.nv-settings-source-text {
  display: inline-flex;
  flex: 1 1 260px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

/* 「다른 CSV」: open the same files with another CSV. */
.nv-csv-choice {
  margin-top: 8px;
}
.nv-csv-choice-title {
  margin: 0 0 4px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-csv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nv-csv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--nv-border-soft);
}
.nv-csv-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
.nv-csv-path {
  font-family: var(--nv-mono);
  font-size: var(--nv-fs-sm);
  overflow-wrap: anywhere;
}
.nv-csv-item .nv-btn {
  flex: none;
}

/* What the Connector left out (excluded_items.json): nesting-relevant rows first, the rest quiet. */
.nv-excluded {
  margin-top: 8px;
}
.nv-excluded-head {
  margin: 0 0 4px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
}
.nv-excluded-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--nv-fs-sm);
}
.nv-excluded-list li {
  display: flex;
  flex-direction: column;
  padding: 3px 0 3px 8px;
  border-left: 3px solid var(--nv-border);
}
.nv-excluded-list li + li {
  margin-top: 3px;
}
.nv-excluded-list li.is-nesting {
  border-left-color: var(--nv-warning);
}
.nv-excluded-list li.is-quiet {
  color: var(--nv-text-dim);
}
.nv-excluded-labels {
  color: var(--nv-text-dim);
  overflow-wrap: anywhere;
}
.nv-diagnostics {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nv-diag {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 4px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--nv-fs-sm);
  text-align: left;
}
.nv-diag.is-link {
  cursor: pointer;
}
.nv-diag.is-link:hover {
  background: var(--nv-hover);
}
.nv-diag-icon {
  margin-top: 1px;
  color: var(--nv-accent);
}
.nv-diag-icon.is-warning {
  color: var(--nv-warning);
}
.nv-diag-icon.is-error {
  color: var(--nv-danger);
}
.nv-edges-wrap {
  display: flex;
  justify-content: center;
}
.nv-edges {
  max-width: 100%;
  height: auto;
  overflow: visible;
}
.nv-edges-part {
  fill: var(--nv-part-tan);
  stroke: #6b4a2b;
  stroke-width: 0.8;
}
.nv-edges-on {
  stroke: var(--nv-accent);
  stroke-width: 4;
  stroke-linecap: round;
}
.nv-edges-off {
  stroke: var(--nv-text-dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.nv-edges-text {
  fill: var(--nv-text);
  font: var(--nv-fw-semibold) 12px var(--nv-font);
}
.nv-edges-caption {
  margin: 4px 0 0;
  text-align: center;
}

/* ---------------------------------------------------------------- status bar */

#nv-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: var(--nv-status-h);
  padding: 0 10px;
  border-top: 1px solid var(--nv-border);
  background: var(--nv-panel-2);
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  white-space: nowrap;
}
.nv-status-main {
  overflow: hidden;
  color: var(--nv-text);
  text-overflow: ellipsis;
}
.nv-status-spacer {
  flex: 1 1 auto;
}
.nv-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
  font-weight: var(--nv-fw-medium);
}
.nv-status-chip.is-warning {
  background: var(--nv-warning-soft);
  color: var(--nv-warning);
}
.nv-status-chip.is-warning.is-error {
  background: color-mix(in srgb, var(--nv-danger) 13%, transparent);
  color: var(--nv-danger);
}
.nv-status-zoom {
  min-width: 52px;
  text-align: right;
}
.nv-status-source {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
}
.nv-status-link {
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--nv-accent-strong);
  font: inherit;
  cursor: pointer;
}
.nv-status-link:hover:not(:disabled) {
  background: var(--nv-accent-soft);
  text-decoration: underline;
}
.nv-status-link:disabled {
  color: var(--nv-text-dim);
  cursor: default;
}

/* ---------------------------------------------------------------- empty state, drop zone, progress */

.nv-empty {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
#nv-app[data-state="ready"] .nv-empty {
  display: none;
}
.nv-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(560px, 100%);
  padding: 28px 28px 20px;
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
  text-align: center;
}
.nv-empty-title {
  margin: 0;
  font-size: var(--nv-fs-xl);
  font-weight: var(--nv-fw-semibold);
}
.nv-empty-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 26px 16px;
  border: 2px dashed color-mix(in srgb, var(--nv-accent) 55%, var(--nv-border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--nv-accent) 5%, transparent);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.nv-empty-drop:hover {
  background: var(--nv-accent-soft);
}
.nv-empty-drop-icon {
  width: 36px;
  height: 36px;
  color: var(--nv-accent);
}
.nv-empty-drop-title {
  font-size: var(--nv-fs-lg);
  font-weight: var(--nv-fw-semibold);
}
.nv-empty-drop-text {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.nv-empty-steps {
  margin: 0;
  padding-left: 1.4em;
  color: var(--nv-text);
  font-size: var(--nv-fs-md);
  text-align: left;
}
.nv-empty-steps li {
  padding: 2px 0;
}
.nv-empty-error {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--nv-danger) 40%, var(--nv-border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--nv-danger) 7%, var(--nv-panel));
  text-align: left;
}
.nv-empty-error-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: var(--nv-fw-semibold);
}
.nv-empty-error-title .nv-icon {
  margin-top: 2px;
  color: var(--nv-danger);
}
.nv-empty-error-found {
  margin: 0 0 0 24px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
/* 「건너뛴 파일: broken.zip — ZIP을 읽지 못했습니다(…)」, one line per file (D4-12). */
.nv-empty-error-skipped {
  margin: 0 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: var(--nv-fs-sm);
  overflow-wrap: anywhere;
}
.nv-empty-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 24px;
}
.nv-empty-error-actions .nv-btn {
  border-color: var(--nv-border-strong);
}
.nv-empty-limit {
  margin: 0;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-empty-help {
  min-height: 24px;
  border: 0;
  background: none;
  color: var(--nv-accent-strong);
  font: inherit;
  font-size: var(--nv-fs-sm);
  cursor: pointer;
}

#nv-dropzone {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--nv-accent) 14%, rgba(15, 23, 42, 0.35));
  pointer-events: none;
}
.nv-dropzone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 48px;
  border: 2px dashed var(--nv-accent);
  border-radius: 14px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
}
.nv-dropzone-icon {
  width: 40px;
  height: 40px;
  color: var(--nv-accent);
}
.nv-dropzone-title {
  font-size: var(--nv-fs-xl);
  font-weight: var(--nv-fw-semibold);
}
.nv-dropzone-text {
  color: var(--nv-text-dim);
}

.nv-progress {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--nv-stage-bg) 70%, transparent);
}
.nv-progress-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(480px, calc(100% - 32px));
  padding: 16px 18px;
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
}
.nv-progress-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nv-progress-title {
  font-size: var(--nv-fs-lg);
  font-weight: var(--nv-fw-semibold);
}
.nv-progress-extra {
  font-variant-numeric: tabular-nums;
}
/* Wraps instead of cutting off: the counts at the end are what people read. */
.nv-progress-sub {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  overflow-wrap: anywhere;
}
.nv-progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 2px;
  padding: 0;
  list-style: none;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-progress-steps li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nv-progress-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--nv-border-strong);
  border-radius: 50%;
  font-size: var(--nv-fs-micro);
  font-variant-numeric: tabular-nums;
}
.nv-progress-steps li.is-done {
  color: var(--nv-success);
}
.nv-progress-steps li.is-done .nv-progress-step-no {
  border-color: var(--nv-success);
  background: var(--nv-success);
  color: var(--nv-on-fill);
}
.nv-progress-steps li.is-current {
  color: var(--nv-accent-strong);
  font-weight: var(--nv-fw-semibold);
}
.nv-progress-steps li.is-current .nv-progress-step-no {
  border-color: var(--nv-accent);
  background: var(--nv-accent);
  color: var(--nv-accent-contrast);
}
.nv-progress-sub:empty {
  display: none;
}
.nv-progress-track {
  position: relative;
  height: 6px;
  margin-top: 2px;
  border-radius: 3px;
  background: var(--nv-border);
  overflow: hidden;
}
.nv-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--nv-accent);
  transition: width 0.15s;
}
.nv-progress-track.is-indeterminate .nv-progress-bar {
  width: 35%;
  animation: nv-indeterminate 1.1s ease-in-out infinite;
}
@keyframes nv-indeterminate {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(300%);
  }
}
.nv-spinner {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--nv-border);
  border-top-color: var(--nv-accent);
  border-radius: 50%;
  animation: nv-spin 0.8s linear infinite;
}
.nv-spinner-sm {
  width: 11px;
  height: 11px;
  border-width: 2px;
}
@keyframes nv-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nv-spinner,
  .nv-progress-track.is-indeterminate .nv-progress-bar {
    animation-duration: 3s;
  }
}

/* ---------------------------------------------------------------- toasts */

/* Toasts live in the stage (moved there by the shell), at its bottom right just above the status bar (VR-06): the
   fitted sheet keeps clear of the legend's band there (its bottom inset), so a short toast covers no part, no stage
   head and no saw table. The newest is the lowest. While the simulation plays they step above its bar, like the legend.
   Beside the legend (bottom left), not over it: the shell's placeToasts sets --nv-toast-w (what fits right of the legend,
   280–440 px) and --nv-toast-lift (above the legend when even 280 px does not fit). */
#nv-toast {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(var(--nv-status-h) + 12px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(440px, calc(100% - 24px));
  pointer-events: none;
}
#nv-stage > #nv-toast {
  position: absolute;
  z-index: 40;
  top: auto;
  right: 12px;
  bottom: calc(12px + var(--nv-toast-lift, 0px));
  width: min(var(--nv-toast-w, 440px), calc(100% - 24px));
}
#nv-stage[data-sim="on"] > #nv-toast {
  bottom: calc(var(--nv-sim-bar-h, 0px) + 22px + var(--nv-toast-lift, 0px));
}
/* The narrow-window drawer covers the stage's right side: keep toasts left of it. */
#nv-main[data-right="drawer"] #nv-stage > #nv-toast {
  right: calc(var(--nv-right-w) + 12px);
  width: min(var(--nv-toast-w, 440px), calc(100% - var(--nv-right-w) - 24px));
}
.nv-toast-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  padding: 8px 6px 8px 10px;
  border: 1px solid var(--nv-border);
  border-left: 3px solid var(--nv-accent);
  border-radius: 7px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
  pointer-events: auto;
  animation: nv-toast-in 0.16s ease-out;
}
@keyframes nv-toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------------------------------------------------------------- stage head, stage note */

/* ‹ 판 3/22 › [던 오크 18T] [⟷ 가로결] [여유 10 mm] [간격 5 mm] [수율 82 %] [⚠ 경고 1] … [actions]
   절단 순서 · 작은 부품 먼저 1~8 → 오른쪽 열부터 9~16                       (D2-08 · D1-12) */
.nv-stage-head {
  position: absolute;
  z-index: 12;
  top: 10px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: calc(100% - 24px);
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--nv-panel) 94%, transparent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.nv-stage-head-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.nv-stage-head .nv-stage-head-row > .nv-btn {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
}
.nv-stage-pos {
  min-width: 56px;
  font-size: 15px;
  font-weight: var(--nv-fw-bold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.nv-stage-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-left: 4px;
}
.nv-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  background: var(--nv-panel-2);
  color: var(--nv-text);
  font-size: var(--nv-fs-md);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nv-stage-chip.is-muted {
  color: var(--nv-text-dim);
}
/* 「판넬쏘」: the sheet tag's colour (D2 §4.2 --nv-saw). */
.nv-stage-chip.is-saw {
  border-color: var(--nv-saw);
  background: var(--nv-saw);
  color: #ffffff;
  font-weight: var(--nv-fw-semibold);
}
:root[data-theme="dark"] .nv-stage-chip.is-saw {
  color: #1d1a14;
}
.nv-stage-chip.is-warning {
  border-color: color-mix(in srgb, var(--nv-warning) 40%, transparent);
  background: var(--nv-warning-soft);
  color: var(--nv-warning);
  font-weight: var(--nv-fw-semibold);
}
.nv-stage-chip.is-error {
  border-color: color-mix(in srgb, var(--nv-danger) 40%, transparent);
  background: color-mix(in srgb, var(--nv-danger) 12%, transparent);
  color: var(--nv-danger);
  font-weight: var(--nv-fw-semibold);
}
.nv-stage-chip .nv-icon {
  width: 14px;
  height: 14px;
}
/* 「이 판: 부품 16개 → 10개」 after a re-nest (until the next sheet). */
.nv-stage-delta {
  margin-left: 4px;
  color: var(--nv-accent-strong);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
  white-space: nowrap;
}
/* The simulation button's slot (nv/player fills it). */
.nv-stage-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}
.nv-stage-actions:empty {
  display: none;
}
/* A narrow stage: ‹ 판 3/22 › and the actions on the first line, the chips across the head below. */
@container (max-width: 640px) {
  .nv-stage-head-row {
    flex-wrap: wrap;
  }
  .nv-stage-chips {
    flex: 1 1 100%;
    order: 1;
    margin: 2px 0 0 4px;
  }
  .nv-stage-delta {
    order: 2;
  }
  .nv-stage-actions {
    margin-left: auto;
  }
}
.nv-stage-sub {
  padding: 0 4px 1px 9px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
/* RD-A-04: 「커넥터 러닝쏘 재단도와 톱 번호가 다릅니다 · 이 화면 기준으로 자르세요」 after a panel-saw sheet's cut line. */
.nv-stage-sub-warn {
  color: var(--nv-warning);
  font-weight: var(--nv-fw-semibold);
}
/* RD-A-11: the narrow-window drawer covers the stage's right side — the head (and its 「▶ 시뮬레이션」) stays
   left of it, its chips wrap. */
#nv-main[data-right="drawer"] .nv-stage-head {
  max-width: max(240px, calc(100% - var(--nv-right-w) - 24px));
}

/* ---------------------------------------------------------------- stage legend (bottom left) */

/* Same frame as /nc-viewer .nc-scene-legend (D2-01): folded = one line, open = a grid of what the
   sheet on screen shows; an item with a display switch is a button (off: 40 % and hatched). */
.nv-stage-legend {
  position: absolute;
  z-index: 12;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  padding: 3px 10px 6px 3px;
  overflow: auto;
  border: 1px solid var(--nv-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--nv-panel) 94%, transparent);
  box-shadow: var(--nv-shadow);
  color: var(--nv-text);
  font-size: var(--nv-fs-sm);
  line-height: 1.2;
}
.nv-stage-legend[data-collapsed="true"] {
  padding: 3px;
}
.nv-stage-legend-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--nv-text-dim);
  font: var(--nv-fw-semibold) var(--nv-fs-sm) / 1 var(--nv-font);
  cursor: pointer;
}
.nv-stage-legend-toggle::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}
.nv-stage-legend-toggle[aria-expanded="false"]::after {
  transform: translateY(1px) rotate(-135deg);
}
.nv-stage-legend-toggle:hover {
  background: var(--nv-hover);
  color: var(--nv-text);
}
.nv-stage-legend-items {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 1px 14px;
  padding-left: 6px;
}
@container (max-width: 760px) {
  .nv-stage-legend-items {
    grid-template-columns: repeat(2, max-content);
  }
}
.nv-stage-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0 -5px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
}
button.nv-stage-legend-item {
  cursor: pointer;
}
button.nv-stage-legend-item:hover {
  background: var(--nv-hover);
}
.nv-stage-legend-item.is-off {
  color: var(--nv-text-dim);
}
.nv-legend-sample {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 28px;
  height: 18px;
}
.nv-legend-sample > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.is-off > .nv-legend-sample > svg {
  opacity: 0.4;
}
.is-off > .nv-legend-sample::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--nv-text) 50%, transparent) 3px 4px);
}

/* D2-13: the dark stage around the (dimmed) sheet. The one place of this colour: nv/sheet's own CSS
   only sets the light stage (REV-C-13). */
:root[data-theme="dark"] #nv-stage .nv-sheet-host {
  --nv-sheet-stage: #25282d;
}
.nv-stage-note {
  position: absolute;
  z-index: 11;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(380px, calc(100% - 32px));
  padding: 18px 20px;
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
  text-align: center;
  transform: translate(-50%, -50%);
}
.nv-stage-note strong {
  font-size: var(--nv-fs-lg);
}
.nv-stage-note-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.nv-toast-item.is-error {
  border-left-color: var(--nv-danger);
}
.nv-toast-item.is-warning {
  border-left-color: var(--nv-warning);
}
.nv-toast-item.is-success {
  border-left-color: var(--nv-success);
}
.nv-toast-icon {
  margin-top: 1px;
  color: var(--nv-accent);
}
.is-error > .nv-toast-icon {
  color: var(--nv-danger);
}
.is-warning > .nv-toast-icon {
  color: var(--nv-warning);
}
.is-success > .nv-toast-icon {
  color: var(--nv-success);
}
.nv-toast-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}
/* Job names are run folders like Wedraw_Demo_Kitchen_20261012_232259_7323_20261012: break them. */
.nv-toast-text {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.nv-toast-link {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--nv-accent-strong);
  font: inherit;
  font-weight: var(--nv-fw-semibold);
  cursor: pointer;
}
/* VR-06 (open): a plain toast's button follows its sentence on the sentence's last line — one row less, so two stacked toasts
   (the open one + the remembered-grain one) stay under the fitted sheet; a `note` keeps a row of its own. The open toast's own
   rows are below (`.nv-toast-body:has(> .nv-toast-open)`). */
.nv-toast-body:not(:has(> .nv-toast-open)) {
  display: block;
}
.nv-toast-body:not(:has(> .nv-toast-open)) > .nv-toast-note {
  display: block;
  margin-top: 3px;
}
/* In the sentence's line: the line keeps the text's height (the 24 px hit box reaches into the padding above and below it). */
.nv-toast-body:not(:has(> .nv-toast-open)) > .nv-toast-link {
  display: inline-block;
  min-height: 0;
  margin: -3px 0 -3px 8px;
  padding: 3px 0;
  vertical-align: baseline;
  white-space: nowrap;
}
.nv-toast-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--nv-text-dim);
  cursor: pointer;
}
.nv-toast-close:hover {
  background: var(--nv-hover);
  color: var(--nv-text);
}

/* ---------------------------------------------------------------- dialogs */

.nv-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  color: var(--nv-text);
  font: var(--nv-fs-md)/1.45 var(--nv-font);
}
.nv-dialog {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  max-height: 100%;
  border: 1px solid var(--nv-border);
  border-radius: 12px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
}
.nv-dialog.is-attention {
  animation: nv-attention 0.5s;
}
@keyframes nv-attention {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
/* One height for both tabs: the dialog does not jump when switching (D2-13). */
.nv-dialog-settings {
  width: min(760px, 100%);
  height: min(736px, 90vh);
}
.nv-dialog-help {
  width: min(600px, 100%);
}
.nv-dialog-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px 20px;
  border-bottom: 1px solid var(--nv-border-soft);
}
.nv-dialog-title {
  margin: 0;
  font-size: var(--nv-fs-xl);
  font-weight: var(--nv-fw-semibold);
}
.nv-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--nv-text-dim);
  cursor: pointer;
}
.nv-dialog-close:hover {
  background: var(--nv-hover);
  color: var(--nv-text);
}
.nv-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 20px;
  overflow-y: auto;
}
.nv-dialog-text {
  margin: 0;
  font-size: var(--nv-fs-lg);
}
.nv-dialog-actions {
  display: flex;
  flex: none;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--nv-border-soft);
}
.nv-dialog-actions .nv-btn {
  height: 32px;
  padding: 0 14px;
}
.nv-btn-left {
  margin-right: auto;
}

/* settings form */
.nv-settings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nv-settings-tabs {
  position: sticky;
  z-index: 1;
  top: -14px;
  margin: -14px -20px 2px;
  padding: 0 14px;
}
.nv-settings-tabs .nv-tab {
  flex: 0 0 auto;
  padding: 0 14px;
}
.nv-fieldset {
  margin: 0;
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--nv-border-soft);
}
.nv-settings-pane .nv-fieldset:last-child {
  border-bottom: 0;
}
.nv-fieldset legend {
  float: left;
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  font-size: var(--nv-fs-md);
  font-weight: var(--nv-fw-semibold);
}
.nv-trim-error {
  display: block;
  clear: both;
  margin: 6px 0 0;
}
.nv-row {
  display: grid;
  clear: both;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 14px;
}
.nv-row-4 {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.nv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nv-field-label {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
}
.nv-field-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nv-input-num {
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.nv-unit {
  flex: none;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-field-hint {
  display: block;
  clear: both;
  margin: 2px 0 0;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-field-hint.is-error,
.nv-field-error,
.nv-form-error {
  color: var(--nv-danger);
  font-size: var(--nv-fs-sm);
}
.nv-form-error {
  margin: 4px 0 0;
  font-weight: var(--nv-fw-medium);
}
.nv-stock-table {
  margin-top: 8px;
}
.nv-stock-table th {
  position: static;
}
.nv-stock-table td {
  padding-top: 2px;
  padding-bottom: 2px;
  border-bottom: 0;
}
.nv-stock-table .nv-input {
  width: 100%;
  min-width: 80px;
}
/* 「기본 원장 따름」 (D4-01 · D4-10): an empty size follows the default stock. */
.nv-stock-table .nv-input-num {
  min-width: 112px;
}
.nv-stock-table .nv-input-num::placeholder {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-stock-table .nv-field-error,
.nv-stock-note {
  display: block;
}
.nv-stock-note {
  margin-top: 2px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-stock-unused {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  color: var(--nv-warning);
}
/* 「판 화면에 보일 것」: the same swatch as the stage legend beside each switch. */
.nv-check-field .nv-legend-sample {
  margin-left: 2px;
}
.nv-radios {
  display: grid;
  clear: both;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px 14px;
}
.nv-radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.nv-radio input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--nv-accent);
}
.nv-radio > span {
  display: flex;
  flex-direction: column;
}
.nv-check-field {
  clear: both;
  margin-bottom: 8px;
}
.nv-check-field .nv-field-hint {
  margin: 0 0 0 4px;
}
/* A checkbox beside labelled fields lines up with their inputs. */
.nv-row > .nv-check-field {
  align-self: end;
  min-height: 32px;
  margin-bottom: 0;
}
.nv-check-grid {
  display: grid;
  clear: both;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 14px;
  margin-bottom: 10px;
}

/* help */
.nv-help-table th {
  position: static;
  width: 42%;
  background: none;
  color: var(--nv-text);
  white-space: normal;
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--nv-border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--nv-panel-2);
  font: var(--nv-fw-medium) var(--nv-fs-sm) var(--nv-font);
}
/* The 「판 화면 읽기」 table gave way to the stage legend: one pointer line. */
.nv-help-legend {
  margin: 4px 0 12px;
  color: var(--nv-text-dim);
}
.nv-help-table + .nv-section-title {
  margin-top: 12px;
}

/* ---------------------------------------------------------------- narrow windows */

/* Narrow defaults come from the shell (nv/rules panelDefaults: 240 / 260 px at <= 1280 px), and the
   right panel becomes a drawer there; folded panels leave a reveal handle on the stage edge. */
.nv-panel-reveal {
  position: absolute;
  z-index: 15;
  top: 50%;
  width: 20px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--nv-border);
  background: var(--nv-panel);
  color: var(--nv-text-dim);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transform: translateY(-50%);
}
.nv-panel-reveal.is-left {
  left: 0;
  border-left: 0;
  border-radius: 0 7px 7px 0;
}
.nv-panel-reveal.is-right {
  right: 0;
  border-right: 0;
  border-radius: 7px 0 0 7px;
}
.nv-panel-reveal:hover:not(:disabled) {
  background: var(--nv-panel);
  color: var(--nv-accent-strong);
}
/* While the simulation plays, a narrow window keeps the drawer handle (「톱 절단 순서」 is in the drawer):
   the shell reports it — or the drawer opened with it — as the stage's right inset, so the sheet and
   the camera keep clear of it (VERIFY-01 · VERIFY-07). */

/* ---------------------------------------------------------------- parts file · sheet counts */

/* 「역할 도어 · id door-0110」 under a material of the job summary. */
.nv-material-info {
  display: block;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
/* 「커넥터 8장 · 뷰어 9장」: the Connector's sheet count of a stock, marked when the viewer's differs. */
.nv-sheet-compare {
  display: inline-block;
  margin-top: 1px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--nv-panel-2);
  box-shadow: inset 0 0 0 1px var(--nv-border);
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}
.nv-sheet-compare.is-differs {
  background: var(--nv-warning-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-warning) 45%, transparent);
  color: var(--nv-warning);
  font-weight: var(--nv-fw-semibold);
}
.nv-material-list .nv-sheet-compare {
  display: table;
}
.nv-sheet-group-title .nv-sheet-compare {
  margin: 0 0 0 6px;
  font-weight: var(--nv-fw-regular);
}
.nv-sheet-group-title .nv-sheet-compare.is-differs {
  font-weight: var(--nv-fw-semibold);
}
.nv-path {
  overflow-wrap: anywhere;
}
.nv-text-warning {
  color: var(--nv-warning);
}
/* 「가로 결」 next to a grain group whose front grain runs across. */
.nv-tag.nv-tag-axis {
  flex: none;
  margin-left: 4px;
  padding: 0 5px;
  line-height: 16px;
}

/* ---------------------------------------------------------------- CSV column mapping */

.nv-dialog-columns {
  width: min(860px, 100%);
}
.nv-columns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nv-columns-open {
  margin: 6px 0 2px;
}
.nv-columns-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
/* 「첫 줄에 숫자가 있어 데이터로 봤습니다」 beside the header box (D4-15). */
.nv-columns-note {
  color: var(--nv-warning);
  font-size: var(--nv-fs-sm);
}
.nv-columns-options > .nv-muted {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-columns-delimiter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nv-columns-preview {
  max-height: 168px;
  overflow: auto;
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-radius);
  background: var(--nv-panel-2);
}
.nv-columns-preview > .nv-muted {
  margin: 4px 8px;
}
.nv-columns-table {
  border-collapse: collapse;
  font-size: var(--nv-fs-sm);
  white-space: nowrap;
}
.nv-columns-table th,
.nv-columns-table td {
  padding: 3px 8px;
  border-right: 1px solid var(--nv-border-soft);
  border-bottom: 1px solid var(--nv-border-soft);
  text-align: left;
  vertical-align: top;
}
.nv-columns-table th {
  position: sticky;
  top: 0;
  background: var(--nv-panel);
  font-weight: var(--nv-fw-semibold);
}
.nv-columns-table .is-used {
  background: var(--nv-accent-soft);
}
.nv-columns-table th.is-used {
  background: color-mix(in srgb, var(--nv-accent) 16%, var(--nv-panel));
}
.nv-columns-colname,
.nv-columns-colfield {
  display: block;
}
.nv-columns-colfield {
  color: var(--nv-accent-strong);
  font-size: var(--nv-fs-micro);
  font-weight: var(--nv-fw-medium);
}
.nv-columns-title {
  margin: 4px 0 0;
  font-size: var(--nv-fs-md);
  font-weight: var(--nv-fw-semibold);
}
.nv-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 14px;
}
.nv-columns-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.nv-columns-field label {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.nv-columns-label {
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
}
.nv-columns-code {
  color: var(--nv-text-dim);
  font: var(--nv-fs-micro) var(--nv-mono);
}
.nv-columns-field select {
  width: 100%;
  min-width: 0;
}
.nv-columns-field.is-required.is-empty select {
  border-color: var(--nv-danger);
  box-shadow: 0 0 0 1px var(--nv-danger);
}
.nv-columns-field:not(.is-required).is-empty select {
  color: var(--nv-text-dim);
}
.nv-columns-hint {
  color: var(--nv-warning);
  font-size: var(--nv-fs-micro);
}
.nv-columns-optional {
  border-top: 1px solid var(--nv-border-soft);
  padding-top: 8px;
}
.nv-columns-optional > summary {
  margin-bottom: 8px;
  font-size: var(--nv-fs-md);
  font-weight: var(--nv-fw-semibold);
  cursor: pointer;
}
.nv-columns-problem {
  margin: 0;
  color: var(--nv-danger);
  font-size: var(--nv-fs-sm);
}
.nv-columns-remember {
  font-size: var(--nv-fs-sm);
}

/* ---------------------------------------------------------------- 열기 흐름 (S-FILES, 실제 데이터 라운드) */
/* RD-C-02: programs picked but no 「가공 파일」 column — a yellow line under the required fields. */
.nv-columns-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--nv-warning) 40%, transparent);
  border-radius: 6px;
  background: var(--nv-warning-soft);
  color: var(--nv-text);
  font-size: var(--nv-fs-sm);
}
.nv-columns-notice[hidden] {
  display: none;
}
.nv-columns-notice > .nv-icon {
  color: var(--nv-warning);
}
.nv-columns-field.is-flagged select {
  border-color: var(--nv-warning);
  box-shadow: 0 0 0 1px var(--nv-warning);
}
.nv-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--nv-accent-strong);
  font: inherit;
  font-weight: var(--nv-fw-semibold);
  cursor: pointer;
}
.nv-link-button:hover {
  text-decoration: underline;
}
/* The open toast's warning line (master plan §0): under the sentence, in the warning colour. */
.nv-toast-note {
  max-width: 100%;
  color: var(--nv-warning);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
  overflow-wrap: anywhere;
}
/* VR-06: the open toast in two rows — the sentence in one line (the job name 「…」 gives way first, a tail line of its own
   below it) and the first warning in one line + 「· 외 n」 + its button. Both end in "…"; the rows' title has it all. */
.nv-toast-body:has(> .nv-toast-open) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
}
.nv-toast-text.nv-toast-open {
  display: flex;
  flex: 1 0 100%;
  flex-direction: column;
  min-width: 0;
  white-space: nowrap;
}
.nv-toast-open-line {
  display: flex;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}
.nv-toast-open-job {
  flex: 0 1000 auto;
  min-width: 4.5em;
  overflow: hidden;
  white-space: pre;
  text-overflow: ellipsis;
}
.nv-toast-open-rest {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-toast-open-more {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.nv-toast-note-row {
  display: flex;
  flex: 1 1 0;
  align-items: baseline;
  min-width: 0;
  color: var(--nv-warning);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-medium);
  white-space: nowrap;
}
.nv-toast-note-row > .nv-toast-note {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
}
.nv-toast-more {
  flex: none;
  white-space: pre;
}
.nv-toast-note-row.is-info,
.nv-toast-note-row.is-info > .nv-toast-note {
  color: var(--nv-text-dim);
}
.nv-toast-body:has(> .nv-toast-open) > .nv-toast-link {
  flex: none;
  min-height: 20px;
  white-space: nowrap;
}
/* RD-A-12: what to pick instead, on the open card. */
.nv-empty-error-hint {
  margin: 0 0 0 24px;
  color: var(--nv-text);
  font-size: var(--nv-fs-sm);
}
/* RD-A-03: 「커넥터 설정 없음」. */
.nv-source-badge.is-missing {
  background: var(--nv-warning-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-warning) 45%, transparent);
  color: var(--nv-warning);
}
.nv-connector-settings.is-missing {
  border-color: color-mix(in srgb, var(--nv-warning) 40%, transparent);
}
/* A section an open notice's button brought into view. */
.nv-section.is-revealed {
  animation: nv-reveal 1.2s ease-out;
}
@keyframes nv-reveal {
  from {
    background: var(--nv-warning-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nv-section.is-revealed {
    animation: none;
  }
}
/* 「출력 고르기」 (RD-A-06 · RD-C-01): one radio row per complete output, newest first. */
.nv-dialog-runs {
  width: min(620px, calc(100vw - 32px));
}
.nv-run-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.nv-run-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--nv-border);
  border-radius: 7px;
  cursor: pointer;
}
.nv-run-label:hover {
  background: var(--nv-hover);
}
.nv-run-label:has(input:checked) {
  border-color: var(--nv-accent);
  box-shadow: inset 0 0 0 1px var(--nv-accent);
}
.nv-run-label > input {
  margin-top: 3px;
}
.nv-run-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nv-run-name {
  font-weight: var(--nv-fw-semibold);
  overflow-wrap: anywhere;
}
.nv-run-detail {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-run-badge {
  flex: none;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
  font-size: var(--nv-fs-sm);
  line-height: 18px;
}
/* VR-13: 「가장 최근」 (or 「설정 있는 최신」) over 「커넥터 설정 없음」 at the row's right. */
.nv-run-badges {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.nv-run-badges:empty {
  display: none;
}
.nv-run-badge.is-warning {
  background: var(--nv-warning-soft);
  color: var(--nv-warning);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 네스팅기 기능 (S-VIEW, 2026-10-14) */
/* Remnants (F2) and kept remnants (F3) wear the sheet's remnant teal (model.COLORS.remnant*); two-pass
   parts (F1) its violet. Settings 「작은 부품」 · 「잔재」 put their fields inside a sentence. */
:root {
  --nv-remnant: #2a7a6f;
  --nv-remnant-soft: rgba(42, 122, 111, 0.12);
  --nv-remnant-fill: #d4ece7;
  --nv-yield-waste: #c9cfd8;
}
:root[data-theme="dark"] {
  --nv-remnant: #5cbfb1;
  --nv-remnant-soft: rgba(92, 191, 177, 0.16);
  --nv-remnant-fill: #2d5a54;
  --nv-yield-waste: #3a4452;
}

.nv-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  clear: both;
  margin: 2px 0 4px;
}
.nv-inline-row > .nv-check-field {
  margin: 0;
}
.nv-inline-label {
  color: var(--nv-text-dim);
  font-weight: var(--nv-fw-medium);
}
.nv-inline-sub {
  padding-left: 24px;
}
.nv-input-num.nv-input-inline {
  width: 84px;
  flex: none;
}
.nv-input-inline:disabled {
  opacity: 0.55;
}
.nv-inline-errors {
  display: flex;
  flex-direction: column;
  clear: both;
}
.nv-inline-errors:empty {
  display: none;
}
.nv-remnant-min-error {
  margin: 2px 0 0;
}

/* 「보관 잔재 (원장보다 먼저 씀)」 table. */
.nv-extra {
  clear: both;
}
.nv-extra-table .nv-input,
.nv-extra-table .nv-input-num {
  min-width: 0;
}
/* Eight columns (출처 too, REV-FU-03) inside the 760 px dialog. */
.nv-extra-table th,
.nv-extra-table td {
  padding-right: 3px;
  padding-left: 3px;
}
/* kept: RD-A-02 — narrower inputs leave room for the ninth column 「예약」 (the table stays inside the 760 px dialog). */
.nv-extra-table .nv-extra-id {
  width: 68px;
}
.nv-extra-table .nv-extra-material {
  width: 84px;
}
.nv-extra-table .nv-extra-thickness {
  width: 48px;
}
.nv-extra-table .nv-extra-size {
  width: 64px;
}
.nv-extra-table .nv-extra-quantity {
  width: 44px;
}
.nv-extra-table select.nv-input {
  width: 84px;
}
.nv-extra-size-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nv-extra-remove {
  width: 32px;
}
.nv-extra-error-row td {
  padding-top: 0;
}
.nv-extra-empty {
  clear: both;
  margin: 2px 0 6px;
}
.nv-extra-tools {
  margin: 6px 0 2px;
}
/* 출처 (read-only, REV-FU-03): 「demo_kitchen · 10-14」 or 「—」. */
.nv-extra-table .nv-extra-origin {
  max-width: 84px;
  overflow: hidden;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-extra-list-error {
  margin: 4px 0 0;
}

/* The end of 「잔재」: kept remnants used (with 「쓴 보관 잔재 빼기」), not used, and this job's own (REV-FU-01 · 02). */
.nv-kept-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.nv-kept-notes p {
  margin: 0;
}
.nv-kept-notes:focus {
  outline: none;
}
.nv-kept-notes:focus-visible {
  outline: 2px solid var(--nv-accent);
  outline-offset: 2px;
}
.nv-kept-notes .nv-remnant-used {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.nv-kept-take:disabled {
  color: var(--nv-text-dim);
}
/* kept: RD-A-05 · RD-C-04 「원장 9장 → 8장 (보관 잔재 1장으로 1장 줄임)」 · RD-A-02 「… 예약되어 쓰지 않았습니다」 + 「예약 풀기」. */
.nv-kept-notes .nv-kept-saving {
  color: var(--nv-text);
  font-weight: var(--nv-fw-medium);
}
.nv-kept-notes .nv-kept-reserved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.nv-kept-release:disabled {
  color: var(--nv-text-dim);
}
/* kept: RD-C-13 — the 「다시 배치」 toast's second line (the settings that changed). */
.nv-toast-text {
  white-space: pre-line;
}

/* kept: RD-A-07 — the settings dialog's 「이 작업에만 (커넥터 값 대신)」 · 「이 브라우저의 모든 작업」. */
.nv-settings-scope {
  margin: 0 0 6px;
  padding: 6px 0 0 10px;
  border-left: 3px solid var(--nv-border);
}
.nv-settings-scope.is-job {
  border-left-color: color-mix(in srgb, var(--nv-accent) 55%, transparent);
}
.nv-settings-scope-title {
  margin: 0;
  font-size: var(--nv-fs-md);
  font-weight: var(--nv-fw-semibold);
}
.nv-settings-scope.is-job .nv-settings-scope-title {
  color: var(--nv-accent-strong);
}
.nv-settings-scope-hint {
  margin: 0 0 2px;
}
.nv-settings-scope .nv-fieldset:last-child {
  border-bottom: 0;
}
.nv-row-sheet-grain {
  margin-top: 8px;
}

/* kept: RD-B-01 · RD-B-02 · RD-A-08 — the per-material grain cell: 「기억함」, 「결 정보 없음 · 돌리지 않음」 + 「무늬 없음으로(돌려도 됨)」. */
.nv-stock-grain-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nv-stock-grain-badge {
  flex: none;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
  font-size: var(--nv-fs-sm);
  line-height: 18px;
  white-space: nowrap;
}
.nv-stock-grain-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-top: 2px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-stock-grain-note.is-assumed {
  color: var(--nv-warning);
}
.nv-stock-grain-note[hidden],
.nv-stock-grain-badge[hidden],
.nv-stock-grain-free[hidden] {
  display: none;
}

/* kept: RD-A-02 — the 「보관 잔재」 table's 「예약」 column (a ninth one: the job name is cut short, the title has it all). */
.nv-extra-table .nv-extra-reserved {
  width: 84px;
  max-width: 84px;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
}
.nv-extra-reserved-text {
  display: block;
  width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* kept: VR-05 — 출처 · 예약 take two lines: the job name (its head and tail when longer, rules.extraCellText) then the date,
   so 「테스트_도면_20261014」 and 「…-2」 differ on screen. */
.nv-extra-table .nv-extra-origin,
.nv-extra-table .nv-extra-reserved {
  vertical-align: middle;
  line-height: 1.25;
}
.nv-extra-cell-text {
  display: -webkit-box;
  width: 80px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.nv-extra-cell-day {
  margin-left: 4px;
  color: var(--nv-text-dim);
  white-space: nowrap;
}

/* kept: VR-04 — the 결 head of the per-material table says a remembered 「무늬 없음」 is this browser's, for every job; and
   「기억한 재질 결」 (in 「이 브라우저의 모든 작업」) lists them with 「지우기」. */
.nv-stock-grain-scope {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: normal;
}
.nv-grain-memory-table {
  width: auto;
  min-width: 320px;
}
.nv-grain-memory-table td {
  padding-top: 2px;
  padding-bottom: 2px;
}
.nv-grain-memory-table tr.is-forgotten td {
  color: var(--nv-text-dim);
}
.nv-grain-memory-table tr.is-forgotten td:nth-child(-n + 2) {
  text-decoration: line-through;
}
.nv-grain-memory-empty {
  margin: 2px 0 4px;
}

/* REV-FU-13: the parts tab's order wears the sheet's violet 「2」 for a two-pass part. */
.nv-two-pass-badge {
  display: inline-block;
  margin-left: 2px;
  padding: 0 2px;
  border-radius: 3px;
  background: #6d3b9e;
  color: #ffffff;
  font-size: 9px;
  font-weight: var(--nv-fw-semibold);
  line-height: 12px;
  vertical-align: 1px;
}

/* 「보관 잔재 R9-1 · demo_kitchen 10-14」: a sheet cut from a kept remnant (sheet card tag, stage chip); a narrow card
   ends it with … (the whole name is its title). */
.nv-sheet-card-title {
  min-width: 0;
}
.nv-tag.nv-tag-kept {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 2px;
  background: var(--nv-remnant-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-remnant) 45%, transparent);
  color: var(--nv-remnant);
  font-weight: var(--nv-fw-medium);
  line-height: 16px;
}
.nv-card-remnants {
  color: var(--nv-remnant);
}
.nv-stage-chip.is-remnant {
  border-color: color-mix(in srgb, var(--nv-remnant) 45%, transparent);
  background: var(--nv-remnant-soft);
  color: var(--nv-remnant);
  font-weight: var(--nv-fw-medium);
}

/* Job summary: where the boards go (F7) — parts · remnants · waste. */
.nv-yield-split {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}
.nv-yield-track {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--nv-yield-waste);
}
.nv-yield-seg {
  flex: none;
  height: 100%;
}
.nv-yield-seg.is-parts {
  background: var(--nv-part-tan);
}
.nv-yield-seg.is-remnant {
  background: repeating-linear-gradient(135deg, var(--nv-remnant-fill) 0 3px, color-mix(in srgb, var(--nv-remnant) 55%, var(--nv-remnant-fill)) 3px 4.5px);
}
.nv-yield-seg.is-waste {
  background: var(--nv-yield-waste);
}
.nv-yield-text {
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-variant-numeric: tabular-nums;
}

/* 「잔재」 of the job summary: a row press shows the remnant on its sheet. */
.nv-remnant-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  margin: 0 0 6px;
}
.nv-remnant-wrap {
  max-height: 340px;
  border: 1px solid var(--nv-border);
  border-radius: 6px;
  overflow-y: auto;
}
/* REV-FU-07: 이름 · 크기 · 결 · 판 never break (「R9-」/「2」 read as two things); a narrow panel wraps 재질 only. */
.nv-remnant-table {
  width: 100%;
  table-layout: auto;
}
.nv-remnant-table th,
.nv-remnant-table td {
  padding-right: 4px;
  padding-left: 4px;
  white-space: nowrap;
}
.nv-remnant-table td.nv-remnant-material {
  width: 100%;
  min-width: 3.5em;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.nv-remnant-table .nv-remnant-actions td {
  white-space: normal;
}
/* A narrow panel (1280 wide window: about 240 px) has no room for five unbroken columns: the grain goes under the size. */
.nv-remnant-wrap {
  container-type: inline-size;
}
.nv-remnant-size-grain {
  display: none;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  text-align: right;
}
@container (max-width: 250px) {
  .nv-remnant-table .nv-remnant-grain {
    display: none;
  }
  .nv-remnant-size-grain {
    display: block;
  }
}
/* kept: VR-14 — 「결 모름(가공 방향)」 in two lines (「결 모름」 · 「(가공 방향)」), so the table stays inside the panel. */
.nv-remnant-grain-line {
  display: block;
}
.nv-remnant-name {
  color: var(--nv-remnant);
  font-weight: var(--nv-fw-semibold);
}
.nv-remnant-table .nv-remnant-main td {
  border-bottom: 0;
}
.nv-remnant-table .nv-remnant-actions td {
  padding-top: 0;
  text-align: right;
}
.nv-remnant-table tbody.is-selected {
  background: var(--nv-selected);
}
.nv-remnant-table tbody:hover {
  background: var(--nv-hover);
}
.nv-remnant-table .nv-remnant-main:hover {
  background: none;
}
.nv-remnant-add:disabled {
  color: var(--nv-text-dim);
  cursor: default;
}
.nv-remnant-used {
  margin: 6px 0 0;
}

/* ---------------------------------------------------------------- print */

@media screen {
  #nv-print {
    display: none;
  }
}

@page {
  size: A4 landscape;
  margin: 9mm;
}

@media print {
  html,
  body.nesting-viewer {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #000;
  }
  body.nv-printing #nv-app,
  body.nv-printing .nv-backdrop,
  body.nv-printing .nv-menu,
  body.nv-printing #nv-toast {
    display: none !important;
  }
  #nv-print {
    display: block;
    color: #000;
    font: 10pt/1.35 var(--nv-font);
  }
  .nv-print-page {
    break-after: page;
  }
  .nv-print-page:last-child {
    break-after: auto;
  }
  .nv-print-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2mm 6mm;
    padding-bottom: 2mm;
    border-bottom: 0.4mm solid #000;
  }
  .nv-print-head strong {
    font-size: 13pt;
  }
  .nv-print-meta {
    flex: 1 1 100%;
    color: #333;
    font-size: 8.5pt;
  }
  /* 「오류 2」 at the right end of a sheet with check errors (D4-02). */
  .nv-print-errors {
    margin-left: auto;
    padding: 0 2mm;
    border: 0.5mm solid #000;
    font-size: 12pt;
    font-weight: 700;
  }
  /* One legend line per page: what this sheet's marks mean, with the screen's swatches (D1-09 · D2-12). */
  .nv-print-legend {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8mm 4mm;
    font-size: 8pt;
  }
  .nv-print-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 1.2mm;
    white-space: nowrap;
  }
  .nv-print-legend .nv-legend-sample {
    width: 7mm;
    height: 4.5mm;
  }
  .nv-print-figure {
    margin: 3mm 0;
    break-inside: avoid;
  }
  /* Height from the row count (shell: printFigureMm) so a sheet and its table fit one page. */
  .nv-print-figure svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: var(--nv-print-fig-h, 105mm);
  }
  .nv-print-tables.is-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 4mm;
  }
  .nv-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 8.5pt;
  }
  .nv-print-tables.is-split .nv-print-table {
    font-size: 8pt;
  }
  .nv-print-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nv-pc-order {
    width: 9mm;
  }
  /* The head 「크기 (가로 × 세로)」 on one line (8.5 pt ≈ 22.5 mm, 8 pt ≈ 21.3 mm, + padding): a wrapped head
     row is taller than printFigureMm counts and pushed a 10-row sheet onto a second page. */
  .nv-pc-size {
    width: 27mm;
  }
  .nv-pc-file {
    width: 25mm;
  }
  .nv-pc-cell {
    width: 18mm;
  }
  /* 가공: 「두 번」 (REV-FU-13). */
  .nv-pc-pass {
    width: 11mm;
  }
  .nv-print-tables.is-split .nv-pc-size {
    width: 25mm;
  }
  .nv-print-tables.is-split .nv-pc-file {
    width: 23mm;
  }
  /* Panel-saw page: the saw-cut table (톱 순서 · 절단 · 띠 폭 · 길이 · 떨어지는 부품) before the parts. */
  .nv-print-tables.is-saw {
    grid-template-columns: 1fr 1fr;
  }
  .nv-pc-saw-order {
    width: 9mm; /* sheet: the head 「순서」 on one line, as the parts table's .nv-pc-order */
  }
  .nv-pc-saw-cut {
    width: 22mm;
  }
  .nv-pc-saw-strip,
  .nv-pc-saw-length {
    width: 16mm;
  }
  .nv-print-saw td:last-child {
    white-space: normal;
  }
  .nv-print-table th,
  .nv-print-table td {
    padding: 0.6mm 1.5mm;
    border: 0.2mm solid #888;
    text-align: left;
  }
  .nv-print-table th {
    overflow: hidden;
    background: #eee;
    white-space: nowrap;
  }
  .nv-print-table tr {
    break-inside: avoid;
  }
  .nv-print-unplaced {
    table-layout: auto;
  }
  .nv-print-table .nv-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  /* The sheet's remnants after its parts (REV-FU-13: 「— · 잔재 R9-1 · 1629 × 1220 · 라우터 4번째」). */
  .nv-print-table tr:not(.nv-print-remnant) + .nv-print-remnant td {
    border-top: 0.45mm solid #333;
  }
  .nv-print-remnant td {
    font-weight: 700;
  }
  /* RD-B-06: a sheet with many rows keeps one page — smaller rows (shell printFit PRINT_DENSITIES, measured
     3.92 · 3.08 mm a row) before the figure shrinks further; the head 「크기 (가로 × 세로)」 stays on one line. */
  .nv-print-tables.is-compact .nv-print-table {
    font-size: 7pt;
    line-height: 1.2;
  }
  .nv-print-tables.is-compact .nv-print-table th,
  .nv-print-tables.is-compact .nv-print-table td {
    padding: 0.35mm 1.2mm;
  }
  .nv-print-tables.is-tight .nv-print-table {
    font-size: 6.5pt;
    line-height: 1.1;
  }
  .nv-print-tables.is-tight .nv-print-table th,
  .nv-print-tables.is-tight .nv-print-table td {
    padding: 0.15mm 1mm;
  }
  /* A sheet too long even for the tightest rows goes on in 「판 17/46 (이어서)」 pages. */
  .nv-print-head.is-continued {
    margin-bottom: 3mm;
  }
}

/* RD-A-04: each panel's size on a panel-saw print figure (shell printPanelSizes, 2.8 mm on paper). */
.nv-print-panel-size {
  fill: #000;
  font-family: var(--nv-font);
  font-weight: 700;
}

/* ---------------------------------------------------------------- labels · job report (print, out) */

/* 「네스팅기 기능」 round F4 · F5 (shell: printLabels · printReport, nv/output). Labels are the Connector's
   50 × 100 mm label (connector_quote_output_bridge.rb write_panel_labels!: page 100 × 50 mm, label
   90 × 50 mm 5 mm in) with its 6 mm brand footer replaced by the nesting band; the report is A4 portrait.
   REV-FU-05: the Connector's label_print_rotation 90 prints on 50 × 100 mm paper with the label turned a
   quarter clockwise (its `left: 50mm; top: 5mm; transform-origin: top left; transform: rotate(90deg)`). */
@page nv-label {
  size: 100mm 50mm;
  margin: 0;
}

@page nv-label-portrait {
  size: 50mm 100mm;
  margin: 0;
}

@page nv-report {
  size: A4 portrait;
  margin: 12mm;
}

/* The label paper rows (radio, the one in use ticked in its hint). */
.nv-menu-item.nv-menu-paper[aria-checked="true"] .nv-menu-label {
  font-weight: 600;
}

/* The print menu's groups (판 · 라벨 · 작업 보고서): a line above the first item of a group. */
.nv-menu-item.nv-menu-sep {
  position: relative;
  margin-top: 9px;
}
.nv-menu-item.nv-menu-sep::before {
  position: absolute;
  top: -5px;
  right: 6px;
  left: 6px;
  border-top: 1px solid var(--nv-border);
  content: "";
}

@media print {
  .nv-print-labels {
    font-family: var(--nv-font);
    line-height: 1.2;
  }
  .nv-label-page {
    page: nv-label;
    position: relative;
    width: 100mm;
    height: 50mm;
    overflow: hidden;
    break-after: page;
  }
  .nv-label-page:last-child {
    break-after: auto;
  }
  .nv-label-page.is-rotated {
    page: nv-label-portrait;
    width: 50mm;
    height: 100mm;
  }
  .nv-label {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 11mm;
    width: 90mm;
    height: 50mm;
    margin-left: 5mm;
    overflow: hidden;
    border: 0.3mm solid #111;
    color: #000;
    background: #fff;
  }
  /* On 50 × 100 mm paper: the same 90 × 50 mm label turned a quarter clockwise, as the Connector prints it. */
  .nv-label.is-rotated {
    position: absolute;
    top: 5mm;
    left: 50mm;
    margin-left: 0;
    transform: rotate(90deg);
    transform-origin: top left;
  }
  .nv-label-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38mm;
    min-height: 0;
  }
  .nv-label-info {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    padding: 3mm 4mm 2.4mm 4.5mm;
  }
  .nv-label-identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  /* Furniture name: two lines at most (the Connector's clamp), the rest 「…」. */
  .nv-label-body {
    display: -webkit-box;
    overflow: hidden;
    font-size: 3.4mm;
    font-weight: 700;
    line-height: 4mm;
    letter-spacing: 0.08mm;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .nv-label-part {
    overflow: hidden;
    font-size: 5.2mm;
    font-weight: 800;
    line-height: 5.8mm;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nv-label-size {
    align-self: center;
    font-size: 5.4mm;
    line-height: 6mm;
    white-space: nowrap;
  }
  .nv-label-meta {
    overflow: hidden;
    font-size: 3.4mm;
    font-weight: 600;
    line-height: 4mm;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nv-label-info.has-machining-note {
    padding: 1.5mm 3mm;
    grid-template-rows: auto minmax(5.4mm, 1fr) auto auto;
  }
  .has-machining-note .nv-label-body { font-size: 2.7mm; line-height: 3.1mm; }
  .has-machining-note .nv-label-part { font-size: 4mm; line-height: 4.5mm; }
  .has-machining-note .nv-label-size { font-size: 4.8mm; line-height: 5.4mm; }
  .has-machining-note .nv-label-meta { font-size: 2.7mm; line-height: 3.2mm; }
  .nv-label-machining-note { margin-top: 0.5mm; font-size: 2.1mm; line-height: 2.6mm; }
  .nv-label-machining-note > strong, .nv-label-machining-note > span { display: block; }
  .nv-label-arrow {
    position: absolute;
    z-index: 3;
    bottom: 1mm;
    right: 1mm;
    font-size: 8mm;
    font-weight: 900;
    line-height: 8mm;
    color: #111;
    background: #fff;
  }
  .nv-label-flip {
    position: absolute;
    z-index: 2;
    top: 0.7mm;
    right: 1mm;
    padding: 0 0.8mm;
    border: 0.35mm solid #111;
    background: #fff;
    font-size: 3.8mm;
    font-weight: 900;
    line-height: 4.2mm;
    letter-spacing: 0.4mm;
  }
  .nv-label-machine {
    display: grid;
    grid-template-rows: 15mm minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    border-left: 0.25mm solid #111;
  }
  .nv-label-diagram-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding-top: 3mm;
  }
  .nv-label-diagram {
    width: 38mm;
    height: 12mm;
  }
  .nv-label-panel {
    fill: #fff;
    stroke: #111;
    stroke-width: 4;
  }
  .nv-label-edge {
    fill: none;
    stroke: #111;
    stroke-width: 9;
    stroke-linecap: round;
  }
  .nv-label-edge-text {
    fill: #111;
    font-size: 34px;
    font-weight: 700;
  }
  .nv-label-code-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
  }
  .nv-label-code {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .nv-label-qr {
    flex: 0 0 20mm;
    width: 20mm;
    height: 20mm;
  }
  .nv-label-code span {
    font-size: 3mm;
    font-weight: 700;
    line-height: 3mm;
    white-space: nowrap;
  }
  /* No QR (REV-FC-01: the program stem does not fit QR v1-L): the whole stem, wrapping anywhere in the
     38 mm column, never cut off; a very long one smaller. */
  .nv-label-code.is-text {
    max-width: 34mm;
  }
  .nv-label-code.is-text span {
    max-width: 34mm;
    font-size: 3.4mm;
    line-height: 3.9mm;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .nv-label-code.is-long span {
    font-size: 2.8mm;
    line-height: 3.2mm;
  }
  /* The nesting band (where the Connector has its logos): sheet thumbnail · 판 3/22 · 순서 7 · 2 · ⟲. */
  .nv-label-nest {
    display: flex;
    align-items: center;
    gap: 2.4mm;
    min-width: 0;
    padding: 0 3mm;
    border-top: 0.25mm solid #111;
  }
  .nv-label-nest .nv-label-thumb {
    flex: 0 0 20mm;
    width: 20mm;
    height: 9mm;
  }
  .nv-label-where {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    font-size: 4.2mm;
    font-weight: 800;
  }
  .nv-label-where-main,
  .nv-label-stock {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* A sheet cut from a kept remnant: 「보관 잔재 R9-1 · demo_kitchen 10-14」 under 판 · 순서. */
  .nv-label-stock {
    font-size: 2.7mm;
    font-weight: 700;
    line-height: 3.1mm;
  }
  .nv-label-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 6.4mm;
    height: 6.4mm;
    padding: 0 0.8mm;
    border: 0.45mm solid #111;
    border-radius: 1.2mm;
    font-size: 4.4mm;
    font-weight: 900;
    line-height: 1;
  }
  /* 「2」 two passes: solid, so it is not read as a quantity next to 순서. */
  .nv-label-two {
    background: #111;
    color: #fff;
  }
  .nv-label-thumb-sheet {
    fill: #fff;
    stroke: #111;
    stroke-width: 0.8;
    vector-effect: non-scaling-stroke;
  }
  .nv-label-thumb-part {
    fill: #cfcfcf;
    stroke: #6b6b6b;
    stroke-width: 0.5;
    vector-effect: non-scaling-stroke;
  }
  .nv-label-thumb-remnant {
    fill: #fff;
    stroke: #111;
    stroke-width: 0.6;
    stroke-dasharray: 2 1.5;
    vector-effect: non-scaling-stroke;
  }
  .nv-label-thumb-self {
    fill: #111;
    stroke: #111;
    stroke-width: 0.6;
    vector-effect: non-scaling-stroke;
  }
  /* A remnant label: the sheet picture takes the right column. */
  .nv-label-remnant-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2mm;
  }
  .nv-label-remnant-thumb .nv-label-thumb {
    width: 34mm;
    height: 30mm;
  }
  .nv-label-remnant-id {
    font-size: 7mm;
    line-height: 7.6mm;
  }
  /* REV-FU-06: the grain on its own line under material · thickness (「결 358 mm 변 방향」), never cut off
     by a long material name; three white strokes along it on the remnant in the picture. */
  .nv-label-remnant .nv-label-info {
    grid-template-rows: auto 1fr auto auto;
  }
  .nv-label-grain {
    overflow: hidden;
    font-size: 3.6mm;
    font-weight: 800;
    line-height: 4.2mm;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nv-label-thumb-grain {
    fill: none;
    stroke: #fff;
    stroke-width: 1.2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
  }

  /* 「작업 보고서」 (A4 portrait). */
  .nv-print-report {
    font-size: 9.5pt;
    line-height: 1.35;
  }
  .nv-report {
    page: nv-report;
  }
  .nv-report-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1mm 5mm;
    padding-bottom: 2mm;
    border-bottom: 0.5mm solid #000;
  }
  .nv-report-head h1 {
    margin: 0;
    font-size: 16pt;
  }
  .nv-report-job {
    font-size: 12pt;
    font-weight: 700;
  }
  .nv-report-meta {
    margin-left: auto;
    color: #333;
    font-size: 9pt;
  }
  .nv-report-summary {
    flex: 1 1 100%;
    margin: 1mm 0 0;
    font-size: 11pt;
    font-weight: 700;
  }
  .nv-report-section {
    margin-top: 5mm;
  }
  .nv-report-section h2 {
    margin: 0 0 1.5mm;
    font-size: 12pt;
    break-after: avoid;
  }
  .nv-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
  }
  .nv-report-table thead {
    display: table-header-group;
  }
  .nv-report-table th,
  .nv-report-table td {
    padding: 0.7mm 1.6mm;
    border: 0.2mm solid #888;
    text-align: left;
    white-space: nowrap;
  }
  .nv-report-table th {
    background: #eee;
  }
  .nv-report-table tr {
    break-inside: avoid;
  }
  .nv-report-table tfoot td {
    border-top: 0.45mm solid #000;
    font-weight: 700;
  }
  .nv-report-table .nv-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  /* RD-A-05: 「원장 5장 + 보관 잔재 2장」 in the 판 (장) column may take two lines. */
  .nv-report-materials td:nth-child(3) {
    white-space: normal;
  }
  .nv-report-line,
  .nv-report-note,
  .nv-report-empty {
    margin: 1.2mm 0 0;
  }
  .nv-report-note,
  .nv-report-notes {
    color: #333;
    font-size: 8pt;
  }
  .nv-report-notes {
    margin-top: 6mm;
    padding-top: 1.5mm;
    border-top: 0.2mm solid #888;
  }
  .nv-report-notes p {
    margin: 0.6mm 0;
  }
}

/* ---------------------------------------------------------------- 시뮬레이션 (nv/player) */

/* The playback bar under the stage (the /nc-viewer .nc-player-bar frame) and the stage-head button
   「▶ 시뮬레이션」. One row of controls, no step text: the bar keeps its height from step to step and the
   shell reports it as the sheet's bottom inset. Playback colours pair yellow with a near-black edge
   (the yellow alone is 1:1 on the tan parts). */
#nv-stage {
  container-name: nv-stage;
  --nv-player-fill: #f5b700;
  --nv-player-outline: #111827;
  --nv-player-done: #6b4a2b;
  --nv-player-rail: color-mix(in srgb, var(--nv-text-dim) 25%, transparent);
}
:root[data-theme="dark"] #nv-stage {
  --nv-player-fill: #ffd23f;
  --nv-player-done: #c39466;
  --nv-player-rail: color-mix(in srgb, var(--nv-text-dim) 34%, transparent);
}

/* 「▶ 시뮬레이션」 / 「■ 시뮬레이션 끝내기」 (aria-pressed) in the stage head's #nv-stage-actions. */
.nv-sim-toggle {
  gap: 5px;
  height: 26px;
  padding: 0 10px 0 8px;
  border-color: color-mix(in srgb, var(--nv-accent) 40%, var(--nv-border));
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
  font-weight: var(--nv-fw-semibold);
  white-space: nowrap;
}
.nv-sim-toggle:hover:not([aria-disabled="true"]) {
  background: color-mix(in srgb, var(--nv-accent) 20%, transparent);
}
.nv-sim-toggle.is-on {
  border-color: var(--nv-accent);
  background: var(--nv-accent);
  color: var(--nv-accent-contrast);
}
.nv-sim-toggle.is-on:hover {
  background: var(--nv-accent-strong);
}
.nv-sim-toggle[aria-disabled="true"] {
  border-color: var(--nv-border);
  background: transparent;
  color: var(--nv-text-dim);
  cursor: not-allowed;
}
.nv-sim-toggle-mark {
  font-size: var(--nv-fs-micro);
  line-height: 1;
}
/* A narrow stage (a 1280 px window with both panels still leaves ~780 px): the mark only; the name
   stays in aria-label and title. */
@container (max-width: 700px) {
  .nv-sim-toggle .nv-btn-label {
    display: none;
  }
  .nv-sim-toggle {
    width: 28px;
    padding: 0;
    justify-content: center;
  }
}

/* 「회전」 · 「드래그 안함」 while it plays (D3 4.7). */
.nv-btn.is-sim-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* The legend steps above the bar while it is on (D2 §5). */
#nv-stage[data-sim="on"] .nv-stage-legend {
  bottom: calc(var(--nv-sim-bar-h, 0px) + 22px);
}

/* The saw cut the simulation is at: its 「톱 절단 순서」 row in light yellow with a yellow edge (the
   playback colour, not the selection's blue) and the parts it frees underlined (REV-U-10; the shell
   sets is-current from ui.sawCurrent). Paint only: a bolder weight re-lays the whole table out on every
   step (about 6 ms on a 66-cut sheet, M-18). */
.nv-saw-table tbody tr.is-current {
  background: rgba(245, 183, 0, 0.16);
}
.nv-saw-table tbody tr.is-current > td:first-child {
  box-shadow: inset 3px 0 0 #f5b700;
}
:root[data-theme="dark"] .nv-saw-table tbody tr.is-current {
  background: rgba(255, 210, 63, 0.14);
}
:root[data-theme="dark"] .nv-saw-table tbody tr.is-current > td:first-child {
  box-shadow: inset 3px 0 0 #ffd23f;
}
.nv-saw-table tbody tr.is-current .nv-saw-part-name {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.nv-player-bar {
  position: absolute;
  z-index: 14;
  right: 16px;
  bottom: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  background: var(--nv-panel);
  background: color-mix(in srgb, var(--nv-panel) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--nv-shadow);
  color: var(--nv-text);
  font-size: var(--nv-fs-md);
  line-height: 1.35;
  container: nv-sim / inline-size;
}
/* A wide stage (the simulation folds the panels, M-10): a longer bar; the slider takes the extra room. */
@container nv-stage (min-width: 1100px) {
  .nv-player-bar {
    max-width: 1040px;
  }
}
/* The narrow-window drawer covers the stage's right side: the bar stays left of it. */
#nv-main[data-right="drawer"] .nv-player-bar {
  right: calc(var(--nv-right-w) + 16px);
}

.nv-player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
}
.nv-player-transport {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1px;
}
.nv-player-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--nv-text);
  cursor: pointer;
}
.nv-player-btn:hover {
  background: var(--nv-panel-2);
}
.nv-player-btn:active {
  background: color-mix(in srgb, var(--nv-accent) 18%, transparent);
}
.nv-player-icon {
  display: inline-grid;
  place-items: center;
}
.nv-player-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.nv-player-btn-first svg,
.nv-player-btn-last svg,
.nv-player-icon-play svg,
.nv-player-more svg {
  fill: currentColor;
}
.nv-player-icon-pause svg {
  stroke-width: 2.8;
}
.nv-player-btn-toggle {
  width: 32px;
  height: 32px;
  margin: 0 2px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--nv-accent) 16%, transparent);
  color: var(--nv-accent);
}
.nv-player-btn-toggle:hover {
  background: color-mix(in srgb, var(--nv-accent) 26%, transparent);
}
.nv-player-btn-toggle .nv-player-icon-pause,
.nv-player-bar[data-playing] .nv-player-btn-toggle .nv-player-icon-play {
  display: none;
}
.nv-player-bar[data-playing] .nv-player-btn-toggle .nv-player-icon-pause {
  display: inline-grid;
}

/* Slider: a 6 px rail with one cell per step (passed brown — labels a lighter brown —,
   now yellow framed, to come = rail; a panel-saw cut cell takes its saw colour), a 2 px gap where the
   kind of step changes (data-edge: the runs Shift+←/→ go between) and the playback thumb (nv/player
   moves it with its own transform). */
.nv-player-scrub {
  position: relative;
  flex: 1 1 200px;
  min-width: 96px;
  height: 24px;
  margin: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  touch-action: none;
}
.nv-player-rail {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 6px;
  margin-top: -3px;
  border-radius: 1px;
  background: var(--nv-player-rail);
}
.nv-player-cells {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 12px;
  margin-top: -6px;
  pointer-events: none;
}
.nv-player-cell {
  position: absolute;
  top: 3px;
  height: 6px;
  border-right: 1px solid var(--nv-panel);
}
.nv-player-cell[data-edge] {
  border-right-width: 2px;
}
.nv-player-cell[data-state="done"] {
  background: var(--nv-player-done);
}
.nv-player-cell[data-kind="label"][data-state="done"] {
  background: color-mix(in srgb, var(--nv-player-done) 55%, var(--nv-panel));
}
.nv-player-cells.is-saw .nv-player-cell[data-state="done"] {
  background: var(--nv-player-cell, var(--nv-player-done));
}
.nv-player-cell[data-state="current"] {
  top: 0;
  height: 12px;
  border: 2px solid var(--nv-player-outline);
  border-radius: 2px;
  background: var(--nv-player-fill);
}
.nv-player-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--nv-player-outline);
  border-radius: 50%;
  background: var(--nv-player-fill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  will-change: transform;
}
.nv-player-scrub:hover .nv-player-thumb,
.nv-player-bar[data-scrubbing] .nv-player-thumb {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
}

/* 「절단 7/13」 — never a time. */
.nv-player-counter {
  flex: none;
  min-width: 6.5em;
  color: var(--nv-text-dim);
  font-size: var(--nv-fs-sm);
  font-weight: var(--nv-fw-semibold);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.nv-player-options {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}
.nv-player-speed {
  height: 26px;
  padding: 0 4px;
  border: 1px solid var(--nv-border);
  border-radius: 6px;
  background: var(--nv-panel-2);
  color: var(--nv-text);
  font: inherit;
  font-size: var(--nv-fs-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.nv-player-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--nv-border);
  border-radius: 13px;
  background: var(--nv-panel-2);
  color: var(--nv-text);
  font: inherit;
  font-size: var(--nv-fs-sm);
  white-space: nowrap;
  cursor: pointer;
}
.nv-player-chip[hidden] {
  display: none;
}
.nv-player-chip:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--nv-accent) 45%, var(--nv-border));
}
.nv-player-chip:disabled {
  color: var(--nv-text-dim);
  cursor: default;
}
.nv-player-chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--nv-accent) 45%, transparent);
  background: var(--nv-accent-soft);
  color: var(--nv-accent-strong);
  font-weight: var(--nv-fw-semibold);
}
.nv-player-next-sheet:not(:disabled) {
  border-color: var(--nv-accent);
  background: var(--nv-accent);
  color: var(--nv-accent-contrast);
  font-weight: var(--nv-fw-semibold);
}
/* 「화면 따라가기 꺼짐」: shown while the user moved the view; pressing it shows the whole sheet again.
   Words; on a narrow bar its icon alone (below). */
.nv-player-follow {
  border-color: color-mix(in srgb, var(--nv-warning) 40%, transparent);
  background: var(--nv-warning-soft);
  color: var(--nv-warning);
}
.nv-player-follow .nv-player-icon {
  display: none;
}
.nv-player-follow .nv-player-icon svg {
  width: 15px;
  height: 15px;
}
.nv-player-more {
  display: none;
}
.nv-player-close .nv-player-icon svg {
  width: 13px;
  height: 13px;
}

.nv-player-bar :is(.nv-player-btn, .nv-player-chip, .nv-player-speed, .nv-player-scrub):focus-visible {
  outline: 2px solid var(--nv-accent);
  outline-offset: 2px;
}

/* Narrow bars: speed and 「이어 보기」 behind ⋯ above the bar, where the row stops fitting. Row widths
   (px, measured: transport 152, slider ≥ 96 + 8, counter 78–90, 「화면 따라가기 꺼짐」 110, 「다음 판 ›」 63,
   speed + 「이어 보기」 148, 「닫기」 57, gaps 6) — a chip that shows (nv/player data-follow-off ·
   data-end) folds them sooner: 600 without chips, 680 with 「다음 판 ›」, 730 with 「화면 따라가기 꺼짐」,
   800 with both; each leaves the slider about 120 px or more. */
@container nv-sim (max-width: 600px) {
  .nv-player-more {
    display: inline-grid;
  }
  .nv-player-options {
    display: none;
  }
  .nv-player-counter {
    min-width: 0;
  }
  .nv-player-close > span:first-child {
    display: none;
  }
}
@container nv-sim (max-width: 680px) {
  .nv-player-bar[data-end] .nv-player-more {
    display: inline-grid;
  }
  .nv-player-bar[data-end] .nv-player-options {
    display: none;
  }
}
@container nv-sim (max-width: 730px) {
  .nv-player-bar[data-follow-off] .nv-player-more {
    display: inline-grid;
  }
  .nv-player-bar[data-follow-off] .nv-player-options {
    display: none;
  }
}
@container nv-sim (max-width: 800px) {
  .nv-player-bar[data-follow-off][data-end] .nv-player-more {
    display: inline-grid;
  }
  .nv-player-bar[data-follow-off][data-end] .nv-player-options {
    display: none;
  }
}
/* 「화면 따라가기 꺼짐」 as its icon alone: below 560 px, below 660 px next to 「다음 판 ›」. */
@container nv-sim (max-width: 560px) {
  .nv-player-follow {
    justify-content: center;
    width: 30px;
    padding: 0;
  }
  .nv-player-follow .nv-player-icon {
    display: inline-grid;
  }
  .nv-player-follow .nv-player-chip-text {
    display: none;
  }
}
@container nv-sim (max-width: 660px) {
  .nv-player-bar[data-end] .nv-player-follow {
    justify-content: center;
    width: 30px;
    padding: 0;
  }
  .nv-player-bar[data-end] .nv-player-follow .nv-player-icon {
    display: inline-grid;
  }
  .nv-player-bar[data-end] .nv-player-follow .nv-player-chip-text {
    display: none;
  }
}
@container nv-sim (max-width: 420px) {
  .nv-player-btn-first,
  .nv-player-btn-last,
  .nv-player-counter {
    display: none;
  }
}
@container nv-sim (max-width: 380px) {
  .nv-player-scrub {
    min-width: 40px;
  }
}
/* The open ⋯ popover (nv/player closes it when the bar's width or its chips change: it is open only
   while ⋯ shows). */
.nv-player-bar[data-more] > .nv-player-controls > .nv-player-options {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid var(--nv-border);
  border-radius: 10px;
  background: var(--nv-panel);
  box-shadow: var(--nv-shadow);
}
.nv-player-bar[data-more] .nv-player-more {
  background: var(--nv-panel-2);
  color: var(--nv-accent);
}

/* Touch screens: 32 px buttons. */
@media (pointer: coarse) {
  .nv-player-btn {
    width: 32px;
    height: 32px;
  }
  .nv-player-chip,
  .nv-player-speed {
    height: 32px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nv-player-btn,
  .nv-player-chip {
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  }
}
