/*
 * 새 화면 공통 스타일 — 모바일 우선. 기본은 휴대폰 폭, 900px 이상에서 왼쪽 메뉴로 바뀜.
 *
 * 디자인 시안 3종을 같은 화면 구조 위에 '테마'로 얹는다 (<html data-theme="a|b|c">, 기본 a).
 *   A. 프로       — 밝은 무채색 + 케이지아이윈도우 남색 하나. 오래 써도 질리지 않는 기본형
 *   B. 인더스트리얼 — 도면(블루프린트) 격자·철강 블루·좁은 숫자 글꼴. 창호 제조사의 정체성
 *   C. 대화형     — AI코디가 화면 중심, 둥글고 큰 글자. 개발계획서 'AI코디 첫 화면'을 가장 강하게
 * 시안이 정해지면 고른 테마만 남기고 나머지 블록을 지운다(구조 CSS는 공통).
 *
 * 규칙: 색·글자·높이·간격·모서리는 아래 변수만 쓴다(DESIGN.md '크기 토큰'). 휴대폰 누르는 곳 최소 44px(--touch).
 * 글자 크기는 rem 토큰(--fs-*)으로 — 글자 크기 설정(보통·크게·아주 크게)을 따라 커짐. 휴대폰 입력칸 글자 16px 이상(아이폰 확대 방지).
 * CSP 때문에 HTML의 style="" 속성은 막혀 있다 — 모양은 전부 이 파일의 클래스로.
 */
@import url('../fonts/pretendard/pretendard.css');
@import url('../fonts/barlow-condensed/barlow-condensed.css');
@import url('schedule.css'); /* 일정·휴가 화면(큰 글자) — 따로 둔 파일 */
@import url('approvals.css'); /* 전자결재 화면(큰 글자·결재 문서 인쇄) — 따로 둔 파일 */
@import url('share.css'); /* 고객에게 견적 보내기·미수금 알림·보낸 문자 — 따로 둔 파일 */
@import url('dashboard.css'); /* 경영 대시보드(넓은 화면·그래프·인쇄) — 따로 둔 파일 */
@import url('briefing.css'); /* 홈 오늘의 브리핑(접힌 한 줄 → 펼치면 큰 글자) — 따로 둔 파일 */
@import url('a11y.css'); /* 보기 편하게 — 더보기 화면 설정(글꼴·글자 크기·다크 모드)·처음 쓰는 분 안내 카드 — 따로 둔 파일 */

/* ================= 디자인 토큰 ================= */
:root {
  --brand: #24307c;              /* 케이지아이윈도우 로고 남색 (원본 견적서 로고에서 추출) */
  --ci: #263280;                 /* 회사 CI 색(2026-10-31 CI 원본 claude/20261031/6.png에서 추출) — 위 막대·로그인 로고(fill=currentColor). 어두운 바탕은 흰색 */
  /* 글꼴 — 더보기 → 화면 설정 → 글꼴(core/a11y.js, <html data-typeface>). 기본 Pretendard, '기기 글꼴'은 휴대폰·컴퓨터에 원래 있는 한글 글꼴
     (윈도우 맑은 고딕, 아이폰·맥 애플 SD 고딕 네오, 안드로이드 기기 기본) — 받을 파일이 없음 */
  --font-pretendard: 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, 'Noto Sans KR', sans-serif;
  --font: var(--font-pretendard);
  --font-num: var(--font);

  /* ---- 크기 토큰(2026-10-31 새 기준 — 30~50대 직원, 현대 B2B 업무 화면 수준). 아래 값은 휴대폰·태블릿(손가락),
     'PC 밀도'(900px 이상 + 마우스) 값은 바로 아래 @media에서. 화면 CSS는 숫자 대신 이 이름만 쓴다 ---- */
  /* 글자(rem — 글자 크기 설정을 따라 커짐)                휴대폰 / PC */
  --fs-xs: .75rem;      /* 12 / 12  아래 탭 이름·배지·작은 개수 */
  --fs-sm: .8125rem;    /* 13 / 13  보조 글·날짜·힌트·칸 이름 — 화면 글자의 바닥 */
  --fs-body: .9375rem;  /* 15 / 14  본문·단추·메뉴 줄 */
  --fs-md: 1rem;        /* 16 / 15  목록 이름·묶음 제목(h2)·카드 제목 */
  --fs-lg: 1.125rem;    /* 18 / 17  확인창 제목·목록 금액·상세 머리 이름 */
  --fs-title: 1.25rem;  /* 20 / 22  화면 제목 h1 */
  --fs-num: 1.5rem;     /* 24 / 26  화면의 핵심 금액 하나(받을 돈 합계 등) */
  --fs-display: 1.625rem; /* 26 / 30  홈 인사말 한 곳 */
  --fs-input: 1rem;     /* 16 / 14  입력칸 글자(휴대폰은 16 아래면 아이폰이 확대) */
  --lh: 1.5;            /* 본문 줄 간격(제목 1.3) */
  /* 높이 — 휴대폰은 손가락 44px 바닥, PC는 마우스라 낮고 촘촘하게 */
  --touch: 44px;        /* 휴대폰 누르는 곳 최소(바뀌지 않음) */
  --h-sm: 44px;         /* 44 / 32  작은 단추(.btn-sm)·칩·아이콘 단추 */
  --h-md: 44px;         /* 44 / 36  기본 단추(.btn)·메뉴 줄 */
  --h-lg: 48px;         /* 48 / 40  확정 단추(.btn-commit) */
  --h-input: 44px;      /* 44 / 36  입력칸·고르기 칸 */
  /* 옛 이름 — 영역 화면 CSS가 아직 씀. 새 값을 그대로 가리킴(새 코드는 --h-*·--touch를 쓸 것) */
  --tap: var(--h-sm);
  --tap-lg: var(--h-md);
  --tap-xl: var(--h-lg);
  --input-h: var(--h-input);
  /* 간격 — 4/8 리듬 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --pad-card: 16px;     /* 16 / 20  카드 안쪽 */
  --pad-row: 12px 14px; /* 목록 한 줄 안쪽(위아래 좌우) — PC 10px 16px */
  --nav-h: 56px;                 /* 휴대폰 아래 탭 높이(아이폰 홈 표시줄 자리는 따로 더함) */
  --topbar-h: 52px;
  --kb: 0px;                     /* 화면 키보드가 가린 높이(아이폰) — main.js가 채움 */
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  /* A. 프로 (기본) */
  --bg: #f5f6f8;
  --bg-image: none;
  --surface: #ffffff;
  --surface-2: #f3f4f6;          /* 카드 안 묶음·hover·고른 메뉴 줄 */
  --text: #101828;
  --text-2: #475467;             /* 덜 중요한 본문(설명 한 줄·메뉴 섹션 이름) — muted보다 진함 */
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;        /* 입력칸·기본 단추 테두리, hover 선 */
  --accent: #24307c;
  --accent-hover: #1c2666;       /* 주 단추 hover */
  --accent-text: #ffffff;
  --accent-weak: #eef0f8;
  --danger: #b42318; --danger-weak: #fdecea; --danger-text: #ffffff;
  --ok: #067647;     --ok-weak: #e8f6ee;
  --warn: #8a5300;   --warn-weak: #fdf2dc;
  --radius: 10px;                /* 카드·고정 막대·패널 */
  --radius-sm: 6px;              /* 단추·입력칸·칩·메뉴 줄 */
  --radius-xs: 4px;              /* 배지·작은 표시 */
  --radius-lg: 14px;             /* 확인창·안내 창 같은 떠 있는 판 */
  --radius-pill: 999px;          /* 동그라미(아이콘·마이크·AI코디 단추)만 — 글자 단추·칩에는 쓰지 않음 */
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 12px 32px -12px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .06); /* 떠 있는 판(옆 목록·패널·확인창) */
  --shadow-dock: 0 -4px 16px -8px rgba(16, 24, 40, .18); /* 아래 고정 막대(.dock) — 떠 있는 것은 막대·확인창·토스트뿐 */
  --toast-bg: #1d2433; --toast-text: #ffffff; --toast-ok: #2a9d63; /* 알림 띠 — 어떤 시안에서도 진한 판 + 흰 글자 */
  --topbar-bg: #ffffff;
  --topbar-text: var(--text);
  --nav-bg: #ffffff;
  --h1: var(--fs-title);
  --chart-1: #3b4cb0;            /* 그래프 막대 — 남색 계열에서 데이터 표시용 명도(검증: dataviz validate_palette, 흰 바탕) */
  --title-transform: none;
  --title-spacing: -0.01em;
  color-scheme: light;
}
/* PC 밀도 — 넓은 화면 + 마우스(공장 태블릿처럼 손가락이면 휴대폰 값 그대로) */
@media (min-width: 900px) and (pointer: fine) {
  :root {
    --fs-body: .875rem; --fs-md: .9375rem; --fs-lg: 1.0625rem; --fs-title: 1.375rem; --fs-num: 1.625rem; --fs-display: 1.875rem; --fs-input: .875rem;
    --h-sm: 32px; --h-md: 36px; --h-lg: 40px; --h-input: 36px;
    --pad-card: 20px; --pad-row: 10px 16px;
  }
}
/* ================= 시안 A 확정판 색(2026-11-16) — Figma 'KGI-윈도우_ERP' 시안 A, erp 디자인/04_디자인시스템_AI용.md 2장 =================
 * 시안 A에만(B·C는 위 :root 값 그대로). 세기 (0,2,0)이라 위 :root를 이기고, 아래 어두운 화면·또렷한 화면 블록(같은 세기, 뒤에 있음)에는 진다.
 * 초록·주황·노랑은 쓰지 않는다: --ok·--warn은 파랑 진하기로. 빨강은 연체·확인 필요·취소에만 */
:root:is(:not([data-theme]), [data-theme="a"]) {
  --bg: #f3f5fa;
  --text: #121314;
  --text-2: #47494d;
  --line: #e4e7ee;
  --danger: #c92132; --danger-weak: #ffeef0;
  --ok: #2e6ff2;     --ok-weak: #dee8ff;
  --warn: #2861d2;   --warn-weak: #dee8ff;
  --chart-1: #24307c;
  --chart-2: #b9cdf9;
  --toast-ok: #8fb3ff;           /* 알림 띠(진한 판) 위 완료 표시 — 초록 대신 밝은 파랑 */
  /* 왼쪽 메뉴(PC 900px~) — 남색 판 */
  --side-bg: #1c2666;
  --side-text: rgba(255, 255, 255, .72);
  --side-text-on: #ffffff;
  --side-on: rgba(255, 255, 255, .16);
  --side-line: rgba(255, 255, 255, .10);
  /* 선택한 줄, AI */
  --select: #eef3ff;             /* 선택한 목록 줄 바탕 */
  --ai: #2e6ff2;                 /* AI 표시 글자·아이콘 */
  --ai-weak: #eef3ff;            /* AI가 채운 입력칸 바탕 */
  --ai-line: #9dbbff;            /* AI가 채운 입력칸 테두리 */
  --ai-grad: linear-gradient(135deg, #24307c, #2e6ff2);
  /* 빨강 보조 */
  --danger-dot: #ff3440;         /* 점·막대(글자 없는 표시만 — 흰 글자를 얹으면 대비 3.6:1이라 숫자 배지는 --danger) */
  --danger-line: #ff9aa2;        /* 경고 상자·확인 필요 칸 테두리 */
  /* 상태 점(04 문서 5-2) */
  --st-draft: #8d9299;           /* 저장만 */
  --st-sent: #6d9cf7;            /* 제출 · 답 기다림 */
  --st-won: #2e6ff2;             /* 수주 */
  --st-prod: #24307c;            /* 생산 중 */
  --st-ready: #1849b8;           /* 출고 대기 */
  --st-out: #47494d;             /* 출고 */
  --st-alert: #c92132;           /* 연체, 확인 필요, 취소 */
  /* 레이아웃 */
  --list-w: 20rem;               /* 목록 칸(보통 글자에서 320px) */
  --ai-w: 23.75rem;              /* AI코디 패널(보통 글자에서 380px) */
}
/*
 * 어두운 화면(시안 A만) — 더보기 → 화면 설정 → 다크 모드(core/theme.js): 기기 설정 따라(기본, 표시 없음) · 어둡게(data-scheme="dark") · 밝게(data-scheme="light").
 * 같은 값을 두 번 씀: ① 기기가 어두운 화면이고 '밝게'를 고르지 않았을 때(@media) ② '어둡게'를 골랐을 때. 값을 바꾸면 두 곳 다.
 * screen만 — 어두운 모드 기기에서 인쇄해도 흰 종이에 검은 글자(잉크·가독성). 선택자 세기는 :where로 예전(0,2,0)과 같게 — 또렷한 화면 값이 이김
 */
@media screen and (prefers-color-scheme: dark) {
  :root:is(:not([data-theme]), [data-theme="a"]):where(:not([data-scheme="light"])) {
    --bg: #0f1115; --surface: #171a20; --surface-2: #1e222a; --text: #e9ebef; --text-2: #c1c7d2; --muted: #98a2b3; --line: #2a2f38; --line-strong: #3a404b;
    --accent: #8ea2ff; --accent-hover: #a5b4ff; --accent-text: #0c1230; --accent-weak: #1d2440;
    --danger: #f28b82; --danger-weak: #3a1f1d; --ok: #8fb3ff; --ok-weak: #1d2440; --warn: #8fb3ff; --warn-weak: #1d2440;
    --danger-text: #171a20;
    --shadow: none; --topbar-bg: #171a20; --nav-bg: #171a20; --ci: #ffffff; /* 어두운 바탕에서는 흰 회사 CI */
    --shadow-dock: 0 -6px 24px -8px rgba(0, 0, 0, .6); --toast-bg: #2b3140;
    --chart-1: #7586e6;          /* 어두운 바탕용 막대(검증: #171a20 바탕) */
    --seg-on: #2c323d;           /* 고른 탭 — 바탕(surface-2)보다 밝게, 눌려 들어간 것처럼 보이지 않게 */
    --hero-bg: #24307c; --side-bg: #12151b; --side-text: #c1c7d2; --side-text-on: #ffffff; --side-on: rgba(255, 255, 255, .08); --side-line: #2a2f38;
    --select: #1d2440; --ai: #8ea2ff; --ai-weak: #1d2440; --ai-line: #3b4cb0;
    --ai-grad: linear-gradient(135deg, #3b4cb0, #8ea2ff);
    --danger-dot: #f28b82; --danger-line: #7a2e2a; --chart-2: #3b4cb0;
    --st-draft: #98a2b3; --st-sent: #8fb3ff; --st-won: #6d9cf7; --st-prod: #a5b4ff;
    --st-ready: #7ea6ff; --st-out: #c1c7d2; --st-alert: #f28b82;
    color-scheme: dark;
  }
}
@media screen {
  :root:is(:not([data-theme]), [data-theme="a"]):where([data-scheme="dark"]) {
    --bg: #0f1115; --surface: #171a20; --surface-2: #1e222a; --text: #e9ebef; --text-2: #c1c7d2; --muted: #98a2b3; --line: #2a2f38; --line-strong: #3a404b;
    --accent: #8ea2ff; --accent-hover: #a5b4ff; --accent-text: #0c1230; --accent-weak: #1d2440;
    --danger: #f28b82; --danger-weak: #3a1f1d; --ok: #8fb3ff; --ok-weak: #1d2440; --warn: #8fb3ff; --warn-weak: #1d2440;
    --danger-text: #171a20;
    --shadow: none; --topbar-bg: #171a20; --nav-bg: #171a20; --ci: #ffffff; /* 어두운 바탕에서는 흰 회사 CI */
    --shadow-dock: 0 -6px 24px -8px rgba(0, 0, 0, .6); --toast-bg: #2b3140;
    --chart-1: #7586e6;          /* 어두운 바탕용 막대(검증: #171a20 바탕) */
    --seg-on: #2c323d;           /* 고른 탭 — 바탕(surface-2)보다 밝게, 눌려 들어간 것처럼 보이지 않게 */
    --hero-bg: #24307c; --side-bg: #12151b; --side-text: #c1c7d2; --side-text-on: #ffffff; --side-on: rgba(255, 255, 255, .08); --side-line: #2a2f38;
    --select: #1d2440; --ai: #8ea2ff; --ai-weak: #1d2440; --ai-line: #3b4cb0;
    --ai-grad: linear-gradient(135deg, #3b4cb0, #8ea2ff);
    --danger-dot: #f28b82; --danger-line: #7a2e2a; --chart-2: #3b4cb0;
    --st-draft: #98a2b3; --st-sent: #8fb3ff; --st-won: #6d9cf7; --st-prod: #a5b4ff;
    --st-ready: #7ea6ff; --st-out: #c1c7d2; --st-alert: #f28b82;
    color-scheme: dark;
  }
}

/* B. 인더스트리얼 — 도면 격자, 철강 블루, 각진 모서리, 좁은 숫자 */
:root[data-theme="b"] {
  --bg: #e8ecf0;
  --bg-image: linear-gradient(rgba(36, 48, 124, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(36, 48, 124, .045) 1px, transparent 1px);
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --text: #121c26;
  --muted: #566676;
  --line: #c8d1db;
  --text-2: #3d4b59;
  --line-strong: #aab6c3;
  --accent: #33618f;
  --accent-hover: #2a5178;
  --accent-text: #ffffff;
  --accent-weak: #e3ecf5;
  --radius: 4px;
  --radius-sm: 3px;
  --radius-xs: 2px;
  --radius-lg: 6px;
  --radius-pill: 3px;
  --shadow: none;
  --topbar-bg: #1b2559;
  --topbar-text: #ffffff;
  --nav-bg: #ffffff;
  --font-num: 'Barlow Condensed', var(--font);
  --title-transform: uppercase;
  --title-spacing: 0.06em;
}

/* C. 대화형 — AI코디 중심, 둥글고 큼직하게 */
:root[data-theme="c"] {
  --bg: #ffffff;
  --surface: #f5f6fb;
  --surface-2: #eceff8;
  --text: #0e1330;
  --muted: #5d6485;
  --line: #e6e8f2;
  --text-2: #3e4566;
  --line-strong: #cfd3e4;
  --accent: #3446c8;
  --accent-hover: #2a3aaa;
  --accent-text: #ffffff;
  --accent-weak: #ebeefe;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow: none;
  --topbar-bg: rgba(255, 255, 255, .92);
  --nav-bg: rgba(255, 255, 255, .96);
}

/* ================= 보기 편하게(core/a11y.js) — 글자 크기 3단계·또렷한 화면 =================
 * 글자 크기: 뿌리 글자(1rem)를 키움 — 화면 글자는 모두 rem 토큰이라 함께 커짐(보통 16px → 크게 18px → 아주 크게 20px).
 *   '보통'이 기준(--fs-* 값 그대로), 크게·아주 크게는 고르는 사람만. 단추·입력칸 높이는 px 바닥(min-height)이라 글자가 커지면 같이 늘어남.
 *   새 글자 크기는 px 말고 --fs-* 토큰으로 쓸 것. 견적서·세금계산서 같은 종이 양식만 px 고정(화면의 [크게 보기]로).
 * 또렷한 화면: 옅은 회색 글자를 본문 글자에 가깝게(대비 7:1 이상 — WCAG AAA), 선·테두리는 진하고 굵게.
 *   색은 각 시안·어두운 화면의 --text·--surface를 섞어 만들어 어느 조합에서도 맞음(시안별 값을 따로 두지 않음). */
:root[data-typeface="system"] { --font: var(--font-system); }
:root[data-font="l"] { font-size: 112.5%; }
:root[data-font="xl"] { font-size: 125%; }
:root[data-contrast="high"] {
  --muted: color-mix(in srgb, var(--text) 88%, var(--surface));
  --text-2: color-mix(in srgb, var(--text) 92%, var(--surface));
  --line: color-mix(in srgb, var(--text) 60%, var(--surface));
  --line-strong: color-mix(in srgb, var(--text) 70%, var(--surface));
  --danger: #8f1a12; --warn: #663c00; --ok: #04583a;
}
:root[data-contrast="high"]:is(:not([data-theme]), [data-theme="a"]) { --ok: #1a3fa0; --warn: #1a3fa0; --danger-line: #8f1a12; --ai-line: #1a3fa0; } /* 시안 A는 초록·황토 대신 진한 파랑(9.3:1) */
:root[data-contrast="high"][data-theme="b"] { --accent: #234a70; }
:root[data-contrast="high"][data-theme="c"] { --accent: #2433a0; }
/* 시안 C는 카드·막대 테두리를 숨겨 두었음 — 또렷한 화면에서는 다시 보이게 */
:root[data-contrast="high"][data-theme="c"] :is(.card, .topbar, .nav) { border-color: var(--line); }
@media screen and (prefers-color-scheme: dark) {
  :root[data-contrast="high"]:is(:not([data-theme]), [data-theme="a"]):where(:not([data-scheme="light"])) { --danger: #ffb4ab; --warn: #b9cdff; --ok: #b9cdff; --accent: #aebcff; --danger-line: #ffb4ab; --ai-line: #aebcff; }
}
@media screen {
  :root[data-contrast="high"]:is(:not([data-theme]), [data-theme="a"]):where([data-scheme="dark"]) { --danger: #ffb4ab; --warn: #b9cdff; --ok: #b9cdff; --accent: #aebcff; --danger-line: #ffb4ab; --ai-line: #aebcff; }
}
[data-contrast="high"] .home { --home-sub: var(--text); }
[data-contrast="high"] .sheet-msg, [data-contrast="high"] .otp-demo, [data-contrast="high"] .qe-l { color: var(--text); }
[data-contrast="high"] .topbar .who { opacity: 1; }
[data-contrast="high"] :is(.input, .chip, .card, .seg, .btn:not(.btn-ghost, .btn-primary)) { border-width: 2px; }
[data-contrast="high"] .composer { border-width: 2px; border-color: var(--line); }
[data-contrast="high"] :focus-visible { outline-width: 4px; }
[data-contrast="high"] .btn:disabled { opacity: .7; }

/* ================= 기본 ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; } /* 세로 스크롤 막대 자리를 늘 비워 둠 — 긴 화면·짧은 화면을 오갈 때 본문이 15px씩 좌우로 흔들리지 않게(PC, 2026-10-31 폭 점검) */
body {
  margin: 0; background-color: var(--bg); background-image: var(--bg-image); background-size: 24px 24px;
  color: var(--text); font: var(--fs-body)/var(--lh) var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; /* 누름 표시는 단추마다 :active로(파란 네모 대신) */
  word-break: keep-all; overflow-wrap: anywhere; /* 한글은 어절 단위로 줄바꿈 */
}
a { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-text); }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: var(--h1); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: var(--fs-md); font-weight: 600; }
h3 { font-size: var(--fs-body); font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } /* 키보드로 고를 때 어디인지 또렷이(또렷한 화면은 4px) */
input, textarea { caret-color: var(--accent); }
#view:focus { outline: none; } /* 화면 전환 때 읽기 위치만 옮김(화면낭독기) — 테두리는 표시 안 함 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 60; transform: translateY(calc(-100% - 16px)); }
.skip-link:focus { transform: none; }

/* ================= 앱 틀: 위 막대 + 본문 + 아래 탭(휴대폰) / 왼쪽 메뉴(PC) ================= */
.app { min-height: 100dvh; }
.app > * { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--topbar-bg); color: var(--topbar-text); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
/* 안쪽 화면(휴대폰) — 로고 대신 큰 [‹ 뒤로] + 화면 이름(main.js). PC는 왼쪽 메뉴·화면 안 '← …' 링크를 그대로 씀 */
.top-back {
  display: inline-flex; align-items: center; gap: 0; flex: 0 0 auto; min-height: var(--touch); margin-left: -8px; padding: 0 10px 0 2px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--accent);
  font: inherit; font-size: var(--fs-body); font-weight: 500; cursor: pointer; transition: background-color .15s;
}
.top-back svg { width: 24px; height: 24px; flex: 0 0 auto; }
.top-back:active { background: var(--accent-weak); }
.top-title { display: none; flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) {
  .app.has-back .brand { display: none; }
  .app.has-back .top-title { display: block; }
  .app.has-back .topbar .who { display: none; }
  /* 화면 안 맨 위 '← 뒤로' 링크는 위 막대 [‹ 뒤로]와 같은 일 — 휴대폰에서는 하나만 보이게(누르면 같은 곳으로: main.js가 그 링크 주소를 씀) */
  .app.has-back #view .view-host > a.back:first-child,
  .app.has-back #view .view-host > * > a.back:first-child { display: none; }
}
@media (min-width: 900px) { .top-back, .top-title { display: none !important; } }
/* 경로 표시(PC 안쪽 화면, main.js setCrumbs) — '섹션 / 메뉴 / 지금 화면'. 작고 조용하게, 메뉴는 링크 */
.crumbs { display: none; }
@media (min-width: 900px) {
  .crumbs:not([hidden]) { display: block; margin: -14px 0 4px; }
  .crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--muted); }
  .crumbs li { display: inline-flex; align-items: center; min-width: 0; }
  .crumbs li + li::before { content: '/'; margin: 0 8px; color: var(--line-strong); }
  .crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--h-sm); min-width: var(--h-sm); padding: 0 4px; color: var(--text-2); text-decoration: none; border-radius: var(--radius-xs); } /* 누르는 곳 32px(PC 바닥) */
  .crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
  .crumbs [aria-current="page"] { color: var(--text); font-weight: 500; }
  /* 경로가 있으면 화면 안 맨 위 '← 부모' 링크는 같은 일 — 하나만 */
  .app.has-crumbs #view .view-host > a.back:first-child,
  .app.has-crumbs #view .view-host > * > a.back:first-child { display: none; }
}
@media print { .crumbs { display: none !important; } }
.brand { display: flex; align-items: center; gap: 8px; min-height: var(--touch); flex: 0 1 auto; min-width: 0; color: inherit; text-decoration: none; }
/* 회사 CI(index.html 안 SVG, fill=currentColor) — 높이 22px(휴대폰 20px), 폭은 비율대로(막대+KGI WINDOW, 약 9:1) */
.ci { display: block; flex: 0 1 auto; min-width: 0; width: auto; aspect-ratio: 362.8 / 40.25; color: var(--ci); }
.brand .ci { height: 22px; }
@media (max-width: 599px) { .brand .ci { height: 20px; } }
@media (max-width: 359px) { .brand .ci { height: 17px; } .brand .erp-tag { display: none; } } /* 아주 좁은 휴대폰 — 톱니바퀴 자리 */
/* 위 막대 오른쪽 톱니바퀴 → 화면 설정(components/display-popover.js) — 모든 화면, 누르는 곳 44px */
.top-gear {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: var(--touch); height: var(--touch); margin: 0 -6px 0 auto; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s;
}
.top-gear svg { width: 22px; height: 22px; }
.top-gear:active, .top-gear[aria-expanded="true"] { background: var(--accent-weak); color: var(--accent); }
@media (hover: hover) { .top-gear:hover { background: var(--surface-2); color: var(--text); } }
@media (min-width: 600px) { .topbar .who ~ .top-gear { margin-left: 2px; } } /* 이름이 보이면(600px 이상) 이름 바로 옆 — 이름이 오른쪽 끝으로 밀어 줌 */
.brand .erp-tag { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; line-height: 1; padding: 3px 5px; border-radius: var(--radius-xs); border: 1px solid var(--line); color: var(--muted); }
.topbar .who { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 본문 폭(2026-10-31 폭 점검 — 사용자 "발주·재고 → 입고 받기에서 폭이 좁아지고 가운데가 풀린다"):
   기본은 하나 — .main 전체(1440px까지, 넓은 화면에선 가운데). 목록과 그 아래 상세·작성·고치기·입고·전표 쓰기 등 하위 화면은 모두 이 폭(화면 CSS에 폭을 두지 않음).
   예외: .narrow(640, 시작선은 같음) = 더보기·비밀번호·도움말·백업처럼 목록 없는 한 줄 화면 / 홈 대화·지난 대화 720 가운데 / 종이 미리보기 794 가운데. DESIGN.md '본문 폭' */
.main {
  width: 100%; max-width: 1440px; margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: clip; /* 화면 전환 때 옆에서 들어오는 동안 가로 스크롤이 생기지 않게(clip은 sticky를 깨지 않음) */
}
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--nav-bg); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); /* 아이폰 홈 표시줄 자리 */
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.nav a {
  flex: 1; min-height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: var(--fs-xs); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 22px; height: 22px; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
/* 휴대폰 아래 탭 — 지금 탭은 그림 뒤 옅은 받침 + 진한 글자(색만으로 알리지 않음), 누르면 그림이 살짝 눌림, 길게 눌러도 글자 선택 안 됨 */
@media (max-width: 899px) {
  .nav a { gap: 2px; padding-top: 2px; letter-spacing: -0.01em; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .nav a svg { box-sizing: content-box; padding: 3px 14px; border-radius: var(--radius-pill); transition: background-color .2s var(--ease-out), transform .12s; }
  .nav a[aria-current="page"] svg { background: var(--accent-weak); stroke-width: 2; }
  .nav a:active svg { transform: scale(.88); background: color-mix(in srgb, var(--accent-weak) 70%, transparent); }
  /* 화면 키보드가 올라오면 아래 탭은 숨김 — 입력칸·아래 고정 막대(--nav-h를 쓰는 것)가 키보드 바로 위에 붙음 */
  :root.kb-open { --nav-h: 0px; }
  :root.kb-open .nav { display: none; }
}
.nav a.nav-wide { display: none; } /* PC 왼쪽 메뉴에만(발주·재고·경영 대시보드) */
.nav-sec-btn, .nav-fly { display: none; } /* 섹션 단추·옆 목록은 PC 왼쪽 메뉴에만 */
/* 휴대폰 아래 탭 — 섹션 틀은 없는 것처럼(display: contents) 해서 다섯 칸(홈·견적·생산·미수금·더보기)이 한 줄에 그대로 */
@media (max-width: 899px) { .nav-sec, .nav-sec-items, .nav-sec-inner { display: contents; } .nav-fly { display: none !important; } }
.nav-toggle { display: none; } /* [메뉴 접기·펼치기]는 PC 왼쪽 메뉴에만 — 휴대폰 아래 탭은 다섯 칸 그대로 */

@media (min-width: 900px) {
  /* 왼쪽 메뉴 — 기본은 접힌 막대(80px, 아이콘만), .nav-open이면 펼침(기본 260px — 글자 '아주 크게'에서도 섹션·메뉴 이름이 잘리지 않게).
     펼친 폭은 오른쪽 경계 손잡이(.nav-resize)로 220~360px 사이에서 바꿈 — main.js가 --nav-w를 .app에 넣고 이 기기에 기억(2026-10-31).
     아이콘 자리(왼쪽 12px)는 두 모양이 같아 폭이 바뀌어도 아이콘은 가만히 */
  .app { --nav-w-closed: 4.5rem; display: grid; grid-template-columns: var(--nav-w-closed) 1fr; grid-template-rows: auto 1fr; }
  .app.nav-open { grid-template-columns: var(--nav-w, 260px) 1fr; }
  .app.nav-ready { transition: grid-template-columns .24s cubic-bezier(.16, 1, .3, 1); }
  .app.nav-ready.nav-resizing { transition: none; } /* 끄는 동안은 손을 바로 따라옴 */
  .topbar { grid-column: 1 / -1; padding: 0 20px 0 18px; }
  .nav {
    position: sticky; top: var(--topbar-h); align-self: start;
    height: calc(100dvh - var(--topbar-h)); flex-direction: column; gap: 1px;
    padding: 10px 10px 12px; border-top: 0; border-right: 1px solid var(--line); overflow-x: hidden;
  }
  /* 메뉴 줄 — 높이 --h-md(36), 글자 본문 크기, 그림 20px. 지금 화면은 옅은 회색 받침 + 진한 글자 + 남색 그림(남색 바탕 덩어리 없이) */
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 10px; color: var(--text-2); font-size: var(--fs-body); font-weight: 500; border-radius: var(--radius-sm); min-height: var(--h-md); white-space: nowrap; }
  .nav a svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--muted); }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
  .nav a[aria-current="page"] svg { color: var(--accent); }
  .nav a.nav-wide { display: flex; }
  .nav-toggle {
    display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: var(--h-md); margin-bottom: 6px; padding: 0 10px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
    font: inherit; font-size: var(--fs-body); font-weight: 500; white-space: nowrap; text-align: left; cursor: pointer;
  }
  .nav-toggle:hover { background: var(--surface-2); color: var(--text); }
  .nav-toggle svg { width: 20px; height: 20px; flex: 0 0 auto; }
  /* [메뉴 접기·펼치기]는 그림만(이름은 aria-label·title — 2026-10-31 사용자 요청) */
  .nav-toggle .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app.nav-open .nav-toggle { align-self: flex-start; width: 40px; }
  .nav-toggle .nav-toggle-dir { transform-box: fill-box; transform-origin: center; }
  .app.nav-open .nav-toggle .nav-toggle-dir { transform: rotate(180deg); }
  /* 접힌 막대 — 이름은 화면에서만 숨김(화면낭독기는 읽음, 마우스를 올리면 title), 섹션은 아이콘만(누르면 옆 목록), 지난 대화 목록은 숨김 */
  .nav { scrollbar-width: thin; } /* 낮은 화면에서 아래 메뉴(더보기·이전 화면)가 더 있다는 것이 보이게 — 가늘게 */
  .app:not(.nav-open) .nav a, .app:not(.nav-open) .nav-toggle, .app:not(.nav-open) .nav-sec-btn { justify-content: center; padding-inline: 0; } /* 스크롤 막대가 생겨도 아이콘은 가운데 */
  .app:not(.nav-open) .nav .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app:not(.nav-open) .nav .nav-chats { display: none; }
  .app:not(.nav-open) .nav a .nav-badge, .app:not(.nav-open) .nav a .nav-count { position: absolute; top: 2px; left: calc(50% + 2px); min-width: 18px; height: 18px; margin: 0; padding: 0 5px; font-size: .6875rem; line-height: 18px; }
  .main { padding: 20px 24px 40px; } /* 시연 전 UX 검토 2-5: 위·옆 여백을 줄여 첫 화면에 본문을 더 */
}

/* 메뉴 폭 손잡이(PC 펼친 메뉴만) — 메뉴 오른쪽 경계. 평소엔 안 보이고, 마우스를 올리거나 초점·끄는 중이면 남색 세로선.
   누르는 곳은 16px로 넉넉히(선은 경계 위 3px). 끌기·좌우 화살표(16px씩)·두 번 누르면 처음 폭 — main.js */
.nav-resize { display: none; }
@media (min-width: 900px) {
  .app.nav-open .nav-resize {
    display: block; position: fixed; z-index: 22; top: var(--topbar-h); bottom: 0; left: calc(var(--nav-w, 260px) - 4px); width: 16px; /* 메뉴 쪽은 4px만 덮음 — 메뉴 스크롤 막대를 가리지 않게 */
    cursor: col-resize; touch-action: none; -webkit-user-select: none; user-select: none; outline: none;
  }
  .nav-resize::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 2px; width: 3px; /* 메뉴 경계선 위 */ border-radius: 2px; background: var(--accent);
    opacity: 0; transition: opacity .15s;
  }
  .nav-resize:hover::after, .nav-resize:focus-visible::after, .app.nav-resizing .nav-resize::after { opacity: 1; }
  .nav-resize:focus-visible::after { width: 4px; box-shadow: 0 0 0 3px var(--accent-weak); }
  .app.nav-ready .nav-resize { transition: left .28s cubic-bezier(.16, 1, .3, 1); }
  .app.nav-resizing .nav-resize { transition: none; }
  /* 끄는 동안 — 화면 어디서나 좌우 화살표 모양, 글자가 선택되지 않게 */
  :root.nav-resizing, :root.nav-resizing * { cursor: col-resize !important; -webkit-user-select: none !important; user-select: none !important; }
}
@media (prefers-reduced-motion: reduce) { .nav-resize::after, .app.nav-ready .nav-resize { transition: none; } }

/* ================= 알림 막대(새 버전 등) ================= */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--warn-weak); color: var(--warn); font-size: var(--fs-body);
}
.banner .btn { margin-left: auto; }
.banner-offline { background: var(--danger-weak); color: var(--danger); position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 15; }

/* ================= 기본 구성 요소 ================= */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > *, #view, .view-host { min-width: 0; } /* 가로 스크롤 칩·긴 거래처명이 화면 폭을 밀어내지 않게 */
.page-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; } /* 화면 제목 줄: <h1> 하나 + 오른쪽에 개수(.muted) 또는 '＋ 새 ○○' 단추 하나 */
.page-title > h1 { min-width: 0; }
.page-title > .btn { flex: 0 0 auto; margin-left: auto; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 8px; }
.section-title h2 { font-size: var(--fs-md); font-weight: 600; text-transform: var(--title-transform); letter-spacing: var(--title-spacing); }
.section-title .muted { font-size: var(--fs-sm); }
.section-title a { display: inline-flex; align-items: center; min-height: var(--h-sm); padding: 0 6px; font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.section-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad-card); box-shadow: var(--shadow); }
.card > h2 { font-size: var(--fs-md); }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s; }
.card-link:hover { border-color: var(--line-strong); }
.card-link:active { background: var(--surface-2); }

/* 단추 — 크기는 이름으로만: 작은 .btn-sm(--h-sm 44/32) · 기본 .btn(--h-md 44/36) · 확정 .btn-commit(--h-lg 48/40). 높이를 화면마다 숫자로 쓰지 않는다 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--h-md); padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: var(--fs-body); font-weight: 500; line-height: 1.3; text-decoration: none; cursor: pointer;
  transition: background-color .12s, border-color .12s, transform .12s var(--ease-out);
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
/* hover 옅은 회색 바탕은 '바탕색을 따로 정하지 않은 보통 단추'에만 — :where()로 세기를 .btn 하나만큼으로 낮춤(2026-11-03 사용자 피드백
   "흰 글자가 마우스를 올리면 안 보임"). 전에는 이 규칙(.btn:hover:not(:disabled), 세기 0,3,0)이 색 바탕 단추의 바탕까지 덮어써서
   빨간 확인 단추(.sheet-danger — [링크 끊기]·[견적 취소] 확인창)·한 번 누른 단추(.btn.confirming 황토)가 hover 때 옅은 회색 바탕 + 흰 글자가 됐다.
   색 바탕 단추는 아래 각자의 hover(조금 진하게)를 쓴다 */
.btn:where(:hover:not(:disabled)) { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
/* 누름 효과 — 손가락 밑에서 살짝 들어감(모든 단추). 움직임 줄이기 기기는 아래에서 끔 */
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-weak); }
.btn.btn-sm { min-height: var(--h-sm); padding: 0 10px; font-size: var(--fs-sm); }
.btn.btn-commit { min-height: var(--h-lg); padding: 0 18px; font-size: var(--fs-md); font-weight: 600; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--h-md); height: var(--h-md); flex: 0 0 auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { background: var(--danger-weak); border-color: var(--danger); color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field legend { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.input {
  width: 100%; min-height: var(--h-input); padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-input); line-height: 1.4;
  transition: border-color .12s, box-shadow .12s;
}
.input:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--text) 30%, var(--line-strong)); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.input::placeholder { color: var(--muted); opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-weak); }
textarea.input { min-height: 88px; padding-block: 9px; line-height: var(--lh); resize: vertical; }

.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .input { flex: 1; }
.search-row .icon-btn[aria-pressed="true"] { animation: pulse 1.2s ease-in-out infinite; }

/* 칩(거르기·고르기) — 알약 대신 토큰 모서리, 얇은 선. 고른 것은 남색 바탕 */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scroll-padding-inline: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; min-height: var(--h-sm); min-width: var(--h-sm); padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip .n:not(:empty) { margin-left: 5px; font-size: var(--fs-xs); opacity: .85; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 2px 7px; border-radius: var(--radius-xs); font-size: var(--fs-xs); font-weight: 600; line-height: 1.45; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.tone-accent { background: var(--accent-weak); color: var(--accent); }
.badge.tone-ok { background: var(--ok-weak); color: var(--ok); }
.badge.tone-warn { background: var(--warn-weak); color: var(--warn); }
.badge.tone-danger { background: var(--danger-weak); color: var(--danger); }

/* 견적 상태 — 배지 대신 점 + 글자(시안 A, 04 문서 5-2). 표는 core/format.js statusBadge(표시 이름도 거기서: 견적→저장만 등).
   점 색은 --st-*, 글자 색은 흰 바탕 대비 4.5:1 이상이 되게 따로(옅은 점 색을 글자에 그대로 쓰면 2.7:1 — 저장만·제출은 --muted).
   시안 B·C는 --st-*가 없어 남색·회색·빨강으로 떨어짐 */
.badge.qs-st {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; border-radius: 0; background: none;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.01em; line-height: 1.4; color: var(--st-t, var(--text-2));
}
.badge.qs-st::before { content: ''; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--st-c, currentColor); }
.badge.qs-st[data-st="견적"] { --st-c: var(--st-draft, var(--muted)); --st-t: var(--muted); }
.badge.qs-st[data-st="견적제출"] { --st-c: var(--st-sent, var(--accent)); --st-t: var(--muted); }
.badge.qs-st[data-st="수주"] { --st-c: var(--st-won, var(--accent)); --st-t: var(--warn); }
.badge.qs-st[data-st="생산중"] { --st-c: var(--st-prod, var(--accent)); --st-t: var(--st-prod, var(--accent)); }
.badge.qs-st[data-st="생산완료"] { --st-c: var(--st-ready, var(--accent)); --st-t: var(--st-ready, var(--accent)); }
.badge.qs-st[data-st="출고"] { --st-c: var(--st-out, var(--text-2)); --st-t: var(--st-out, var(--text-2)); }
.badge.qs-st[data-st="취소"] { --st-c: var(--st-alert, var(--danger)); --st-t: var(--st-alert, var(--danger)); }

/* ================= 시안 A 공용 부품(04 문서 5장) — 목록 줄·진행 막대·다음 할 일·줄 목록·접힌 링크·경고 상자·AI 태그 =================
 * 크기·색은 토큰만. 견적·거래처·수금·발주·보고서 화면이 같이 씀 */

/* 5-1 목록 줄 .li2 — 위: 이름 | 금액, 아래: 보조 | 상태. 선택한 줄은 옅은 파랑 바탕만(테두리·왼쪽 선 없음) */
.li2-list { display: flex; flex-direction: column; padding: 0; overflow: clip; }
.li2 {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-3); align-items: baseline;
  padding: var(--pad-row); color: inherit; text-decoration: none; cursor: pointer;
}
.li2-list > * + * { border-top: 1px solid var(--line); } /* 줄 사이 선(줄을 listitem으로 감싸도 같게) */
.li2-list > [role="listitem"] > .li2 { height: 100%; }
.li2:hover { background: var(--surface-2); }
.li2:is([aria-current="page"], [aria-current="true"], .on) { background: var(--select, var(--accent-weak)); }
.li2:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.li2-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 600; }
.li2-amt { font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.li2-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); }
.li2-st { justify-self: end; white-space: nowrap; }
.li2-amt.is-empty { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.li2[data-st="취소"] :is(.li2-name, .li2-amt) { color: var(--muted); }

/* 5-4 진행 막대 .track — 7칸, 칸 높이 6px. 지난 단계 남색, 지금 단계 반쯤, 남은 단계 선 색. 아래 이름(휴대폰은 지금 단계만) */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.track > li { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.track > li::before { content: ''; display: block; height: 6px; border-radius: var(--radius-pill); background: var(--line); }
.track > li.is-done::before { background: var(--accent); }
.track > li.is-now::before { background: linear-gradient(90deg, var(--accent) 50%, var(--line) 50%); }
.track-l { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track > li.is-done .track-l { color: var(--text-2); }
.track > li.is-now .track-l { color: var(--accent); font-weight: 700; }
.track.is-off > li::before { background: var(--line); }
.track.is-off .track-l { color: var(--muted); }
@media (max-width: 599px) { .track > li:not(.is-now) .track-l { visibility: hidden; } .track > li.is-now .track-l { overflow: visible; } }

/* 5-5 다음 할 일 카드 .next — [아이콘 칸] [다음 할 일 / 제목 / 설명] [글자 링크][확정 단추]. 화면에 하나.
   단추는 아래 고정 막대(.dock)를 카드 안에 둔 것 — 899px 아래는 막대가 화면 아래에 붙고, 900px 위는 카드 안 제자리 */
.next { display: flex; align-items: center; gap: var(--sp-4); box-shadow: var(--shadow-pop); border-color: transparent; }
.next-ico { display: grid; place-items: center; flex: 0 0 auto; width: var(--h-lg); height: var(--h-lg); border-radius: var(--radius); background: var(--ok-weak); color: var(--accent); }
.next-ico svg { width: 22px; height: 22px; }
.next-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-k { margin: 0; color: var(--accent); font-size: var(--fs-xs); font-weight: 700; }
.next-h { margin: 0; font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; letter-spacing: -.01em; word-break: keep-all; }
.next-d { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; word-break: keep-all; }
.next[data-st="취소"] .next-ico { background: var(--danger-weak); color: var(--danger); }
.next[data-st="취소"] .next-k { color: var(--danger); }
@media (max-width: 599px) { .next { align-items: flex-start; } .next-ico { width: var(--h-sm); height: var(--h-sm); } }

/* 글자 링크 — 테두리 없는 단추(아이콘 + 글자) */
.text-link {
  display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--h-sm); padding: 0 var(--sp-1); border: 0; background: none;
  color: var(--text-2); font: inherit; font-size: var(--fs-body); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.text-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.text-link:hover { color: var(--text); }

/* 5-7 섹션 제목 줄 — 제목 + 보조 + 오른쪽 링크 */
.sec-h { display: flex; align-items: baseline; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.sec-h h2 { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.sec-h .sec-sub { color: var(--muted); font-size: var(--fs-sm); }
.sec-h .sec-go { display: inline-flex; align-items: center; min-height: var(--h-sm); min-width: 2.5rem; margin-left: auto; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.sec-h .sec-go:hover { color: var(--text); }

/* 5-8 줄 목록 .row2 — [번호 칸] [이름 / 설명] [수량] [금액]. 세로선·칸 테두리 없음, 줄 사이 선 */
.row2-list { list-style: none; margin: 0; padding: 0 var(--pad-card); }
.row2 { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row2:last-child { border-bottom: 0; }
.row2-no { display: grid; place-items: center; flex: 0 0 auto; width: var(--h-sm); height: var(--h-sm); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.row2-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row2-name { font-size: var(--fs-body); font-weight: 600; overflow-wrap: anywhere; }
.row2-d { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.row2-q { flex: 0 0 auto; font-size: var(--fs-body); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row2-v { flex: 0 0 auto; font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.row2.is-sum .row2-name { color: var(--text-2); }
.row2.is-sum .row2-v { font-size: var(--fs-lg); font-weight: 700; }

/* 5-9 링크 칸 .qs-act(견적에서 시작한 이름 그대로 — 거래처·수금·발주도 씀) — 칸: 카드 높이 --h-lg, 아이콘 + 이름 + 오른쪽 보조. 휴대폰 2칸씩 */
.qs-act {
  display: flex; align-items: center; gap: 10px; min-height: var(--h-lg); min-width: 0; padding: 0 var(--sp-4);
  border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out);
}
.qs-act:hover { border-color: var(--line-strong); }
.qs-act:active { transform: scale(.99); }
.qs-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qs-act-ico { display: grid; place-items: center; flex: 0 0 auto; color: var(--text-2); }
.qs-act-ico .qs-ico { width: 18px; height: 18px; }
.qs-act-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body); font-weight: 600; }
.qs-act-sub { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 599px) { .qs-act { padding: 0 var(--sp-3); } .qs-act-sub { display: none; } }

/* 5-5 다음 할 일 카드 오른쪽 [글자 링크][확정 단추] 칸 */
.next-go { display: flex; align-items: center; gap: var(--sp-3); flex: 0 0 auto; }
@media (max-width: 899px) { .next.is-wrap { flex-wrap: wrap; } .next.is-wrap .next-go { flex-basis: 100%; } .next.is-wrap .next-go .btn { flex: 1 1 auto; } }

/* 점 + 글자(상태 배지가 아닌 곳 — 거래처 연체·견적 수 등). data-tone: danger·accent·muted */
.dot-t { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dot-t::before { content: ''; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--dot-c, var(--muted)); }
.dot-t[data-tone="danger"] { --dot-c: var(--danger-dot, var(--danger)); color: var(--danger); }
.dot-t[data-tone="accent"] { --dot-c: var(--accent); color: var(--accent); }
.dot-t[data-tone="ok"] { --dot-c: var(--ok); color: var(--ok); }
.dot-t[data-tone="muted"] { --dot-c: var(--muted); color: var(--muted); }

/* 5-9 접힌 링크 줄 .links — 가로 4칸(휴대폰 2칸씩), 칸: 아이콘 + 이름 + 오른쪽 보조 */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--sp-3); }
@media (max-width: 599px) { .links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 5-12 경고 상자 — 흰 바탕 + 빨강 테두리(회색 바탕 위에 연한 빨강 상자를 바로 올리지 않음) */
.warn-box {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin: 0; padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--danger-line, var(--danger)); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--danger); font-size: var(--fs-body); font-weight: 600;
}
.warn-box > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.warn-box .btn-sm { background: var(--danger-weak); border-color: var(--danger-line, var(--danger)); color: var(--danger); }

/* 4-1 목록 + 상세 2단(1100px~) — 왼쪽 목록 칸(--list-w)은 화면에 붙어 따로 스크롤, 오른쪽 상세는 화면 스크롤. 좁으면 상세만 */
.split-list { display: none; }
@media (min-width: 1100px) {
  .split { display: grid; grid-template-columns: var(--list-w, 20rem) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
  .split-list { display: block; position: sticky; top: calc(var(--topbar-h) + var(--sp-5)); min-width: 0; }
  .split-list > .card { display: flex; flex-direction: column; max-height: calc(100dvh - var(--topbar-h) - var(--sp-5) * 2); padding: 0; overflow: hidden; }
  .split-main { min-width: 0; }
}
/* 목록 칸 머리 — 제목(--fs-title) + 작은 등록 단추, 찾기 칸, 줄 목록 */
.qp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--pad-card) var(--pad-card) var(--sp-3); }
.qp-title { margin: 0; font-size: var(--fs-title); font-weight: 700; letter-spacing: -.02em; }
.qp-new { gap: 4px; }
.qp-new svg { width: 16px; height: 16px; }
.qp-search { padding: 0 var(--pad-card) var(--sp-3); border-bottom: 1px solid var(--line); }
.qp-search .input { width: 100%; background: var(--surface-2); border-color: transparent; }
.qp-tabs { display: flex; gap: var(--sp-4); padding: var(--sp-3) var(--pad-card) 0; border-bottom: 1px solid var(--line); }
.qp-tab { min-height: var(--h-sm); padding: 0 0 2px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.qp-tab { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; }
.qp-tab .n:not(:empty) { margin-left: 4px; }
.qp-tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }
.qp-tab:hover { color: var(--text); }
.qp-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qp-search:has(+ .qp-tabs) { border-bottom: 0; }
.qp-top { padding: 0 var(--pad-card) var(--sp-3); }
/* 합계 판(남색) — 수금 목록 칸 위·수금 화면 위. 남색 바탕 + 흰 글자, 연체만 옅은 빨강 */
.sum-hero { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-4) var(--sp-5); border-radius: var(--radius); background: var(--hero-bg, var(--side-bg, var(--accent))); color: #fff; text-decoration: none; }
.sum-hero:hover { filter: brightness(1.08); }
.sum-hero:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sum-hero-k { color: rgb(255 255 255 / .72); font-size: var(--fs-sm); font-weight: 500; }
.sum-hero-v { font-size: var(--fs-num); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; }
.sum-hero-s { color: #ffb4bb; font-size: var(--fs-sm); font-weight: 600; }
.sum-hero-s b { font-weight: 700; }
.sum-hero-s.is-none { color: rgb(255 255 255 / .72); }
.qp-foot:not(:empty) { padding: var(--sp-3) var(--pad-card) var(--pad-card); border-top: 1px solid var(--line); }
.pane-warn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--sp-4); border-radius: var(--radius); background: var(--danger-weak); color: var(--danger); text-decoration: none; }
.pane-warn strong { font-size: var(--fs-body); font-weight: 700; }
.pane-warn > span:not(.btn) { font-size: var(--fs-sm); }
.pane-warn .btn { margin-top: var(--sp-2); gap: 4px; border-color: var(--danger-line, var(--danger)); background: var(--surface); color: var(--text); }
.pane-warn .btn svg { width: 14px; height: 14px; }
.li2-po { padding-bottom: var(--sp-3); }
.li2-bar { grid-column: 1 / -1; width: 100%; height: 4px; margin-top: var(--sp-2); border: 0; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; -webkit-appearance: none; appearance: none; }
.li2-bar::-webkit-progress-bar { background: var(--line); border-radius: var(--radius-pill); }
.li2-bar::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-pill); }
.li2-bar::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-pill); }
.qp-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: 0; }
.qp-list .skeleton { margin: var(--sp-3) var(--pad-card); }

/* 5-13 AI 태그 */
.ai-tag { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: var(--radius-xs); background: var(--ok-weak); color: var(--ai, var(--accent)); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }

.state { padding: 32px 16px; text-align: center; color: var(--muted); font-size: var(--fs-body); }
.state .state-title { color: var(--text); font-weight: 600; }
.state > p + p, .state > p + .btn, .state > .error-text + .btn { margin-top: 12px; }
.error-text { color: var(--danger); font-size: var(--fs-sm); }
.check { display: flex; align-items: center; gap: 8px; min-height: var(--h-sm); font-size: var(--fs-body); cursor: pointer; }
.check input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.hint { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.warn-text, .hint.warn-text { color: var(--warn); font-weight: 500; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ================= 견적 목록 행 ================= */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; }
.item .title { font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amount { text-align: right; font-size: var(--fs-md); font-weight: 700; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .amount.empty { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.item .meta { text-align: right; }

/* ================= 홈 — 대화가 첫 화면 =================
 * ChatGPT·Claude 수준으로 단정하게: 인사말 한 줄(--fs-display) + 얇은 선의 입력칸 + 작은 추천 질문 칩. 크기는 모두 토큰.
 */
.home { --home-sub: var(--text-2); display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 720px; margin: 0 auto; font-size: var(--fs-md); }
/* 홈 대화창은 남은 화면 높이를 다 씀 — 대화 전에는 그 가운데, 대화 중에는 입력칸이 맨 아래. 휴대폰은 홈에서도 아래 탭이 보이므로 탭 높이만큼 뺌 */
.home-chat { min-height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top) - 16px - var(--nav-h) - env(safe-area-inset-bottom)); }
.main:has(> #view .home-chat) { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .home-chat { min-height: calc(100dvh - var(--topbar-h) - 20px); } /* 20px = PC .main 위 여백 */
  .main:has(> #view .home-chat) { padding-bottom: 0; }
}
.home-coach { display: flex; flex-direction: column; flex: 1 1 auto; }
.home-coach > .chat { flex: 1 1 auto; }

/* 대화 영역 — 대화 전에는 화면 가운데, 대화 중에는 위에서부터 쌓이고 입력칸이 아래에 붙음 */
.chat { display: flex; flex-direction: column; gap: 16px; }
.chat:not(.is-chatting) { justify-content: center; }
.chat-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-height: var(--h-sm); }
.chat:not(.is-chatting) .chat-tools { display: none; } /* 대화 전 첫 화면은 입력칸 하나만 눈에 띄게 */
.btn-quiet {
  min-height: var(--h-sm); padding: 0 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 500;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border-color: var(--line); color: var(--text-2);
}
.btn-quiet svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-quiet:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn-quiet[aria-pressed="true"] { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }

.chat-hero { text-align: center; padding: 0 4px; }
/* 첫 화면이 열릴 때 한 번 — 인사말·입력칸·추천이 차례로 살짝 떠오름(처음부터 보이는 상태에서 시작해 깜빡임 없음).
   [새 대화]로 돌아올 때도 인사말·추천은 다시 떠오르고, 입력칸은 아래에서 미끄러져 올라옴(coach.js FLIP — 그래서 .has-morphed면 입력칸 떠오름은 끔) */
.chat:not(.is-chatting) > .chat-hero, .chat:not(.is-chatting) > .composer-dock, .chat:not(.is-chatting) > .suggest {
  animation: home-in .32s cubic-bezier(.16, 1, .3, 1) both;
}
.chat:not(.is-chatting) > .composer-dock { animation-delay: .03s; }
.chat:not(.is-chatting) > .suggest { animation-delay: .06s; }
.chat.has-morphed > .composer-dock { animation: none; }
/* 대화 시작·[새 대화] 때 사라지는 인사말·추천 질문·말풍선의 복사본(coach.js) — 제자리에서 흐려짐 */
.chat-ghost { position: fixed; z-index: 3; margin: 0; pointer-events: none; }
.chat-ghost, .chat-ghost * { animation: none !important; }
@keyframes home-in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* 새 말풍선만 살짝 떠오름(다시 그려도 앞의 말풍선은 가만히) */
.chat-log > .msg:last-child { animation: msg-in .24s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-hero h1 { font-size: var(--fs-display); font-weight: 600; line-height: 1.25; letter-spacing: -0.025em; text-wrap: balance; }
.chat-hero p { margin-top: 6px; color: var(--home-sub); font-size: var(--fs-body); text-wrap: balance; }

/* 입력칸 — 얇은 선·아주 옅은 그림자, 여러 줄, 아래 줄에 사진·마이크(그림만 있는 단추) + [보내기](주 행동이라 그림 + 글자) */
.composer-dock { display: flex; flex-direction: column; gap: 6px; }
.composer {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 8px 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -12px rgba(16, 24, 40, .14);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), 0 6px 20px -12px rgba(16, 24, 40, .14); }
.composer-input {
  display: block; width: 100%; min-height: 52px; max-height: 220px; padding: 4px 2px; resize: none; overflow-y: auto;
  border: 0; outline: none; background: transparent; color: var(--text);
  font: inherit; font-size: var(--fs-md); line-height: 1.55; letter-spacing: -0.006em;
}
@media (max-width: 899px) { .composer-input { font-size: 1rem; } } /* 휴대폰 16px 바닥 — 아이폰이 입력칸을 확대하지 않게 */
.composer-input::placeholder { color: var(--muted); opacity: 1; }
.composer .composer-input:focus-visible { outline: none; } /* 테두리는 입력칸 전체(.composer)에 */
.composer-bar { display: flex; align-items: center; gap: 6px; }
.send-btn, .mic-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h-md); padding: 0 14px;
  border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-body); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.send-btn { margin-left: auto; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); transition: background-color .12s, opacity .12s; }
.send-btn:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.send-btn svg { width: 16px; height: 16px; }
.send-btn:disabled { opacity: .4; cursor: default; }
/* 마이크·사진 — 그림만 있는 단추(--h-md 44/36, components/mic-button.js). 이름은 aria-label·title.
   듣는 중: 빨간 바탕 + 멈춤(네모) 그림 + 소리 막대로 넓어짐 — 색·그림·움직임 셋으로 알림. 홈 입력칸·견적 찾기가 같은 모양 */
.mic-btn { flex: 0 0 auto; width: var(--h-md); min-width: var(--h-md); height: var(--h-md); padding: 0; border: 1px solid transparent; background: transparent; color: var(--text-2); transition: background-color .12s, border-color .12s, color .12s, transform .12s var(--ease-out); }
.search-row .mic-btn { border-color: var(--line-strong); background: var(--surface); } /* 입력칸 옆(견적 찾기)에서는 칸과 같은 테두리 */
.mic-btn svg { width: 20px; height: 20px; display: block; }
.mic-btn:active { transform: scale(.95); }
@media (hover: hover) { .mic-btn:not([aria-pressed="true"]):hover { background: var(--surface-2); color: var(--text); } }
.mic-btn .stop-ico, .mic-btn .wave { display: none; }
.mic-btn[aria-pressed="true"] { width: auto; padding: 0 12px 0 10px; gap: 8px; background: var(--danger); border-color: var(--danger); color: var(--danger-text); }
.mic-btn[aria-pressed="true"] .mic-ico { display: none; }
.mic-btn[aria-pressed="true"] .stop-ico { display: block; }
.mic-btn[aria-pressed="true"] .wave { display: inline-flex; }
/* 듣는 중 소리 막대 — 조용히 숨 쉬듯 움직이다가 글자가 들어오면(말소리) 크게 */
.wave { align-items: center; gap: 3px; height: 18px; }
.wave i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform: scaleY(.3); animation: wave-soft 1.3s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -.25s; } .wave i:nth-child(3) { animation-delay: -.5s; }
.wave i:nth-child(4) { animation-delay: -.75s; } .wave i:nth-child(5) { animation-delay: -1s; }
.mic-btn.hearing .wave i { animation-name: wave-loud; animation-duration: .7s; }
@keyframes wave-soft { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(.55); } }
@keyframes wave-loud { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.listening.composer { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.chat-status { padding: 0 6px; font-size: var(--fs-sm); color: var(--home-sub); }
.chat-status[data-tone="listening"] { color: var(--danger); font-weight: 500; }
.chat-status[data-tone="error"] { color: var(--danger); font-weight: 500; }

/* 추천 질문 — 작은 칩 한두 줄(가운데). 누르면 바로 물음 */
.suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.suggest-chip {
  display: inline-flex; align-items: center; min-height: var(--h-sm); padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 500; line-height: 1.35; text-align: left; cursor: pointer;
  transition: border-color .12s, color .12s, background-color .12s;
}
.suggest-chip:hover { border-color: var(--line-strong); color: var(--text); }
.suggest-chip:active { background: var(--surface-2); }
/* 나에게 맞춘 추천을 받아 오는 잠깐 — 자리는 잡아 두고 비워 둠(역할 기본 글이 바뀌며 깜빡이지 않게, 1초 넘으면 기본 글) */
.suggest.is-pending { visibility: hidden; }
/* '자주 가는 곳'(맞춤형) — 이 직원이 많이 간 화면 3개. 추천 질문보다 조용하게(글자 링크), 대화가 시작되면 숨김 */
.places { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px; }
.places[hidden] { display: none; }
.places-title { color: var(--muted); font-size: var(--fs-sm); }
.places-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 100%; }
.place-chip {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--h-sm); padding: 0 6px 0 8px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.place-chip svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--muted); }
.place-chip:hover { background: var(--surface-2); color: var(--text); }
.chat:not(.is-chatting) > .places { animation: home-in .32s cubic-bezier(.16, 1, .3, 1) .08s both; }

/* 대화 중 — 말풍선이 위로 쌓이고 입력칸은 화면 아래에 붙음 */
.chat.is-chatting { gap: 12px; }
.chat.is-chatting .composer-dock { /* 좌우 끝을 흐리게(mask) — 배경 위에 네모난 띠가 보이지 않게 */
  position: sticky; bottom: 0; z-index: 5; margin-top: auto; /* 말풍선이 적어도 입력칸은 맨 아래 */
  margin-inline: -16px; padding: 18px 16px calc(12px + env(safe-area-inset-bottom)); /* .main 좌우 여백(16px)만큼만 — 더 나가면 휴대폰에서 가로로 밀림 */
  background: linear-gradient(to bottom, transparent, var(--bg) 18px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
/* 휴대폰: 아래 탭 바로 위에 붙음(아이폰 아래 막대 자리는 탭이 이미 비켜 둠) */
@media (max-width: 899px) {
  .chat.is-chatting .composer-dock { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-top: 12px; padding-bottom: 8px; }
  /* 화면 키보드가 열림 — 아래 탭이 숨고 입력칸은 키보드 바로 위(아이폰은 --kb만큼 올림) */
  :root.kb-open .chat.is-chatting .composer-dock { bottom: var(--kb); padding-bottom: 8px; }
}
/* 휴대폰 대화 중 — 입력칸을 낮게(한 줄 + 단추 줄) 해서 말풍선 칸을 넓게 */
@media (max-width: 599px) {
  .chat.is-chatting .composer { padding: 6px 6px 6px 10px; gap: 2px; }
  .chat.is-chatting .composer-input { min-height: 40px; padding: 8px 2px 4px; }
  .chat.is-chatting .composer-bar > .send-btn { flex: 0 0 auto; margin-left: auto; padding: 0 12px; }
}
.chat.is-chatting .chat-tools { /* 대화가 길어져도 [새 대화]가 위에 남게 */
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 4;
  margin-inline: -16px; padding: 6px 16px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.chat.is-chatting .composer-input { min-height: 44px; }
/* 휴대폰 첫 화면 — 인사말·입력칸·추천 질문이 한 화면(360×780)에 */
@media (max-width: 599px) {
  .chat { gap: 14px; }
  .chat-hero p { margin-top: 4px; }
}
.chat-log { display: flex; flex-direction: column; gap: 16px; }
.chat-log:empty { display: none; }
.chat-log > :last-child { scroll-margin-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 64px); }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 88%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.ai { align-self: flex-start; }
.msg-who { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.coach-mark {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .625rem; letter-spacing: .02em; /* 'AI' 표시는 장식(aria-hidden) — 옆 'AI코디' 글이 이름 */
}
.bubble { padding: 10px 14px; border-radius: var(--radius-lg); font-size: var(--fs-md); line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
/* 내 말은 옅은 남색 판 + 먹색 글자(남색 덩어리는 주 단추에만), AI코디 답은 흰 판 + 얇은 선 */
.msg.user .bubble { background: var(--accent-weak); color: var(--text); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.ai .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble ul { margin: 4px 0 0; padding-left: 20px; }
.msg .cards { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.msg .cards .card { padding: 10px 14px; }
.msg .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 12px 16px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.typing-text:not(:empty) { margin-left: 8px; color: var(--home-sub); font-size: var(--fs-sm); }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--danger-weak); } 50% { box-shadow: 0 0 0 6px var(--danger-weak); } }
.fb { display: flex; gap: 4px; }
.fb-btn { /* 답 아래 작은 단추([AI에게 자세히 묻기]) — 모양은 조용하게(답보다 눈에 띄지 않게) */
  min-height: var(--h-sm); min-width: var(--h-sm); padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
.fb { margin-top: -4px; margin-left: -8px; }
.fb-btn:active { background: var(--surface-2); }
.fb-btn:hover { color: var(--text); background: var(--surface-2); }
.fb-done { font-size: var(--fs-sm); color: var(--muted); }
/* 입력 돕기 — 견적 작성 화면에 채운 칸·바꾼 값(답 아래 한 줄, components/coach.js) */
.fill-note { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }

/* 사진 → 견적 초안 — [사진 올리기]·미리보기·확인 카드 (components/photo-quote.js). 업무 부품(.card·.btn·.input) 크기 그대로 */
/* 사진·마이크가 그림만이라 휴대폰에서도 세 단추가 한 줄([사진][마이크] … [보내기]) */
.composer.dropping { border-color: var(--accent); border-style: dashed; box-shadow: 0 0 0 3px var(--accent-weak); }
.composer-attach { padding: 2px 0 4px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.attach-chip img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); flex: 0 0 auto; background: #fff; }
.attach-name { min-width: 0; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-x {
  flex: 0 0 auto; width: var(--h-sm); height: var(--h-sm); border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-body); cursor: pointer;
}
.photo-file {
  display: inline-grid; place-items: center; width: 56px; height: 56px; flex: 0 0 auto; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted); font-weight: 600; font-size: var(--fs-sm); border: 1px solid var(--line);
}
.photo-bubble { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.photo-thumb { display: block; max-width: 200px; max-height: 200px; border-radius: var(--radius); background: #fff; }

/* 확인 카드 */
.msg.msg-wide { max-width: 100%; width: 100%; }
.ocr-card {
  display: flex; flex-direction: column; gap: 12px; padding: var(--pad-card); font-size: var(--fs-body);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ocr-title { font-size: var(--fs-lg); font-weight: 600; }
.ocr-sub { margin-top: -6px; font-size: var(--fs-sm); }
.ocr-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 700px) { .ocr-head { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ocr-head .wide, .ocr-head .ocr-cust-box { grid-column: 1 / -1; } }
.ocr-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ocr-l { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.ocr-card textarea.input { min-height: 64px; }
.ocr-card select.input { padding-right: 8px; }
/* 확인이 필요한 칸 — 흑백 인쇄·색약에도 보이게 점선 테두리 + 글자 안내(색만으로 알리지 않음) */
.ocr-f.unsure .input, .ocr-procs.unsure { border: 1.5px dashed var(--warn); background: var(--warn-weak); }
.ocr-check.unsure, .ocr-procs.unsure { border-radius: var(--radius-sm); }
.ocr-need { color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.ocr-cust { font-size: var(--fs-body); }
.ocr-cust.ok { color: var(--ok); }
.ocr-cust.ok > svg, .ocr-done > svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; stroke-width: 2.2; }
.ocr-cust.need { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-weak); color: var(--text); }
.ocr-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.link-btn {
  display: inline-flex; align-items: center; min-height: var(--h-sm); padding: 0 4px; border: 0; background: none;
  color: var(--accent); font: inherit; font-size: var(--fs-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.ocr-items { display: flex; flex-direction: column; gap: 10px; }
.ocr-item { margin: 0; padding: 10px 12px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.ocr-item.has-prob { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.ocr-item legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 600; font-size: var(--fs-md); }
.ocr-no {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: var(--radius-xs);
  background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 600;
}
.ocr-raw { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ocr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ocr-grid .wide { grid-column: 1 / -1; }
@media (min-width: 900px) { .ocr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ocr-check { flex-direction: row; align-items: center; gap: 8px; min-height: var(--h-input); align-self: end; padding: 0 6px; cursor: pointer; }
.ocr-check input, .ocr-proc input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.ocr-check > span:not(.ocr-need) { font-weight: 500; }
.ocr-procs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding: 4px; }
.ocr-procs .ocr-l { flex: 0 0 100%; }
.ocr-proc {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-sm); padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: var(--fs-sm);
}
.ocr-proc:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-weak); font-weight: 600; }
.ocr-manual { margin-top: 10px; }
.ocr-calc { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ocr-amt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.ocr-amt strong { font-size: var(--fs-md); }
.ocr-amt.none { color: var(--warn); font-weight: 500; }
.ocr-probs { margin: 6px 0 0; padding-left: 20px; color: var(--warn); font-weight: 500; font-size: var(--fs-sm); }
.ocr-probs li::marker { content: '! '; }
.ocr-assume { margin-top: 4px; color: var(--muted); font-size: var(--fs-sm); }
.ocr-del { margin-top: 2px; color: var(--muted); }
.ocr-add { align-self: flex-start; }
.ocr-sum { display: grid; gap: 4px; margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.ocr-sum > div { display: flex; justify-content: space-between; gap: 12px; }
.ocr-sum dt { color: var(--muted); }
.ocr-sum dd { margin: 0; font-weight: 600; }
.ocr-sum .all { padding-top: 6px; border-top: 1px solid var(--line); font-size: var(--fs-lg); }
.ocr-sum .all dt { color: var(--text); font-weight: 600; }
.ocr-sum .all dd { font-weight: 700; }
.ocr-warn { margin-top: 8px; color: var(--warn); font-weight: 600; }
.ocr-status:empty { display: none; }
.ocr-status { font-weight: 500; }
.ocr-status[data-tone="error"] { color: var(--danger); }
.ocr-actions { display: flex; flex-direction: column; gap: 8px; }
.ocr-actions .btn { min-height: var(--h-lg); font-size: var(--fs-md); font-weight: 600; }
.ocr-actions .ocr-note { margin-top: -2px; font-size: var(--fs-sm); }
.ocr-actions .ocr-again { min-height: var(--h-md); font-size: var(--fs-body); font-weight: 500; }
.ocr-done { color: var(--ok); font-weight: 600; }
.ocr-card.is-done .input { background: var(--surface-2); }
.window.extra .what { grid-column: 2 / -1; }

/* 기능 바로가기 — AI코디 권한이 없는 역할의 홈(대화창 대신). 이름 + 설명 한 줄 */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature {
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none;
}
.feature svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--accent); }
.feature > span { display: flex; flex-direction: column; min-width: 0; }
.feature strong { font-size: var(--fs-body); font-weight: 600; line-height: 1.35; }
.feature-sub { color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; }
.feature:hover { border-color: var(--line-strong); }

/* ================= 견적 상세 ================= */
.back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; min-height: var(--h-sm); color: var(--muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.back:hover { color: var(--text); }
.detail-head { display: flex; flex-direction: column; gap: 6px; }
.detail-head .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.detail-actions { display: flex; flex-direction: column; gap: 12px; }
/* PC: 버튼 세 개가 1,000px 넘게 늘어나지 않게 한 줄로 나란히(주 버튼이 앞) */
@media (min-width: 900px) { .detail-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.figures div { min-width: 0; }
.figures dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; text-transform: var(--title-transform); letter-spacing: var(--title-spacing); }
.figures dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 700; font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.figures dd small { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); font-family: var(--font); }
.window { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; }
.window .no { grid-row: span 2; display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .85rem; font-family: var(--font-num); }
.window .what { font-weight: 650; }
.window .size { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.window .spec { grid-column: 2 / -1; color: var(--muted); font-size: .84rem; }
.note-card { white-space: pre-wrap; }

/* ================= 단계 탭(세그먼트) ================= */
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: calc(var(--radius-sm) + 2px); background: var(--surface-2); border: 1px solid var(--line); }
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h-sm); padding: 0 8px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2);
  font: inherit; font-size: var(--fs-body); font-weight: 500; cursor: pointer; flex-wrap: wrap; min-width: 0; padding-block: 4px; line-height: 1.3;
}
.seg button[aria-selected="true"] { background: var(--seg-on, var(--surface)); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 0 0 1px var(--line); }
.seg .count { flex: 0 0 auto; min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--line); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg button[aria-selected="true"] .count { background: var(--accent); color: var(--accent-text); }
.seg .count.danger, .seg button[aria-selected="true"] .count.danger { background: var(--danger-weak); color: var(--danger); }

/* ================= 생산 — 목록·생산지시서·인쇄 모양은 production.css(화면이 ensureCss로 붙임) ================= */
/* 생산 단계 단추(생산 목록·생산지시서·견적 상세) — 두 번 누르기 대기 색만 */
.stage-btn.confirming { background: var(--warn); border-color: var(--warn); color: var(--surface); } /* 어두운 화면에서는 밝은 주황 바탕 → 어두운 글자 */

.print-only { display: none; }
@media print {
  .topbar, .nav, .back, .banner, .toast, .seg, .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #999; break-inside: avoid; }
}

/* ================= 발주·재고 ================= */
.po { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.po .title { font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po .sub { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-sm); }
.po-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
progress { flex: 1; height: 6px; appearance: none; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.stock-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; }
.stock-row .what { display: flex; flex-direction: column; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.stock-row .what small { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.stock-row strong { font-size: var(--fs-md); font-weight: 700; text-align: right; }
.stock-row strong small { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.stock-row .badge { grid-column: 1 / -1; justify-self: start; }
.stock-row.low { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.recv-tools h2 { flex: 1; font-size: var(--fs-md); }
.pay summary { flex-wrap: wrap; }
.pay summary .muted { margin-left: 4px; }
.row-gap .grow { flex: 1; min-width: 0; }
.recv-list { display: flex; flex-direction: column; }
.recv-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; align-items: center; padding: 10px 0; }
.recv-row + .recv-row { border-top: 1px solid var(--line); }
.recv-row .what { display: flex; flex-direction: column; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.recv-row .what small { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.recv-row .input { text-align: right; }
.recv-row.done .what { color: var(--muted); } /* 흐리게(opacity) 하면 글자 대비가 기준 미달 — 색으로만 */
.recv-row .badge { justify-self: end; }

/* ================= 알림 띠(토스트) ================= */
/* components/toast.js — 아래 탭 바로 위에 본문 크기로, 아래에서 살짝 올라와 잠깐 뒤 내려감. 키보드가 열려 있으면 키보드 위 */
.toast {
  position: fixed; left: 12px; right: 12px; z-index: 70; width: fit-content; margin: 0 auto; /* left:50%이면 폭이 화면 절반으로 줄어 글자가 접힘 */
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; max-width: 520px; min-height: 48px; padding: 6px 6px 6px 12px;
  border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .08); background: var(--toast-bg); color: var(--toast-text);
  font-size: var(--fs-body); font-weight: 500; line-height: 1.4; box-shadow: 0 12px 28px -10px rgba(16, 24, 40, .45);
  animation: toast-in .24s var(--ease-out) both;
}
.toast:not(:has(.toast-act)) { padding-right: 16px; }
.toast[data-tone="error"] { background: var(--danger); color: var(--danger-text); border-color: transparent; }
.toast.is-leaving { animation: toast-out .18s ease-in forwards; }
.toast-ico { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; background: var(--toast-ok); color: var(--toast-text); }
.toast[data-tone="error"] .toast-ico { background: rgba(255, 255, 255, .22); color: inherit; }
.toast-ico svg { width: 14px; height: 14px; stroke-width: 2.6; } /* core/icons.js 아이콘을 굵게 */
.toast-text { min-width: 0; }
.toast-act {
  flex: 0 0 auto; margin-left: auto; min-height: var(--h-sm); padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .12); color: inherit; font: inherit; font-size: var(--fs-body); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.toast-act:active { background: rgba(255, 255, 255, .26); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }
@media (max-width: 899px) { :root.kb-open .toast { bottom: calc(var(--kb) + 12px); } }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ================= 확인창 — 아래에서 올라오는 시트(components/sheet.js) =================
 * 휴대폰: 화면 아래 판, 큰 단추 두 줄([지우기] 위, [그만두기] 아래 — 엄지가 닿는 곳). PC·태블릿: 화면 가운데 창, 단추 나란히 */
dialog.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 0; background: transparent; color: var(--text); overflow: visible;
}
dialog.sheet::backdrop { background: rgba(16, 24, 40, .5); animation: sheet-fade .22s ease-out both; }
.sheet-panel {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface); box-shadow: 0 -12px 40px rgba(16, 24, 40, .2);
  font-size: var(--fs-body); line-height: var(--lh); animation: sheet-up .26s cubic-bezier(.2, .9, .3, 1) both;
}
.sheet-grip { align-self: center; width: 36px; height: 4px; margin-bottom: 10px; border-radius: 2px; background: var(--line); }
.sheet-title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.35; }
.sheet-msg { color: var(--text-2); font-size: var(--fs-body); overflow-wrap: anywhere; }
.sheet-btns { display: grid; gap: 8px; margin-top: 14px; }
.sheet-btns .btn { min-height: var(--h-md); font-weight: 500; }
.sheet-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-text); }
.sheet-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: color-mix(in srgb, var(--danger) 88%, #000); }
dialog.sheet.is-leaving .sheet-panel { animation: sheet-down .17s ease-in forwards; }
dialog.sheet.is-leaving::backdrop { animation: sheet-fade-out .17s ease-in forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes sheet-fade-out { to { opacity: 0; } }
@media (min-width: 600px) {
  dialog.sheet { margin: auto; max-width: 480px; }
  .sheet-panel { border-radius: var(--radius-lg); padding: 20px 20px 16px; animation-name: sheet-pop; }
  .sheet-grip { display: none; }
  .sheet-btns { display: flex; justify-content: flex-end; } /* PC·태블릿: 오른쪽에 [그만두기] [확정] 나란히 */
  .sheet-btns .sheet-ok { order: 2; }
  dialog.sheet.is-leaving .sheet-panel { animation: sheet-fade-out .15s ease-in forwards; }
}
@keyframes sheet-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
/* 사유 입력칸(confirmSheet reason) — 확정 단추 위. 휴대폰 키보드가 열리면 판을 키보드 위로 */
.sheet-reason { margin-top: 6px; }
.sheet-reason .input { min-height: 80px; }
@media (max-width: 899px) { :root.kb-open dialog.sheet { margin-bottom: var(--kb); max-height: calc(100dvh - var(--kb) - 8px); } }

/* ================= '앱으로 설치' 안내 창(components/app-install-guide.js) — 확인창과 같은 판 =================
 * 아이폰 사파리 그림: 그림 높이가 단계마다 달라도 창 크기가 흔들리지 않게 같은 틀(4:3). 그림은 밝은 아이폰 화면이라 다크 모드에서도 틀은 밝게 두지 않고 테두리만 */
.app-guide .sheet-panel { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.ai-shot { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; margin: 8px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.ai-shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ai-step { margin-top: 10px; font-size: var(--fs-md); word-break: keep-all; }
.ai-count { margin-bottom: 2px; color: var(--accent); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-hint { margin-top: 6px; color: var(--text-2); font-size: var(--fs-sm); word-break: keep-all; }
.ai-center { text-align: center; }
.ai-pair { grid-auto-flow: column; grid-auto-columns: 1fr; }
.ai-steps { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 0; padding: 14px 16px 14px 34px; border-radius: var(--radius); background: var(--surface-2); word-break: keep-all; }
.ai-steps li::marker { color: var(--accent); font-weight: 700; }
@media (min-width: 600px) { .ai-pair .btn { min-width: 96px; } }
[data-contrast="high"] :is(.ai-hint, .app-guide .sheet-msg) { color: var(--text); }

/* ================= 화면 전환(core/router.js) — 짧게(0.2초 안팎), 움직임 줄이기 기기는 없음 ================= */
.view-host[data-enter="tab"] { animation: view-tab .2s var(--ease-out) backwards; }
.view-host[data-enter="forward"] { animation: view-forward .22s var(--ease-out) backwards; }
.view-host[data-enter="back"] { animation: view-back .22s var(--ease-out) backwards; }
@keyframes view-tab { from { opacity: 0; transform: translateY(6px); } }
@keyframes view-forward { from { opacity: 0; transform: translateX(28px); } }
@keyframes view-back { from { opacity: 0; transform: translateX(-28px); } }


/* ================= 폼·메뉴·계정 ================= */
.narrow { max-width: 640px; margin-inline: auto; width: 100%; } /* 목록 없는 한 줄 화면(더보기·비밀번호·도움말·백업) — PC는 왼쪽 시작선(아래 'PC 셸 다듬기' ②) */
.readable { max-width: 960px; margin-inline: auto; width: 100%; } /* (2026-10-31 폭 점검 뒤 화면에서는 안 씀 — 목록의 하위 화면은 목록과 같은 넓은 폭) */
.narrow.chats { max-width: 720px; } /* 지난 대화 — 홈 대화와 같은 720 가운데(홈 ↔ 지난 대화를 오갈 때 폭·정렬이 같게) */
.form { display: flex; flex-direction: column; gap: 14px; }
details > .form { margin-top: 14px; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap .input { flex: 1; min-width: 0; }
.row-gap > .btn { flex: 0 0 auto; }
select.input { appearance: auto; padding-right: 8px; }
details > summary { cursor: pointer; min-height: var(--h-sm); display: flex; align-items: center; gap: 8px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details[open] > summary::after { transform: rotate(-135deg); }
.btn.confirming { background: var(--warn); border-color: var(--warn); color: var(--surface); }
/* 한 번 누른 단추는 마우스가 그 위에 있는 채로 보임 — hover에도 황토 바탕 그대로(조금 진하게). 주 단추·글자 단추 hover보다 세게 */
.btn.confirming:hover:not(:disabled) { background: color-mix(in srgb, var(--warn) 88%, #000); border-color: color-mix(in srgb, var(--warn) 88%, #000); }
.btn-danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

.menu { padding: 4px 0; }
.menu-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; color: inherit; text-decoration: none; transition: background-color .12s; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-row strong { font-weight: 500; }
.menu-row .chev { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.menu-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.help h2 { margin-bottom: 8px; }
.help-scenarios-link { display: flex; flex-direction: column; gap: 4px; }
.help-scenarios-link strong { display: block; font-size: var(--fs-md); font-weight: 600; }
.help ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.help li { line-height: 1.6; }
.help .help-act { margin-top: 14px; } /* 사용 안내 '앱으로 설치' 단추 */
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; cursor: pointer; }
.switch-row + .switch-row, .menu-row + .switch-row { border-top: 1px solid var(--line); } /* 더보기 → 이 기기: [앱으로 설치] 줄 아래 스위치 */
.switch-row > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.switch-row input { appearance: none; flex: 0 0 auto; width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(16px); }
.switch-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.user { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.user.inactive { background: var(--surface-2); }
.user.inactive strong { color: var(--muted); }
.user-head { display: flex; align-items: flex-start; gap: 8px; }
.user-head > div { flex: 1; min-width: 0; }
.user summary { font-size: var(--fs-sm); font-weight: 500; color: var(--accent); min-height: var(--h-sm); }
.user-edit { display: flex; flex-direction: column; gap: 16px; padding: 8px 0 10px; }

/* ================= 숫자 요약(통계) ================= */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0 0 8px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats div { min-width: 0; }
.stats dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.stats dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stats dd.stat-sub, .stats-3 > :first-child dd.stat-sub { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.log { padding: 4px 16px; }
.log summary { flex-wrap: wrap; padding: 8px 0; gap: 2px 8px; }
.log-q { font-weight: 600; flex: 1 1 100%; }
.log-meta { flex: 1; }
.log-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }

/* ================= 미수금·원장 ================= */
/* 휴대폰: 합계 한 줄 크게 + 아래 두 칸 / 넓으면 세 칸 — 금액이 '원'에서 줄바꿈되지 않게 */
.stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-3 > :first-child { grid-column: 1 / -1; }
.stats-3 > :first-child dd { font-size: var(--fs-num); }
.stats-3 dd { white-space: nowrap; }
@media (min-width: 640px) { .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stats-3 > :first-child { grid-column: auto; } .stats-3 > :first-child dd { font-size: var(--fs-lg); } }
.stats dd.danger, .num.danger { color: var(--danger); }
.item .meta { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.item .amount.neg { color: var(--ok); }
.ledger-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; align-items: baseline; }
.ledger-row .date { color: var(--muted); font-size: .85rem; }
.ledger-row .what { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.ledger-row .what .small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-row .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.ledger-row.pay .amt { color: var(--ok); }
.ledger-row .bal { grid-column: 3; text-align: right; white-space: nowrap; }
.figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ================= 경영 요약 그래프·표 ================= */
.chart-card { display: flex; flex-direction: column; gap: 8px; }
.chart-card h2 { font-size: var(--fs-md); }
.readout { display: flex; flex-direction: column; min-height: 46px; }
.readout strong { font-size: var(--fs-lg); }
.bars { display: block; overflow: visible; max-width: 100%; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .tick, .bars .mlabel { fill: var(--muted); font-size: 10px; font-family: var(--font-num); }
.bars .hit { fill: transparent; cursor: pointer; }
.bars .mark { fill: var(--chart-1); opacity: .55; transition: opacity .15s; }
.bars .bar.on .mark, .bars .bar:hover .mark { opacity: 1; }
.bars .mlabel.on { fill: var(--text); font-weight: 700; }
.bars .bar:focus { outline: none; }
.bars .bar:focus-visible .hit { stroke: var(--accent); stroke-width: 2; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl thead th:first-child { text-align: left; }
.tbl thead th { color: var(--muted); font-weight: 500; font-size: var(--fs-sm); }

/* ================= 진행 기록·변경 기록 ================= */
.timeline, .audit-list { list-style: none; margin: 0; padding: 6px 16px; }
.tl { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 10px 0 10px 18px; }
.tl + .tl { border-top: 1px solid var(--line); }
.tl::before { content: ''; position: absolute; left: 0; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tl-status::before { background: var(--accent); }
.tl:first-child.tl-status::before { box-shadow: 0 0 0 4px var(--accent-weak); }
.audit-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 10px 0; align-items: baseline; }
.audit-row + .audit-row { border-top: 1px solid var(--line); }
.audit-row .when { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.audit-row .what { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.audit-row .what small { color: var(--muted); font-size: var(--fs-sm); }
.audit-row a { text-decoration: none; }

/* ================= 로그인·오프라인 ================= */
/* 공용 카드 모양(로그인·오프라인 화면이 같이 씀). 로그인에만 있는 것(비밀번호 보기·안내 줄·2단계 휴대폰 인증)은 login.css */
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
/* 휴대폰은 카드 테두리 없이 화면 전체(앱 첫 화면처럼) */
@media (max-width: 599px) {
  .login-page {
    place-items: start stretch; background: var(--surface);
    padding: calc(env(safe-area-inset-top) + 40px) max(22px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 28px) max(22px, env(safe-area-inset-left));
  }
  .login-page .login-card { max-width: none; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .login-page .login-card .logo { height: 26px; margin-bottom: 32px; }
}
/* 단정한 카드 하나: 로고 · 제목 · 입력 · 주 단추(확정 높이) */
.login-card { width: 100%; max-width: 400px; padding: 32px 28px 28px; font-size: var(--fs-body); }
@media (min-width: 600px) { .login-page { background: var(--bg); } .login-card { box-shadow: var(--shadow-pop); } }
.login-card .logo { height: 28px; max-width: 100%; margin-bottom: 24px; } /* 회사 CI(login.html 안 SVG) — 모양·색은 .ci */
.login-card h1 { font-size: var(--fs-title); font-weight: 600; }
.login-card form { margin-top: 24px; }
.login-card .stack { gap: 14px; }
.login-card .btn-primary { min-height: var(--h-lg); font-size: var(--fs-md); font-weight: 600; margin-top: 4px; }

/* ================= 디자인 시안 선택(더보기) ================= */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-pick button { min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.theme-pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }
.theme-pick strong { display: block; }

/* ================= 테마별 모양 차이 ================= */

/* B. 인더스트리얼 */
[data-theme="b"] .topbar { --ci: #ffffff; } /* 남색 막대 위 흰 CI */
[data-theme="b"] .top-gear { color: #fff; }
[data-theme="b"] .top-gear:active, [data-theme="b"] .top-gear[aria-expanded="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
@media (hover: hover) { [data-theme="b"] .top-gear:hover { background: rgba(255, 255, 255, .14); color: #fff; } }
[data-theme="b"] .brand .erp-tag { background: rgba(255, 255, 255, .14); color: #fff; }
[data-theme="b"] .topbar { border-bottom: 0; }
[data-theme="b"] .card { border-color: var(--line); }
[data-theme="b"] .section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); order: 1; }
[data-theme="b"] .section-title a { order: 2; }
[data-theme="b"] .chat-hero h1, [data-theme="b"] .page-title h1 { text-transform: none; }
[data-theme="b"] .coach-mark { border-radius: var(--radius-sm); font-family: 'Barlow Condensed', var(--font); font-size: var(--fs-sm); }
[data-theme="b"] .badge { font-family: var(--font); letter-spacing: .02em; }
[data-theme="b"] .figures dd { font-size: var(--fs-num); font-weight: 600; }
[data-theme="b"] .window .size { font-size: var(--fs-lg); font-weight: 600; }
[data-theme="b"] .item .amount { font-size: var(--fs-lg); font-weight: 600; }
[data-theme="b"] .window .no { background: var(--accent); color: #fff; }
[data-theme="b"] .nav a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--accent); }
@media (min-width: 900px) { [data-theme="b"] .nav a[aria-current="page"] { box-shadow: none; } }

/* C. 대화형 — 둥글고 가벼운 틀(홈은 모든 시안이 대화형 첫 화면) */
[data-theme="c"] .topbar { border-bottom-color: transparent; }
[data-theme="c"] .nav { border-top-color: transparent; box-shadow: 0 -1px 0 var(--line); }
[data-theme="c"] .card { border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .skeleton, .typing i, .search-row .icon-btn[aria-pressed="true"] { animation: none; }
  .wave i { animation: none; transform: scaleY(.6); } /* 듣는 중은 멈춤 그림과 빨간 바탕으로 */
  .mic-btn { transition: none; } .mic-btn:active { transform: none; }
  .composer, .suggest-chip, .app.nav-ready { transition: none; }
  .view-host[data-enter], .toast, .toast.is-leaving, .sheet-panel, dialog.sheet::backdrop, dialog.sheet.is-leaving .sheet-panel { animation: none !important; }
  .btn, .nav a svg, .top-back, .chat-row, .chat-open, .chat-more { transition: none; }
  .btn:active:not(:disabled), .nav a:active svg { transform: none; }
  .chat > *, .chat-log > .msg:last-child { animation: none !important; }
  .suggest-chip:active { transform: none; }
  .card-link { transition: none; }
  .card-link:active { transform: none; }
  .bars .mark, details > summary::after, .switch-row input, .switch-row input::after { transition: none; }
}

/* ================= 공지사항·출퇴근 ================= */
.nav a { position: relative; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--danger); color: var(--danger-text);
  font-size: .6875rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
@media (max-width: 899px) { .nav a .nav-badge { position: absolute; top: 5px; left: calc(50% + 6px); } }
@media (min-width: 900px) {
  .nav a .nav-badge { margin-left: auto; }
  .nav a[data-path="/more"] .nav-badge { display: none; } /* PC는 '공지사항' 메뉴에 보임 */
}
.menu-row strong .nav-badge { margin-left: 6px; vertical-align: 2px; }
.big-menu .menu-row { min-height: 56px; }
.big-menu .menu-row strong { font-size: var(--fs-md); }

/* ================= 화면 뿌리 .big-ui — 이제 '큰 글자'가 아니라 일반 기준(2026-10-31) =================
 * 이름은 그대로 둔다(화면 30여 곳이 뿌리에 씀). 하는 일: 본문 글자·줄 간격을 기준값으로 맞추고 h1을 화면 제목 크기로.
 * 단추·입력칸·칩·배지 크기는 이제 공용 부품(.btn·.input·.chip·.badge) 자체가 기준값 — .big-ui 안팎이 같다.
 * 새 화면은 .big-ui 없이 써도 되지만, 뿌리에 붙이면 화면별 CSS가 덧칠한 옛 큰 크기보다 아래 규칙이 이긴다(세기 0,1,1).
 * 단추 높이: 작은 .btn-sm(--h-sm 44/32) · 기본 .btn(--h-md 44/36) · 확정 .btn-commit(--h-lg 48/40). 입력칸 --h-input(44/36).
 * 글자: 본문 --fs-body(15/14), 보조(.small·.hint·숫자 칸 이름) --fs-sm(13) — 그보다 작은 글은 배지·아래 탭 이름(--fs-xs 12)뿐. */
.big-ui { font-size: var(--fs-body); line-height: var(--lh); }
.big-ui h1 { font-size: var(--fs-title); }
.big-ui .section-title h2, .big-ui .card > h2 { font-size: var(--fs-md); }
.big-ui .btn { min-height: var(--h-md); padding: 0 14px; font-size: var(--fs-body); }
.big-ui .btn.btn-sm { min-height: var(--h-sm); padding: 0 10px; font-size: var(--fs-sm); }
.big-ui .btn.btn-commit { min-height: var(--h-lg); padding: 0 18px; font-size: var(--fs-md); font-weight: 600; }
.big-ui .input { min-height: var(--h-input); font-size: var(--fs-input); }
.big-ui :is(.small, .hint, .stats dt, .figures dt, .stat-sub) { font-size: var(--fs-sm); }
.big-ui .badge { font-size: var(--fs-xs); }
.big-btn { min-height: var(--h-md); } /* 옛 이름 — .btn과 같음 */
/* 불러오기 실패(components/state.js errorState) — 쉬운 말 한 줄 + [다시 불러오기] */
.state-error .error-text { margin: 0 0 12px; }

/* ================= 아래 고정 실행 막대 .dock — 양식·작성 화면의 '합계 + 확정 단추' (DESIGN.md '아래 고정 실행 막대') =================
 * <div class="dock" role="region" aria-label="합계와 저장">
 *   <span class="dock-sum"><span class="dock-label">합계금액</span><strong class="dock-amount num">1,234,000원</strong></span>
 *   <button class="btn btn-primary btn-commit dock-go" type="button">저장</button>
 * </div>
 * - 휴대폰: 아래 탭 바로 위에 붙어 스크롤해도 늘 보임(sticky, 아이폰 홈 표시줄 자리 포함). PC: 화면 아래 12px.
 * - 화면 키보드가 열리면(main.js :root.kb-open, 가린 높이 --kb) 키보드 바로 위로 따라 올라감.
 *   글 쓰는 동안 막대가 칸을 가리면 안 되는 화면은 .dock-yield — 키보드가 열리면 제자리(static)로 내려앉음.
 * - 막대 안 메시지 줄(입력 오류): .dock-msg(전체 폭). 단추 둘이면 .dock-go를 두 개(같은 칸에 나란히).
 * - 인쇄에는 안 나옴. 또렷한 화면은 선 2px. */
.dock {
  position: sticky; z-index: 12; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px;
  margin: 8px -4px 0; padding: 8px 8px 8px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-dock);
}
.dock-sum { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dock-label { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-amount { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dock-msg { grid-column: 1 / -1; margin: 0; }
.dock .dock-go { min-height: var(--h-lg); padding: 0 18px; font-size: var(--fs-md); font-weight: 600; }
@media (max-width: 899px) {
  :root.kb-open .dock { bottom: calc(var(--kb) + 4px); padding-block: 6px; }
  :root.kb-open .dock-yield { position: static; box-shadow: none; }
}
@media (min-width: 900px) { .dock { bottom: 12px; padding: 10px 10px 10px 16px; } }
[data-contrast="high"] .dock { border-width: 2px; border-color: var(--line); }
@media print { .dock { display: none !important; } }

/* PC(900px 이상) 목록 — 카드 여러 장 대신 한 판 안의 줄(줄 사이 1px 선, DESIGN '목록 줄 표준'). 휴대폰은 카드 그대로.
 * 쓰는 곳: 전자결재·휴가·공지·발주 목록(<div class="list pc-rows">) */
@media (min-width: 900px) {
  .pc-rows:has(> .card) { gap: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .pc-rows > .card { border: 0; border-radius: 0; box-shadow: none; padding: var(--pad-row); }
  .pc-rows > .card + .card { border-top: 1px solid var(--line); }
  .pc-rows > a.card-link { transition: background-color .12s; }
  .pc-rows > a.card-link:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
}

/* 공지 — 목록은 넓게(PC 줄 목록), 본문 읽기는 .readable */
.nt-card { display: flex; flex-direction: column; gap: 4px; }
.nt-card.pinned { background: color-mix(in srgb, var(--warn-weak) 55%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.pc-rows > .nt-card.pinned { background: color-mix(in srgb, var(--warn-weak) 45%, var(--surface)); }
.nt-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.nt-tags:empty { display: none; }
.nt-title { font-size: var(--fs-md); font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.nt-card.unread .nt-title { font-weight: 600; }
.nt-preview { color: var(--text-2); font-size: var(--fs-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.nt-meta { color: var(--muted); font-size: var(--fs-sm); }
@media (min-width: 900px) {
  /* PC 한 줄: [표시] 제목 ……… 쓴 사람·날짜 / 미리보기는 한 줄 */
  .pc-rows > .nt-card { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; }
  .pc-rows > .nt-card .nt-tags { grid-column: 1; grid-row: 1; align-self: center; }
  .pc-rows > .nt-card .nt-tags:empty { display: block; }
  .pc-rows > .nt-card .nt-title { grid-column: 2; grid-row: 1; font-size: var(--fs-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pc-rows > .nt-card .nt-meta { grid-column: 3; grid-row: 1; white-space: nowrap; }
  .pc-rows > .nt-card .nt-preview { grid-column: 2 / -1; grid-row: 2; -webkit-line-clamp: 1; line-clamp: 1; }
}
.nt-detail { display: flex; flex-direction: column; gap: 8px; padding: var(--pad-card); }
@media (min-width: 640px) { .nt-detail { padding: 28px 32px; } }
.nt-h { font-size: var(--fs-title); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.nt-body { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.nt-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .nt-actions { grid-template-columns: repeat(2, max-content); justify-content: end; } }
.nt-textarea { min-height: 220px; resize: vertical; line-height: 1.65; }

/* 출퇴근 — 내 상태 카드와 출근·퇴근 단추(그 화면의 단 하나 동작이라 조금 크게: 64 휴대폰 / 56 PC) */
.att-me { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px var(--pad-card); text-align: center; }
.att-date { margin: 0; font-weight: 500; color: var(--text-2); }
.att-date strong { font-size: var(--fs-lg); font-weight: 700; color: var(--text); margin-left: 2px; }
.att-state { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.att-big { width: 100%; max-width: 420px; min-height: 64px; border-radius: var(--radius-sm); font-size: var(--fs-lg); font-weight: 600; }
.big-ui .att-big { min-height: 64px; font-size: var(--fs-lg); font-weight: 600; }
@media (min-width: 900px) and (pointer: fine) { .att-big, .big-ui .att-big { min-height: 56px; } }
.att-me .att-std { margin: 0; font-size: var(--fs-sm); }
/* PC(관리자): [내 상태 | 오늘 직원 현황], [월 요약 | 내 기록] 두 칸 */
@media (min-width: 1100px) {
  .att-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
}

/* 달 넘기기·합계 */
.att-month { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; text-align: center; margin-top: 8px; }
.att-month strong { font-size: var(--fs-lg); font-weight: 600; }
.big-ui .att-month .btn { padding: 0 12px; }
@media (max-width: 479px) { .att-month { grid-template-columns: repeat(2, minmax(0, 1fr)); } .att-month strong { grid-column: 1 / -1; grid-row: 1; } } /* 휴대폰 — 달 이름 한 줄, 단추 반씩 */
.att-total { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
.att-total div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.att-total dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.att-total dd { margin: 0; font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.att-total dd.warn { color: var(--warn); }
@media (max-width: 479px) { .att-total { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 날짜별 한 줄 — 휴대폰: 날짜·근무시간 / 출퇴근 시각 / 표시, 넓으면 한 줄 */
.att-days, .att-board { padding: 2px 16px; }
.att-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d h" "t t" "f f" "x x"; gap: 2px 14px; align-items: center; padding: 10px 0; }
.att-day + .att-day, .att-fix + .att-day { border-top: 1px solid var(--line); }
.att-d { grid-area: d; font-weight: 600; white-space: nowrap; }
.att-t { grid-area: t; font-variant-numeric: tabular-nums; }
.att-h { grid-area: h; text-align: right; white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.att-flags { grid-area: f; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.att-fix-btn { grid-area: x; justify-self: start; margin-top: 6px; }
.att-day.today .att-d { color: var(--accent); }
.att-day.off { color: var(--muted); }
.att-day.off .att-d { font-weight: 500; }
@media (min-width: 640px) {
  .att-day { grid-template-columns: 8em minmax(0, 1fr) auto; grid-template-areas: "d t h" "f f f" "x x x"; }
}
.att-fix { padding: 12px 0 16px; border-top: 1px dashed var(--line); }
.att-fix-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* 오늘 직원 현황(관리자) — 5명 남짓 한 줄씩 */
.att-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n b" "t l"; gap: 2px 12px; align-items: center; min-height: var(--touch); padding: 10px 0; color: inherit; text-decoration: none; }
.att-row + .att-row { border-top: 1px solid var(--line); }
.att-row:hover .att-name { color: var(--accent); }
.att-name { grid-area: n; font-weight: 600; }
.att-row > .badge { grid-area: b; justify-self: end; }
.att-row .att-t { grid-area: t; color: var(--muted); font-size: var(--fs-sm); }
.att-row .att-l { grid-area: l; justify-self: end; }
@media (min-width: 640px) {
  .att-row { grid-template-columns: minmax(0, 1fr) 6em 9em 4.5em; grid-template-areas: "n b t l"; }
  .att-row > .badge { justify-self: start; }
}

/* 월 요약 표 */
.att-sum-wrap { margin-top: 0; padding: 2px 16px; }
.att-sum th, .att-sum td { padding: 10px 8px; }
.att-sum tbody th { text-align: left; }
.att-sum a { display: inline-flex; align-items: center; min-height: var(--h-sm); min-width: var(--h-sm); font-weight: 600; } /* 두 글자 이름(대표)도 누르는 곳 44px(휴대폰) */
.att-sum td.warn { color: var(--warn); font-weight: 600; }
@media (max-width: 420px) { .att-sum th, .att-sum td { padding: 10px 4px; } .att-sum td:last-child { white-space: normal; min-width: 4.5em; } } /* 휴대폰 — 다섯 칸이 옆으로 밀리지 않게 */

/* 공장 공용 태블릿 — 이름 단추(장갑 낀 손: 크게, 그러나 단정하게) */
.att-lead { margin: 8px 0 4px; font-size: var(--fs-md); font-weight: 600; }
.att-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
@media (max-width: 479px) { .att-people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.att-person {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 96px; padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, background-color .15s, transform .12s;
}
.att-person strong { font-size: var(--fs-title); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.att-person:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.att-person:active { transform: scale(.98); }
.att-person:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.att-picked { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 560px; margin: 0 auto; padding: 28px var(--pad-card); text-align: center; }
.att-who { margin: 0; font-size: var(--fs-title); font-weight: 600; }
.att-ok { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--ok); }
.att-picked .btn-block { max-width: 420px; }
@media (prefers-reduced-motion: reduce) { .att-person { transition: none; } .att-person:active { transform: none; } }

/* ================= 메뉴 섹션(core/nav-sections.js) — PC 왼쪽 메뉴: 펼치면 아코디언, 접힌 막대면 아이콘 + 옆 목록 =================
 * 움직임은 짧게(0.18초), 줄이기 설정이면 바로. 색은 토큰만(시안 a/b/c·어두운 화면·또렷한 화면이 그대로 따라옴) */
@media (min-width: 900px) {
  .nav { overflow-y: auto; overscroll-behavior: contain; }
  .nav a[data-path="/more"] { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0; }
  .nav-sec { display: flex; flex-direction: column; flex: 0 0 auto; }
  .nav-sec + .nav-sec, .nav > a + .nav-sec, .nav-chats + .nav-sec { margin-top: 1px; }
  /* 섹션 줄 — 메뉴 줄과 같은 높이(--h-md)·글자. 화살표는 작게, 섹션 이름은 보조색(안쪽 메뉴가 주인공) */
  .nav-sec-btn {
    position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--h-md); padding: 0 8px 0 10px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2);
    font: inherit; font-size: var(--fs-body); font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer;
  }
  .nav-sec-btn:hover { background: var(--surface-2); color: var(--text); }
  .nav-sec-btn > svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--muted); }
  .nav-sec-btn .nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .nav-sec-btn > .nav-sec-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .18s var(--ease-out); }
  .nav-sec.is-open > .nav-sec-btn > .nav-sec-chev { transform: rotate(180deg); }
  /* 지금 화면이 들어 있는 섹션 — 섹션 그림을 남색으로 + 글자 진하게(접혀 있어도 어디 있는지 보이게) */
  .nav-sec.is-current > .nav-sec-btn { color: var(--text); font-weight: 600; }
  .nav-sec.is-current > .nav-sec-btn > svg:first-child { color: var(--accent); }
  /* 섹션 안 줄 — 0.18초 동안 높이가 열리고 닫힘. 닫힌 줄은 보이지도 눌리지도 않음(visibility). 그림 없이 섹션 그림 줄에 맞춰 들여씀 */
  .nav-sec-items { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .18s var(--ease-out), visibility .18s; }
  .nav-sec.is-open > .nav-sec-items { grid-template-rows: 1fr; visibility: visible; }
  .nav-sec-inner { display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow: hidden; padding: 1px 0 4px 20px; }
  .nav-sec-inner a { min-height: 32px; font-weight: 400; }
  .nav-sec-inner a[aria-current="page"] { font-weight: 600; }
  .nav-sec-inner a:focus-visible { outline-offset: -2px; }
  /* 알림 점 — 섹션 안에 안 읽은 공지·결재 대기가 있으면(펼쳐서 숫자가 보이면 숨김) */
  .nav-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
  .app.nav-open .nav-sec.is-open .nav-dot { display: none; }
  /* 접힌 막대 — 섹션은 아이콘 하나, 화살표·안쪽 줄은 숨김. 지금 화면의 섹션은 옅은 받침(메뉴 줄의 '지금 화면'과 같은 모양) */
  .app:not(.nav-open) .nav-sec-btn > .nav-sec-chev, .app:not(.nav-open) .nav-sec-items { display: none; }
  .app:not(.nav-open) .nav-sec-btn, .app:not(.nav-open) .nav > a, .app:not(.nav-open) .nav-toggle { min-height: 40px; }
  .app:not(.nav-open) .nav-sec.is-current > .nav-sec-btn { background: var(--surface-2); }
  .app:not(.nav-open) .nav-sec-btn[aria-expanded="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .app:not(.nav-open) .nav-dot { position: absolute; top: 7px; left: calc(50% + 6px); box-shadow: 0 0 0 2px var(--nav-bg); }
  /* 옆 목록(flyout) — 접힌 막대의 섹션 아이콘 옆. 위치(--fly-top·--fly-left)는 main.js가 단추에 맞춰 넣음 */
  .nav-fly:not([hidden]) {
    position: fixed; z-index: 40; top: var(--fly-top, 80px); left: var(--fly-left, 72px);
    display: flex; flex-direction: column; gap: 1px; min-width: 200px; max-width: min(300px, calc(100vw - 96px)); max-height: calc(100dvh - 16px); overflow-y: auto;
    padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow-pop);
    animation: nav-fly-in .15s var(--ease-out);
  }
  .nav-fly-title { margin: 6px 10px 4px; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
  .nav-fly a {
    position: relative; display: flex; align-items: center; gap: 10px; min-height: var(--h-md); padding: 0 10px; border-radius: var(--radius-sm);
    color: var(--text-2); font-size: var(--fs-body); font-weight: 500; text-decoration: none; white-space: nowrap;
  }
  .nav-fly a svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
  .nav-fly a:hover { background: var(--surface-2); color: var(--text); }
  .nav-fly a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
  .nav-fly a[aria-current="page"] svg { color: var(--accent); }
  .nav-fly a:focus-visible { outline-offset: -2px; }
  .nav a .nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--accent-weak); color: var(--accent); font-size: var(--fs-xs); font-weight: 600; line-height: 18px; text-align: center; }
  .nav-fly a .nav-badge, .nav-fly a .nav-count { margin-left: auto; }
  .nav-fly a .nav-count { min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; text-align: center; }
  [data-contrast="high"] .nav-fly:not([hidden]) { border-width: 2px; }
}
@keyframes nav-fly-in { from { opacity: 0; transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .nav-sec-items, .nav-sec-btn > .nav-sec-chev { transition: none; }
  .nav-fly:not([hidden]) { animation: none; }
}
/* ================= 왼쪽 메뉴 남색 판(시안 A, PC 900px~) — 04 문서 4-2 =================
 * 메뉴 안에서만 색 토큰을 남색 판용으로 바꿔 끼운다 → 메뉴 줄·섹션·지난 대화·접기 단추·개수·초점 테두리가 따로 고치지 않아도 따라옴.
 * 옆 목록(.nav-fly, .app 아래)·대화 ⋯ 메뉴(.chat-menu, body 아래)는 .nav 밖이라 흰 판 그대로. 휴대폰 아래 탭(~899px)은 흰색 그대로.
 * 빨간 숫자 배지(.nav-badge)는 --danger 바탕 + 흰 글자 그대로(--danger-dot에 흰 글자는 대비 부족) */
@media (min-width: 900px) {
  :root:is(:not([data-theme]), [data-theme="a"]) .nav {
    --nav-bg: var(--side-bg);
    --text: var(--side-text-on); --text-2: var(--side-text); --muted: var(--side-text);
    --surface: var(--side-bg); --surface-2: var(--side-on); --line: var(--side-line); --line-strong: rgba(255, 255, 255, .24);
    --accent: var(--side-text-on); --accent-weak: var(--side-on);
    background: var(--side-bg); border-right-color: transparent; color: var(--side-text);
  }
  :root:is(:not([data-theme]), [data-theme="a"]) .nav-chats-title { color: rgba(255, 255, 255, .6); font-weight: 600; } /* 섹션 이름 — 45%는 대비 4:1이라 60%(5.9:1) */
}
/* 홈 기능 바로가기(AI코디 권한이 없는 역할) 묶음 이름 */
.feature-group { margin: 14px 0 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.feature-group:first-child { margin-top: 0; }
/* 더보기 — 내 정보 카드(이름 첫 글자 동그라미), 줄마다 그림 + 이름 + 설명, 묶음 사이 넉넉히(설정 화면처럼) */
.more { gap: 12px; }
.more-group { display: flex; flex-direction: column; margin-top: 8px; }
.more-group > .section-title { margin: 0 4px 6px; }
.more-group-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 4px 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.more-group-title .mg-note { margin-left: auto; font-size: var(--fs-sm); font-weight: 400; }
.more-group-title .mg-ic { display: inline-grid; flex: 0 0 auto; }
.more-group-title .mg-ic svg { width: 16px; height: 16px; }
.more-me { display: flex; align-items: center; gap: 14px; padding: var(--pad-card); }
.more-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: var(--accent-weak); color: var(--accent); font-size: var(--fs-lg); font-weight: 600; }
.more-kv { gap: 0 10px; font-size: var(--fs-sm); }
.more-kv .more-name { grid-column: 1 / -1; margin-bottom: 2px; font-size: var(--fs-md); font-weight: 600; line-height: 1.35; }
.more-menu { padding: 0; overflow: hidden; }
.more .menu-row { gap: 12px; min-height: 56px; padding: 8px 14px; }
.more .menu-row strong { font-size: var(--fs-body); font-weight: 500; line-height: 1.4; }
.more .menu-row .small { font-size: var(--fs-sm); line-height: 1.4; }
.more .menu-row:active { background: var(--surface-2); }
.menu-row .mi { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.menu-row .mi svg { width: 18px; height: 18px; }
/* 줄 사이 선은 그림 오른쪽부터(설정 화면처럼) */
.more-menu .menu-row + .menu-row { position: relative; border-top: 0; }
.more-menu .menu-row + .menu-row::before { content: ''; position: absolute; top: 0; left: 58px; right: 0; border-top: 1px solid var(--line); }
.more-logout { gap: 6px; min-height: var(--h-md); margin-top: 8px; color: var(--danger); }
.more-logout svg { width: 18px; height: 18px; }

/* ================= 의견 보내기 — 창(components/feedback.js). 여는 곳은 더보기 → [의견 보내기](2026-10-31 위 막대에서 옮김) ================= */
@media (max-width: 599px) { .topbar .who { display: none; } }
[data-theme="b"] .top-back, [data-theme="b"] .top-title { color: #fff; }
[data-theme="b"] .top-back:active { background: rgba(255, 255, 255, .14); }
.fb-dialog .sheet-panel { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.fb-form { display: flex; flex-direction: column; gap: 12px; font-size: var(--fs-body); line-height: var(--lh); }
/* (옛 틀) 시트가 아닌 .fb-dialog — 미수금 알림 문구 창(receivable-reminders.js)이 아직 빌려 씀 */
dialog.fb-dialog:not(.sheet) {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 16px 48px rgba(16, 24, 40, .3);
}
dialog.fb-dialog:not(.sheet)::backdrop { background: rgba(16, 24, 40, .45); }
dialog.fb-dialog:not(.sheet) .fb-form { padding: 22px 20px; }
.fb-form h2 { font-size: var(--fs-lg); }
.fb-form textarea {
  width: 100%; min-height: 140px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-input); line-height: var(--lh); resize: vertical;
}
.fb-form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.fb-moods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; border: 0; }
.fb-moods legend { grid-column: 1 / -1; margin-bottom: 6px; padding: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.fb-moods legend .muted { font-weight: 400; }
.fb-mood { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h-md); padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.fb-mood input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; } /* 옛 기기(:has 없음)에서도 고른 것이 보이게 동그라미는 그대로 */
.fb-mood:has(input:checked) { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.fb-where { font-size: var(--fs-sm); }
.fb-send { min-height: var(--h-lg); }
.fb-thanks p { font-size: var(--fs-md); }
/* 직원 의견 목록(관리자) */
.fb-item { display: flex; flex-direction: column; gap: 8px; padding: var(--pad-card); }
.fb-item.done { opacity: .72; }
.fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fb-head .num { margin-left: auto; }
.fb-msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-route { margin: 0; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.fb-route a { display: inline-flex; align-items: center; min-height: var(--h-sm); }
.fb-checked { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ok); font-size: var(--fs-sm); font-weight: 600; }
.fb-checked svg { width: 16px; height: 16px; flex: 0 0 auto; stroke-width: 2.4; }
.fb-check[aria-pressed="true"] { color: var(--ok); }
@media (min-width: 900px) { .fb-item .fb-check { width: auto; align-self: flex-start; } }

/* ================= 직원 시험 안내(#/help/scenarios) ================= */
.sc { line-height: 1.6; }
.sc-intro { padding: var(--pad-card); }
.sc-intro p { margin: 0; }
.sc-item { padding: var(--pad-card); }
.sc-item h2 { margin-bottom: 4px; }
.sc-who { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-sm); }
.sc-item ol { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.sc-ok { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-weak); }
.sc-ok strong { display: block; margin-bottom: 2px; font-weight: 600; }
.sc-samples { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.sc-tail { padding: var(--pad-card); }
@media (max-width: 479px) { .fb-mood { flex-direction: column; gap: 2px; min-height: 60px; } }

/* ================= AI코디 지난 대화 — PC 왼쪽 메뉴 묶음·홈 [지난 대화]·#/chats ================= */
/* PC 메뉴: '홈' 바로 아래 최근 5개 제목. 휴대폰은 아래 탭 다섯 칸 그대로라 숨김(홈 대화창 [지난 대화]·더보기에서) */
.nav-chats { display: none; }
@media (min-width: 900px) {
  .nav-chats { display: flex; flex-direction: column; flex: 0 0 auto; gap: 1px; margin: 2px 0 6px; padding: 0 0 6px 0; border-bottom: 1px solid var(--line); }
  .nav-chats-title { margin: 8px 10px 2px 40px; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
  .nav-chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
  .nav .nav-chat {
    display: block; min-height: 32px; padding: 6px 10px 6px 40px; border-radius: var(--radius-sm);
    font-size: var(--fs-sm); font-weight: 400; line-height: 1.4; color: var(--text-2);
    /* 제목은 한 줄(Claude의 최근 대화처럼), 넘치면 끝만 말줄임. 전체 제목은 title(마우스 올림) */
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  .nav .nav-chat:hover { background: var(--surface-2); color: var(--text); }
  .nav .nav-chat[aria-current="true"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
  /* 줄 오른쪽 ⋯ — 마우스를 올리거나 초점이 있을 때·지금 대화·메뉴가 열린 줄만 보임(터치 화면은 늘). 보일 때 제목 끝을 비켜 줌 */
  .nav-chat-row { position: relative; }
  .nav-chat-row .chat-more { position: absolute; top: 50%; right: 0; width: 32px; height: 32px; min-width: 0; transform: translateY(-50%); opacity: 0; } /* PC 누르는 곳 최소 32px */
  .nav-chat-row:is(:hover, :focus-within, .is-current, .is-menu-open) .chat-more { opacity: 1; }
  .nav-chat-row:is(:hover, :focus-within, .is-current, .is-menu-open) .nav-chat { padding-right: 36px; }
  .nav-chat-row.is-removing { opacity: .4; }
  @media (hover: none) {
    .nav-chat-row .chat-more { opacity: 1; }
    .nav .nav-chat-row .nav-chat { padding-right: 36px; }
  }
  .nav .nav-chats-all { min-height: 32px; padding: 0 10px 0 40px; font-size: var(--fs-sm); font-weight: 500; color: var(--accent); }
  .nav-chats-empty { margin: 2px 10px 4px 40px; font-size: var(--fs-sm); color: var(--muted); }
}
/* 홈 대화창 [지난 대화] — 휴대폰만(PC는 왼쪽 메뉴). 저장된 대화가 있으면 대화 전 첫 화면에도 위쪽에 작게 */
@media (min-width: 900px) { .chat-history-btn { display: none !important; } }
/* 첫 화면(휴대폰): [지난 대화]는 추천 질문 아래 가운데에 조용한 글자 단추로 — 인사말·입력칸 위를 비워 둠 */
@media (max-width: 899px) {
  .chat.has-history:not(.is-chatting) .chat-tools { display: flex; order: 10; justify-content: center; min-height: 0; margin-top: -6px; }
  .chat:not(.is-chatting) .chat-history-btn { background: transparent; border-color: transparent; color: var(--accent); font-weight: 700; }
}

/* #/chats 목록 — 묶음(고정됨·오늘·어제·날짜) 머리글 + 줄(말풍선/핀 그림 + 제목 두 줄까지, 시각은 title로만), 오른쪽 끝 ⋯ → 고정·삭제(삭제는 확인창) */
.chats-new { padding: 0 14px 0 10px; gap: 4px; }
.chats-new svg { width: 16px; height: 16px; }
.chats-lead { margin-top: -6px; }
/* 한 판 안의 줄 목록(카드 여러 장 대신) — 줄 사이 1px 선 */
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chat-row { display: flex; align-items: stretch; transition: opacity .2s, background-color .15s; }
.chat-row + .chat-row { border-top: 1px solid var(--line); }
.chat-row.is-current { background: color-mix(in srgb, var(--accent-weak) 55%, var(--surface)); }
.chat-row.is-removing { opacity: .4; }
.chat-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 56px; padding: 10px 8px 10px 14px; color: inherit; text-decoration: none; transition: background-color .12s; }
.chat-open:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.chat-open:active { background: var(--surface-2); }
.chat-ico { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.chat-ico svg { width: 18px; height: 18px; }
.chat-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-row.is-pinned .chat-ico { color: var(--accent); }
.chat-title { font-size: var(--fs-body); font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-now { flex: 0 0 auto; margin-left: auto; }
/* 묶음 머리글(고정됨·오늘·어제·10월 28일) — 작은 회색 글자 */
.chat-group-title { margin: 14px 4px 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.chat-group-title:first-child { margin-top: 0; }
/* 줄 오른쪽 ⋯ 단추 — #/chats는 늘 보임(누름 영역 44px), PC 왼쪽 메뉴는 위 .nav-chat-row 규칙 */
.chat-more {
  display: grid; place-items: center; flex: 0 0 auto; min-width: var(--touch); padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .12s, color .12s, opacity .12s;
}
.chat-more svg { width: 18px; height: 18px; stroke-width: 2.4; }
.chat-more:hover, .chat-more[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.chat-row .chat-more { width: var(--touch); border-radius: 0; }
/* ⋯ 메뉴 — body 끝에 떠 있는 작은 판(chat-list.js가 단추 옆 화면 안쪽에 위치를 넣음) */
.chat-menu {
  position: fixed; z-index: 50; display: flex; flex-direction: column; gap: 1px; min-width: 148px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-pop);
}
.chat-menu [role="menuitem"] {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer;
}
.chat-menu [role="menuitem"] svg { width: 16px; height: 16px; flex: 0 0 auto; }
.chat-menu [role="menuitem"]:hover, .chat-menu [role="menuitem"]:focus-visible { background: var(--surface-2); }
.chat-menu [role="menuitem"].is-danger { color: var(--danger); }
.chat-menu [role="menuitem"].is-danger:hover, .chat-menu [role="menuitem"].is-danger:focus-visible { background: var(--danger-weak); }
@media (max-width: 899px), (hover: none) { .chat-menu [role="menuitem"] { min-height: var(--touch); font-size: var(--fs-body); } }
.chats-empty { display: flex; flex-direction: column; align-items: center; }
.chats-empty-ico { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); }
.chats-empty-ico svg { width: 24px; height: 24px; }

/* ================= PC 셸 다듬기(2026-10-31 밤, 시연 전 UX 검토 셸·홈) =================
 * ① 접힌 메뉴 막대(72px)에도 이름을 그림 아래 12px로 — 휴대폰 아래 탭과 같은 모양(그림 + 이름, 지금 섹션은 그림 뒤 옅은 남색 받침 + 600).
 *    검토는 '1280 이상 기본 펼침'을 권했지만, 사용자가 전에 '처음 들어갔을 때 사이드바가 접기가 되어야'라고 해서 기본 접힘은 그대로 두고
 *    접힌 채로도 어디가 견적·수금인지, 지금 어느 섹션인지 바로 보이게 함. [메뉴 펼치기]는 그림만(사용자 요청) — 대신 테두리 있는 단추 모양.
 * ② PC에서 상세(.readable 960)·좁은 화면(.narrow 640)도 왼쪽 정렬 — 경로 표시(맨 위 '섹션 / 메뉴 / 지금')와 시작선을 맞춤(검토 2-4). */
@media (min-width: 900px) {
  .app:not(.nav-open) .nav { padding-inline: 6px; }
  .app:not(.nav-open) .nav > a, .app:not(.nav-open) .nav-sec-btn {
    flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 2px 5px;
  }
  .app:not(.nav-open) .nav :is(a, .nav-sec-btn) > .nav-label {
    position: static; width: auto; height: auto; max-width: 100%; overflow: hidden; clip: auto; text-overflow: ellipsis;
    font-size: var(--fs-xs); font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; color: var(--text-2);
  }
  .app:not(.nav-open) .nav :is(a, .nav-sec-btn) > svg { box-sizing: content-box; padding: 3px 12px; border-radius: var(--radius-pill); transition: background-color .15s var(--ease-out); }
  .app:not(.nav-open) .nav :is(a, .nav-sec-btn):hover { background: transparent; }
  .app:not(.nav-open) .nav :is(a, .nav-sec-btn):hover > svg { background: var(--surface-2); color: var(--text); }
  .app:not(.nav-open) .nav-sec.is-current > .nav-sec-btn,
  .app:not(.nav-open) .nav > a[aria-current="page"] { background: transparent; }
  .app:not(.nav-open) .nav-sec.is-current > .nav-sec-btn > svg:first-child,
  .app:not(.nav-open) .nav > a[aria-current="page"] > svg { background: var(--accent-weak); color: var(--accent); stroke-width: 2; }
  .app:not(.nav-open) .nav-sec.is-current > .nav-sec-btn > .nav-label,
  .app:not(.nav-open) .nav > a[aria-current="page"] > .nav-label { color: var(--text); font-weight: 600; }
  .app:not(.nav-open) .nav-sec-btn[aria-expanded="true"] { background: var(--surface-2); box-shadow: none; }
  .app:not(.nav-open) .nav-dot { top: 4px; left: calc(50% + 8px); }
  .app:not(.nav-open) .nav a .nav-badge, .app:not(.nav-open) .nav a .nav-count { top: 0; left: calc(50% + 6px); }
  .app:not(.nav-open) .nav a[data-path="/more"] { border-radius: 0; }
  /* [메뉴 펼치기] — 맨 위 테두리 있는 그림 단추(누르면 펼쳐진다는 것이 보이게), 아래에 얇은 선으로 메뉴와 나눔 */
  .app:not(.nav-open) .nav-toggle {
    align-self: center; width: 40px; min-height: 36px; margin: 0 0 8px; color: var(--text-2);
    border: 1px solid var(--line-strong); background: var(--surface);
  }
  .app:not(.nav-open) .nav-toggle:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
  .readable, .narrow { margin-inline: 0; }
  .narrow.chats { margin-inline: auto; }
}
/* 지난 대화는 720 가운데라 단추 자리(68px)를 따로 비우지 않음 — 홈 대화와 같은 가운데선(1000px 아래는 단추와 겹칠 수 있어 그대로) */
@media (min-width: 1000px) { :root.cd-fab-on .main:has(> #view .narrow.chats) { padding-right: 24px; } }
@media (prefers-reduced-motion: reduce) { .app:not(.nav-open) .nav :is(a, .nav-sec-btn) > svg { transition: none; } }
/* ③ 휴대폰 안쪽 화면 — 위 막대에 화면 이름이 있으니 화면 안 제목(h1)은 화면에서만 숨김(화면낭독기는 읽음). 제목 줄의 개수·단추는 그대로(검토 P2: 첫 화면 60px 낭비)
   ④ 대화 중 위에 붙는 [새 대화][지난 대화] 줄 — 바탕을 꽉 채우고 아래 선(뒤 말풍선·'AI코디' 이름이 비쳐 겹쳐 보이던 것, 검토 P2) */
@media (max-width: 899px) {
  .app.has-back #view .page-title > h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.chat.is-chatting .chat-tools { background: var(--bg); -webkit-mask-image: none; mask-image: none; box-shadow: 0 1px 0 var(--line); }
/* 유리 카드 계산 줄 — '24평 × 평당 4,830원 = 115,920원 (부가세 포함)' + '공급가 105,382원'(시연 전 흐름 검토 4, photo-quote.js calcView) */
.ocr-amt small { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.ocr-amt-v { white-space: nowrap; }

/* ================= 시안 A — AI코디 홈 첫 화면(Figma 116-2) =================
 * 대화 전: 인사말 굵게, 입력칸은 둥근 큰 검색창(파란 테두리·옅은 빛), 추천 질문은 옅은 회색 알약.
 * 대화 중 입력칸·말풍선은 그대로(04 문서 5-15 '입력부: 현행 .composer 그대로') */
:root:is(:not([data-theme]), [data-theme="a"]) .chat:not(.is-chatting) .chat-hero h1 { font-weight: 700; letter-spacing: -.03em; }
:root:is(:not([data-theme]), [data-theme="a"]) .home .chat:not(.is-chatting) .composer {
  border: 2px solid color-mix(in srgb, var(--ok, var(--accent)) 70%, var(--line-strong)); border-radius: 28px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok, var(--accent)) 10%, transparent), 0 10px 30px -18px rgba(16, 24, 40, .25);
  padding: 10px 10px 8px 20px;
}
:root:is(:not([data-theme]), [data-theme="a"]) .home .chat:not(.is-chatting) .composer:focus-within { border-color: var(--ok, var(--accent)); }
:root:is(:not([data-theme]), [data-theme="a"]) .home .chat:not(.is-chatting) .send-btn { border-radius: var(--radius-pill); padding: 0 18px; }
@media (min-width: 600px) {
  :root:is(:not([data-theme]), [data-theme="a"]) .home .chat:not(.is-chatting) .composer { flex-direction: row; align-items: flex-end; gap: 8px; border-radius: var(--radius-pill); }
  :root:is(:not([data-theme]), [data-theme="a"]) .home .chat:not(.is-chatting) .composer-input { min-height: 44px; padding: 9px 0; }
  :root:is(:not([data-theme]), [data-theme="a"]) .home .chat:not(.is-chatting) .composer-bar { flex: 0 0 auto; }
}
:root:is(:not([data-theme]), [data-theme="a"]) .suggest { gap: 8px; }
:root:is(:not([data-theme]), [data-theme="a"]) .suggest-chip {
  min-height: var(--touch, 44px); padding: 0 16px; border-color: transparent; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); color: var(--text); font-weight: 600;
}
:root:is(:not([data-theme]), [data-theme="a"]) .suggest-chip:hover { background: var(--ok-weak, var(--accent-weak)); border-color: transparent; }

/* ================= 시안 A — 화면 전체 공통(04 문서 5-2·5-11) =================
 * 견적 상태가 아닌 배지(연체·완료·매입 등 .badge.tone-*)도 바탕 칸 대신 점 + 글자. 회색 이름표(.badge만)는 그대로.
 * 확인이 필요한 입력칸(틀린 값·AI·글자 읽기가 자신 없는 칸)은 옅은 빨강 바탕 + 빨강 선(노랑 쓰지 않음) */
:root:is(:not([data-theme]), [data-theme="a"]) .badge:is(.tone-ok, .tone-warn, .tone-danger, .tone-accent):not(.qs-st) {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border-radius: 0; background: none;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.01em; vertical-align: baseline;
}
:root:is(:not([data-theme]), [data-theme="a"]) .badge:is(.tone-ok, .tone-warn, .tone-danger, .tone-accent):not(.qs-st)::before { content: ''; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
:root:is(:not([data-theme]), [data-theme="a"]) .badge.tone-danger:not(.qs-st)::before { background: var(--danger-dot, var(--danger)); }
:root:is(:not([data-theme]), [data-theme="a"]) .input[aria-invalid="true"] { background: var(--danger-weak); border-color: var(--danger-line, var(--danger)); }
:root:is(:not([data-theme]), [data-theme="a"]) :is(.ocr-f.unsure .input, .ocr-procs.unsure) { border: 1.5px solid var(--danger-line, var(--danger)); background: var(--danger-weak); color: var(--danger); }

/* ---------- 5-10 숫자 카드 — 예전 화면의 '카드 하나 안 숫자 칸'(.card > dl.stats)도 숫자마다 카드로(전표·세금계산서·통장·직원 등).
   감싼 카드는 바탕만 남기고 투명, 칸마다 흰 카드. 줄 배치 PC 3칸(4개면 4칸) / 600~899px 2칸 / ~599px 1칸 ---------- */
:root:is(:not([data-theme]), [data-theme="a"]) .card:has(> dl.stats:not(.rv-sum, .rp-kpis, .stats-handle)) {
  padding: 0; border-color: transparent; background: transparent; box-shadow: none;
}
:root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) {
  grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); margin: 0; padding: 0; border: 0;
}
:root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) > div {
  grid-column: auto; padding: var(--sp-4) var(--sp-5); border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
:root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) dt { color: var(--text-2); font-size: var(--fs-body); font-weight: 600; }
:root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) dd:not(.stat-sub) { margin-top: var(--sp-1); font-size: var(--fs-num); font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
:root:is(:not([data-theme]), [data-theme="a"]) .card:has(> dl.stats:not(.rv-sum, .rp-kpis, .stats-handle)) > :not(dl) { padding-inline: var(--sp-1); }
@media (min-width: 600px) { :root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { :root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); } }
:root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) dd.danger,
:root:is(:not([data-theme]), [data-theme="a"]) .card > dl.stats:not(.rv-sum, .rp-kpis, .stats-handle) dd.minus { color: var(--danger); }

/* ---------- 5-11 AI가 채운 칸 — 옅은 파랑 바탕 + 파랑 선(견적 작성 AI코디 입력 돕기 .qe-ai-mark) ---------- */
:root:is(:not([data-theme]), [data-theme="a"]) .qe .qe-ai-mark { background-color: var(--ai-weak); border-color: var(--ai-line); }

/* ---------- 5-15 대화 말풍선 — 내 말: 남색 바탕 흰 글자(오른쪽 아래만 작은 모서리), AI 말: 흰 카드(그림자, 왼쪽 아래만 작은 모서리).
   위 'AI코디' 이름은 작고 굵게. 패널 바탕은 옅은 회색 ---------- */
:root:is(:not([data-theme]), [data-theme="a"]) .msg.user .bubble { background: var(--accent); color: var(--accent-text); border-bottom-right-radius: var(--radius-xs); font-size: var(--fs-body); }
:root:is(:not([data-theme]), [data-theme="a"]) .msg.ai .bubble { border-color: transparent; box-shadow: var(--shadow); border-bottom-left-radius: var(--radius-xs); font-size: var(--fs-body); line-height: 1.6; }
:root:is(:not([data-theme]), [data-theme="a"]) .msg.ai { max-width: 92%; }
:root:is(:not([data-theme]), [data-theme="a"]) .msg.user { max-width: 82%; }
:root:is(:not([data-theme]), [data-theme="a"]) .msg-who { font-size: var(--fs-xs); font-weight: 700; }
:root:is(:not([data-theme]), [data-theme="a"]) .coach-mark { background: var(--ai-grad, var(--accent)); color: #fff; }
