.quote-workflow { margin: 0 0 20px; padding: 16px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; color: #1e293b; }
.quote-workflow-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.quote-workflow-heading strong { font-size: var(--fs-title); }
.quote-workflow-heading p { margin: 4px 0 0; color: #64748b; font-size: var(--fs-meta); }
.quote-workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quote-workflow-steps button { border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; padding: 10px 8px; font-size: var(--fs-base); font-weight: 700; text-align: left; color: #475569; }
.quote-workflow-steps button[aria-current] { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.quote-workflow-steps button:hover { border-color: #93c5fd; }
#quoteEditArea #quotePricingControls { position: static; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: var(--fs-base); }
#quoteEditArea #quotePricingControls select { font-size: 16px; max-width: 100%; }
#quoteEditArea #quoteGrandTotal { margin-top: 24px; }
#quoteEditArea[data-quote-locked="true"] :is(.quote-paper, .quote-pricing-card) :is(input, select, textarea) { color: #334155; opacity: 1; -webkit-text-fill-color: #334155; cursor: default; }
#quoteEditArea[data-quote-locked="true"] :is(.quote-paper, .quote-pricing-card) button:disabled { opacity: .45; cursor: not-allowed; }
.quote-review-section { margin: 24px 0 0; padding: 20px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; }
.quote-review-section h2 { margin: 0 0 16px; font-size: var(--fs-title); font-weight: 800; }
.quote-review-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: var(--fs-title); }
.quote-review-heading strong { overflow-wrap: anywhere; }
.quote-review-status { font-size: var(--fs-meta); color: #475569; background: #f1f5f9; border-radius: 6px; padding: 4px 8px; }
.quote-review-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 16px 0; }
.quote-review-details div { min-width: 0; }
.quote-review-details dt { font-size: var(--fs-meta); color: #64748b; margin-bottom: 3px; }
.quote-review-details dd { font-size: var(--fs-body); font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.quote-review-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; border-radius: 10px; background: #f8fafc; margin: 16px 0; }
.quote-review-totals dt { font-size: var(--fs-meta); color: #475569; }
.quote-review-totals dd { margin: 5px 0 0; font-size: var(--fs-title); font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quote-review-totals div:last-child { color: #1d4ed8; }
.quote-review-note { font-size: var(--fs-meta); line-height: 1.7; color: #475569; }
.quote-review-warnings { padding: 12px 12px 12px 28px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #92400e; font-size: var(--fs-base); list-style: disc; line-height: 1.7; }
.quote-review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quote-review-actions .btn { font-size: var(--fs-base); min-height: 40px; white-space: normal; }
.quote-review-modal { line-height: 1.5; }
@media (max-width: 600px) {
    .quote-workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quote-review-section { padding: 16px; }
    .quote-review-details { grid-template-columns: 1fr; }
    .quote-review-totals { grid-template-columns: 1fr; gap: 10px; }
    .quote-review-totals div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
    .quote-review-totals dd { margin: 0; }
    .quote-review-actions .btn { flex: 1 1 140px; }
}
@media print { .quote-workflow, .quote-review-section { display: none !important; } }

/* 📐 PC 2열 (2026-10-12) — 편집 종이 옆에 단계·도구·최종 확인·출력을 따라오는 패널로 붙인다.
   기준은 화면이 아니라 견적 영역 폭(사이드바가 접혔는지에 따라 같은 화면에서도 다르다): 종이 최소 800 + 24 + 패널 최소 360.
   종이는 남는 폭을 먼저 받아 최대 1200px, 패널은 그 뒤에 360→440px — 출력물(PDF)은 화면 종이를 찍지 않고 데이터로 따로 그려 영향이 없다.
   좁으면 두 묶음을 풀어(display: contents) 종전 순서 그대로 한 줄 — DOM 은 종이가 먼저라 order 로 되돌린다. */
#quoteEditArea { container: quote-edit / inline-size; }
/* 폰의 하단 결재 띠는 문서가 아닌 화면에 고정한다. PC 컨테이너 쿼리는 유지. */
@media screen and (max-width: 768px) {
    #quoteEditArea { container-type: normal; }
}
.quote-layout { display: flex; flex-direction: column; }
.quote-layout-main, .quote-layout-side { display: contents; }
.quote-layout .quote-workflow { order: 1; }
#quoteAuxActions { order: 2; }
#quoteApprovalPanel { order: 3; }
.quote-layout-main > .overflow-x-auto { order: 4; }
#quotePricingCard { order: 5; }
#quoteReviewSection { order: 6; }
#quoteFooterActions { order: 7; }
/* 💰 할인·부가세 — 견적서 내용이 아니라 작성 설정(종이 밖). 결과 줄은 종이에 남는다. */
.quote-pricing-card { margin: 24px 0 0; padding: 16px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; }
.quote-pricing-card h2 { margin: 0 0 12px; font-size: var(--fs-title); font-weight: 800; }
.quote-pricing-card .quote-pricing-row { justify-content: flex-start; }
.quote-review-more > summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-size: var(--fs-base); font-weight: 700; color: #475569; }   /* 기본 ▶ 표시는 남긴다(견적 도구와 같은 모양) */
.quote-review-more > summary:hover { color: #1d4ed8; }
.quote-review-more[open] > .quote-review-details { margin-top: 4px; }
@container quote-edit (min-width: 1184px) {
    .quote-layout { display: grid; grid-template-columns: minmax(800px, 1200px) clamp(360px, calc(100cqi - 1224px), 440px); gap: 24px; align-items: start; }
    .quote-layout-main { display: block; min-width: 0; }
    .quote-layout-main .quote-paper { max-width: none; }
    .quote-layout-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; }
    .quote-layout-side .quote-workflow { margin: 0; padding: 14px; }
    .quote-layout-side .quote-workflow-heading .btn { display: none; }   /* 같은 패널 아래 «내용 확인 후 승인·출력»과 같은 동작 */
    .quote-layout-side .quote-workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quote-layout-side #quoteAuxActions { margin: 0; }
    .quote-layout-side #quoteAuxActions > .flex:last-child { width: 100%; align-items: flex-start; }   /* 견적 도구를 펼쳐도 «다음 단계»가 따라 늘지 않게 */
    .quote-layout-side #quoteAuxActions .workspace-tools { flex: 1 1 auto; }
    .quote-layout-side .quote-pricing-card { margin: 0; padding: 14px 16px; }
    .quote-layout-side .quote-review-section { margin: 0; padding: 16px; }
    .quote-layout-side .quote-review-section h2 { margin-bottom: 8px; }
    .quote-layout-side .quote-review-totals { grid-template-columns: 1fr; gap: 6px; padding: 12px; margin: 12px 0; }
    .quote-layout-side .quote-review-totals div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
    .quote-layout-side .quote-review-totals dd { margin: 0; }
    .quote-layout-side #quoteReviewSection > .btn { width: 100%; }
    .quote-layout-side #quoteFooterActions { margin: 0; }
    .quote-layout-side #quoteFooterActions .btn { flex: 1 1 0; }
}

/* 📊 편집 표 (2026-10-12) — 12칸에 칸 여백 10px 이면 «단 위»처럼 띄어 쓴 머리글이 세로로 쪼개지고 단가·규격이 잘린다
   (사장님 «세부항목들이 뭉개지는»). 폰은 patches-extracted.css 의 전용 규칙(칸 숨김·!important 여백)이 따로 있어 PC 만. */
@media (min-width: 769px) {
    #quoteEditTable th, #quoteEditTable td { padding-left: 4px; padding-right: 4px; }
    #quoteEditTable thead th { white-space: nowrap; }
    #quoteEditTable .input-no-border { padding-left: 3px; padding-right: 3px; }   /* 금액칸은 오른쪽 12px(.text-right-input)까지 먹어 «46,200,000»이 잘렸다 */
}

/* 이전 승인본 비교: 긴 품목명·큰 금액도 패널 폭 안에서 줄을 바꾼다. */
.quote-revision-diff { min-width:0; margin:12px 0; padding:12px; border:1px solid #cbd5e1; border-radius:8px; background:#f8fafc; color:#334155; font-size:var(--fs-base); word-break:keep-all; overflow-wrap:break-word; }
.quote-revision-diff summary { min-height:44px; padding:10px 0; cursor:pointer; font-weight:700; }
.quote-revision-totals { margin:12px 0; }
.quote-revision-totals div { margin:8px 0; }
.quote-revision-totals dt { font-weight:700; }
.quote-revision-totals dd { margin:2px 0 0; font-variant-numeric:tabular-nums; }
.quote-revision-rows { margin:0; padding:0; list-style:none; }
.quote-revision-rows li { padding:10px 0; border-top:1px solid #e2e8f0; }
.quote-revision-rows p { margin:4px 0 0; line-height:1.7; white-space:normal; }
