/* CATWIN UI v0.4.1: 토큰과 공통 라이브러리. 생성 파일입니다. 저장소 루트에서 node apps/common/ui/scripts/build.mjs를 실행합니다. */

/* CATWIN UI 토큰 v0.4.1
   생성 파일입니다. 직접 고치지 말고 tokens/catwin.tokens.json을 고친 뒤 저장소 루트에서 node apps/common/ui/scripts/build-tokens.mjs를 실행합니다. */

:root {
  /* 색 구성표 */
  --cw-scheme: dark;

  /* 색 · 바탕과 글자 */
  --cw-bg: #191A1C;
  --cw-surface: #242628;
  --cw-paper: #303235;
  --cw-field: rgba(0, 0, 0, .20);
  --cw-inset: #191A1C;
  --cw-text: #E7EEF7;
  --cw-text-muted: #909BAC;
  --cw-steel: #7D899C;

  /* 색 · 선과 면 상태 */
  --cw-line: rgba(255, 255, 255, .08);
  --cw-line-strong: rgba(255, 255, 255, .16);
  --cw-line-control: #6B717B;
  --cw-hover: rgba(255, 255, 255, .065);
  --cw-pressed: rgba(255, 255, 255, .04);
  --cw-selected: rgba(110, 168, 242, .10);
  --cw-text-selection: rgba(110, 168, 242, .35);
  --cw-scroll-thumb: rgba(255, 255, 255, .22);
  --cw-knob: #F2F5F9;

  /* 색 · 콘텐츠 기능 */
  --cw-action: #6EA8F2;
  --cw-on-action: #191A1C;
  --cw-selection: #6EA8F2;
  --cw-focus: #6EA8F2;
  --cw-focus-halo: rgba(110, 168, 242, .30);
  --cw-emphasis: #F2C94C;
  --cw-series: #D7B58D;

  /* 색 · 채운 버튼과 위험 조작 */
  --cw-action-fill: #3D72C2;
  --cw-action-fill-hover: #4276C3;
  --cw-action-fill-pressed: #3869B2;
  --cw-destructive: #C23D44;
  --cw-destructive-hover: #C9464D;
  --cw-destructive-pressed: #AD353B;
  --cw-destructive-text: #EB8A8E;
  --cw-on-solid: #FFFFFF;

  /* 색 · 조작 요소의 면 */
  --cw-control: rgba(255, 255, 255, .065);
  --cw-control-hover: rgba(255, 255, 255, .10);
  --cw-control-pressed: rgba(255, 255, 255, .045);
  --cw-control-edge: rgba(255, 255, 255, .08);
  --cw-field-hover: rgba(0, 0, 0, .26);
  --cw-field-focus: rgba(0, 0, 0, .30);
  --cw-field-edge: rgba(255, 255, 255, .36);
  --cw-check-edge: rgba(255, 255, 255, .42);
  --cw-knob-off: rgba(255, 255, 255, .62);
  --cw-track: rgba(0, 0, 0, .22);
  --cw-thumb: rgba(255, 255, 255, .13);
  --cw-item-hover: rgba(255, 255, 255, .08);
  --cw-float-edge: rgba(255, 255, 255, .09);
  --cw-kbd: rgba(255, 255, 255, .08);
  --cw-text-disabled: rgba(231, 238, 247, .34);
  --cw-fill-disabled: rgba(255, 255, 255, .03);

  /* 색 · 창 조작 */
  --cw-close-hover: #C42B1C;
  --cw-on-close: #FFFFFF;

  /* 색 · 판정 */
  --cw-success: #08C98F;
  --cw-warning: #DC990F;
  --cw-danger: #EC5FC0;
  --cw-hold: #AAB7CA;
  --cw-on-fill: #191A1C;
  --cw-on-danger: #191A1C;

  /* 색 · 해석 범례 */
  --cw-map-low: #4D689D;
  --cw-map-mid: #7C8795;
  --cw-map-high: #F2C94C;
  --cw-map-negative: #3F91DB;
  --cw-map-zero: #DFE5ED;
  --cw-map-positive: #F07858;

  /* 색 · 브랜드와 프로그램 대표색 */
  --cw-brand: #295CDB;
  --cw-brand-secondary: #C1B6ED;
  --cw-brand-highlight: #F2C94C;
  --cw-reviewer: #4F8FF7;
  --cw-engineer: #A88BEA;
  --cw-modeler: #46C99A;
  --cw-designer: #F17D61;
  --cw-plugins: #E9BE4A;
  --cw-learn: #4FC8D7;

  /* 칠: 대표색을 바탕에 섞는 비율 */
  --cw-tint-product: 14%;
  --cw-tint-product-inactive: 6%;

  /* 글꼴 */
  --cw-font-ui: "Pretendard Variable", "Pretendard", "Segoe UI", "Malgun Gothic", sans-serif;
  --cw-font-code: "Cascadia Code", "Cascadia Mono", Consolas, "Pretendard Variable", "Pretendard", "Malgun Gothic", monospace;

  /* 글자 단계: 크기 / 줄 높이 */
  --cw-fs-caption: 12px;
  --cw-lh-caption: 18px;
  --cw-fs-small: 13px;
  --cw-lh-small: 20px;
  --cw-fs-body: 14px;
  --cw-lh-body: 22px;
  --cw-lh-read: 24px;
  --cw-fs-subtitle: 16px;
  --cw-lh-subtitle: 24px;
  --cw-fs-title: 18px;
  --cw-lh-title: 26px;
  --cw-fs-heading: 24px;
  --cw-lh-heading: 32px;
  --cw-fs-code: 13px;
  --cw-lh-code: 20px;
  --cw-fw-regular: 400;
  --cw-fw-medium: 500;
  --cw-fw-strong: 600;

  /* 간격: 4px 격자, 관계 이름 */
  --cw-space-tight: 4px;
  --cw-space-item: 8px;
  --cw-space-control: 12px;
  --cw-space-group: 16px;
  --cw-space-panel: 20px;
  --cw-space-gutter: 24px;
  --cw-space-section: 32px;
  --cw-space-region: 48px;

  /* 크기: 조작 요소 높이 */
  --cw-h-compact: 28px;
  --cw-h-tool: 32px;
  --cw-h-control: 36px;
  --cw-h-decision: 40px;
  --cw-h-row: 36px;
  --cw-h-tab: 40px;

  /* 크기: 화면 틀 */
  --cw-h-titlebar: 40px;
  --cw-h-toolbar: 48px;
  --cw-h-panel-head: 48px;
  --cw-h-statusbar: 28px;
  --cw-w-rail: 48px;
  --cw-w-left: 280px;
  --cw-w-left-min: 240px;
  --cw-w-left-max: 360px;
  --cw-w-right: 360px;
  --cw-w-right-min: 300px;
  --cw-w-right-max: 480px;
  --cw-w-read: 720px;
  --cw-w-dialog: 480px;
  --cw-w-dialog-wide: 640px;
  --cw-w-scrollbar: 12px;
  --cw-w-caption: 46px;
  --cw-w-traffic: 78px;
  --cw-w-center-min: 480px;
  --cw-w-handle: 8px;
  --cw-w-snap: 8px;
  --cw-w-collapse-pull: 48px;
  --cw-w-side-rail: 32px;
  --cw-w-decision-min: 88px;
  --cw-w-reader-toc: 240px;
  --cw-w-menu-min: 240px;
  --cw-w-tip-max: 320px;
  --cw-w-toast: 360px;
  --cw-w-finder: 440px;
  --cw-w-settings-nav: 200px;
  --cw-h-cell: 24px;
  --cw-w-fwin-min: 240px;
  --cw-h-fwin-min: 120px;
  --cw-w-blue-float: 380px;
  --cw-h-blue-float: 560px;
  --cw-w-blue-pin: 360px;
  --cw-w-blue-pin-min: 300px;
  --cw-w-blue-pin-max: 560px;

  /* 아이콘 */
  --cw-icon-sm: 16px;
  --cw-icon-md: 20px;
  --cw-icon-lg: 24px;
  --cw-icon-stroke: 1.5px;

  /* 모서리 */
  --cw-radius-badge: 3px;
  --cw-radius-control: 8px;
  --cw-radius-container: 12px;

  /* 선 */
  --cw-border: 1px;
  --cw-hairline: 1px;
  --cw-bar-selected: 3px;
  --cw-focus-width: 2px;
  --cw-focus-offset: 1px;

  /* 깊이: 조작 요소와 떠 있는 면 */
  --cw-shadow-control: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 1px rgba(0, 0, 0, .28);
  --cw-shadow-action: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(0, 0, 0, .30);
  --cw-shadow-thumb: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .35);
  --cw-shadow-float: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(0, 0, 0, .45), 0 4px 10px rgba(0, 0, 0, .22), 0 18px 44px rgba(0, 0, 0, .38);

  /* 움직임 */
  --cw-dur-fast: 100ms;
  --cw-dur-base: 160ms;
  --cw-dur-slow: 240ms;
  --cw-ease: cubic-bezier(.2, 0, 0, 1);
}

/* 테마 · light: 밝은 테마. 문서 면이 흰색이고 바탕이 가장 어둡다. 판정색과 대표색은 색상을 유지하고 명도만 낮춰 흰 바탕에서 4.5:1을 넘긴다. 해석 범례는 데이터 색이므로 영점만 바꾼다. 타이틀바 칠은 밝은 바탕에서 더 옅게 섞는다. */
[data-theme="light"] {
  --cw-scheme: light;
  --cw-bg: #E9EAEC;
  --cw-surface: #F4F5F6;
  --cw-paper: #FFFFFF;
  --cw-field: #FFFFFF;
  --cw-inset: #EEF0F2;
  --cw-text: #1B1D20;
  --cw-text-muted: #5C6572;
  --cw-steel: #7A8494;
  --cw-line: rgba(0, 0, 0, .08);
  --cw-line-strong: rgba(0, 0, 0, .16);
  --cw-line-control: #7A818B;
  --cw-hover: rgba(0, 0, 0, .045);
  --cw-pressed: rgba(0, 0, 0, .07);
  --cw-selected: rgba(42, 102, 219, .10);
  --cw-text-selection: rgba(42, 102, 219, .22);
  --cw-scroll-thumb: rgba(0, 0, 0, .28);
  --cw-knob: #FFFFFF;
  --cw-action: #2A66DB;
  --cw-on-action: #FFFFFF;
  --cw-selection: #2A66DB;
  --cw-focus: #2A66DB;
  --cw-focus-halo: rgba(42, 102, 219, .25);
  --cw-emphasis: #8A6700;
  --cw-series: #A47F4A;
  --cw-success: #0A7554;
  --cw-warning: #8F5B00;
  --cw-danger: #B5207F;
  --cw-hold: #596679;
  --cw-on-fill: #FFFFFF;
  --cw-on-danger: #FFFFFF;
  --cw-map-zero: #AEB6C1;
  --cw-reviewer: #1F62CC;
  --cw-engineer: #6F50C0;
  --cw-modeler: #157252;
  --cw-designer: #B4412A;
  --cw-plugins: #876400;
  --cw-learn: #0F7187;
  --cw-shadow-float: 0 0 0 1px rgba(0, 0, 0, .08), 0 4px 10px rgba(0, 0, 0, .07), 0 18px 44px rgba(0, 0, 0, .16);
  --cw-tint-product: 10%;
  --cw-tint-product-inactive: 5%;
  --cw-action-fill: #3265C3;
  --cw-action-fill-hover: #396DCB;
  --cw-action-fill-pressed: #2B58AA;
  --cw-destructive: #B63A3A;
  --cw-destructive-hover: #C04343;
  --cw-destructive-pressed: #9E3232;
  --cw-destructive-text: #B63A3A;
  --cw-control: #FFFFFF;
  --cw-control-hover: #F8F9FA;
  --cw-control-pressed: #EFF1F3;
  --cw-control-edge: rgba(0, 0, 0, .11);
  --cw-field-hover: #FBFBFC;
  --cw-field-focus: #FFFFFF;
  --cw-field-edge: rgba(0, 0, 0, .44);
  --cw-check-edge: rgba(0, 0, 0, .46);
  --cw-knob-off: rgba(0, 0, 0, .55);
  --cw-track: rgba(0, 0, 0, .055);
  --cw-thumb: #FFFFFF;
  --cw-item-hover: rgba(0, 0, 0, .055);
  --cw-float-edge: transparent;
  --cw-kbd: rgba(0, 0, 0, .06);
  --cw-text-disabled: rgba(27, 29, 32, .34);
  --cw-fill-disabled: rgba(0, 0, 0, .035);
  --cw-shadow-control: inset 0 -1px 0 rgba(0, 0, 0, .05), 0 1px 1px rgba(0, 0, 0, .05);
  --cw-shadow-action: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(17, 40, 90, .22);
  --cw-shadow-thumb: 0 0 0 1px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12);
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --cw-scheme: light;
    --cw-bg: #E9EAEC;
    --cw-surface: #F4F5F6;
    --cw-paper: #FFFFFF;
    --cw-field: #FFFFFF;
    --cw-inset: #EEF0F2;
    --cw-text: #1B1D20;
    --cw-text-muted: #5C6572;
    --cw-steel: #7A8494;
    --cw-line: rgba(0, 0, 0, .08);
    --cw-line-strong: rgba(0, 0, 0, .16);
    --cw-line-control: #7A818B;
    --cw-hover: rgba(0, 0, 0, .045);
    --cw-pressed: rgba(0, 0, 0, .07);
    --cw-selected: rgba(42, 102, 219, .10);
    --cw-text-selection: rgba(42, 102, 219, .22);
    --cw-scroll-thumb: rgba(0, 0, 0, .28);
    --cw-knob: #FFFFFF;
    --cw-action: #2A66DB;
    --cw-on-action: #FFFFFF;
    --cw-selection: #2A66DB;
    --cw-focus: #2A66DB;
    --cw-focus-halo: rgba(42, 102, 219, .25);
    --cw-emphasis: #8A6700;
    --cw-series: #A47F4A;
    --cw-success: #0A7554;
    --cw-warning: #8F5B00;
    --cw-danger: #B5207F;
    --cw-hold: #596679;
    --cw-on-fill: #FFFFFF;
    --cw-on-danger: #FFFFFF;
    --cw-map-zero: #AEB6C1;
    --cw-reviewer: #1F62CC;
    --cw-engineer: #6F50C0;
    --cw-modeler: #157252;
    --cw-designer: #B4412A;
    --cw-plugins: #876400;
    --cw-learn: #0F7187;
    --cw-shadow-float: 0 0 0 1px rgba(0, 0, 0, .08), 0 4px 10px rgba(0, 0, 0, .07), 0 18px 44px rgba(0, 0, 0, .16);
    --cw-tint-product: 10%;
    --cw-tint-product-inactive: 5%;
    --cw-action-fill: #3265C3;
    --cw-action-fill-hover: #396DCB;
    --cw-action-fill-pressed: #2B58AA;
    --cw-destructive: #B63A3A;
    --cw-destructive-hover: #C04343;
    --cw-destructive-pressed: #9E3232;
    --cw-destructive-text: #B63A3A;
    --cw-control: #FFFFFF;
    --cw-control-hover: #F8F9FA;
    --cw-control-pressed: #EFF1F3;
    --cw-control-edge: rgba(0, 0, 0, .11);
    --cw-field-hover: #FBFBFC;
    --cw-field-focus: #FFFFFF;
    --cw-field-edge: rgba(0, 0, 0, .44);
    --cw-check-edge: rgba(0, 0, 0, .46);
    --cw-knob-off: rgba(0, 0, 0, .55);
    --cw-track: rgba(0, 0, 0, .055);
    --cw-thumb: #FFFFFF;
    --cw-item-hover: rgba(0, 0, 0, .055);
    --cw-float-edge: transparent;
    --cw-kbd: rgba(0, 0, 0, .06);
    --cw-text-disabled: rgba(27, 29, 32, .34);
    --cw-fill-disabled: rgba(0, 0, 0, .035);
    --cw-shadow-control: inset 0 -1px 0 rgba(0, 0, 0, .05), 0 1px 1px rgba(0, 0, 0, .05);
    --cw-shadow-action: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(17, 40, 90, .22);
    --cw-shadow-thumb: 0 0 0 1px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .12);
  }
}

/* 테마 · dark: 밝은 영역 안의 어두운 영역 */
[data-theme="dark"] {
  --cw-scheme: dark;
  --cw-bg: #191A1C;
  --cw-surface: #242628;
  --cw-paper: #303235;
  --cw-field: rgba(0, 0, 0, .20);
  --cw-inset: #191A1C;
  --cw-text: #E7EEF7;
  --cw-text-muted: #909BAC;
  --cw-steel: #7D899C;
  --cw-line: rgba(255, 255, 255, .08);
  --cw-line-strong: rgba(255, 255, 255, .16);
  --cw-line-control: #6B717B;
  --cw-hover: rgba(255, 255, 255, .065);
  --cw-pressed: rgba(255, 255, 255, .04);
  --cw-selected: rgba(110, 168, 242, .10);
  --cw-text-selection: rgba(110, 168, 242, .35);
  --cw-scroll-thumb: rgba(255, 255, 255, .22);
  --cw-knob: #F2F5F9;
  --cw-action: #6EA8F2;
  --cw-on-action: #191A1C;
  --cw-selection: #6EA8F2;
  --cw-focus: #6EA8F2;
  --cw-focus-halo: rgba(110, 168, 242, .30);
  --cw-emphasis: #F2C94C;
  --cw-series: #D7B58D;
  --cw-success: #08C98F;
  --cw-warning: #DC990F;
  --cw-danger: #EC5FC0;
  --cw-hold: #AAB7CA;
  --cw-on-fill: #191A1C;
  --cw-on-danger: #191A1C;
  --cw-map-zero: #DFE5ED;
  --cw-reviewer: #4F8FF7;
  --cw-engineer: #A88BEA;
  --cw-modeler: #46C99A;
  --cw-designer: #F17D61;
  --cw-plugins: #E9BE4A;
  --cw-learn: #4FC8D7;
  --cw-shadow-float: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(0, 0, 0, .45), 0 4px 10px rgba(0, 0, 0, .22), 0 18px 44px rgba(0, 0, 0, .38);
  --cw-tint-product: 14%;
  --cw-tint-product-inactive: 6%;
  --cw-action-fill: #3D72C2;
  --cw-action-fill-hover: #4276C3;
  --cw-action-fill-pressed: #3869B2;
  --cw-destructive: #C23D44;
  --cw-destructive-hover: #C9464D;
  --cw-destructive-pressed: #AD353B;
  --cw-destructive-text: #EB8A8E;
  --cw-control: rgba(255, 255, 255, .065);
  --cw-control-hover: rgba(255, 255, 255, .10);
  --cw-control-pressed: rgba(255, 255, 255, .045);
  --cw-control-edge: rgba(255, 255, 255, .08);
  --cw-field-hover: rgba(0, 0, 0, .26);
  --cw-field-focus: rgba(0, 0, 0, .30);
  --cw-field-edge: rgba(255, 255, 255, .36);
  --cw-check-edge: rgba(255, 255, 255, .42);
  --cw-knob-off: rgba(255, 255, 255, .62);
  --cw-track: rgba(0, 0, 0, .22);
  --cw-thumb: rgba(255, 255, 255, .13);
  --cw-item-hover: rgba(255, 255, 255, .08);
  --cw-float-edge: rgba(255, 255, 255, .09);
  --cw-kbd: rgba(255, 255, 255, .08);
  --cw-text-disabled: rgba(231, 238, 247, .34);
  --cw-fill-disabled: rgba(255, 255, 255, .03);
  --cw-shadow-control: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 1px rgba(0, 0, 0, .28);
  --cw-shadow-action: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(0, 0, 0, .30);
  --cw-shadow-thumb: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .35);
}

/* CAD·BIM 안의 좁은 패널. 안쪽 값과 높이만 줄이고 바깥 간격과 글자 크기는 유지한다. */
[data-density="compact"] {
  --cw-space-control: 8px;
  --cw-space-panel: 12px;
  --cw-h-tool: 28px;
  --cw-h-control: 32px;
  --cw-h-decision: 36px;
  --cw-h-row: 28px;
  --cw-h-tab: 32px;
  --cw-h-toolbar: 40px;
  --cw-h-panel-head: 40px;
}

/* 2배 이상 배율에서는 구분선을 반 픽셀 헤어라인으로 그린다. 조작 요소 테두리(border)는 그대로 1px이다. */
@media (min-resolution: 2dppx) {
  :root {
    --cw-hairline: .5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --cw-dur-fast: 0ms; --cw-dur-base: 0ms; --cw-dur-slow: 0ms; }
}

/* ─── base/font.css ─── */
/* 바탕 · 글꼴. Pretendard 가변 글꼴(1.3.9, SIL OFL 1.1)을 함께 싣는다. 사용자 PC에 글꼴이 없어도 같은 글자로 보인다.
   굵기 축은 45~920이고 토큰은 400 · 500 · 600만 쓴다. 배포 파일에서는 build.mjs가 주소를 dist/assets/fonts/로 바꾼다. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("assets/fonts/PretendardVariable.woff2") format("woff2-variations"), url("assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920; font-style: normal; font-display: swap;
}

/* ─── base/reset.css ─── */
/* 바탕 · 리셋. 모든 프로그램이 같은 출발점에서 시작한다.
   색 구성표는 토큰(--cw-scheme)을 따르므로 네이티브 스크롤바·폼·선택 색이 테마와 함께 바뀐다. */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: var(--cw-scheme);
  background: var(--cw-bg); color: var(--cw-text);
  font-family: var(--cw-font-ui); font-size: var(--cw-fs-body); line-height: var(--cw-lh-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  word-break: keep-all; overflow-wrap: anywhere; /* 한글은 어절 단위로 줄을 바꾸고, 긴 식별자만 어디서든 끊는다 */
  -webkit-tap-highlight-color: transparent;
}
body { margin: 0; min-height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { margin: 0; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre { margin: 0; }
img, video, canvas { display: block; max-width: 100%; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }

/* ─── base/typography.css ─── */
/* 바탕 · 글자. 여섯 단계와 코드. 숫자는 고정폭, 코드는 연자 끔.
   단계 이름을 클래스로 쓰면 제품 CSS에서 글자 크기를 다시 정하지 않아도 된다. */
.caption { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); }
.small { font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); }
.body { font-size: var(--cw-fs-body); line-height: var(--cw-lh-body); }
.read { line-height: var(--cw-lh-read); }
.subtitle { font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); }
.title { font-size: var(--cw-fs-title); line-height: var(--cw-lh-title); font-weight: var(--cw-fw-strong); letter-spacing: -.01em; }
.heading { font-size: var(--cw-fs-heading); line-height: var(--cw-lh-heading); font-weight: var(--cw-fw-strong); letter-spacing: -.02em; }
strong, b { font-weight: var(--cw-fw-strong); }

code, kbd, samp, pre, .code, .mono {
  font-family: var(--cw-font-code); font-size: var(--cw-fs-code); line-height: var(--cw-lh-code);
  font-variant-ligatures: none; font-feature-settings: "calt" 0;
}
.num { font-variant-numeric: tabular-nums; }
.unit { color: var(--cw-text-muted); }
.muted { color: var(--cw-text-muted); }

/* 말줄임. 잘린 글에는 title로 전체 문구를 둔다. */
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.truncate-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* 카드와 패널 안의 구역 이름 */
.section-label {
  display: block; margin-bottom: var(--cw-space-item);
  font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-weight: var(--cw-fw-medium); letter-spacing: .02em;
  color: var(--cw-text-muted);
}

::selection { background: var(--cw-text-selection); }

/* ─── base/focus.css ─── */
/* 바탕 · 포커스. 키보드로 왔을 때만 2px 링을 바깥 2px 띄워 그린다. 마우스 클릭에는 그리지 않는다.
   입력 칸은 테두리색과 띠로 따로 그린다(input.css). 스크롤 영역 안처럼 바깥 링이 잘리는 곳은 안쪽 링을 쓴다. */
:focus-visible { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: var(--cw-focus-offset); }
:focus:not(:focus-visible) { outline: none; }
.focus-inset:focus-visible,
.panel-body :is(.row, .tab, tr, li):focus-visible { outline-offset: calc(-1 * var(--cw-focus-width)); }

/* ─── base/scrollbar.css ─── */
/* 바탕 · 스크롤바. 가늘고 둥근 손잡이가 영역에 마우스를 올리거나 포커스가 있을 때만 보인다.
   Chromium의 ::-webkit-scrollbar를 쓰므로 같은 요소에 scrollbar-width·scrollbar-color를 지정하지 않는다.
   두 속성을 지정하면 Chromium 121부터 아래 규칙을 무시한다. 폭 12px 가운데 손잡이는 6px이고 양쪽 3px은 빈 테두리다. */
::-webkit-scrollbar { width: var(--cw-w-scrollbar); height: var(--cw-w-scrollbar); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: transparent; background-clip: padding-box;
  border: 3px solid transparent; border-radius: var(--cw-radius-container);
}
:hover::-webkit-scrollbar-thumb, :focus-within::-webkit-scrollbar-thumb { background-color: var(--cw-scroll-thumb); }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--cw-scroll-thumb), var(--cw-text) 30%); }
::-webkit-scrollbar-thumb:active { background-color: color-mix(in srgb, var(--cw-scroll-thumb), var(--cw-text) 50%); }

/* 내용이 늘어나도 폭이 흔들리지 않게 스크롤바 자리를 미리 비워 둔다. 패널 본문과 문서 영역에 쓴다. */
.scroll-stable { scrollbar-gutter: stable; }

/* ─── base/motion.css ─── */
/* 바탕 · 움직임. 시간과 곡선은 토큰으로만 쓴다. 테마를 바꾸는 순간에는 모든 전환을 꺼서 화면 전체가 따로따로 바뀌지 않게 한다.
   catwin.theme.set()이 html[data-theme-switching]을 두 프레임 동안 붙인다. 진행 표시의 회전은 운영체제의 움직임 줄이기와 무관하게 유지한다. */
[data-theme-switching], [data-theme-switching] *, [data-theme-switching] *::before, [data-theme-switching] *::after { transition: none !important; }
@keyframes cw-spin { to { transform: rotate(1turn); } }
@keyframes cw-fade-in { from { opacity: 0; } }

/* ─── base/window.css ─── */
/* 바탕 · 창 비활성. 창이 뒤로 가면 틀(타이틀바, 툴바, 패널 머리, 상태 표시줄)의 글자를 한 단계 낮추고
   선택색을 회색으로 바꾼다. 내용 글자와 판정색은 그대로 둔다. catwin.js가 html[data-window]를 active·inactive로 관리한다.
   타이틀바 칠의 비활성 값은 titlebar.css에 있다. */
[data-window="inactive"] {
  --cw-selection: var(--cw-steel);
  --cw-selected: color-mix(in srgb, var(--cw-text) 8%, transparent);
  --cw-focus: var(--cw-steel);
}
[data-window="inactive"] :is(.toolbar, .panel-head, .statusbar) { color: var(--cw-text-muted); }
[data-window="inactive"] :is(.toolbar, .panel-head, .statusbar) :is(h1, h2, h3, h4) { color: var(--cw-text-muted); }

/* ─── base/icon.css ─── */
/* 바탕 · 아이콘. src/assets/icons.svg의 심벌을 <svg class="i"><use href="#i-search"/></svg>로 쓴다.
   16·20·24px 세 크기, 선 굵기 1.5px. 글줄 안에서는 x높이 중앙에 오도록 3px 내린다. */
svg.i {
  width: var(--cw-icon-sm); height: var(--cw-icon-sm); flex: none;
  fill: none; stroke: currentColor; stroke-width: var(--cw-icon-stroke); stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px;
}
svg.i.md { width: var(--cw-icon-md); height: var(--cw-icon-md); vertical-align: -5px; }
svg.i.lg { width: var(--cw-icon-lg); height: var(--cw-icon-lg); vertical-align: -6px; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ─── base/helpers.css ─── */
/* 바탕 · 배치 도우미와 접근성. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 틀 영역: 데스크톱 관례대로 화살표 커서이고 글자를 고를 수 없다. 내용 영역에는 쓰지 않는다. */
.ui { cursor: default; user-select: none; }

.stack { display: flex; flex-direction: column; gap: var(--cw-space-group); min-width: 0; }
.stack.tight { gap: var(--cw-space-tight); }
.stack.item { gap: var(--cw-space-item); }
.stack.section { gap: var(--cw-space-section); }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cw-space-item); min-width: 0; }
.inline.group { gap: var(--cw-space-group); }
.spacer { flex: 1; }

/* ─── components/button.css ─── */
/* 버튼. 등급 네 가지(기본·주·조용·위험), 높이 네 가지(compact 28 · tool 32 · 기본 36 · decision 40), 아이콘 전용.
   상태: 기본 → 호버 → 눌림 → 포커스 → 켜짐(aria-pressed) → 비활성 → 진행(aria-busy).
   기본 버튼은 면 없이 테두리(line-strong)만 둔다(카드형). 호버와 눌림에서 면을 칠한다.
   데스크톱 관례대로 커서는 화살표이고 글자는 고를 수 없다. 손 모양 커서는 링크에만 쓴다.
   주 버튼은 한 영역에 하나. .is-hover .is-active .is-focus는 갤러리에서 상태를 고정해 보여 주는 거울 클래스다. */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--cw-space-item);
  height: var(--cw-h-control); padding: 0 var(--cw-space-control);
  border: var(--cw-border) solid var(--cw-line-strong); border-radius: var(--cw-radius-control);
  background: transparent; color: var(--cw-text); box-shadow: none;
  font-size: var(--cw-fs-body); line-height: 1; font-weight: var(--cw-fw-medium);
  white-space: nowrap; text-decoration: none; vertical-align: middle;
  cursor: default; user-select: none;
  transition: background-color var(--cw-dur-fast) var(--cw-ease), border-color var(--cw-dur-fast) var(--cw-ease),
              box-shadow var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease);
}
.btn > .i { margin-inline: -2px; } /* 아이콘은 글자보다 2px 안쪽에 두어야 양쪽 여백이 같아 보인다 */
.btn:hover, .btn.is-hover { background: var(--cw-control-hover); }
.btn:active, .btn.is-active { background: var(--cw-control-pressed); box-shadow: none; color: color-mix(in srgb, var(--cw-text) 78%, transparent); transition-duration: 0ms; }
.btn.is-focus { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: var(--cw-focus-offset); }
.btn[aria-pressed="true"], .btn.picked { background: var(--cw-selected); border-color: color-mix(in srgb, var(--cw-selection) 40%, transparent); box-shadow: none; color: var(--cw-text); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--cw-fill-disabled); border-color: transparent; box-shadow: none; color: var(--cw-text-disabled); pointer-events: none; }

/* 주 버튼: 채운 실행색에 흰 글자. 그림자 없이 면으로만 구분한다. */
.btn.primary { background: var(--cw-action-fill); border-color: transparent; color: var(--cw-on-solid); box-shadow: none; }
.btn.primary:hover, .btn.primary.is-hover { background: var(--cw-action-fill-hover); }
.btn.primary:active, .btn.primary.is-active { background: var(--cw-action-fill-pressed); box-shadow: none; color: var(--cw-on-solid); }
.btn.primary[aria-pressed="true"] { background: var(--cw-action-fill); border-color: transparent; color: var(--cw-on-solid); }
.btn.primary:disabled, .btn.primary[aria-disabled="true"] { background: var(--cw-fill-disabled); box-shadow: none; color: var(--cw-text-disabled); }

/* 조용한 버튼과 아이콘 버튼: 면과 테두리 없이 호버 때만 칠한다. */
.btn.quiet, .btn.icon { background: transparent; border-color: transparent; box-shadow: none; }
.btn.quiet:hover, .btn.quiet.is-hover, .btn.icon:hover, .btn.icon.is-hover { background: var(--cw-hover); }
.btn.quiet:active, .btn.quiet.is-active, .btn.icon:active, .btn.icon.is-active { background: var(--cw-pressed); }
.btn.quiet[aria-pressed="true"], .btn.icon[aria-pressed="true"] { background: var(--cw-selected); border-color: transparent; }
.btn.quiet:disabled, .btn.icon:disabled { background: transparent; }

/* 위험 버튼: 판정색(부적합 분홍)과 나눈 빨강. 첫 단계는 기본 버튼 모양에 빨간 글자, 되돌리기 어려운 확인 단계만 .danger.primary로 채운다. */
.btn.danger { color: var(--cw-destructive-text); }
.btn.danger:hover, .btn.danger.is-hover { background: color-mix(in srgb, var(--cw-destructive) 14%, transparent); border-color: color-mix(in srgb, var(--cw-destructive) 32%, transparent); }
.btn.danger:active, .btn.danger.is-active { background: color-mix(in srgb, var(--cw-destructive) 20%, transparent); color: var(--cw-destructive-text); }
.btn.danger.primary { background: var(--cw-destructive); border-color: transparent; color: var(--cw-on-solid); box-shadow: none; }
.btn.danger.primary:hover, .btn.danger.primary.is-hover { background: var(--cw-destructive-hover); }
.btn.danger.primary:active, .btn.danger.primary.is-active { background: var(--cw-destructive-pressed); box-shadow: none; color: var(--cw-on-solid); }

/* 높이 */
.btn.tool { height: var(--cw-h-tool); font-size: var(--cw-fs-small); }
.btn.compact { height: var(--cw-h-compact); padding: 0 var(--cw-space-item); font-size: var(--cw-fs-small); }
.btn.decision { height: var(--cw-h-decision); padding: 0 var(--cw-space-group); }
.btn.block { display: flex; width: 100%; }

/* 아이콘 전용: 정사각형, 보조 글자색. aria-label을 반드시 둔다. 기본 높이는 툴바 높이(32px)다. */
.btn.icon { width: var(--cw-h-tool); height: var(--cw-h-tool); padding: 0; color: var(--cw-text-muted); }
.btn.icon > .i { margin: 0; }
.btn.icon:hover, .btn.icon.is-hover, .btn.icon[aria-pressed="true"] { color: var(--cw-text); }
.btn.icon.compact { width: var(--cw-h-compact); height: var(--cw-h-compact); }
.btn.icon.control { width: var(--cw-h-control); height: var(--cw-h-control); }
.btn.icon.outlined { background: transparent; border-color: var(--cw-line-strong); box-shadow: none; }
.btn.icon.outlined:hover { background: var(--cw-control-hover); }

/* 진행: 글자를 숨기고 같은 자리에 회전 고리를 둔다. 폭이 변하지 않는다. 글자는 보조 기술에 그대로 읽힌다. */
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"] > .i { visibility: hidden; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: var(--cw-icon-sm); height: var(--cw-icon-sm);
  border: 2px solid color-mix(in srgb, var(--cw-text) 25%, transparent); border-top-color: var(--cw-text); border-radius: 50%;
  animation: cw-spin .8s linear infinite;
}
.btn.primary[aria-busy="true"]::after { border-color: color-mix(in srgb, var(--cw-on-solid) 30%, transparent); border-top-color: var(--cw-on-solid); }
.btn.compact[aria-busy="true"]::after { width: var(--cw-space-control); height: var(--cw-space-control); }

/* 나란한 버튼 묶음. 주 버튼은 오른쪽 끝에 둔다. 결정과 다른 버튼(저장 안 함, 자세한 내용 복사)은 .lead로 왼쪽 끝에 둔다. */
.btn-row { display: flex; align-items: center; gap: var(--cw-space-item); }
.btn-row.end { justify-content: flex-end; }
.btn-row > .lead { margin-right: auto; }

/* ─── components/spinner.css ─── */
/* 진행 표시. 글자색 고리가 돈다. 실행 상태를 나타내며 판정이 아니다. */
.spinner {
  display: inline-block; flex: none; width: var(--cw-icon-sm); height: var(--cw-icon-sm);
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%;
  animation: cw-spin .8s linear infinite; vertical-align: -3px;
}
.spinner.md { width: var(--cw-icon-md); height: var(--cw-icon-md); vertical-align: -5px; }
.spinner.lg { width: var(--cw-icon-lg); height: var(--cw-icon-lg); border-width: 3px; vertical-align: -6px; }

/* 진행 막대. 두께 4, 트랙은 강한 선, 채움은 글자색이다(진행은 판정이 아니므로 판정색을 쓰지 않는다).
   진행 정도는 --p(0~100)로 주고 role="progressbar"와 aria-valuenow를 함께 둔다. 끝을 모르면 .indeterminate. */
.progress { display: block; flex: none; height: 4px; border-radius: 2px; background: var(--cw-line-strong); overflow: hidden; } /* cw-allow 막대 두께 */
.progress > i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); border-radius: inherit; background: currentColor; transition: width var(--cw-dur-base) var(--cw-ease); }
.progress.indeterminate > i { width: 40%; animation: cw-progress 1.4s var(--cw-ease) infinite; }
@keyframes cw-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ─── components/input.css ─── */
/* 입력. 라벨은 항상 보이고 도움말과 오류는 칸 아래에 둔다.
   칸은 면과 테두리(line-control, 3:1 대비)로 그린 둥근 상자다(카드형). 읽기 전용 칸은 옅은 테두리로 구분한다.
   상태: 기본 → 호버(면 조금 진하게) → 포커스(테두리가 포커스색, 둘레에 빛 테두리) → 오류(테두리 위험색) → 읽기 전용(면 없음) → 비활성.
   높이: .input 36 · .input.tool 32 · .input.compact 28. 숫자 칸은 .num으로 오른쪽 정렬한다.
   아이콘·단위·지우기 버튼이 붙는 칸은 .input-wrap이 면과 선을 맡고 안의 .input은 투명하다. */
.field { display: flex; flex-direction: column; gap: var(--cw-space-tight); min-width: 0; }
.field + .field { margin-top: var(--cw-space-group); }
.field.inline { flex-direction: row; align-items: center; gap: var(--cw-space-control); }
.field.inline > .label { flex: none; }
.field > .seg { align-self: flex-start; } /* 분할 버튼은 칸 폭으로 늘리지 않는다 */
.label { display: flex; align-items: baseline; gap: var(--cw-space-tight); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.label .opt { font-weight: var(--cw-fw-regular); color: var(--cw-steel); }
.label .req { color: var(--cw-destructive-text); }

.input, .input-wrap {
  background: var(--cw-field); border: var(--cw-border) solid var(--cw-line-control); border-radius: var(--cw-radius-control);
  box-shadow: none;
  transition: background-color var(--cw-dur-fast) var(--cw-ease), box-shadow var(--cw-dur-fast) var(--cw-ease);
}
.input {
  display: block; width: 100%; height: var(--cw-h-control); padding: 0 var(--cw-space-control);
  color: var(--cw-text); font-size: var(--cw-fs-body); line-height: var(--cw-lh-body);
  appearance: none; outline: none;
}
.input::placeholder { color: var(--cw-steel); opacity: 1; }
.input:hover:not(:disabled, :focus, [readonly]), .input.is-hover { background: var(--cw-field-hover); }
.input:focus, .input.is-focus { background: var(--cw-field-focus); border-color: var(--cw-focus); box-shadow: 0 0 0 3px var(--cw-focus-halo); } /* cw-allow 포커스 빛 3px */
.input:focus-visible { outline: none; }
.input.is-error, .input[aria-invalid="true"] { border-color: var(--cw-destructive-text); box-shadow: none; }
.input[readonly], .input[readonly]:focus { background: transparent; border-color: var(--cw-control-edge); box-shadow: none; }
.input:disabled { background: var(--cw-fill-disabled); border-color: transparent; box-shadow: none; color: var(--cw-text-disabled); }
.input.tool { height: var(--cw-h-tool); font-size: var(--cw-fs-small); }
.input.compact { height: var(--cw-h-compact); padding: 0 var(--cw-space-item); font-size: var(--cw-fs-small); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input.code { font-family: var(--cw-font-code); font-size: var(--cw-fs-code); }

/* 여러 줄. 내용에 맞춰 3줄에서 12줄까지 늘어난다. */
textarea.input {
  height: auto; min-height: calc(var(--cw-lh-body) * 3 + var(--cw-space-item) * 2 + var(--cw-border) * 2);
  max-height: calc(var(--cw-lh-body) * 12 + var(--cw-space-item) * 2 + var(--cw-border) * 2);
  padding: var(--cw-space-item) var(--cw-space-control); resize: vertical; field-sizing: content;
}

/* 숫자와 검색 칸의 브라우저 장식을 없앤다. 증감은 키보드 위아래로 한다. */
.input[type="number"] { -moz-appearance: textfield; }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.input[type="search"]::-webkit-search-cancel-button, .input[type="search"]::-webkit-search-decoration { appearance: none; }

/* 선택 칸: 네이티브 select 위에 화살표만 그린다. 목록 자체는 운영체제 모양이다. */
.select { position: relative; display: block; min-width: 0; }
.select > .input { padding-right: calc(var(--cw-space-control) + var(--cw-icon-sm) + var(--cw-space-item)); cursor: default; }
.select::after {
  content: ""; position: absolute; top: 50%; right: var(--cw-space-control); width: var(--cw-icon-sm); height: var(--cw-icon-sm);
  translate: 0 -50%; pointer-events: none; background: var(--cw-text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.select:has(> .input:disabled)::after { background: var(--cw-text-disabled); }

/* 아이콘·단위·버튼이 붙는 칸. 면과 아래 선은 바깥 상자가 맡는다. */
.input-wrap {
  display: flex; align-items: center; gap: var(--cw-space-item); min-width: 0;
  height: var(--cw-h-control); padding: 0 var(--cw-space-control);
}
.input-wrap:hover:not(:focus-within), .input-wrap.is-hover { background: var(--cw-field-hover); }
.input-wrap:focus-within, .input-wrap.is-focus { background: var(--cw-field-focus); border-color: var(--cw-focus); box-shadow: 0 0 0 3px var(--cw-focus-halo); } /* cw-allow 포커스 빛 3px */
.input-wrap.is-error, .input-wrap:has(> [aria-invalid="true"]) { border-color: var(--cw-destructive-text); box-shadow: none; }
.input-wrap:has(> .input:disabled) { background: var(--cw-fill-disabled); border-color: transparent; box-shadow: none; }
.input-wrap:has(> .input:disabled) > * { color: var(--cw-text-disabled); }
.input-wrap > .input, .input-wrap > .input:hover, .input-wrap > .input:focus { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.input-wrap > .i { color: var(--cw-steel); }
.input-wrap > .affix { flex: none; font-size: var(--cw-fs-small); color: var(--cw-text-muted); white-space: nowrap; }
.input-wrap > .btn.icon.compact { margin-right: calc(-1 * var(--cw-space-item)); } /* 지우기 버튼이 오른쪽 여백 안에 들어가게 */
.input-wrap > .btn.icon.compact:last-child { margin-right: calc(var(--cw-space-tight) - var(--cw-space-control)); }
.input-wrap.tool { height: var(--cw-h-tool); font-size: var(--cw-fs-small); }
.input-wrap.tool > .input { font-size: var(--cw-fs-small); }
.input-wrap.compact { height: var(--cw-h-compact); padding: 0 var(--cw-space-item); font-size: var(--cw-fs-small); }
.input-wrap.compact > .input { font-size: var(--cw-fs-small); }

/* 도움말과 오류. 오류 문구에는 원인과 고치는 방법을 함께 적는다. */
.help { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.help.error { display: flex; gap: var(--cw-space-tight); color: var(--cw-destructive-text); }
.help.error::before { content: "×"; font-weight: var(--cw-fw-strong); }

/* ─── components/choice.css ─── */
/* 선택: 체크박스 · 라디오 · 토글. 네이티브 input을 그대로 두고(appearance: none) 모양만 그린다.
   키보드와 보조 기술 동작은 브라우저 것이다. 상자는 16px이고 첫 줄 글자(22px)의 중앙에 맞춰 3px 내린다.
   켜지면 채운 실행색에 흰 표시를 둔다. 꺼진 상자는 면 없이 3:1 테두리만 그린다.
   상태: 기본 → 호버 → 포커스 → 켜짐 → 일부 선택(indeterminate) → 비활성. */
.check, .radio, .switch {
  display: inline-flex; align-items: flex-start; gap: var(--cw-space-item);
  min-height: var(--cw-lh-body); font-size: var(--cw-fs-body); line-height: var(--cw-lh-body);
  cursor: default; user-select: none;
}
.check input, .radio input, .switch input {
  appearance: none; flex: none; margin: 3px 0 0; display: grid; place-items: center;
  width: var(--cw-icon-sm); height: var(--cw-icon-sm);
  background: transparent; border: var(--cw-border) solid var(--cw-check-edge);
  transition: background-color var(--cw-dur-fast) var(--cw-ease), border-color var(--cw-dur-fast) var(--cw-ease), box-shadow var(--cw-dur-fast) var(--cw-ease);
}
.check input { border-radius: var(--cw-radius-badge); }
.radio input { border-radius: 50%; }
.check input::before, .radio input::before { content: ""; transform: scale(0); transition: transform var(--cw-dur-fast) var(--cw-ease); }
.check input::before {
  width: var(--cw-space-control); height: var(--cw-space-control); background: var(--cw-on-solid);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.check input:indeterminate::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3.5 8h9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3.5 8h9'/%3E%3C/svg%3E");
}
.radio input::before { width: 6px; height: 6px; border-radius: 50%; background: var(--cw-on-solid); }
.check input:checked, .check input:indeterminate, .radio input:checked { background: var(--cw-action-fill); border-color: var(--cw-action-fill); }
.check input:checked::before, .check input:indeterminate::before, .radio input:checked::before { transform: scale(1); }
.check input:hover:not(:disabled), .radio input:hover:not(:disabled), .check.is-hover input, .radio.is-hover input { background: var(--cw-hover); border-color: color-mix(in srgb, var(--cw-check-edge), var(--cw-text) 35%); }
.check input:checked:hover:not(:disabled), .check input:indeterminate:hover:not(:disabled), .radio input:checked:hover:not(:disabled) { background: var(--cw-action-fill-hover); border-color: var(--cw-action-fill-hover); }
.check input:checked:active:not(:disabled), .radio input:checked:active:not(:disabled) { background: var(--cw-action-fill-pressed); border-color: var(--cw-action-fill-pressed); }
.check.is-focus input, .radio.is-focus input, .switch.is-focus input { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: var(--cw-focus-offset); }
.check:has(input:disabled), .radio:has(input:disabled), .switch:has(input:disabled) { color: var(--cw-text-disabled); }
.check input:disabled, .radio input:disabled { background: var(--cw-fill-disabled); border-color: var(--cw-fill-disabled); }
.check input:disabled:checked, .check input:disabled:indeterminate, .radio input:disabled:checked { background: color-mix(in srgb, var(--cw-action-fill) 35%, transparent); border-color: transparent; }

/* 토글: 28×16 트랙, 12px 손잡이. 꺼짐은 테두리만, 켜짐은 채운 실행색에 흰 손잡이. */
.switch input { position: relative; width: 28px; border: 0; border-radius: var(--cw-radius-container); box-shadow: inset 0 0 0 1px var(--cw-check-edge); }
.switch input::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: var(--cw-space-control); height: var(--cw-space-control);
  border-radius: 50%; background: var(--cw-knob-off); transition: translate var(--cw-dur-base) var(--cw-ease), width var(--cw-dur-fast) var(--cw-ease);
}
.switch input:hover:not(:disabled), .switch.is-hover input { background: var(--cw-hover); }
.switch input:checked { background: var(--cw-action-fill); box-shadow: none; }
.switch input:checked:hover:not(:disabled) { background: var(--cw-action-fill-hover); }
.switch input:checked::before { translate: var(--cw-space-control) 0; background: var(--cw-on-solid); box-shadow: 0 1px 2px color-mix(in srgb, var(--cw-bg) 45%, transparent); }
.switch input:active:not(:disabled)::before { width: var(--cw-space-group); }
.switch input:checked:active:not(:disabled)::before { translate: var(--cw-space-item) 0; }
.switch input:disabled { box-shadow: inset 0 0 0 1px var(--cw-fill-disabled); }
.switch input:disabled::before { background: var(--cw-text-disabled); }
.switch input:disabled:checked { background: color-mix(in srgb, var(--cw-action-fill) 35%, transparent); }
.switch input:disabled:checked::before { background: color-mix(in srgb, var(--cw-on-solid) 60%, transparent); }

/* 선택 묶음. 세로가 기본이고 .inline은 가로다. 묶음 이름은 legend.label로 둔다. */
.choices { display: flex; flex-direction: column; gap: var(--cw-space-item); }
.choices.inline { flex-direction: row; flex-wrap: wrap; gap: var(--cw-space-item) var(--cw-space-group); }
.choices > .label { margin-bottom: var(--cw-space-tight); }

/* ─── components/segmented.css ─── */
/* 분할 버튼. 같은 대상을 다른 방식으로 보는 전환. 상태는 aria-pressed로 두고 catwin.js(data-cw="seg")가 방향키 이동과 단일 선택을 맡는다.
   높이 32px, .compact 28px. 홈(track) 안에서 고른 칸만 떠오르고 칸 사이에는 선이 없다. 아이콘 전용 칸은 .icon에 aria-label을 둔다.
   포커스 링은 잘리지 않도록 안쪽에 그린다. */
.seg {
  display: inline-flex; gap: 2px; height: var(--cw-h-tool); padding: 2px; isolation: isolate; /* cw-allow 홈 안쪽 2px */
  background: var(--cw-track); border-radius: calc(var(--cw-radius-control) + 2px); /* cw-allow 바깥 모서리 = 칸 모서리 + 홈 안쪽 */
  cursor: default; user-select: none;
}
.seg > button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--cw-space-item);
  height: 100%; padding: 0 var(--cw-space-control); border: 0; border-radius: var(--cw-radius-control); background: transparent;
  color: var(--cw-text-muted); font-size: var(--cw-fs-small); font-weight: var(--cw-fw-medium); white-space: nowrap; cursor: default;
  transition: background-color var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease), box-shadow var(--cw-dur-fast) var(--cw-ease);
}
.seg > button:hover, .seg > button.is-hover { background: var(--cw-hover); color: var(--cw-text); }
.seg > button:active, .seg > button.is-active { background: var(--cw-pressed); transition-duration: 0ms; }
.seg > button[aria-pressed="true"] { background: var(--cw-thumb); color: var(--cw-text); box-shadow: var(--cw-shadow-thumb); }
.seg > button:focus-visible, .seg > button.is-focus { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: calc(-1 * var(--cw-focus-width)); z-index: 1; }
.seg > button:disabled { color: var(--cw-text-disabled); pointer-events: none; }
.seg > button.icon { width: calc(var(--cw-h-tool) - 4px); padding: 0; } /* cw-allow 홈 안쪽 2px만큼 */
.seg > button > .i { margin-inline: -2px; }
.seg > button.icon > .i { margin: 0; }
.seg.compact { height: var(--cw-h-compact); }
.seg.compact > button { padding: 0 var(--cw-space-item); }
.seg.compact > button.icon { width: calc(var(--cw-h-compact) - 4px); } /* cw-allow */

/* ─── components/tabs.css ─── */
/* 탭. role=tablist / tab / tabpanel. 선택은 aria-selected이고 catwin.js(data-cw="tabs")가 방향키·Home·End·Delete·가운데 클릭을 맡는다.
   주 탭 40px, 하위 탭(.sub) 32px. 가로 탭의 선택은 고른 탭에 선택색 옅은 면과 테두리를 칠하고(카드형), 세로 탭은 둥근 면과 왼쪽 가운데의 16px 막대다.
   닫기 버튼은 선택한 탭에서는 항상, 나머지는 올렸을 때만 보인다. 저장 안 된 탭(.is-dirty)은 닫기 자리에 점을 둔다. */
.tabs { display: flex; align-items: stretch; height: var(--cw-h-tab); gap: var(--cw-space-tight); min-width: 0; cursor: default; user-select: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: var(--cw-space-item);
  height: 100%; padding: 0 var(--cw-space-control); border: 0; background: none;
  color: var(--cw-text-muted); font-size: var(--cw-fs-body); font-weight: var(--cw-fw-medium); white-space: nowrap; cursor: default;
  border-radius: var(--cw-radius-control) var(--cw-radius-control) 0 0;
  transition: color var(--cw-dur-fast) var(--cw-ease), background-color var(--cw-dur-fast) var(--cw-ease);
}
.tab::after { content: ""; position: absolute; left: var(--cw-space-control); right: var(--cw-space-control); bottom: 0; height: var(--cw-bar-selected); border-radius: 2px; background: transparent; transition: background-color var(--cw-dur-fast) var(--cw-ease); } /* cw-allow 막대 끝 둥글림 */
.tab:hover, .tab.is-hover { color: var(--cw-text); background: var(--cw-hover); }
.tab:active, .tab.is-active { background: var(--cw-pressed); transition-duration: 0ms; }
.tab[aria-selected="true"] { color: var(--cw-text); }
.tab[aria-selected="true"]::after { background: var(--cw-selection); }
/* 가로 탭: 아래 막대 대신 고른 탭 전체에 면을 칠한다. 탭은 줄 높이보다 8px 낮게 가운데에 놓는다. */
.tabs:not(.vertical) { align-items: center; }
.tabs:not(.vertical) > .tab { height: calc(100% - var(--cw-space-item)); border-radius: var(--cw-radius-control); }
.tabs:not(.vertical) > .tab::after { display: none; }
.tabs:not(.vertical) > .tab[aria-selected="true"] { background: var(--cw-selected); box-shadow: inset 0 0 0 var(--cw-border) color-mix(in srgb, var(--cw-selection) 45%, transparent); }
.tab:focus-visible, .tab.is-focus { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: calc(-1 * var(--cw-focus-width)); }
.tab:disabled, .tab[aria-disabled="true"] { color: var(--cw-text-disabled); pointer-events: none; }
.tab > .i { color: var(--cw-text-muted); margin-inline: -2px; }
.tab[aria-selected="true"] > .i { color: var(--cw-text); }
.tab .count { font-size: var(--cw-fs-caption); font-variant-numeric: tabular-nums; color: var(--cw-text-muted); }

.tab-close {
  display: inline-grid; place-items: center; flex: none;
  width: var(--cw-icon-md); height: var(--cw-icon-md); margin-right: calc(-1 * var(--cw-space-tight));
  border: 0; border-radius: var(--cw-radius-badge); background: transparent; color: var(--cw-text-muted); opacity: 0;
  transition: opacity var(--cw-dur-fast) var(--cw-ease), background-color var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease);
}
.tab-close > .i { width: var(--cw-space-control); height: var(--cw-space-control); stroke-width: 2; }
.tab:hover .tab-close, .tab[aria-selected="true"] .tab-close, .tab-close:focus-visible, .tab.is-dirty .tab-close { opacity: 1; }
.tab-close:hover { background: color-mix(in srgb, var(--cw-text) 12%, transparent); color: var(--cw-text); }
.tab-close:active { background: color-mix(in srgb, var(--cw-text) 20%, transparent); }
.tab.is-dirty .tab-close:not(:hover) > .i { display: none; }
.tab.is-dirty .tab-close:not(:hover)::before { content: ""; width: var(--cw-space-item); height: var(--cw-space-item); border-radius: 50%; background: var(--cw-text-muted); }

.tabs.sub { height: var(--cw-h-tool); }
.tabs.sub .tab { font-size: var(--cw-fs-small); }
.tabs.fill > .tab { flex: 1; justify-content: center; }

/* 넘치면 가로로 스크롤한다. 스크롤바는 숨기고 양 끝을 흐려 더 있음을 알린다(.is-overflow는 catwin.js가 붙인다). */
.tabs.scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs.scroll > .tab { flex: none; }
.tabs.scroll::-webkit-scrollbar { display: none; }
.tabs.scroll.is-overflow { -webkit-mask-image: linear-gradient(to right, transparent, black var(--cw-space-group), black calc(100% - var(--cw-space-group)), transparent); mask-image: linear-gradient(to right, transparent, black var(--cw-space-group), black calc(100% - var(--cw-space-group)), transparent); }

/* 세로 탭: 둥근 면과 왼쪽 가운데 막대로 선택을 표시한다. aria-orientation="vertical"로 위아래 키를 쓴다. */
.tabs.vertical { flex-direction: column; height: auto; align-items: stretch; }
.tabs.vertical .tab { height: var(--cw-h-tool); margin: 0 var(--cw-space-tight); justify-content: flex-start; border-radius: var(--cw-radius-control); }
.tabs.vertical .tab::after { top: 50%; bottom: auto; right: auto; left: 0; width: var(--cw-bar-selected); height: var(--cw-icon-sm); translate: 0 -50%; }
.tabs.vertical .tab[aria-selected="true"] { background: var(--cw-hover); }

[role="tabpanel"]:focus-visible { outline-offset: calc(-1 * var(--cw-focus-width)); }

/* ─── components/badge.css ─── */
/* 판정 표시와 식별자. 패널에서는 기호와 글자, 문서 면에서는 채운 배지(.fill). 식별자는 테두리 없는 보조 글자.
   판정은 색·기호·문구를 함께 쓴다: ✓ 적합, △ 보완, × 부적합, Ⅱ 보류. */
.badge { display: inline-flex; align-items: center; gap: var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-weight: var(--cw-fw-medium); white-space: nowrap; }
.badge b { font-weight: var(--cw-fw-strong); }
.badge.success { color: var(--cw-success); }
.badge.warning { color: var(--cw-warning); }
.badge.danger { color: var(--cw-danger); }
.badge.hold { color: var(--cw-hold); }
.badge.fill { height: var(--cw-icon-md); padding: 0 6px; border-radius: var(--cw-radius-badge); color: var(--cw-on-fill); } /* cw-allow 배지 안쪽 */
.badge.fill.success { background: var(--cw-success); }
.badge.fill.warning { background: var(--cw-warning); }
.badge.fill.danger { background: var(--cw-danger); color: var(--cw-on-danger); }
.badge.fill.hold { background: var(--cw-hold); }

.chip { font-family: var(--cw-font-code); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); font-variant-ligatures: none; }

/* 링크는 손 모양 커서를 쓰는 유일한 요소다. */
.link { color: var(--cw-action); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--cw-action) 45%, transparent); text-underline-offset: 3px; cursor: pointer; }
button.link { padding: 0; border: 0; background: none; font: inherit; color: var(--cw-action); }
.link:hover { text-decoration-color: currentColor; }
.link.quiet { text-decoration: none; }
.link.quiet:hover { text-decoration: underline; }

/* ─── components/combo.css ─── */
/* 콤보 상자 (1층): 닫힌 모양은 입력 칸과 같고, 목록은 메뉴와 같은 떠 있는 면이다. */
.combo { position: relative; display: block; min-width: 0; }
.combo-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--cw-space-item); width: 100%; text-align: left; cursor: default; }
.combo-btn > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.combo-btn .ph { color: var(--cw-text-muted); }
.combo .chev { flex: none; color: var(--cw-text-muted); transition: transform var(--cw-dur-base) var(--cw-ease); }
.combo.is-open .chev { transform: rotate(180deg); }
.combo.is-open .combo-btn { background: var(--cw-field-focus); box-shadow: inset 0 -2px 0 var(--cw-focus); }
.listbox {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + var(--cw-space-tight)); min-width: 100%;
  padding: var(--cw-space-tight); background: var(--cw-paper); border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-container); box-shadow: var(--cw-shadow-float);
  animation: cw-pop-in var(--cw-dur-fast) var(--cw-ease);
}
.listbox.up { top: auto; bottom: calc(100% + var(--cw-space-tight)); }
.listbox-search { padding: var(--cw-space-tight) var(--cw-space-tight) var(--cw-space-item); }
.listbox-list { max-height: calc(var(--cw-h-tool) * 8); overflow: auto; }
.listbox [role="option"] {
  display: flex; align-items: center; gap: var(--cw-space-item); height: var(--cw-h-tool); padding: 0 var(--cw-space-item);
  border-radius: var(--cw-radius-control); font-size: var(--cw-fs-small); white-space: nowrap; cursor: default;
}
.listbox [role="option"]::before { content: ""; flex: none; width: var(--cw-icon-sm); text-align: center; }
.listbox [role="option"][aria-selected="true"]::before { content: "✓"; font-weight: var(--cw-fw-strong); }
.listbox [role="option"] .meta { margin-left: auto; padding-left: var(--cw-space-group); font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.listbox [role="option"].is-active, .listbox [role="option"]:hover { background: var(--cw-item-hover); }
.listbox [role="option"][aria-disabled="true"] { color: var(--cw-text-disabled); }
.listbox mark { background: none; color: var(--cw-text); font-weight: var(--cw-fw-strong); }
.listbox .empty { padding: var(--cw-space-item) var(--cw-space-item) var(--cw-space-item) calc(var(--cw-icon-sm) + var(--cw-space-group)); font-size: var(--cw-fs-small); color: var(--cw-text-muted); }

/* ─── components/table.css ─── */
/* 표 (4층). 숫자 열은 .r, 단위는 .unit. 행 구분선은 헤어라인이다.
   선택한 행(.is-selected)과 인용한 셀(.cited)을 한 표에서 동시에 강조하지 않는다. */
.table { width: 100%; border-collapse: collapse; font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); }
.table th {
  height: var(--cw-h-row); padding: 0 var(--cw-space-control); text-align: left; white-space: nowrap;
  font-size: var(--cw-fs-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted);
  border-bottom: var(--cw-hairline) solid var(--cw-line-strong);
}
.table td { height: var(--cw-h-row); padding: 0 var(--cw-space-control); border-bottom: var(--cw-hairline) solid var(--cw-line); white-space: nowrap; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table .unit { color: var(--cw-text-muted); font-size: var(--cw-fs-caption); }
.table tbody tr:hover td { background: var(--cw-hover); }
.table tr.is-selected td { background: var(--cw-selected); color: var(--cw-text); }
.table tr.is-selected td:first-child { box-shadow: inset var(--cw-bar-selected) 0 0 var(--cw-selection); }
.table tr.is-selected .unit { color: var(--cw-text); }
.table tr.is-cited td { background: color-mix(in srgb, var(--cw-emphasis) 8%, transparent); }
.table td.cited { box-shadow: inset 0 0 0 1px var(--cw-emphasis); color: var(--cw-emphasis); font-weight: var(--cw-fw-strong); }

.table-wrap { max-height: 320px; overflow: auto; border: var(--cw-hairline) solid var(--cw-line); border-radius: var(--cw-radius-control); }
.table-wrap .table thead th { position: sticky; top: 0; z-index: 1; background: var(--cw-surface); }
.table th[aria-sort] { padding: 0; }
.table th[aria-sort] > button { display: inline-flex; align-items: center; gap: var(--cw-space-tight); width: 100%; height: var(--cw-h-row); padding: 0 var(--cw-space-control); border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: default; }
.table th.r[aria-sort] > button { justify-content: flex-end; }
.table th[aria-sort] > button:hover { color: var(--cw-text); }
.table th[aria-sort] .i { width: var(--cw-space-control); height: var(--cw-space-control); opacity: 0; }
.table th[aria-sort="ascending"] .i, .table th[aria-sort="descending"] .i { opacity: 1; }
.table th[aria-sort="ascending"] .i { transform: rotate(180deg); }
.table th[aria-sort="ascending"], .table th[aria-sort="descending"] { color: var(--cw-text); }
.table tr.group td { height: var(--cw-h-compact); background: var(--cw-inset); font-size: var(--cw-fs-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.table tr.total td { border-top: var(--cw-border) solid var(--cw-line-strong); border-bottom: 0; font-weight: var(--cw-fw-medium); }
.table td .ratio { display: inline-flex; align-items: center; gap: var(--cw-space-item); }
.table td .ratio i { display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--cw-line-strong); overflow: hidden; } /* cw-allow 검정비 막대 */
.table td .ratio i::after { content: ""; display: block; width: calc(min(var(--v), 1) * 100%); height: 100%; background: var(--cw-text-muted); }
.table td .ratio.over i::after { background: var(--cw-danger); }
.table .empty td { height: auto; padding: var(--cw-space-section) var(--cw-space-control); text-align: center; color: var(--cw-text-muted); white-space: normal; }
.table.ruled { background: var(--cw-paper); }
.table.ruled th, .table.ruled td { height: var(--cw-h-compact); padding: 0 var(--cw-space-item); border: var(--cw-border) solid var(--cw-line-strong); }
.table.ruled thead th { background: var(--cw-surface); color: var(--cw-text); font-weight: var(--cw-fw-medium); text-align: center; }
.table.ruled tbody tr:hover td { background: transparent; }

/* ─── components/list.css ─── */
/* 목록과 속성 (4층). */
.list { display: flex; flex-direction: column; }
.list-group { padding: var(--cw-space-group) var(--cw-space-panel) var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.list-group:first-child { padding-top: var(--cw-space-item); }
/* 행의 호버와 선택은 행 전체가 아니라 안쪽 둥근 면(::before)에 칠하고, 선택은 선택색 옅은 면에 테두리를 더한다(카드형). */
.row {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; gap: var(--cw-space-tight); width: 100%;
  padding: var(--cw-space-control) var(--cw-space-panel); border: 0; background: none; color: inherit; text-align: left; cursor: default; user-select: none;
}
.row::before { content: ""; position: absolute; inset: 2px var(--cw-space-item); z-index: -1; border-radius: var(--cw-radius-control); background: transparent; transition: background-color var(--cw-dur-fast) var(--cw-ease); } /* cw-allow 행 사이 2px */
.row:hover::before { background: var(--cw-hover); }
.row:active::before { background: var(--cw-pressed); transition-duration: 0ms; }
.row.is-selected::before { background: var(--cw-selected); box-shadow: inset 0 0 0 var(--cw-border) color-mix(in srgb, var(--cw-selection) 45%, transparent); }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--cw-space-item); }
.row-title { font-size: var(--cw-fs-body); line-height: var(--cw-lh-body); font-weight: var(--cw-fw-regular); }
.row.is-selected .row-title { font-weight: var(--cw-fw-medium); }
.row-meta { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.row.one { flex-direction: row; align-items: center; justify-content: space-between; min-height: var(--cw-h-row); padding-block: 0; }
.row.one.check { justify-content: flex-start; gap: var(--cw-space-item); } /* 체크박스를 넣은 행: 상자 다음에 제목이 붙는다 */

/* 속성: 라벨과 값 두 칸 */
.kv { display: grid; grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); align-items: center; gap: var(--cw-space-item) var(--cw-space-control); }
.kv dt { font-size: var(--cw-fs-small); color: var(--cw-text-muted); }
.kv dd { margin: 0; font-size: var(--cw-fs-small); font-variant-numeric: tabular-nums; }
.row.is-hover::before { background: var(--cw-hover); } /* 상태 행렬의 거울 클래스 */

/* 고른 것의 상세 카드(오른쪽 패널): 판정, 제목, 식별 줄, 구역 */
.detail-title { margin-top: var(--cw-space-item); font-size: var(--cw-fs-title); line-height: var(--cw-lh-title); font-weight: var(--cw-fw-strong); letter-spacing: -.01em; }
.detail-meta { margin-top: var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }
.detail-sec { margin-top: var(--cw-space-section); }
.detail-sec > .section-label + * { margin-top: var(--cw-space-tight); }
.detail-sec .formula { margin-top: var(--cw-space-control); }

/* ─── components/formula.css ─── */
/* 수식과 코드 블록. 안쪽 면(inset)에 올린다. */
.formula { padding: var(--cw-space-control); background: var(--cw-inset); border-radius: var(--cw-radius-control); overflow-x: auto; }
.formula .katex { font-size: 1.08em; }
.code-block { margin: 0; padding: var(--cw-space-control); background: var(--cw-inset); border-radius: var(--cw-radius-control); white-space: pre; overflow-x: auto; }

/* ─── components/sheet.css ─── */
/* 시트 격자 (4층): 계산서 원문을 엑셀처럼 그린다. 행 높이는 엑셀에 맞춰 24. */
.sheet[data-cw="sheet"] { position: relative; max-height: 340px; overflow: auto; background: var(--cw-paper); border: var(--cw-hairline) solid var(--cw-line); border-radius: var(--cw-radius-control); }
.grid { --row: var(--cw-h-cell); border-collapse: collapse; table-layout: fixed; font-size: var(--cw-fs-small); font-variant-numeric: tabular-nums; }
.grid th, .grid td { height: var(--row); padding: 0 var(--cw-space-item); border: var(--cw-border) solid var(--cw-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: calc(var(--row) - var(--cw-border)); }
.grid col.rh { width: 44px; } /* cw-allow 행 번호 열 */
.grid col.c { width: 96px; } /* cw-allow 시트 열 폭 */
.grid col.w { width: 200px; } /* cw-allow 시트 열 폭 */
.grid thead th { position: sticky; top: 0; z-index: 3; background: var(--cw-surface); color: var(--cw-text-muted); font-size: var(--cw-fs-caption); font-weight: var(--cw-fw-medium); text-align: center; border-bottom-color: var(--cw-line-strong); }
.grid tbody th { position: sticky; left: 0; z-index: 2; background: var(--cw-surface); color: var(--cw-text-muted); font-size: var(--cw-fs-caption); font-weight: var(--cw-fw-regular); text-align: right; border-right-color: var(--cw-line-strong); }
.grid thead th:first-child { left: 0; z-index: 4; }
.grid td.n { text-align: right; }
.grid td.u { color: var(--cw-text-muted); }
.grid tr.is-focus > td { background-color: color-mix(in srgb, var(--cw-selection) 8%, transparent); }
.grid tr.is-focus > th, .grid thead th.is-focus { color: var(--cw-text); font-weight: var(--cw-fw-strong); background: color-mix(in srgb, var(--cw-selection) 22%, var(--cw-surface)); }
.grid thead th.is-focus { box-shadow: inset 0 -3px 0 var(--cw-selection); }
/* 판정 칠과 고른 범위는 '지금 보는 행'의 띠보다 이긴다 */
.grid tr > td.v-fail { background: color-mix(in srgb, var(--cw-danger) 14%, transparent); }
.grid tr > td.v-warn { background: color-mix(in srgb, var(--cw-warning) 11%, transparent); }
.grid tr > td.v-ok { background: color-mix(in srgb, var(--cw-success) 11%, transparent); }
.grid tr > td.v-hold { background: color-mix(in srgb, var(--cw-hold) 10%, transparent); }
.grid tr > td.is-sel { background: color-mix(in srgb, var(--cw-selection) 14%, transparent); }
.grid-frame { position: absolute; z-index: 1; pointer-events: none; border: var(--cw-border) solid color-mix(in srgb, var(--cw-text-muted) 55%, transparent); border-radius: 2px; }
.grid-frame.sel { border: 2px solid var(--cw-selection); }
.grid-frame.focus { border: 2px solid var(--cw-selection); animation: grid-pulse 1s var(--cw-ease) 2; }
@keyframes grid-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cw-selection) 55%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }
/* 창을 채우는 시트: 칸을 고르고 오른쪽 버튼으로 묻는 문서 면 */
.sheet[data-cw="sheet"].fill { position: absolute; inset: 0; max-height: none; border: 0; border-radius: 0; outline: none; scrollbar-width: thin; }
.sheet[data-cw="sheet"] .grid td { cursor: cell; }
.grid td.h { font-weight: var(--cw-fw-strong); }
.grid td.l { color: var(--cw-text-muted); font-size: var(--cw-fs-caption); }
.sheet-canvas { position: relative; display: inline-block; min-width: 100%; vertical-align: top; }
.sheet-sel { position: absolute; z-index: 2; border: 2px solid var(--cw-selection); border-radius: 2px; pointer-events: none; transition: left var(--cw-dur-fast) var(--cw-ease), top var(--cw-dur-fast) var(--cw-ease); } /* cw-allow 고른 칸 틀 */
.sheet:focus-visible .sheet-sel { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cw-focus) 55%, transparent); } /* cw-allow 키보드 초점 */
.sheet-canvas .grid { width: max-content; }

/* ─── components/tree.css ─── */
/* 트리 (4층): role=tree. 화살표는 펴고 접기만, 행은 고르기만 한다. */
.tree { padding: var(--cw-space-tight) 0; outline: none; }
.tree-row {
  --lv: 1; position: relative; isolation: isolate; display: flex; align-items: center; gap: var(--cw-space-tight);
  height: var(--cw-h-tool); padding: 0 var(--cw-space-control) 0 calc(var(--cw-space-item) + (var(--lv) - 1) * var(--cw-space-group));
  font-size: var(--cw-fs-small); cursor: default; user-select: none; outline: none;
}
[data-density="compact"] .tree-row { height: var(--cw-h-compact); }
.tree-row[aria-level="2"] { --lv: 2; }
.tree-row[aria-level="3"] { --lv: 3; }
.tree-row[aria-level="4"] { --lv: 4; }
.tree-row[aria-level="5"] { --lv: 5; }
.tree-row::before { content: ""; position: absolute; inset: 1px var(--cw-space-tight); z-index: -1; border-radius: var(--cw-radius-control); transition: background-color var(--cw-dur-fast) var(--cw-ease); } /* cw-allow 행 사이 2px */
.tree-row:hover::before { background: var(--cw-hover); }
.tree-row.is-selected::before { background: var(--cw-selected); }
.tree-row.is-selected::after { content: ""; position: absolute; left: var(--cw-space-tight); top: 50%; width: var(--cw-bar-selected); height: var(--cw-icon-sm); translate: 0 -50%; border-radius: 2px; background: var(--cw-selection); } /* cw-allow 막대 끝 둥글림 */
.tree-row:focus-visible::before { box-shadow: inset 0 0 0 var(--cw-focus-width) var(--cw-focus); }
.tree-row .tw { flex: none; display: grid; place-items: center; width: var(--cw-icon-sm); height: var(--cw-icon-sm); color: var(--cw-text-muted); }
.tree-row[aria-expanded] .tw::before {
  content: ""; width: var(--cw-icon-sm); height: var(--cw-icon-sm); background: currentColor; transition: rotate var(--cw-dur-base) var(--cw-ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tree-row[aria-expanded="true"] .tw::before { rotate: 90deg; }
.tree-row .tw:hover { color: var(--cw-text); }
.tree-row .tl { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tree-row.is-selected .tl { font-weight: var(--cw-fw-medium); }
.tree-row .tm { font-size: var(--cw-fs-caption); color: var(--cw-text-muted); font-variant-numeric: tabular-nums; }
.tree-row .badge { flex: none; }
.tree-row.is-hover::before { background: var(--cw-hover); } /* 상태 행렬의 거울 클래스 */
.tree-row.is-focus::before { box-shadow: inset 0 0 0 var(--cw-focus-width) var(--cw-focus); }

/* ─── components/state.css ─── */
/* 빈 · 불러오는 중 · 오류 (4층): 영역 위에서 1/3 높이에 문구 한 문장과 할 일 하나. */
.state-msg { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--cw-space-item); padding: 18% var(--cw-space-panel) 0; text-align: center; font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); color: var(--cw-text-muted); }
.state-msg .err-mark { color: var(--cw-destructive-text); }
.state-msg .btn { margin-top: var(--cw-space-tight); }

/* ─── components/provenance.css ─── */
/* 출처 표기 (4층): 셀 주소, AI 제안, 직접 고침. AI 제안에는 색을 쓰지 않는다. */
.src-ref { font-family: var(--cw-font-code); font-size: var(--cw-fs-caption); color: var(--cw-text-muted); text-decoration: none; }
.src-ref:hover { color: var(--cw-action); text-decoration: underline; }
.src-ai, .src-edit { display: inline-flex; align-items: center; height: var(--cw-lh-caption); padding: 0 var(--cw-space-tight); border: var(--cw-border) solid var(--cw-line-strong); border-radius: var(--cw-radius-badge); font-size: var(--cw-fs-caption); color: var(--cw-text-muted); white-space: nowrap; }
.src-ai-val { text-decoration: underline dotted var(--cw-text-muted); text-underline-offset: 3px; } /* cw-allow 밑줄 간격 */
.is-confirmed .src-ai-val { text-decoration: none; }

/* ─── components/app.css ─── */
/* 앱 틀 (2층): 창 · 툴바 · 작업 영역 · 패널 · 상태 표시줄. 타이틀바는 titlebar.css. 틀은 화살표 커서이고 글자를 고를 수 없다.
   실제 창에서는 테두리와 모서리를 운영체제가 그리므로 .app에는 없다. 갤러리 미리보기처럼 페이지 안에 창을 그릴 때는 .app.framed를 쓴다. */
.app {
  --product: var(--cw-reviewer);
  display: flex; flex-direction: column; overflow: hidden; container-type: inline-size;
  background: var(--cw-bg);
}
.app.framed { border: var(--cw-border) solid var(--cw-line-strong); border-radius: var(--cw-radius-container); }
.titlebar .spacer, .statusbar .spacer { flex: 1; }
/* 툴바는 toolbar.css */
/* 작업 영역: 왼쪽 사이드바 · 가운데 · 오른쪽 사이드바가 가로로 놓인다. 사이드바는 고정 폭(sidebar.css), 나머지가 남은 폭을 나눠 가진다. */
/* 카드형: 패널과 가운데 영역을 8px 간격의 둥근 카드로 띄운다. 손잡이는 폭 0이므로 양쪽 간격을 반씩 당겨 카드 사이를 8px로 맞춘다. */
.work { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: var(--cw-space-item); padding: 0 var(--cw-space-item) var(--cw-space-item); }
.work > :is(.panel, .center) { border: var(--cw-hairline) solid var(--cw-line); border-radius: var(--cw-radius-container); overflow: hidden; }
.work > .side-handle { margin-inline: calc(var(--cw-space-item) / -2); }
.work > * { min-width: 0; min-height: 0; }
.work > :not(.side-l, .side-r, .side-handle) { flex: 1 1 0; }
.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--cw-surface); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--cw-space-item); flex: none;
  height: var(--cw-h-panel-head); padding: 0 var(--cw-space-item) 0 var(--cw-space-panel);
  border-bottom: var(--cw-hairline) solid transparent; cursor: default; user-select: none;
}
.panel-head h3 { flex: 1; font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); } /* 제목이 남는 폭을 써서 도구 버튼과 접기 버튼이 오른쪽에 모인다 */
.panel-head .count { margin-left: var(--cw-space-item); font-size: var(--cw-fs-small); font-weight: var(--cw-fw-regular); color: var(--cw-text-muted); }
/* 거르기 줄: 패널 머리 바로 아래. 그 목록을 거르거나 다른 조건으로 보는 조작(분할 버튼, 거르기 칸)을 둔다. 분할 버튼은 폭을 채운다. */
.panel-filter { flex: none; display: flex; align-items: center; gap: var(--cw-space-item); padding: var(--cw-space-item) var(--cw-space-panel); border-bottom: var(--cw-hairline) solid transparent; }
.panel-filter > .seg { flex: 1; }
.panel-filter > .seg > button { flex: 1; }
.panel-body { flex: 1; min-height: 0; overflow: auto; }
.panel-pad { padding: var(--cw-space-panel); }
.panel-foot { flex: none; padding: var(--cw-space-group) var(--cw-space-panel); border-top: var(--cw-hairline) solid var(--cw-line); }
.statusbar {
  display: flex; align-items: center; gap: var(--cw-space-group); flex: none;
  height: var(--cw-h-statusbar); padding: 0 var(--cw-space-control);
  background: var(--cw-bg); border-top: var(--cw-hairline) solid transparent;
  font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted);
  cursor: default; user-select: none;
}
.statusbar b { font-weight: var(--cw-fw-medium); }
/* 상태 표시줄 안: 왼쪽 묶음은 읽기만 하는 상태(작업 · 저장), 오른쪽 묶음은 누르면 바꾸는 이 문서의 설정(적용 기준 · 단위).
   설정 단추(.status-btn)는 안쪽 여백만큼 바깥으로 당겨 글자 사이 간격이 다른 항목과 같은 16px이 되게 한다.
   좁은 창: 960px 아래에서 .status-long 대신 .status-short, 760px 아래에서 .status-optional을 숨긴다. */
.status-group { display: flex; align-items: center; gap: var(--cw-space-group); min-width: 0; white-space: nowrap; }
.status-item { display: inline-flex; align-items: center; gap: var(--cw-space-tight); white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-item:has(.verdict) { gap: var(--cw-space-item); }
.status-item .spinner { width: var(--cw-space-control); height: var(--cw-space-control); vertical-align: 0; }
.status-item .progress { width: 120px; margin-left: var(--cw-space-tight); } /* cw-allow 상태 표시줄의 진행 막대 폭 */
.status-item button.link { padding: 0; border: 0; background: none; font: inherit; margin-left: var(--cw-space-tight); }
.status-alert { color: var(--cw-emphasis); }
.status-alert b { margin-right: var(--cw-space-tight); }
.status-btn {
  display: inline-flex; align-items: center; height: calc(var(--cw-h-statusbar) - var(--cw-space-tight)); padding: 0 var(--cw-space-item); margin: 0 calc(-1 * var(--cw-space-item));
  border: 0; border-radius: var(--cw-radius-control); background: none; color: inherit; font: inherit; font-variant-numeric: tabular-nums; cursor: default;
  transition: background-color var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease);
}
.status-btn:hover, .status-btn[aria-expanded="true"] { background: var(--cw-hover); color: var(--cw-text); }
.status-btn:focus-visible { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: calc(-1 * var(--cw-focus-width)); }
.status-short { display: none; }
@container (max-width: 960px) { .statusbar .status-long { display: none; } .statusbar .status-short { display: inline; } }
@container (max-width: 760px) { .statusbar .status-optional { display: none; } }
.app { position: relative; } /* 메뉴와 대화상자의 층이 앱 틀 안에 놓인다 */
.status-item .warn-mark { margin-right: var(--cw-space-tight); color: var(--cw-emphasis); font-weight: var(--cw-fw-strong); }

/* ─── components/titlebar.css ─── */
/* 타이틀바 (2층). 높이 40px, 대표색을 바탕에 14% 섞은 칠. 왼쪽 제품 표기, 가운데 문서 이름, 오른쪽 창 조작 버튼.
   막대 전체가 창을 끄는 영역이고 버튼·입력·탭만 뺀다. 더블클릭은 최대화·복원이다(catwin.js, data-cw="titlebar").
   창 조작 버튼은 Windows 관례대로 46×40, 오른쪽 끝에 붙고 모서리가 없으며 Tab 순서 밖이다. 닫기 호버만 운영체제 관례의 빨강이다.
   호스트: .app[data-host="desktop"](기본, 버튼 그림) · "web"(버튼 없음) · "pwa"(버튼 없음, 운영체제 버튼 자리를 비움) · "mac"(신호등 자리를 비움). */
.titlebar {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; flex: none;
  height: var(--cw-h-titlebar); padding-left: var(--cw-space-control);
  background: color-mix(in srgb, var(--product) var(--cw-tint-product), var(--cw-bg));
  border-bottom: var(--cw-hairline) solid var(--cw-line);
  cursor: default; user-select: none; -webkit-app-region: drag; app-region: drag;
  transition: background-color var(--cw-dur-base) var(--cw-ease);
}
.titlebar :is(button, input, select, a, .seg, .tabs) { -webkit-app-region: no-drag; app-region: no-drag; }

/* 왼쪽: 타일 20px, 제품 이름(칠 위에서는 글자색), by Catwin */
.tb-left { display: flex; align-items: center; gap: var(--cw-space-item); min-width: 0; }
.product-tile { display: grid; place-items: center; flex: none; width: var(--cw-icon-md); height: var(--cw-icon-md); border-radius: calc(var(--cw-icon-md) / 5); background: var(--product); color: var(--cw-bg); } /* 앱 타일과 같은 20% 모서리 비율. 모서리 토큰을 따르지 않는다 */
.product-tile svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.product-name { font-weight: var(--cw-fw-strong); color: var(--cw-text); white-space: nowrap; }
.endorse { display: inline-flex; align-items: center; gap: var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); white-space: nowrap; }
.endorse svg { width: var(--cw-space-control); height: var(--cw-space-control); }

/* 가운데: 문서 이름. 창 기준 중앙이고 넘치면 끝을 줄인다. 저장 안 된 문서는 앞에 점. */
.doc-name { min-width: 0; padding: 0 var(--cw-space-group); font-size: var(--cw-fs-small); color: var(--cw-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.doc-name.is-dirty::before { content: "•"; margin-right: var(--cw-space-tight); color: var(--cw-text); }

/* 오른쪽: 창 조작 버튼 */
.tb-right { display: flex; justify-content: flex-end; align-self: stretch; min-width: 0; margin-bottom: calc(-1 * var(--cw-hairline)); } /* 창 조작 버튼은 아래 헤어라인까지 덮어 꽉 찬 40px이다 */
.win-controls { display: flex; align-self: stretch; }
.win-controls > button {
  display: grid; place-items: center; width: var(--cw-w-caption); height: 100%;
  border: 0; border-radius: 0; background: transparent; color: var(--cw-text); cursor: default;
  transition: background-color var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease);
}
.win-controls > button:hover, .win-controls > button.is-hover { background: color-mix(in srgb, var(--cw-text) 9%, transparent); }
.win-controls > button:active, .win-controls > button.is-active { background: color-mix(in srgb, var(--cw-text) 6%, transparent); transition-duration: 0ms; }
.win-controls > button[data-window-command="close"]:hover, .win-controls > button[data-window-command="close"].is-hover { background: var(--cw-close-hover); color: var(--cw-on-close); }
.win-controls > button[data-window-command="close"]:active, .win-controls > button[data-window-command="close"].is-active { background: color-mix(in srgb, var(--cw-close-hover) 80%, var(--cw-bg)); color: var(--cw-on-close); }
.win-controls > button:focus-visible { outline-offset: calc(-1 * var(--cw-focus-width)); }
.win-controls .w { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1px; shape-rendering: crispEdges; }
.win-controls [data-window-command="close"] .w { shape-rendering: geometricPrecision; }
.win-controls .w.restore { display: none; }
.app.is-maximized .win-controls [data-window-command="toggle-maximize"] .w { display: none; }
.app.is-maximized .win-controls [data-window-command="toggle-maximize"] .w.restore { display: block; }

/* 비활성 창: 칠을 옅게, 글자는 보조색 */
[data-window="inactive"] .titlebar { background: color-mix(in srgb, var(--product) var(--cw-tint-product-inactive), var(--cw-bg)); }
[data-window="inactive"] .titlebar :is(.product-name, .doc-name, .win-controls) { color: var(--cw-text-muted); }
[data-window="inactive"] .titlebar .doc-name.is-dirty::before { color: var(--cw-text-muted); }
[data-window="inactive"] .titlebar .product-tile { opacity: .6; }

/* 호스트 변형 */
.app[data-host="web"] .win-controls, .app[data-host="pwa"] .win-controls, .app[data-host="mac"] .win-controls { display: none; }
.app[data-host="web"] .titlebar { padding-right: var(--cw-space-control); }
.app[data-host="pwa"] .titlebar { padding-right: max(var(--cw-space-control), calc(100% - env(titlebar-area-width, 100%))); }
.app[data-host="mac"] .titlebar { padding-left: var(--cw-w-traffic); }

/* 좁은 창: by Catwin, 그다음 문서 이름을 숨긴다 */
@container (max-width: 640px) { .titlebar .endorse { display: none; } }
@container (max-width: 440px) { .titlebar .doc-name { visibility: hidden; } }

/* ─── components/toolbar.css ─── */
/* 툴바 (2층). 높이 48(조밀 40), 창 바탕과 같은 면이고 구분선이 없다(카드형), 좌우 안쪽 여백 12. 문서 전체에 대한 조작만 둔다.
   세 구역으로 나누고 아래 창의 세 칸과 뜻을 맞춘다. 버튼은 하는 일로 자리가 정해진다.
   .tool-start 찾아가기: 메뉴(≡, 끝에 고정), 찾기, 열기와 불러오기.
   .tool-mid 보기와 다루기: 문서 보기 전환, 작업 도구. 창의 가운데에 온다.
   .tool-end 일하기: 내보내기, 중지, 주 버튼(끝에 고정).
   패널 버튼은 패널 머리에, 목록 거르기는 .panel-filter에 둔다.
   버튼은 32px 조용한 버튼(.btn.quiet.tool)이 기본이고 주 버튼만 채운다. 묶음 사이는 .sep.
   툴바는 Tab 정지 하나이고 안에서 ←→로 옮긴다(catwin.js, data-cw="toolbar").
   좁은 창: 960px 아래에서 .btn-text을 숨겨 아이콘만 남기고(title이 라벨을 대신한다), 720px 아래에서 검색 칸을 줄인다. */
.toolbar {
  display: flex; align-items: center; gap: var(--cw-space-item); flex: none;
  height: var(--cw-h-toolbar); padding: 0 var(--cw-space-control);
  background: var(--cw-bg); border-bottom: var(--cw-hairline) solid transparent;
  cursor: default; user-select: none;
}
.toolbar:has(> .tool-start, > .tool-mid, > .tool-end) { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); column-gap: var(--cw-space-group); }
.tool-start, .tool-mid, .tool-end { display: flex; align-items: center; gap: var(--cw-space-item); min-width: 0; }
.tool-start { grid-column: 1; }
.tool-mid { grid-column: 2; }
.tool-end { grid-column: 3; justify-content: flex-end; }
.toolbar .spacer { flex: 1; }
.toolbar .sep, .float-bar .sep { flex: none; width: var(--cw-border); height: var(--cw-icon-md); margin: 0 var(--cw-space-item); background: var(--cw-line-strong); }
.toolbar .btn { flex: none; }
.toolbar .btn.quiet { font-weight: var(--cw-fw-regular); } /* 툴바 글자는 보통 굵기. 주 버튼만 500이다 */

/* 검색 칸: 평소 220px, 포커스하면 320px. 단축키 힌트는 포커스하거나 값이 있으면 숨긴다. */
.toolbar .search { flex: none; width: 220px; transition: width var(--cw-dur-base) var(--cw-ease); }
.toolbar .search:focus-within, .toolbar .search.is-focus { width: 320px; }
.toolbar .search .kbd { flex: none; margin-right: calc(var(--cw-space-tight) - var(--cw-space-control)); }
.toolbar .search:focus-within .kbd, .toolbar .search.is-focus .kbd, .toolbar .search:has(.input:not(:placeholder-shown)) .kbd { display: none; }

/* 좁은 창 */
@container (max-width: 960px) {
  .toolbar .btn.tool > .btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .toolbar .btn.tool:has(> .i):has(> .btn-text) { width: var(--cw-h-tool); padding: 0; }
  .toolbar .btn.tool:has(> .i):has(> .btn-text) > .i { margin: 0; }
}
@container (max-width: 720px) {
  .toolbar .search { width: 160px; }
  .toolbar .search:focus-within { width: 240px; }
}

/* ─── components/sidebar.css ─── */
/* 사이드바 (2층). 왼쪽 280px(240~360), 오른쪽 360px(300~480). 제품은 --cw-side-w, --cw-side-min, --cw-side-max를 인라인으로 바꿀 수 있다.
   안쪽 경계에 8px 손잡이(.side-handle, catwin.js가 넣는다)가 있고 보이는 선은 헤어라인이다. 올리면 200ms 뒤 2px 선택색 선이 나타나고 끌 때는 즉시 보인다.
   접힘(.is-collapsed)은 폭 32px의 띠(.side-rail, catwin.js가 넣는다)이고 바탕은 창 바탕색이다. 폭은 240ms로 한 번에 이어서 움직이고,
   그동안 내용은 원래 폭을 유지한 채(.is-animating) 흐려지고 띠는 끝 무렵에 나타난다. 펼칠 때는 띠가 먼저 사라지고 내용이 조금 늦게 나타난다. */
.panel.side-l, .panel.side-r {
  position: relative; flex: none; overflow: hidden;
  width: var(--cw-side-w, var(--cw-w-left));
  transition: width var(--cw-dur-slow) var(--cw-ease), background-color var(--cw-dur-slow) var(--cw-ease);
}
.panel.side-r { width: var(--cw-side-w, var(--cw-w-right)); }
.panel.side-l.is-dragging, .panel.side-r.is-dragging { transition: none; }
.panel.side-l.is-collapsed, .panel.side-r.is-collapsed { width: var(--cw-w-side-rail) !important; background: var(--cw-bg); }
.panel.side-l.is-animating > :not(.side-rail), .panel.side-r.is-animating > :not(.side-rail) { width: var(--cw-side-content-w); flex-shrink: 0; }
.panel.side-l > :not(.side-rail), .panel.side-r > :not(.side-rail) { transition: opacity var(--cw-dur-base) var(--cw-ease) var(--cw-dur-fast); }
.panel.is-collapsed > :not(.side-rail) { opacity: 0; transition-duration: var(--cw-dur-fast); transition-delay: 0ms; }
.panel.is-dragging > :not(.side-rail) { transition: none; }

/* 띠: 접힌 패널 전체를 덮는 단추 하나. 패널 아이콘(data-rail-icon)과 개수, 이름은 툴팁. 어디를 눌러도 펼친다. */
.side-rail {
  position: absolute; top: 0; bottom: 0; width: var(--cw-w-side-rail); z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: var(--cw-space-tight);
  padding: calc((var(--cw-h-panel-head) - var(--cw-icon-sm)) / 2) 0 0; border: 0; background: transparent; color: var(--cw-text-muted); cursor: default;
  opacity: 0; visibility: hidden;
  transition: opacity var(--cw-dur-fast) var(--cw-ease), visibility 0s linear var(--cw-dur-fast), background-color var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease);
}
.side-l > .side-rail { left: 0; }
.side-r > .side-rail { right: 0; }
.panel.is-collapsed > .side-rail {
  opacity: 1; visibility: visible;
  transition: opacity var(--cw-dur-base) var(--cw-ease) var(--cw-dur-fast), visibility 0s, background-color var(--cw-dur-fast) var(--cw-ease), color var(--cw-dur-fast) var(--cw-ease);
}
.panel.is-dragging > .side-rail { transition: none; }
.side-rail:hover { background: var(--cw-surface); color: var(--cw-text); }
.side-rail:active { background: color-mix(in srgb, var(--cw-surface), var(--cw-text) 6%); transition-duration: 0ms; }
.side-rail:focus-visible { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: calc(-1 * var(--cw-focus-width)); }
.side-rail .count { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-variant-numeric: tabular-nums; }
[data-window="inactive"] .side-rail { color: var(--cw-text-muted); }
.panel-head h3 { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 손잡이: 폭 0인 자리에 8px 맞춤 영역과 2px 표시선을 겹쳐 둔다 */
.side-handle { position: relative; flex: none; width: 0; z-index: 3; outline: none; }
.side-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--cw-w-handle) / 2); width: var(--cw-w-handle); cursor: col-resize; }
.side-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: transparent; pointer-events: none; transition: background-color var(--cw-dur-fast) var(--cw-ease); }
.side-handle:hover::after { background: var(--cw-selection); transition-delay: 200ms; }
.side-handle.is-active::after, .side-handle:focus-visible::after { background: var(--cw-selection); transition-delay: 0ms; }

/* 끄는 동안 페이지 전체의 커서와 글자 선택, iframe 이벤트를 막는다 */
.cw-resizing, .cw-resizing * { cursor: col-resize !important; user-select: none !important; }
.cw-resizing iframe { pointer-events: none; }

/* ─── components/window-extra.css ─── */
/* 추가 창 (2층): 대화상자 창, 도구 창, 설정 창의 안쪽. */
.titlebar.plain { background: var(--cw-paper); border-bottom: 0; }
.titlebar .win-title { font-size: var(--cw-fs-small); font-weight: var(--cw-fw-medium); color: var(--cw-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-window="inactive"] .titlebar .win-title { color: var(--cw-text-muted); }
.win-dialog { width: var(--cw-w-dialog-wide); max-width: 100%; background: var(--cw-paper); }
.win-dialog .dlg-body { padding-top: var(--cw-space-item); }
.win-settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 0; flex: 1; background: var(--cw-paper); }
.win-settings .tabs.vertical { padding: var(--cw-space-item) 0; border-right: var(--cw-hairline) solid var(--cw-line); }
.win-settings .pane { padding: var(--cw-space-panel) var(--cw-space-gutter); overflow: auto; }
.win-settings .pane > * + * { margin-top: var(--cw-space-group); }
.parent-dim { position: absolute; inset: 0; background: color-mix(in srgb, var(--cw-bg) 40%, transparent); pointer-events: none; }

/* ─── components/float.css ─── */
/* 떠 있는 카드 (3층): 작업 대상이 창 전체를 쓰는 화면(Modeler 등)에서 도구와 패널을 올려 둔다.
   타이틀바는 다른 프로그램과 같고, 그 아래 작업 영역만 플로팅 방식으로 바뀐다. */
.stage-fill { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--cw-bg); }
.float {
  position: absolute; z-index: 2;
  background: color-mix(in srgb, var(--cw-surface) 90%, transparent); backdrop-filter: blur(12px);
  border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-container);
  box-shadow: var(--cw-shadow-float);
}
.float-bar { display: flex; align-items: center; gap: var(--cw-space-tight); padding: var(--cw-space-tight); }
.float-bar .sep { margin: 0 var(--cw-space-tight); }
.float .panel-head { height: var(--cw-h-tool); padding-left: var(--cw-space-control); }
.float .panel-head h3 { font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); }
.cmdbar { display: flex; align-items: center; gap: var(--cw-space-item); height: 44px; padding: 0 var(--cw-space-control) 0 var(--cw-space-group); color: var(--cw-text-muted); }
.cmdbar .ph { flex: 1; }
.kbd {
  display: inline-grid; place-items: center; min-width: var(--cw-icon-md); height: var(--cw-icon-md); padding: 0 var(--cw-space-tight);
  border: var(--cw-border) solid transparent; border-radius: var(--cw-radius-control); background: var(--cw-kbd);
  font-family: var(--cw-font-code); font-size: 11px; color: var(--cw-text-muted); /* cw-allow 단축키 표시는 캡션보다 한 단계 작다 */
}

/* ─── components/popmenu.css ─── */
/* 메뉴 (3층): 툴바의 ≡, 상태 표시줄의 설정, 오른쪽 버튼이 연다. .float-layer는 앱 틀 안의 떠 있는 층이다. */
.btn[data-menu][aria-expanded="true"], .status-btn[data-menu][aria-expanded="true"] { background: var(--cw-hover); color: var(--cw-text); } /* 메뉴가 열린 동안 연 버튼을 눌린 듯 둔다 */
.float-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.popmenu {
  position: absolute; min-width: var(--cw-w-menu-min);
  padding: var(--cw-space-tight); background: var(--cw-paper); border: var(--cw-border) solid var(--cw-float-edge);
  border-radius: var(--cw-radius-container); box-shadow: var(--cw-shadow-float); pointer-events: auto;
  animation: cw-pop-in var(--cw-dur-fast) var(--cw-ease);
}
.popmenu:focus { outline: none; }
@keyframes cw-pop-in { from { opacity: 0; transform: translateY(calc(-1 * var(--cw-space-tight))); } }
.popmenu-item {
  display: flex; align-items: center; gap: var(--cw-space-item); width: 100%; height: var(--cw-h-tool); padding: 0 var(--cw-space-item);
  border: 0; border-radius: var(--cw-radius-control); background: none; color: var(--cw-text); font: inherit; font-size: var(--cw-fs-small);
  text-align: left; white-space: nowrap; cursor: default;
}
.popmenu-item:focus, .popmenu-item.is-open { outline: none; background: var(--cw-item-hover); }
.popmenu-item:focus-visible { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: calc(-1 * var(--cw-focus-width)); }
.popmenu-item:disabled { color: var(--cw-text-disabled); }
.popmenu-item:disabled .popmenu-key { color: inherit; }
.popmenu-label { flex: 1; }
.popmenu-key { padding-left: var(--cw-space-group); font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.popmenu-item > .popmenu-sub { color: var(--cw-text-muted); margin-right: calc(-1 * var(--cw-space-tight)); }
.popmenu-mark { display: grid; place-items: center; flex: none; width: var(--cw-icon-sm); }
.popmenu-radio { width: 6px; height: 6px; border-radius: 50%; background: currentColor; } /* cw-allow 라디오 점 */
.popmenu-sep { height: var(--cw-hairline); margin: var(--cw-space-tight) var(--cw-space-item); background: var(--cw-line); }
/* ── 15 메뉴: 판 안에서 펼친 채 보여 주는 견본과 위험 항목 ── */
.popmenu.static { position: relative; animation: none; }
.popmenu-item.danger { color: var(--cw-destructive-text); }
.popmenu-group { padding: var(--cw-space-tight) var(--cw-space-item) 0 calc(var(--cw-icon-sm) + var(--cw-space-group)); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.popmenu-item.is-hover, .popmenu-item.is-focus { background: var(--cw-item-hover); } /* 상태 행렬의 거울 클래스 */
.popmenu-item.is-focus { outline: var(--cw-focus-width) solid var(--cw-focus); outline-offset: calc(-1 * var(--cw-focus-width)); }

/* ─── components/tooltip.css ─── */
/* 툴팁 (3층): 아이콘만 있는 버튼, 잘린 글자, 줄임말, 상태 표시줄의 짧은 말에만 쓴다. */
.tip {
  position: fixed; z-index: 100; max-width: var(--cw-w-tip-max); padding: var(--cw-space-tight) var(--cw-space-item);
  background: var(--cw-paper); color: var(--cw-text); border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-control); box-shadow: var(--cw-shadow-float);
  font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); white-space: normal; pointer-events: auto;
  opacity: 0; transition: opacity var(--cw-dur-fast) var(--cw-ease);
}
.tip.is-on { opacity: 1; }
.tip kbd { margin-left: var(--cw-space-item); padding: 0; background: none; font-family: var(--cw-font-ui); font-size: inherit; color: var(--cw-text-muted); }
.tip.static { position: static; display: inline-block; opacity: 1; }
.trunc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }

/* ─── components/dialog.css ─── */
/* 메시지 상자와 대화상자 (3층): 본문은 문서 면, 버튼 줄은 패널 면 띠. */
.dlg-backdrop {
  position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--cw-space-section);
  background: color-mix(in srgb, var(--cw-bg) 64%, transparent); animation: cw-fade-in var(--cw-dur-base) var(--cw-ease);
}
.dlg-backdrop.is-closing { opacity: 0; transition: opacity var(--cw-dur-fast) var(--cw-ease); }
.dlg {
  display: flex; flex-direction: column; width: var(--cw-w-dialog); max-width: 100%; max-height: 100%; overflow: hidden;
  background: var(--cw-paper); border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-container); box-shadow: var(--cw-shadow-float);
  animation: dlg-in var(--cw-dur-base) var(--cw-ease);
}
.dlg.static { animation: none; }
.dlg.wide { width: var(--cw-w-dialog-wide); }
@keyframes dlg-in { from { opacity: 0; transform: scale(.98); } }
.dlg-body { padding: var(--cw-space-panel); overflow: auto; }
.dlg-title { font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); }
.dlg-text { margin-top: var(--cw-space-item); font-size: var(--cw-fs-body); line-height: var(--cw-lh-read); }
.dlg-text + .dlg-text { margin-top: var(--cw-space-item); }
.dlg-body .field { margin-top: var(--cw-space-group); }
.dlg-detail { margin-top: var(--cw-space-group); }
.dlg-detail summary { display: inline-flex; align-items: center; gap: var(--cw-space-tight); font-size: var(--cw-fs-small); color: var(--cw-text-muted); cursor: default; list-style: none; }
.dlg-detail summary::-webkit-details-marker { display: none; }
.dlg-detail summary .i { transition: transform var(--cw-dur-base) var(--cw-ease); }
.dlg-detail[open] summary .i { transform: rotate(90deg); }
.dlg-detail pre { margin-top: var(--cw-space-item); padding: var(--cw-space-control); background: var(--cw-inset); border-radius: var(--cw-radius-control); white-space: pre-wrap; color: var(--cw-text-muted); }
/* 버튼 줄: 주 버튼이 오른쪽 끝, 결정과 다른 버튼(.lead)은 왼쪽 끝. 버튼은 32px에 최소 폭 88px(Windows 대화상자 관례) */
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--cw-space-item); flex: none; padding: var(--cw-space-group) var(--cw-space-panel); background: color-mix(in srgb, var(--cw-surface) 70%, var(--cw-paper)); border-top: var(--cw-hairline) solid var(--cw-line); }
.dlg-foot > .lead { margin-right: auto; }
.dlg-foot .btn.decision { height: var(--cw-h-tool); min-width: var(--cw-w-decision-min); padding: 0 var(--cw-space-group); font-size: var(--cw-fs-small); }

/* ─── components/notice.css ─── */
/* 알림줄 (3층): 패널이나 문서 위에 붙는 막지 않는 메시지. 주목은 주목색 기호, 정보는 무채색. */
.notice { display: flex; align-items: center; gap: var(--cw-space-item); min-height: var(--cw-h-panel-head); padding: var(--cw-space-item) var(--cw-space-tight) var(--cw-space-item) var(--cw-space-control); border-bottom: var(--cw-hairline) solid var(--cw-line); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); }
.notice > .text { flex: 1; min-width: 0; }
.notice > b { flex: none; width: var(--cw-icon-sm); text-align: center; }
.notice.attention { background: color-mix(in srgb, var(--cw-emphasis) 9%, var(--cw-surface)); }
.notice.attention > b { color: var(--cw-emphasis); }
.notice.info { background: var(--cw-surface); }
.notice.info > b { color: var(--cw-text-muted); }

/* ─── components/toast.css ─── */
/* 알림 (3층): 창 오른쪽 아래, 상태 표시줄 위 16px에 최대 3개까지 쌓는다. */
.toasts { position: absolute; right: var(--cw-space-group); bottom: calc(var(--cw-h-statusbar) + var(--cw-space-group)); z-index: 15; display: flex; flex-direction: column; gap: var(--cw-space-item); width: var(--cw-w-toast); max-width: calc(100% - var(--cw-space-section)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: var(--cw-space-item); padding: var(--cw-space-control) var(--cw-space-tight) var(--cw-space-control) var(--cw-space-group);
  background: var(--cw-paper); border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-container); box-shadow: var(--cw-shadow-float);
  font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); pointer-events: auto;
  animation: toast-in var(--cw-dur-base) var(--cw-ease);
}
.toast.is-leaving { opacity: 0; transform: translateY(var(--cw-space-tight)); transition: opacity var(--cw-dur-fast) var(--cw-ease), transform var(--cw-dur-fast) var(--cw-ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(var(--cw-space-item)); } }
.toast .text { flex: 1; min-width: 0; padding-top: var(--cw-space-tight); }
.toast .text b.mark { margin-right: var(--cw-space-tight); color: var(--cw-destructive-text); }
.toast .act { margin-left: var(--cw-space-item); white-space: nowrap; }
.btn.icon > .menu-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--cw-focus); } /* cw-allow ≡ 버튼의 알림 점 */

/* ─── components/finder.css ─── */
/* 찾기 (3층): Ctrl+K 찾기 목록과 Ctrl+F 찾기 막대. */
.finder-pop {
  position: absolute; z-index: 30; width: var(--cw-w-finder); max-width: calc(100% - var(--cw-space-group)); padding: var(--cw-space-tight);
  background: var(--cw-paper); border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-container); box-shadow: var(--cw-shadow-float);
  animation: cw-pop-in var(--cw-dur-fast) var(--cw-ease);
}
.finder-pop .fg { padding: var(--cw-space-item) var(--cw-space-item) var(--cw-space-tight); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.finder-pop [role="option"] { display: flex; align-items: center; gap: var(--cw-space-item); height: var(--cw-h-tool); padding: 0 var(--cw-space-item); border-radius: var(--cw-radius-control); font-size: var(--cw-fs-small); white-space: nowrap; cursor: default; }
.finder-pop [role="option"] > .i { flex: none; color: var(--cw-text-muted); }
.finder-pop [role="option"] .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.finder-pop [role="option"] .m { font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.finder-pop [role="option"].is-active { background: var(--cw-item-hover); }
.finder-pop mark { background: none; color: var(--cw-text); font-weight: var(--cw-fw-strong); }
.finder-pop .none { padding: var(--cw-space-item); font-size: var(--cw-fs-small); color: var(--cw-text-muted); }
.find-doc { display: flex; flex-direction: column; background: var(--cw-paper); }
.findbar { display: flex; align-items: center; gap: var(--cw-space-tight); padding: var(--cw-space-tight) var(--cw-space-item); background: var(--cw-surface); border-bottom: var(--cw-hairline) solid var(--cw-line); }
.findbar .input-wrap { width: 200px; }
.findbar .num { min-width: var(--cw-space-region); text-align: center; font-variant-numeric: tabular-nums; }

/* ─── components/keys.css ─── */
/* 단축키 표시와 단축키 창 (3층). */
kbd.key, .keys-list kbd, .blue-lens kbd { display: inline-block; padding: 0 var(--cw-space-tight); border-radius: var(--cw-radius-control); background: var(--cw-kbd); font-family: var(--cw-font-ui); font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text); }
.keys-list { max-height: 300px; margin-top: var(--cw-space-group); overflow: auto; }
.keys-list .kg { padding: var(--cw-space-group) 0 var(--cw-space-tight); font-size: var(--cw-fs-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.keys-list .kr { display: flex; justify-content: space-between; gap: var(--cw-space-group); padding: var(--cw-space-tight) 0; border-bottom: var(--cw-hairline) solid var(--cw-line); font-size: var(--cw-fs-small); }
.keys-filter { margin-top: var(--cw-space-group); }

/* ─── components/settings.css ─── */
/* 설정 · 정보 (3층): 왼쪽 세로 탭과 오른쪽 내용. 설정은 바로 적용되어 버튼이 없다. */
.settings { display: grid; grid-template-columns: var(--cw-w-settings-nav) minmax(0, 1fr); min-height: 0; background: var(--cw-paper); border: var(--cw-hairline) solid var(--cw-line); border-radius: var(--cw-radius-container); overflow: hidden; }
.settings .tabs.vertical { padding: var(--cw-space-item) 0; border-right: var(--cw-hairline) solid var(--cw-line); background: var(--cw-surface); }
.settings .tab .caption { margin-left: auto; font-weight: var(--cw-fw-regular); }
.settings-body { padding: var(--cw-space-panel) var(--cw-space-gutter); overflow: auto; }
.settings-body > div > * + * { margin-top: var(--cw-space-item); }
.about-head { display: flex; align-items: center; gap: var(--cw-space-control); padding: var(--cw-space-group) 0; }
.about-head .product-tile { width: var(--cw-h-decision); height: var(--cw-h-decision); }
.about-head .product-tile svg { width: var(--cw-icon-lg); height: var(--cw-icon-lg); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: var(--cw-space-group); padding: var(--cw-space-control) 0; border-bottom: var(--cw-hairline) solid var(--cw-line); }
.setting .what { display: flex; flex-direction: column; gap: 2px; }
.setting .what small { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); color: var(--cw-text-muted); }

/* ─── components/fwin.css ─── */
/* 떠 있는 창 (3층): 앱 창 안의 모달 아닌 보조 창. 여러 개를 띄우고 자석으로 붙이고 Alt+끌기로 묶는다. */
.fw-stage { --fw-face: color-mix(in srgb, var(--cw-bg) 64%, transparent); --fw-head: color-mix(in srgb, var(--cw-surface) 55%, transparent); --fw-edge: color-mix(in srgb, var(--cw-text) 18%, transparent); --fw-blur: blur(var(--cw-space-section)) saturate(.65); position: relative; overflow: hidden; }
.fw-stage.solid { --fw-face: var(--cw-paper); --fw-head: var(--cw-surface); --fw-edge: var(--cw-float-edge); --fw-blur: none; }
@media (prefers-reduced-transparency: reduce) { .fw-stage { --fw-face: var(--cw-paper); --fw-head: var(--cw-surface); --fw-blur: none; } }
.fwin, .fw-group {
  position: absolute; display: flex; flex-direction: column; min-width: 0;
  background: var(--fw-face); backdrop-filter: var(--fw-blur);
  border: var(--cw-border) solid var(--fw-edge); border-radius: var(--cw-radius-container); box-shadow: var(--cw-shadow-float); overflow: hidden;
}
.fwin-head { display: flex; align-items: center; gap: 2px; flex: none; height: var(--cw-h-tool); padding: 0 var(--cw-space-tight) 0 var(--cw-space-control); background: var(--fw-head); border-bottom: var(--cw-hairline) solid var(--cw-line); cursor: default; user-select: none; touch-action: none; outline: none; } /* cw-allow 버튼 사이 2px */
.fwin-head:focus-visible { box-shadow: inset 0 0 0 var(--cw-focus-width) var(--cw-focus); }
.fwin-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--cw-fs-small); font-weight: var(--cw-fw-medium); }
.fwin-body { flex: 1; min-height: 0; overflow: auto; padding: var(--cw-space-control); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); }
.fwin-body.read { line-height: var(--cw-lh-read); color: var(--cw-text); }
.fwin.is-folded { height: auto !important; }
.fwin.is-folded > .fwin-body, .fwin.is-folded > .fwin-grip { display: none; }
.fwin.is-folded > .fwin-head { border-bottom: 0; }
.fwin.is-moving, .fw-group.is-moving { transition: none; }
.fwin.is-merging { opacity: .55; }
.fwin-grip, .fw-group > .fwin-grip { position: absolute; right: 0; bottom: 0; width: var(--cw-space-group); height: var(--cw-space-group); cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--cw-steel) 50%, var(--cw-steel) 56%, transparent 56%, transparent 68%, var(--cw-steel) 68%, var(--cw-steel) 74%, transparent 74%); }
.fw-table { width: 100%; }
.fw-table th, .fw-table td { height: var(--cw-h-compact); background: transparent; }
.fw-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.fw-preview { position: absolute; z-index: 900; pointer-events: none; border: 2px dashed var(--cw-focus); border-radius: var(--cw-radius-container); }
.fw-preview.merge { border-style: solid; background: color-mix(in srgb, var(--cw-focus) 22%, transparent); }
.fw-hint { position: absolute; z-index: 901; left: 50%; bottom: var(--cw-space-control); translate: -50% 0; padding: var(--cw-space-tight) var(--cw-space-control); background: var(--cw-paper); border: var(--cw-border) solid var(--cw-float-edge); border-radius: var(--cw-radius-control); box-shadow: var(--cw-shadow-float); font-size: var(--cw-fs-caption); white-space: nowrap; pointer-events: none; }
/* 묶음: 얇은 머리 + 안의 창이 나란히(또는 위아래) */
.fw-group-head { display: flex; align-items: center; gap: var(--cw-space-tight); flex: none; height: var(--cw-h-compact); padding: 0 var(--cw-space-tight) 0 var(--cw-space-control); border-bottom: var(--cw-hairline) solid var(--cw-line-strong); font-size: var(--cw-fs-caption); cursor: default; user-select: none; touch-action: none; outline: none; }
.fw-group-head:focus-visible { box-shadow: inset 0 0 0 var(--cw-focus-width) var(--cw-focus); }
.fw-group-head .names { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--cw-text-muted); }
.fw-group-head .btn.compact { height: var(--cw-icon-md); padding: 0 var(--cw-space-item); font-size: var(--cw-fs-caption); }
.fw-group-body { flex: 1; min-height: 0; display: flex; }
.fw-group.col > .fw-group-body { flex-direction: column; }
.fw-group-body > .fwin { position: static; z-index: auto !important; flex: var(--share, 1) 1 0; min-width: 0; min-height: 0; width: auto !important; height: auto !important; border: 0; border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; }
.fw-group-body > .fwin > .fwin-head { background: transparent; }
.fw-group-body > .fwin > .fwin-grip, .fw-group-body > .fwin [data-fw-act="fold"] { display: none; }
.fw-split { position: relative; flex: none; width: var(--cw-w-handle); margin: 0 calc(-1 * var(--cw-space-tight)); z-index: 1; cursor: col-resize; touch-action: none; }
.fw-split::after { content: ""; position: absolute; inset: 0 auto 0 50%; width: var(--cw-hairline); background: var(--cw-line-strong); }
.fw-group.col .fw-split { width: auto; height: var(--cw-w-handle); margin: calc(-1 * var(--cw-space-tight)) 0; cursor: row-resize; }
.fw-group.col .fw-split::after { inset: 50% 0 auto 0; width: auto; height: var(--cw-hairline); }
.fw-split:hover::after { background: var(--cw-focus); }
.fw-keys { margin-top: var(--cw-space-item); }
.fwin-edge { position: absolute; z-index: 2; touch-action: none; }
.fwin-edge[data-edge="n"], .fwin-edge[data-edge="s"] { left: var(--cw-space-group); right: var(--cw-space-group); height: var(--cw-space-tight); cursor: ns-resize; }
.fwin-edge[data-edge="e"], .fwin-edge[data-edge="w"] { top: var(--cw-space-group); bottom: var(--cw-space-group); width: var(--cw-space-tight); cursor: ew-resize; }
.fwin-edge[data-edge="n"] { top: 0; }
.fwin-edge[data-edge="s"] { bottom: 0; }
.fwin-edge[data-edge="e"] { right: 0; }
.fwin-edge[data-edge="w"] { left: 0; }
.fwin.is-folded > .fwin-edge, .fw-group-body > .fwin > .fwin-edge { display: none; }

/* ─── components/blue.css ─── */
/* Blue (3층, 2026-11-17 확정): 하나의 몸(접힌 아이콘 · 떠 있는 판 · 오른쪽 끝에 붙인 판), 앱 위의 메모, 문서 위의 렌즈와 주석.
   입체로 신뢰감을 낸다: 위에서 비추는 빛의 면, 파인 화면과 입력 칸, 볼록한 단추. 유리 흐림과 회전하는 빛은 쓰지 않는다.
   Blue색은 진행, 음파, 메모 번호와 선에만, 주목색은 허락 대기와 어긋남 표시에만 쓴다. 숫자는 화면 글꼴의 고정폭 숫자로 쓴다. */
.blue-host {
  --blue-c: var(--cw-engineer); /* 주의: Blue 강조색을 따로 정할 때까지 Engineer 제품의 대표색을 빌림 */
  --blue-glow: color-mix(in srgb, var(--blue-c) 22%, transparent);
  --blue-morph: 320ms; /* cw-allow 몸이 모양을 바꾸는 시간 */
  --blue-hi: rgba(255, 255, 255, .085); /* cw-allow 위쪽 모서리 빛 */
  --blue-lo: rgba(0, 0, 0, .42); /* cw-allow 아래쪽 그늘 */
  --blue-edge: rgba(0, 0, 0, .6); /* cw-allow 바깥 윤곽 */
  --blue-face-top: color-mix(in srgb, var(--cw-surface), #fff 5%); /* cw-allow 면의 밝은 위쪽 */
  --blue-face-bot: color-mix(in srgb, var(--cw-surface), #000 12%); /* cw-allow 면의 어두운 아래쪽 */
  --blue-well: color-mix(in srgb, var(--cw-surface) 70%, var(--cw-bg));
  --blue-drop: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 22px -6px rgba(0, 0, 0, .5), 0 34px 70px -18px rgba(0, 0, 0, .6); /* cw-allow 떠 있는 판의 그림자 */
}
:root[data-theme="light"] .blue-host, [data-theme="light"] .blue-host {
  --blue-hi: rgba(255, 255, 255, .95); /* cw-allow 밝은 테마의 빛 */
  --blue-lo: rgba(15, 23, 42, .12); /* cw-allow 밝은 테마의 그늘 */
  --blue-edge: rgba(15, 23, 42, .16); /* cw-allow 밝은 테마의 윤곽 */
  --blue-face-top: color-mix(in srgb, var(--cw-surface), #fff 60%); /* cw-allow 밝은 테마의 면 */
  --blue-face-bot: color-mix(in srgb, var(--cw-surface), #0f172a 5%); /* cw-allow 밝은 테마의 면 */
  --blue-well: color-mix(in srgb, var(--cw-bg) 70%, var(--cw-surface));
  --blue-drop: 0 1px 2px rgba(15, 23, 42, .08), 0 10px 22px -8px rgba(15, 23, 42, .2), 0 34px 70px -22px rgba(15, 23, 42, .28); /* cw-allow 밝은 테마의 그림자 */
}
@media (prefers-color-scheme: light) { :root[data-theme="system"] .blue-host {
  --blue-hi: rgba(255, 255, 255, .95); /* cw-allow 밝은 테마의 빛 */
  --blue-lo: rgba(15, 23, 42, .12); /* cw-allow 밝은 테마의 그늘 */
  --blue-edge: rgba(15, 23, 42, .16); /* cw-allow 밝은 테마의 윤곽 */
  --blue-face-top: color-mix(in srgb, var(--cw-surface), #fff 60%); /* cw-allow 밝은 테마의 면 */
  --blue-face-bot: color-mix(in srgb, var(--cw-surface), #0f172a 5%); /* cw-allow 밝은 테마의 면 */
  --blue-well: color-mix(in srgb, var(--cw-bg) 70%, var(--cw-surface));
  --blue-drop: 0 1px 2px rgba(15, 23, 42, .08), 0 10px 22px -8px rgba(15, 23, 42, .2), 0 34px 70px -22px rgba(15, 23, 42, .28); /* cw-allow 밝은 테마의 그림자 */
} }
@media (prefers-reduced-motion: reduce) { .blue-host { --blue-morph: 1ms; } }
.blue-host .blue-work { position: relative; overflow: hidden; transition: padding-right var(--blue-morph) var(--cw-ease); }
.blue-host .blue-work.is-blue-resize { transition: none; }
.blue, .blue-memos, .blue-lens, .blue-note, .blue-tag { font-variant-numeric: tabular-nums; }
.blue :is(.src-ref, kbd), .blue-note .src-ref, .blue-lens kbd { font-family: var(--cw-font-ui); } /* 판 안의 칸 주소와 키도 화면 글꼴로. 코드용 글꼴은 설치에 따라 모양이 달라진다 */
.blue-mark { display: block; flex: none; width: var(--cw-space-control); height: var(--cw-space-control); color: var(--cw-brand); }
.popmenu-mark .blue-mark { width: var(--cw-icon-sm); height: var(--cw-icon-sm); }
/* 가로로 넓은 심벌(KDH 고양이)은 칸을 채우도록 크게 그린다 */
.blue-brand-kdh .blue-tile .blue-mark { width: 32px; height: 32px; } /* cw-allow 넓은 심벌 */
.blue-brand-kdh .blue-head .blue-mark { width: 22px; height: 22px; } /* cw-allow 넓은 심벌 */
.blue-brand-kdh .blue-voice .core .blue-mark, .blue-brand-kdh .blue-fly .blue-mark { width: calc(var(--s, 28px) * .74); height: calc(var(--s, 28px) * .74); }

/* 몸: 위에서 빛을 받는 면. 자리와 크기는 스크립트가 px로 준다 */
.blue { position: absolute; z-index: 20; display: flex; flex-direction: column; border-radius: var(--cw-radius-container); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px var(--blue-edge), var(--blue-drop); color: var(--cw-text); font-family: var(--cw-font-ui); }
.blue.is-morph { transition: left var(--blue-morph) var(--cw-ease), top var(--blue-morph) var(--cw-ease), width var(--blue-morph) var(--cw-ease), height var(--blue-morph) var(--cw-ease), border-radius var(--blue-morph) var(--cw-ease); }
.blue.is-settle { transition: left var(--cw-dur-slow) var(--cw-ease); }
.blue.is-pin { border-radius: 0; box-shadow: inset 1px 0 0 var(--blue-hi), -1px 0 0 var(--blue-edge), -18px 0 36px -22px var(--blue-lo); } /* cw-allow 붙인 판이 앱 위에 드리우는 그늘 */
/* 카드형 틀: 붙인 판도 패널과 같은 둥근 카드. 빛 받는 면은 그대로 두고 떠 있는 그림자 대신 얕은 그늘 */
.blue.is-pin.is-card { border-radius: var(--cw-radius-container); box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px var(--blue-edge), 0 1px 2px var(--blue-lo); }
.blue-zone.is-card { border-radius: var(--cw-radius-container); box-shadow: inset 0 0 0 1px var(--blue-c); }
.blue-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: inherit; }
.blue.is-fold .blue-inner, .blue.is-fold .blue-grip, .blue.is-fold .blue-edge { visibility: hidden; pointer-events: none; }
.blue-grip { z-index: 5; }
.blue:not(.is-float) .blue-grip { display: none; }
.blue-edge { position: absolute; z-index: 5; left: -3px; top: 0; bottom: 0; width: 6px; cursor: ew-resize; touch-action: none; } /* cw-allow 가장자리 잡는 폭 */
.blue:not(.is-pin) .blue-edge { display: none; }
.blue-zone { position: absolute; z-index: 19; top: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--blue-c) 8%, transparent); box-shadow: inset 1px 0 0 var(--blue-c); pointer-events: none; }

/* 접힌 아이콘: 눌리는 단추처럼 볼록하다. 일하는 동안 테두리에서 음파가 퍼진다 */
.blue-tile { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 0; border: 0; border-radius: inherit; background: none; cursor: default; visibility: hidden; }
.blue.is-fold .blue-tile { visibility: visible; }
.blue.is-fold { box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -2px 0 var(--blue-lo), 0 0 0 1px var(--blue-edge), 0 2px 4px var(--blue-lo), 0 10px 20px -8px var(--blue-lo); transition: translate var(--cw-dur-fast) var(--cw-ease), box-shadow var(--cw-dur-fast) var(--cw-ease); }
.blue.is-fold:hover { translate: 0 -1px; }
.blue.is-fold:active { translate: 0 1px; box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px var(--blue-edge), 0 1px 2px var(--blue-lo); }
.blue-tile .blue-mark { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 var(--blue-lo)); } /* cw-allow 접힌 아이콘의 고양이 크기 */
.blue-dot { position: absolute; top: -3px; right: -3px; display: none; width: 9px; height: 9px; border-radius: 50%; background: var(--blue-c); box-shadow: 0 0 0 2px var(--cw-bg); } /* cw-allow 알림 점 */
.blue.is-fold.is-done .blue-dot { display: block; }
.blue.is-fold.is-gate .blue-dot { display: block; background: var(--cw-emphasis); }
.blue.is-fold.is-gate { box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -2px 0 var(--blue-lo), 0 0 0 1px var(--cw-emphasis), 0 2px 4px var(--blue-lo), 0 10px 20px -8px var(--blue-lo); }
.blue-rings { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; }
.blue:not(.is-fold) .blue-rings { display: none; }
.blue-rings i, .blue-voice > i { position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 1px var(--blue-c); opacity: 0; }
.blue.is-fold.is-working .blue-rings i { animation: blue-wave 1.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.blue.is-fold.is-burst .blue-rings i { animation: blue-wave 1.2s cubic-bezier(.2, .6, .3, 1) 1 both; }
.blue-rings i:nth-child(2), .blue-voice > i:nth-child(2) { animation-delay: .4s !important; }
.blue-rings i:nth-child(3), .blue-voice > i:nth-child(3) { animation-delay: .8s !important; }
@keyframes blue-wave { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(1.9); opacity: 0; border-radius: 50%; } }
@keyframes blue-wave-soft { 0% { transform: scale(1); opacity: .4; } 70%, 100% { transform: scale(1.7); opacity: 0; border-radius: 50%; } }

/* 말하는 아이콘: 볼록한 판과 음파 세 겹 */
.blue-voice { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--s, 28px); height: var(--s, 28px); border-radius: calc(var(--s, 28px) * .28); }
.blue-voice .core, .blue-fly { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; border-radius: calc(var(--s, 28px) * .28); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px var(--blue-edge), 0 2px 6px -1px var(--blue-lo); }
.blue-fly { position: fixed; inset: auto; z-index: 40; pointer-events: none; transform-origin: center; }
.blue-voice .core .blue-mark, .blue-fly .blue-mark { width: calc(var(--s, 28px) * .56); height: calc(var(--s, 28px) * .56); filter: drop-shadow(0 1px 0 var(--blue-lo)); }
.blue-voice.is-idle > i:first-child { animation: blue-wave-soft 3.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.blue-voice.is-idle .core { box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px var(--blue-edge), 0 6px 18px -4px var(--blue-lo), 0 0 0 6px color-mix(in srgb, var(--blue-c) 6%, transparent); }
.blue-voice.is-talk > i { animation: blue-wave 1.5s cubic-bezier(.2, .6, .3, 1) infinite; }
.blue-voice.is-talk .core { animation: blue-thump .38s ease-in-out infinite alternate; box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px color-mix(in srgb, var(--blue-c) 70%, var(--blue-edge)), 0 2px 10px -1px var(--blue-glow); }
.blue-voice.is-burst > i, .blue-voice.is-idle.is-burst > i:first-child { animation: blue-wave 1.2s cubic-bezier(.2, .6, .3, 1) 1 both; }
@keyframes blue-thump { from { transform: scale(1); } to { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .blue-rings i, .blue-voice > i, .blue-voice .core { animation: none !important; } }

/* 머리: 판의 윗면. 아래에 진행 선이 지나가는 홈이 있다 */
.blue-head { display: flex; align-items: center; gap: var(--cw-space-item); flex: none; height: var(--cw-h-panel-head); padding: 0 var(--cw-space-tight) 0 var(--cw-space-control); user-select: none; touch-action: none; }
.blue-head .btn.icon { flex: none; }
.blue-head .blue-mark { width: 18px; height: 18px; } /* cw-allow 머리의 고양이 */
.blue-name { flex: none; font-size: var(--cw-fs-body); line-height: var(--cw-lh-small); font-weight: var(--cw-fw-strong); letter-spacing: -.01em; }
.blue-status { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue.is-working .blue-status { color: var(--cw-text); }
.blue.is-gate .blue-status { color: var(--cw-emphasis); }
.blue-prog { position: relative; flex: none; height: 2px; margin: 0 var(--cw-space-item); border-radius: 1px; overflow: hidden; background: var(--blue-lo); box-shadow: 0 1px 0 var(--blue-hi); } /* cw-allow 진행 홈 */
.blue-prog i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); background: var(--blue-c); box-shadow: 0 0 6px var(--blue-glow); opacity: 0; transition: width 420ms var(--cw-ease), opacity var(--cw-dur-slow) var(--cw-ease); } /* cw-allow 진행 선이 차는 시간 */
.blue.is-working .blue-prog i, .blue.is-gate .blue-prog i { opacity: 1; }
.blue.is-gate .blue-prog i { background: var(--cw-emphasis); }
.blue-prog::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 64px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--blue-c) 70%, #fff), transparent); opacity: 0; } /* cw-allow 지나가는 표시 */
.blue.is-working .blue-prog::after { opacity: .8; animation: blue-scan 1.8s var(--cw-ease) infinite; }
@keyframes blue-scan { from { left: -64px; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .blue-prog::after { animation: none; display: none; } }

/* 화면: 판에 파묻힌 표시창 */
.blue-log { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; margin: var(--cw-space-item) var(--cw-space-item) 0; padding: var(--cw-space-tight) 0 var(--cw-space-control); border-radius: var(--cw-radius-control); background: var(--blue-well); box-shadow: inset 0 1px 3px var(--blue-lo), inset 0 0 0 1px color-mix(in srgb, var(--blue-edge) 60%, transparent), 0 1px 0 var(--blue-hi); scrollbar-width: thin; }
.blue-job { flex: none; }
.blue-job + .blue-job { border-top: var(--cw-hairline) solid var(--cw-line); }
.blue-job-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: var(--cw-space-item); width: 100%; padding: var(--cw-space-item) var(--cw-space-control); border: 0; background: none; color: var(--cw-text-muted); font: inherit; font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); text-align: left; cursor: default; }
.blue-job-head:hover { color: var(--cw-text); }
.blue-job-head .q { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.blue-when { font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue-job.is-open > .blue-job-head { color: var(--cw-text); }
.blue-job.is-open > .blue-job-head .q { white-space: normal; font-weight: var(--cw-fw-medium); }
.blue-job.is-open > .blue-job-head .v { display: none; }
.blue-job-body { display: none; flex-direction: column; gap: var(--cw-space-control); padding: 0 var(--cw-space-control) var(--cw-space-group); }
.blue-job.is-open > .blue-job-body { display: flex; }

/* 말하는 줄: 일하는 동안은 지금 하는 일, 끝나면 결론 */
.blue-say { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--cw-space-control); min-height: 36px; } /* cw-allow 말하는 줄 높이 */
.blue-say-t { display: flex; align-items: flex-start; gap: var(--cw-space-item); min-width: 0; font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); color: var(--cw-text-muted); }
.blue-say-t .vb:empty { display: none; }
.blue-say-t .vb .badge { margin-top: 2px; } /* cw-allow 첫 줄 맞춤 */
.blue-say .c { font-size: var(--cw-fs-caption); color: var(--blue-c); }
.blue-say.is-said .blue-say-t { font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); letter-spacing: -.01em; color: var(--cw-text); }
.blue-say.is-gate .blue-say-t { color: var(--cw-emphasis); font-weight: var(--cw-fw-medium); }
.blue-say.is-gate .core { box-shadow: inset 0 1px 0 var(--blue-hi), inset 0 -1px 0 var(--blue-lo), 0 0 0 1px var(--cw-emphasis), 0 2px 6px -1px var(--blue-lo); }
.blue-res { margin-top: -6px; margin-left: calc(28px + var(--cw-space-control)); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); color: var(--cw-text-muted); } /* cw-allow 결론 아래에 붙임 */
.blue-res[hidden] { display: none; }

/* 단계: 표시 하나, 프로그램, 하는 일, 결과 */
.blue-steps { position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0 0 0 12px; padding: 0; list-style: none; } /* cw-allow 말하는 아이콘 가운데에 맞춤 */
.blue-steps::before { content: ""; position: absolute; left: 2px; top: 10px; bottom: 10px; width: 1px; background: var(--cw-line); } /* cw-allow 단계 잇는 선 */
.blue-job.is-done:not(.is-steps) .blue-steps, .blue-job.is-done:not(.is-steps) .blue-detail { display: none; }
.blue-step { position: relative; display: grid; grid-template-columns: 5px 14px minmax(0, 1fr) auto; align-items: center; column-gap: var(--cw-space-item); min-height: 22px; border-radius: var(--cw-radius-badge); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); color: var(--cw-text-muted); } /* cw-allow 단계 칸 */
.blue-step .mk { width: 5px; height: 5px; border-radius: 1px; box-shadow: inset 0 0 0 1px var(--cw-line-strong); background: var(--blue-well); } /* cw-allow 단계 표시 */
.blue-step .product-tile { width: 14px; height: 14px; border-radius: var(--cw-radius-badge); } /* cw-allow 아주 작은 타일 */
.blue-step .product-tile svg { width: 9px; height: 9px; } /* cw-allow 아주 작은 타일 */
.blue-step .blue-mark { width: 14px; height: 14px; padding: 1px; color: var(--cw-text-muted); } /* cw-allow Blue가 하는 단계 */
.blue-step .t { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.blue-step .res { font-size: var(--cw-fs-caption); color: var(--cw-text-muted); white-space: nowrap; }
.blue-step .kind { padding: 0 var(--cw-space-tight); border-radius: var(--cw-radius-badge); box-shadow: inset 0 0 0 1px var(--cw-line-strong); }
.blue-step.is-copy .kind { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue-c) 60%, transparent); color: var(--cw-text); }
.blue-step.is-write .kind { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cw-emphasis) 70%, transparent); color: var(--cw-emphasis); }
.blue-step.is-run, .blue-step.is-done, .blue-step.is-gate { color: var(--cw-text); }
.blue-step.is-done .mk { background: var(--cw-text-muted); box-shadow: none; }
.blue-step.is-run .mk { background: var(--blue-c); box-shadow: 0 0 6px var(--blue-glow); animation: blue-blink 1s steps(2, jump-none) infinite; }
.blue-step.is-gate .mk { background: var(--cw-emphasis); box-shadow: none; }
.blue-step.is-run .res::after { content: "…"; color: var(--blue-c); }
.blue-step[tabindex="0"]:hover, .blue-step.is-picked { background: var(--cw-item-hover); }
@keyframes blue-blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .blue-step.is-run .mk { animation: none; } }
.blue-detail { margin-left: 12px; padding: var(--cw-space-tight) var(--cw-space-item); border-radius: var(--cw-radius-control); background: color-mix(in srgb, var(--cw-text) 5%, transparent); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); } /* cw-allow 단계 줄과 맞춤 */
.blue-detail[hidden] { display: none; }
.blue-trail { display: inline-flex; align-items: center; gap: var(--cw-space-tight); align-self: flex-start; margin-left: calc(28px + var(--cw-space-control)); padding: 0; border: 0; background: none; color: var(--cw-text-muted); font: inherit; font-size: var(--cw-fs-caption); cursor: default; } /* cw-allow 결론 글과 맞춤 */
.blue-trail[hidden] { display: none; }
.blue-trail .i { width: var(--cw-icon-sm); height: var(--cw-icon-sm); }
.blue-trail:hover { color: var(--cw-text); }

/* 결과: 절, 근거 번호, 바닥 단추. 떠 있으면 핵심 절만, 붙이거나 '자세히'를 누르면 모두 */
.blue-out { display: flex; flex-direction: column; gap: var(--cw-space-control); }
.blue-out[hidden] { display: none; }
.blue:not(.is-pin) .blue-job:not(.is-full) :is(.blue-sec.is-more, .blue-insert) { display: none; }
.blue.is-pin [data-more] { display: none; }
.blue-sec { display: flex; flex-direction: column; gap: var(--cw-space-item); }
.blue-sec h4 { font-size: var(--cw-fs-caption); line-height: var(--cw-lh-caption); font-weight: var(--cw-fw-medium); color: var(--cw-text-muted); }
.blue-lead { display: flex; align-items: flex-start; gap: var(--cw-space-item); font-size: var(--cw-fs-body); line-height: var(--cw-lh-body); font-weight: var(--cw-fw-medium); }
.blue-lead .badge { flex: none; margin-top: 2px; } /* cw-allow 첫 줄 맞춤 */
.blue-text { font-size: var(--cw-fs-body); line-height: var(--cw-lh-read); color: var(--cw-text); }
.blue-sec.is-key + .blue-sec.is-key .blue-text { font-size: var(--cw-fs-small); }
.blue-metrics { display: flex; flex-direction: column; border-radius: var(--cw-radius-control); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px color-mix(in srgb, var(--blue-edge) 70%, transparent), 0 1px 2px var(--blue-lo); }
.blue-metrics > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--cw-space-control); align-items: center; padding: var(--cw-space-item) var(--cw-space-control); }
.blue-metrics > div + div { border-top: var(--cw-hairline) solid var(--cw-line); }
.blue-metrics .k { grid-column: 1; grid-row: 1; font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue-metrics .from { grid-column: 1; grid-row: 2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue-metrics b { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: var(--cw-fs-title); line-height: var(--cw-lh-title); font-weight: var(--cw-fw-strong); letter-spacing: -.01em; }
.blue-metrics b small { margin-left: var(--cw-space-tight); font-size: var(--cw-fs-caption); font-weight: var(--cw-fw-regular); color: var(--cw-text-muted); }
.blue-calc { padding: var(--cw-space-item) var(--cw-space-control); border-radius: var(--cw-radius-control); background: var(--blue-well); box-shadow: inset 0 1px 2px var(--blue-lo); font-size: var(--cw-fs-small); line-height: var(--cw-lh-read); white-space: pre-wrap; overflow-wrap: anywhere; }
.blue-sec .choices { gap: var(--cw-space-tight); }
.blue-insert { display: flex; align-items: center; gap: var(--cw-space-item); width: 100%; height: var(--cw-space-group); padding: 0; border: 0; background: none; color: var(--cw-text-muted); font: inherit; font-size: var(--cw-fs-caption); opacity: .35; cursor: default; transition: opacity var(--cw-dur-fast) var(--cw-ease); }
.blue-insert::before, .blue-insert::after { content: ""; flex: 1; height: var(--cw-hairline); background: var(--cw-line); }
.blue-insert:hover, .blue-insert:focus-visible { opacity: 1; color: var(--cw-text); }
.blue-insert-field { display: block; width: 100%; height: var(--cw-h-tool); padding: 0 var(--cw-space-item); border: 0; border-radius: var(--cw-radius-control); background: var(--blue-well); box-shadow: inset 0 1px 2px var(--blue-lo), inset 0 0 0 1px color-mix(in srgb, var(--blue-c) 60%, transparent); color: var(--cw-text); font: inherit; font-size: var(--cw-fs-small); outline: none; }
.blue-insert-field::placeholder { color: var(--cw-steel); }
.blue-refs { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; } /* cw-allow 근거 줄 사이 */
.blue-refs button { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--cw-space-item); width: 100%; min-height: var(--cw-h-tool); padding: 0 var(--cw-space-tight) 0 var(--cw-space-item); border: 0; border-radius: var(--cw-radius-control); background: linear-gradient(180deg, color-mix(in srgb, var(--blue-face-top) 70%, transparent), color-mix(in srgb, var(--blue-face-bot) 70%, transparent)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px color-mix(in srgb, var(--blue-edge) 70%, transparent), 0 1px 2px var(--blue-lo); color: var(--cw-text); font: inherit; font-size: var(--cw-fs-small); text-align: left; cursor: default; transition: translate var(--cw-dur-fast) var(--cw-ease); }
.blue-refs button:hover { translate: 0 -1px; }
.blue-refs .n { font-size: var(--cw-fs-caption); color: var(--blue-c); }
.blue-refs .m { font-size: var(--cw-fs-caption); color: var(--cw-text-muted); white-space: nowrap; }
.blue-refs .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.blue-refs .i { width: var(--cw-icon-sm); height: var(--cw-icon-sm); color: var(--cw-text-muted); opacity: 0; }
.blue-refs button:hover .i, .blue-refs button.is-on .i { opacity: 1; }
.blue-refs button.is-on { box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px var(--blue-c), 0 0 10px -2px var(--blue-glow); }
.blue-record { font-size: var(--cw-fs-small); color: var(--cw-text-muted); }
.blue-foot { display: flex; flex-direction: column; gap: var(--cw-space-control); }
.blue-foot .blue-acts:empty { display: none; }
.blue-foot .btn-row { padding-top: var(--cw-space-control); border-top: var(--cw-hairline) solid var(--cw-line); }
.blue-acts { display: flex; flex-wrap: wrap; gap: var(--cw-space-tight); }
.blue-act { display: inline-flex; align-items: center; gap: var(--cw-space-item); min-height: var(--cw-h-tool); padding: 0 var(--cw-space-control) 0 var(--cw-space-item); border: 0; border-radius: var(--cw-radius-control); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px color-mix(in srgb, var(--blue-edge) 70%, transparent), 0 1px 2px var(--blue-lo); color: var(--cw-text); font: inherit; font-size: var(--cw-fs-small); text-align: left; cursor: default; }
.blue-act:hover { translate: 0 -1px; }

/* 허락: 바뀌는 것만 보이고 결정 단추는 바로 아래 */
.blue-gate { display: flex; flex-direction: column; gap: var(--cw-space-item); padding: var(--cw-space-control); border-radius: var(--cw-radius-control); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px color-mix(in srgb, var(--cw-emphasis) 55%, var(--blue-edge)), 0 4px 12px -4px var(--blue-lo); }
.blue-gate .ask { font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); font-weight: var(--cw-fw-medium); }
.blue-gate .btn-row { padding-top: var(--cw-space-tight); flex-wrap: wrap; }
.blue-cmp { display: flex; flex-direction: column; margin: 0; }
.blue-cmp > div { display: grid; grid-template-columns: minmax(56px, 34%) minmax(0, 1fr); align-items: baseline; column-gap: var(--cw-space-item); padding: var(--cw-space-tight) 0; border-top: var(--cw-hairline) solid var(--cw-line); } /* cw-allow 항목 이름 폭 */
.blue-cmp dt { font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue-cmp dd { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--cw-space-tight); margin: 0; font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); } /* cw-allow 줄 사이 */
.blue-cmp dd .from { color: var(--cw-text-muted); text-decoration: line-through; text-decoration-color: var(--cw-line-strong); }
.blue-cmp dd .i { width: var(--cw-icon-sm); height: var(--cw-icon-sm); color: var(--cw-text-muted); }
.blue-cmp dd b { font-weight: var(--cw-fw-medium); }
.blue-cmp dd small { flex-basis: 100%; font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }

/* 첫 화면: 가운데 아이콘 하나 */
.blue-empty { flex: 1 0 200px; display: grid; place-items: center; cursor: text; } /* cw-allow 첫 화면 최소 높이 */

/* 입력: 판에 파인 칸 */
.blue-compose { flex: none; padding: var(--cw-space-item); }
.blue-ctx { display: flex; flex-wrap: wrap; gap: var(--cw-space-tight); padding: 0 var(--cw-space-tight) var(--cw-space-tight); }
.blue-ctx:empty { display: none; }
.blue-chip { display: inline-flex; gap: var(--cw-space-tight); font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue-chip b { font-weight: var(--cw-fw-medium); }
.blue-field { display: flex; align-items: flex-end; gap: var(--cw-space-tight); padding: 0 var(--cw-space-tight) 0 var(--cw-space-control); border-radius: var(--cw-radius-control); background: var(--blue-well); box-shadow: inset 0 1px 3px var(--blue-lo), inset 0 0 0 1px color-mix(in srgb, var(--blue-edge) 60%, transparent), 0 1px 0 var(--blue-hi); transition: box-shadow var(--cw-dur-base) var(--cw-ease); }
.blue-field:focus-within { box-shadow: inset 0 1px 3px var(--blue-lo), inset 0 0 0 1px color-mix(in srgb, var(--blue-c) 75%, transparent), 0 1px 0 var(--blue-hi), 0 0 0 3px color-mix(in srgb, var(--blue-c) 16%, transparent); }
.blue-input { flex: 1; min-width: 0; max-height: calc(var(--cw-lh-body) * 6); padding: var(--cw-space-item) 0; border: 0; background: transparent; color: var(--cw-text); font: inherit; font-size: var(--cw-fs-body); line-height: var(--cw-lh-body); resize: none; outline: none; field-sizing: content; }
.blue-input::placeholder { color: var(--cw-steel); }
.blue-field .blue-send { margin-bottom: 3px; } /* cw-allow 입력 줄 맞춤 */
.blue-field .blue-send:not(:disabled) { background: linear-gradient(180deg, color-mix(in srgb, var(--blue-c), #fff 12%), color-mix(in srgb, var(--blue-c), #000 18%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px color-mix(in srgb, var(--blue-c), #000 40%), 0 2px 4px var(--blue-lo); color: var(--cw-on-solid); } /* cw-allow 볼록한 보내기 단추 */
.blue-field .blue-send:not(:disabled):active { translate: 0 1px; }

/* 앱 위의 검토 메모: 줄 끝의 번호, 지금 메모의 테두리와 지시선, 메모 카드 */
.blue-memos { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
.blue-memos[hidden] { display: none; }
.blue-leads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.blue-leads path { fill: none; stroke: var(--blue-c); stroke-width: 1; filter: drop-shadow(0 0 3px var(--blue-glow)); }
.blue-frame { position: absolute; border-radius: var(--cw-radius-control); box-shadow: inset 0 0 0 1px var(--blue-c), 0 0 0 3px color-mix(in srgb, var(--blue-c) 12%, transparent); background: color-mix(in srgb, var(--blue-c) 5%, transparent); }
.blue-frame[hidden], .blue-card[hidden], .blue-pin[hidden] { display: none; }
.blue-pin { position: absolute; z-index: 1; min-width: 26px; height: 18px; padding: 0 var(--cw-space-tight); border: 0; border-radius: var(--cw-radius-badge); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px var(--blue-c), 0 2px 4px var(--blue-lo); color: var(--blue-c); font: inherit; font-size: var(--cw-fs-caption); line-height: 18px; pointer-events: auto; cursor: default; } /* cw-allow 메모 번호 크기 */
.blue-pin:hover { translate: 0 -1px; }
.blue-pin.is-on { background: linear-gradient(180deg, color-mix(in srgb, var(--blue-c), #fff 12%), color-mix(in srgb, var(--blue-c), #000 15%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px color-mix(in srgb, var(--blue-c), #000 35%), 0 2px 8px var(--blue-glow); color: var(--cw-on-solid); } /* cw-allow 지금 메모 번호 */
.blue-card { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: var(--cw-space-tight); width: 280px; padding: var(--cw-space-tight) var(--cw-space-tight) var(--cw-space-control) var(--cw-space-control); border-radius: var(--cw-radius-container); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), inset 2px 0 0 var(--blue-c), 0 0 0 1px var(--blue-edge), var(--blue-drop); font-family: var(--cw-font-ui); pointer-events: auto; } /* cw-allow 메모 카드 폭 */
.blue-card-head { display: flex; align-items: center; gap: var(--cw-space-item); font-size: var(--cw-fs-caption); }
.blue-card-head .n { color: var(--blue-c); }
.blue-card-head .n span, .blue-card-head .m { color: var(--cw-text-muted); }
.blue-card-head .sp { flex: 1; }
.blue-card-head .btn.icon { flex: none; }
.blue-card-t { margin-right: var(--cw-space-item); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); font-weight: var(--cw-fw-medium); }
.blue-card p { margin-right: var(--cw-space-item); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); color: var(--cw-text-muted); }
.i.flip { transform: scaleX(-1); }

/* 문서 위: 렌즈, 주석, 근거 칸, 칸 모서리 표시, 어긋남 표시, 선 */
.blue-doc { position: relative; overflow: hidden; background: var(--cw-paper); }
.blue-canvas { position: relative; padding: 0 0 var(--blue-keep-b, 0) 0; }
.blue-canvas .grid td.is-changed { animation: blue-flash 1400ms var(--cw-ease); } /* cw-allow 바뀐 칸을 한 번 비춘다 */
@keyframes blue-flash { 20% { background-color: color-mix(in srgb, var(--cw-emphasis) 30%, transparent); } }
.blue-g { position: absolute; border-radius: var(--cw-radius-container); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px var(--blue-edge), var(--blue-drop); color: var(--cw-text); font-family: var(--cw-font-ui); }
.blue-hit { position: absolute; z-index: 2; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--blue-c); background: color-mix(in srgb, var(--blue-c) 8%, transparent); pointer-events: none; animation: cw-fade-in var(--cw-dur-slow) var(--cw-ease); } /* cw-allow 근거 칸 */
.blue-mark-cell { position: absolute; z-index: 3; width: 12px; height: 12px; padding: 0; border: 0; background: var(--blue-c); clip-path: polygon(100% 0, 0 0, 100% 100%); cursor: default; } /* cw-allow 칸 모서리의 주석 표시 */
.blue-tag { position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: var(--cw-space-tight); height: var(--cw-lh-small); padding: 0 var(--cw-space-item); border-radius: var(--cw-radius-control); background: linear-gradient(180deg, var(--blue-face-top), var(--blue-face-bot)); box-shadow: inset 0 1px 0 var(--blue-hi), 0 0 0 1px color-mix(in srgb, var(--cw-emphasis) 60%, transparent), 0 2px 6px var(--blue-lo); font-size: var(--cw-fs-caption); white-space: nowrap; animation: cw-fade-in var(--cw-dur-slow) var(--cw-ease); }
.blue-notes-off .blue-notes, .blue-notes-off .blue-marks, .blue-notes-off ~ .blue-wires { display: none; }
.blue-wires { position: absolute; inset: 0; z-index: 7; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.blue-wires path { fill: none; stroke: var(--blue-c); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: blue-draw 520ms var(--cw-ease) forwards; transition: opacity var(--cw-dur-slow) var(--cw-ease); } /* cw-allow 선이 그어지는 시간 */
.blue-wires path.is-out { opacity: 0; }
@keyframes blue-draw { to { stroke-dashoffset: 0; } }
.blue-lens { z-index: 6; display: flex; flex-direction: column; width: 420px; padding: var(--cw-space-item) var(--cw-space-item) var(--cw-space-item) var(--cw-space-control); animation: cw-fade-in var(--cw-dur-base) var(--cw-ease); } /* cw-allow 렌즈 폭 */
.blue-lens[hidden] { display: none; }
.blue-lens-row { display: flex; align-items: center; gap: var(--cw-space-item); min-height: var(--cw-h-tool); }
.blue-lens-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cw-text); font: inherit; font-size: var(--cw-fs-body); outline: none; }
.blue-lens-input::placeholder { color: var(--cw-steel); }
.blue-lens kbd { flex: none; }
.blue-lens-sug { display: flex; flex-wrap: wrap; gap: var(--cw-space-tight); margin-top: var(--cw-space-tight); }
.blue-lens-sug:empty { display: none; }
.blue-lens-sug .blue-act { min-height: var(--cw-icon-lg); padding: 0 var(--cw-space-item); font-size: var(--cw-fs-caption); }
.blue-lens.is-working .blue-lens-sug { display: none; }
.blue-note { z-index: 5; width: 320px; display: flex; flex-direction: column; gap: var(--cw-space-item); padding: var(--cw-space-item) var(--cw-space-tight) var(--cw-space-control) var(--cw-space-control); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); box-shadow: inset 0 1px 0 var(--blue-hi), inset 2px 0 0 var(--blue-c), 0 0 0 1px var(--blue-edge), var(--blue-drop); animation: cw-fade-in var(--cw-dur-slow) var(--cw-ease); } /* cw-allow 주석 폭 */
.blue-note > :not(.blue-note-head) { margin-right: var(--cw-space-item); }
.blue-note-head { display: flex; align-items: center; gap: var(--cw-space-item); }
.blue-note-head .caption { flex: 1; }
.blue-note-lead { display: flex; align-items: flex-start; gap: var(--cw-space-item); font-size: var(--cw-fs-subtitle); line-height: var(--cw-lh-subtitle); font-weight: var(--cw-fw-strong); }
.blue-note-lead .badge { flex: none; margin-top: 3px; } /* cw-allow 첫 줄 맞춤 */
.blue-note .blue-acts .blue-act { min-height: var(--cw-icon-lg); padding: 0 var(--cw-space-item); font-size: var(--cw-fs-caption); }
.blue-ghost { z-index: 30; pointer-events: none; }

/* ─── patterns/workspace.css ─── */
/* 3단 작업 화면 (5층): 툴바, 왼쪽 목록, 가운데 작업 영역, 오른쪽 패널, 상태 표시줄. 틀은 app.css와 sidebar.css가 맡고 여기는 가운데 면의 변형만 정한다. */
.center.paper { background: var(--cw-paper); }
.center.on-bg { background: var(--cw-bg); }

/* ─── patterns/workbench.css ─── */
/* 플로팅 작업대 (5층): 타이틀바 아래 전체를 작업 대상이 채우고 도구, 트리, 속성, 명령 검색을 떠 있는 카드로 둔다. 카드 모양은 float.css에 있다. */
.float.at-top { top: var(--cw-space-group); left: 50%; translate: -50% 0; }
.float.at-left { top: var(--cw-space-group); left: var(--cw-space-group); width: var(--cw-w-left-min); max-height: calc(100% - var(--cw-space-section)); overflow: auto; }
.float.at-right { top: var(--cw-space-group); right: var(--cw-space-group); width: var(--cw-w-right-min); max-height: calc(100% - var(--cw-space-section)); overflow: auto; }
.float.at-bottom { bottom: var(--cw-space-group); left: 50%; translate: -50% 0; width: var(--cw-w-dialog); max-width: calc(100% - var(--cw-space-section)); }
.float.at-corner { bottom: var(--cw-space-group); right: var(--cw-space-group); }
.float.at-status { bottom: var(--cw-space-group); left: var(--cw-space-group); padding: var(--cw-space-tight) var(--cw-space-item); font-size: var(--cw-fs-caption); color: var(--cw-text-muted); }
.blue-host .float.at-corner { right: calc(var(--cw-space-group) + 88px); } /* cw-allow Blue 구슬(56)과 그 여백을 비킨다 */

/* ─── patterns/reader.css ─── */
/* 문서 읽기 (5층): 왼쪽 목차 280, 가운데 본문 최대 720, 오른쪽 '이 페이지' 240. 폭이 모자라면 오른쪽부터 숨긴다. */
.reader { display: grid; grid-template-columns: var(--cw-w-left) minmax(0, 1fr) var(--cw-w-reader-toc); flex: 1; min-height: 0; background: var(--cw-paper); container-type: inline-size; }
.reader-nav { min-height: 0; overflow: auto; padding: var(--cw-space-group) 0; background: var(--cw-surface); border-right: var(--cw-hairline) solid var(--cw-line); }
.reader-main { min-width: 0; min-height: 0; overflow: auto; padding: var(--cw-space-section) var(--cw-space-gutter) var(--cw-space-region); }
.reader-body { max-width: var(--cw-w-read); margin: 0 auto; font-size: var(--cw-fs-body); line-height: var(--cw-lh-read); }
.reader-body > * + * { margin-top: var(--cw-space-group); }
.reader-body h2 { margin-top: var(--cw-space-section); font-size: var(--cw-fs-title); line-height: var(--cw-lh-title); font-weight: var(--cw-fw-strong); }
.reader-toc { min-height: 0; overflow: auto; padding: var(--cw-space-section) var(--cw-space-group); font-size: var(--cw-fs-small); line-height: var(--cw-lh-small); color: var(--cw-text-muted); }
.reader-toc a { display: block; padding: var(--cw-space-tight) 0; color: inherit; text-decoration: none; }
.reader-toc a:hover, .reader-toc a[aria-current="true"] { color: var(--cw-text); }
@container (max-width: 1100px) { .reader { grid-template-columns: var(--cw-w-left) minmax(0, 1fr); } .reader-toc { display: none; } } /* cw-allow 오른쪽 목차를 숨기는 폭 */
@container (max-width: 760px) { .reader { grid-template-columns: minmax(0, 1fr); } .reader-nav { display: none; } } /* cw-allow 왼쪽 목차를 숨기는 폭 */

/* ─── patterns/host-panel.css ─── */
/* 호스트 안 패널 (5층): 다른 CAD · BIM 프로그램 안의 패널. 바깥 틀은 호스트의 것이고 Catwin은 안쪽만 정한다. 머리는 타이틀바와 같은 대표색 칠이다. */
.plugin { --product: var(--cw-plugins); position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--cw-surface); color: var(--cw-text); border-left: var(--cw-border) solid var(--host-line, var(--cw-line)); font-family: var(--cw-font-ui); font-size: var(--cw-fs-body); }
.plugin-head { display: flex; align-items: center; gap: var(--cw-space-item); flex: none; height: var(--cw-h-panel-head); padding: 0 var(--cw-space-tight) 0 var(--cw-space-control); border-bottom: var(--cw-hairline) solid var(--cw-line); background: color-mix(in srgb, var(--product, var(--cw-plugins)) var(--cw-tint-product), var(--cw-bg)); }
.plugin.is-line .plugin-head { background: var(--cw-surface); box-shadow: inset 0 2px 0 var(--product, var(--cw-plugins)); }
.plugin-head .product-name { color: var(--cw-text); }
.plugin-head .spacer { flex: 1; }
.plugin .tabs { padding: 0 var(--cw-space-control); border-bottom: var(--cw-hairline) solid var(--cw-line); }
.plugin-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--cw-space-item); padding: var(--cw-space-control) var(--cw-space-control) var(--cw-space-tight); font-size: var(--cw-fs-small); color: var(--cw-text-muted); }
.plugin .list-group { padding-inline: var(--cw-space-control); }
.plugin .row { padding-inline: var(--cw-space-control); }
/* 카드형의 선택 테두리는 행 안쪽 8px에 그리는데, 조밀 모드의 패널 행은 글자 여백도 8px이라 테두리가 글자에 붙는다. 패널 행에서는 4px만 들인다. */
.plugin .row::before { inset: 2px var(--cw-space-tight); } /* cw-allow 행 사이 2px */
.plugin-detail { padding: var(--cw-space-control); border-top: var(--cw-hairline) solid var(--cw-line); }
.plugin .panel-foot { display: flex; gap: var(--cw-space-item); padding: var(--cw-space-control); }
.plugin .panel-foot .btn { flex: 1; }
