/* Extracted from app.css for route-specific maintainability. */
/* 교체 이력: app.layout 에만 마운트(page-content 전환·부트 레이아웃과 무관) — 콜백 flat_data IndexError 방지 */
#swap-route-panel { box-sizing: border-box; }
#swap-route-panel.swap-route-visible {
    display: block !important;
    position: fixed;
    z-index: 100;
    left: 180px;
    top: 162px;
    right: 0;
    bottom: 88px;
    overflow: auto;
    background: #f8fafc;
    padding: 12px 16px;
}
@media screen and (max-width: 800px) {
    #swap-route-panel.swap-route-visible {
        left: 0;
        top: env(safe-area-inset-top, 0px);
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        padding: 0 !important;
    }
    /* /work/swap: 교체 이력 자체 상단바를 쓰므로 앱 공통 상단바 숨김 */
    body:has(#swap-route-panel.swap-route-visible) .app-top-header { display: none !important; }
    body:has(#swap-route-panel.swap-route-visible) .metric-header-fixed { display: none !important; }
    /* /work/swap: 상단바는 스크롤에 안 딸려가게(패널 내부 sticky) */
    body:has(#swap-route-panel.swap-route-visible) #swap-route-panel.swap-route-visible .technote-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 10125 !important;
    }
}
/* 견적서 작성: 교체 이력과 동일하게 app.layout 단일 마운트 */
#estimate-route-panel { box-sizing: border-box; }
#estimate-route-panel.estimate-route-visible {
    display: block !important;
    position: fixed;
    z-index: 100;
    left: 180px;
    top: 162px;
    right: 0;
    bottom: 88px;
    overflow: auto;
    background: #f4f5f7;
    padding: 12px 16px;
}
@media screen and (max-width: 800px) {
    /* 앱 상단바(브랜드+DB시각, 약 두 줄) 아래에서 스크롤 시작 — 견적 상단·스텝이 잘리지 않게 */
    #estimate-route-panel.estimate-route-visible {
        left: 0;
        top: calc(56px + 28px + env(safe-area-inset-top, 0px));
        bottom: 72px;
        padding: 10px 8px;
    }
    /* /work/estimate: 견적서 자체 상단바를 쓰므로 앱 공통 상단바 숨김 */
    body:has(#estimate-route-panel.estimate-route-visible) .app-top-header {
        display: none !important;
    }
    body:has(#estimate-route-panel.estimate-route-visible) #estimate-route-panel.estimate-route-visible {
        top: env(safe-area-inset-top, 0px);
        z-index: 10120 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        /* 하단 고정 채팅바 + safe-area 만큼 비워서 본문이 가리지 않게 */
        bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
        padding: 0 !important;
    }
    /* /work/estimate: 상단바는 스크롤에 안 딸려가게(패널 내부 sticky) */
    body:has(#estimate-route-panel.estimate-route-visible) #estimate-route-panel.estimate-route-visible .technote-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 10125 !important;
    }
}
/* 기술노트(/tech): 고정 패널 — tech-data-table 등 콜백 id 가 모든 라우트에서 존재 */
#technote-route-panel {
    box-sizing: border-box;
    display: none;
}
#technote-route-panel.technote-route-visible {
    display: block !important;
    position: fixed;
    z-index: 100;
    left: 180px;
    top: 0;
    right: 0;
    bottom: 88px;
    overflow: hidden;
    background: #f4f6f9;
    /* 좌우 패딩 없음: 상단 네이비 바가 패널 가로 전체를 채움(회색 틈 방지). 본문은 .technote-cat-scroll 등 자체 패딩 */
    padding: 0 0 12px;
    box-sizing: border-box;
}

/* /tech PC: 상단 여백 제거 + 전역 헤더 레이어 숨김 */
body:has(#technote-route-panel.technote-route-visible) .app-top-header {
    display: none !important;
}
body:has(#technote-route-panel.technote-route-visible) .metric-header-fixed {
    display: none !important;
}
body:has(#technote-route-panel.technote-route-visible) #dashboard-stack.content-area {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body:has(#technote-route-panel.technote-route-visible) #dashboard-content {
    padding: 0 !important;
}
/* /work/opinion (technote-route-panel 사용): PC에서 모바일 폭 고정 해제 */
body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .opinion-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 0 24px !important;
    box-sizing: border-box !important;
}
body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .opinion-page .technote-topbar {
    margin: 0 !important;
}
body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .opinion-page .weekly-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* /tech PC: 모달 팝업 대신 우측 상세패널만 사용 */
@media screen and (min-width: 801px) {
    body:has(#technote-route-panel.technote-route-visible) #tech-modal.modal--technote {
        display: none !important;
    }
}
@media screen and (max-width: 800px) {
    #technote-route-panel.technote-route-visible {
        left: 0;
        top: calc(56px + 28px + env(safe-area-inset-top, 0px));
        bottom: 72px;
        padding: 0 0 10px;
    }
    /* /tech: 기술노트 자체 상단바와 겹치지 않도록 전역 앱 헤더 숨김 + 패널을 안전영역부터 */
    body:has(#technote-route-panel.technote-route-visible) .app-top-header {
        display: none !important;
    }
    body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible {
        top: env(safe-area-inset-top, 0px);
        /* 앱 상단(10050)·메트릭(10040)보다 위로 — 좌우에 다른 레이어가 비치는 현상 방지 */
        z-index: 10120 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .technote-page {
        width: 100%;
        max-width: none;
        margin: 0;
    }
    body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .technote-topbar {
        width: 100%;
        box-sizing: border-box;
    }
    body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .technote-main-panels {
        display: block !important;
    }
    body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .technote-list-panel {
        width: 100% !important;
    }
    body:has(#technote-route-panel.technote-route-visible) #technote-route-panel.technote-route-visible .technote-detail-panel {
        display: none !important;
    }
}
/* 견적서 작성 — 카드·스텝·폼 목업 톤 */
.estimate-quotation-page.est-q-mock {
    max-width: 420px;
    margin: 0 auto;
    padding: 0 0 24px;
    box-sizing: border-box;
}
@media screen and (max-width: 800px) {
    /* /work/estimate: 상단바는 풀폭, 본문만 여백 */
    .estimate-quotation-page.est-q-mock {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 8px 24px !important;
    }
    body:has(#estimate-route-panel.estimate-route-visible) .estimate-quotation-page.est-q-mock .technote-topbar {
        margin: 0 -8px 0 !important;
    }
}

/* ── 교체 이력(/work/swap) — 목업 카드 UI */
.swap-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 0 0 24px;
    box-sizing: border-box;
}
@media screen and (max-width: 800px) {
    /* /work/swap: 상단바는 풀폭, 본문만 여백 */
    .swap-page {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 8px 24px !important;
    }
    body:has(#swap-route-panel.swap-route-visible) .swap-page .technote-topbar {
        margin: 0 -8px 0 !important;
    }
}
.swap-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.swap-card {
    background: #fff;
    border-radius: 12px;
    border: 0.5px solid #e5e7eb;
    overflow: hidden;
}
.swap-ch {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px 10px;
    border-bottom: 0.5px solid #f3f4f6;
}
.swap-ci {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.swap-ci-b { background: #eff6ff; }
.swap-ci-g { background: #f0fdf4; }
.swap-ct {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
}
.swap-csb {
    font-size: 10px;
    color: #9ca3af;
    margin-left: auto;
}
.swap-cb {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.swap-fr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.swap-fi { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.swap-fl { font-size: 11px; font-weight: 500; color: #374151; display: flex; gap: 6px; align-items: baseline; }
.swap-inp input,
.swap-inp {
    height: 40px;
    border-radius: 9px;
    border: 0.5px solid #e5e7eb;
    font-size: 13px;
    padding: 0 12px;
    outline: none;
    color: #111827;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
}
.swap-inp::placeholder { color: #9ca3af; font-size: 12px; }
.swap-fi > div.swap-inp {
    height: auto;
    padding: 0;
    border: none;
    background: transparent;
}
.swap-fi > div.swap-inp .SingleDatePickerInput {
    height: 40px;
    border-radius: 9px;
    border: 0.5px solid #e5e7eb;
    background: #fafafa;
    box-sizing: border-box;
}
.swap-ta {
    border-radius: 9px;
    border: 0.5px solid #e5e7eb;
    font-size: 13px;
    padding: 10px 12px;
    outline: none;
    color: #111827;
    background: #fafafa;
    width: 100%;
    resize: none;
    min-height: 58px;
    line-height: 1.5;
    box-sizing: border-box;
}
.swap-ta::placeholder { color: #9ca3af; font-size: 12px; }

/* 사진 업로드 — 순서형 */
.swap-photo-label { font-size: 11px; font-weight: 500; color: #374151; display: flex; align-items: center; justify-content: space-between; }
.swap-photo-hint { font-size: 10px; color: #9ca3af; font-weight: 400; }
.swap-photo-strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.swap-photo-strip::-webkit-scrollbar { display: none; }
.swap-photo-slot {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: #fafafa;
}
.swap-ps-empty { border: 1.5px dashed #d1d5db; }
.swap-ps-empty:hover { border-color: #1a56db; background: #f0f7ff; }
.swap-ps-num { font-size: 10px; font-weight: 500; color: #9ca3af; margin-top: 5px; }
.swap-save-path {
    background: #f8faff;
    border: 0.5px solid #dbeafe;
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    gap: 7px;
    align-items: flex-start;
}
.swap-save-path .swap-path-text {
    font-size: 11px;
    color: #1e40af;
    line-height: 1.55;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-all;
}
.swap-save-btn {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: #1a2744;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* 저장된 이력: 검색 */
.swap-search-wrap { position: relative; }
.swap-srch {
    width: 100%;
    height: 38px;
    border-radius: 9px;
    border: 0.5px solid #e5e7eb;
    font-size: 12px;
    padding: 0 36px 0 12px;
    outline: none;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
}
.swap-srch::placeholder { color: #9ca3af; }
.swap-sico { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); }

/* 이력 카드 */
.swap-hist-card {
    background: #fff;
    border-radius: 11px;
    border: 0.5px solid #e5e7eb;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s;
}
.swap-hist-card:hover { border-color: #9ca3af; }
.swap-hist-card.swap-selected { border-color: #1a56db; background: #f8fbff; }
.swap-hc-top { padding: 10px 13px; display: flex; align-items: center; gap: 10px; }
.swap-hc-chk {
    width: 18px; height: 18px; border-radius: 5px;
    border: 0.5px solid #d1d5db; background: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.swap-hc-chk.on { background: #1a2744; border-color: #1a2744; }
.swap-hc-info { flex: 1; min-width: 0; }
.swap-hc-date { font-size: 10px; color: #9ca3af; margin-bottom: 2px; }
.swap-hc-site { font-size: 13px; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swap-hc-part { font-size: 11px; color: #6b7280; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swap-hc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.swap-hc-id { font-size: 10px; color: #d1d5db; }
.swap-hc-photo-badge { font-size: 10px; font-weight: 500; background: #eff6ff; color: #1e40af; padding: 2px 7px; border-radius: 4px; }
.swap-hc-thumbs { display: flex; gap: 5px; padding: 0 13px 10px; }
.swap-hc-thumb { width: 52px; height: 52px; border-radius: 7px; flex-shrink: 0; overflow: hidden; background: #f3f4f6; position: relative; }
.swap-hc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.swap-hc-thumb-label { position: absolute; bottom: 0; left: 0; right: 0; padding: 2px 4px; background: rgba(0,0,0,.45); font-size: 8px; color: #fff; text-align: center; }
.swap-hc-thumb-more { width: 52px; height: 52px; border-radius: 7px; background: #f3f4f6; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: #6b7280; }

/* 하단 액션 */
.swap-hist-actions { display: flex; gap: 7px; padding: 0 0 4px; }
.swap-ha-btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
}
.swap-btn-zip { background: #1a2744; color: #fff; }
.swap-btn-del { background: #fef2f2; color: #dc2626; border: 0.5px solid #fecaca; }

/* /work/swap PC 리디자인 v2 */
@media screen and (min-width: 801px) {
  body:has(#swap-route-panel.swap-route-visible) .app-top-header { display: none !important; }
  body:has(#swap-route-panel.swap-route-visible) .metric-header-fixed { display: none !important; }
  body:has(#swap-route-panel.swap-route-visible) #dashboard-stack.content-area {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body:has(#swap-route-panel.swap-route-visible) #dashboard-content { padding: 0 !important; }
  #swap-route-panel.swap-route-visible {
    left: 180px;
    top: 0;
    bottom: 88px;
    padding: 0 !important;
    overflow: hidden;
    background: #f0f2f5;
  }
  #swap-route-panel.swap-route-visible .swap-page {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
}

.swap-v2-topbar {
  background: #1a2744;
  padding: 8px 12px;
  flex-shrink: 0;
}
.swap-v2-topbar-row { display: flex; align-items: center; justify-content: flex-start; gap: 0; min-height: 28px; }
.swap-v2-top-left { display: flex; align-items: center; gap: 0; min-width: 0; width: 100%; }
.swap-v2-back-link { text-decoration: none; }
.swap-v2-back-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.swap-v2-top-text { min-width: 0; display: flex; align-items: center; }
.swap-v2-home-link { display: none; }
.swap-v2-page-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; margin-top: 0; }
.swap-v2-hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.swap-v2-hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #8fa8d4;
  border-radius: 2px;
}

.swap-v2-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: #f0f2f5;
}
.swap-v2-reg-panel {
  width: 360px;
  flex-shrink: 0;
  background: #fff;
  border-right: 0.5px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.swap-v2-reg-head {
  padding: 12px 16px 10px;
  border-bottom: 0.5px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.swap-v2-reg-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
}
.swap-v2-save-btn { height: 40px; border-radius: 10px; font-size: 13px; }

.swap-v2-hist-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8f9fb;
}
.swap-v2-hist-head {
  background: #fff;
  border-bottom: 0.5px solid #e5e7eb;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.swap-v2-head-spacer { flex: 1; }
.swap-v2-search-wrap { width: 240px; flex-shrink: 0; }
.swap-v2-head-actions { margin-left: 0; gap: 6px; padding: 0; }
.swap-v2-head-actions .swap-ha-btn {
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
  padding: 0 11px;
}
.swap-v2-hist-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  background: #f8f9fb;
}
.swap-v2-hist-body #swap-history-cards { display: flex; flex-direction: column; gap: 10px; }

@media screen and (max-width: 800px) {
  .swap-v2-topbar { padding: 12px 12px 10px; }
  .swap-v2-panels { display: block; overflow: auto; }
  .swap-v2-reg-panel { width: 100%; border-right: none; border-bottom: 0.5px solid #e5e7eb; }
  .swap-v2-reg-body { padding: 12px 14px; }
  .swap-fr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .swap-fi, .swap-inp { min-width: 0; max-width: 100%; }
  .swap-fi .DateInput,
  .swap-fi .DateInput_input,
  .swap-fi .SingleDatePicker,
  .swap-fi .SingleDatePickerInput {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .swap-fi .DateInput_input {
    height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }
  .swap-v2-hist-head { padding: 10px 12px; flex-wrap: wrap; }
  .swap-v2-head-spacer { display: none; }
  .swap-v2-search-wrap { width: 100%; order: 3; }
  .swap-v2-head-actions { width: 100%; order: 4; }
  .swap-v2-hist-body { padding: 10px 12px; }
}
.est-q-topbar {
    background: #1a2744;
    padding: 12px 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    margin: 0 -12px 0;
    box-sizing: border-box;
}
@media screen and (max-width: 800px) {
    .est-q-topbar {
        margin: 0 -8px 0;
    }
}
.est-q-topbar-left .est-q-title {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}
.est-q-topbar-left .est-q-meta {
    font-size: 10px;
    color: #6b85b5;
    margin-top: 2px;
}
.est-step-bar {
    background: #fff;
    border-bottom: 0.5px solid #e8eaed;
    padding: 12px 16px;
    margin: 0 -12px 0;
    box-sizing: border-box;
}
@media screen and (max-width: 800px) {
    .est-step-bar {
        margin: 0 -8px 0;
    }
}
.est-step-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.est-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    position: relative;
}
.est-step-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 60%;
    right: -40%;
    height: 1px;
    background: #e5e7eb;
    z-index: 0;
}
.est-step-item.est-step-done:not(:last-child)::after {
    background: #1a56db;
}
.est-step-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    z-index: 1;
    position: relative;
}
.est-step-item.est-step-done .est-step-circle {
    background: #1a2744;
    border-color: #1a2744;
    color: #fff;
}
.est-step-item.est-step-active .est-step-circle {
    background: #1a56db;
    border-color: #1a56db;
    color: #fff;
}
.est-step-label {
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
}
.est-step-item.est-step-active .est-step-label {
    color: #1a56db;
    font-weight: 500;
}
.est-step-item.est-step-done .est-step-label {
    color: #374151;
}
.est-q-body {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.est-card {
    background: #fff;
    border-radius: 12px;
    border: 0.5px solid #e5e7eb;
    padding: 14px;
    box-sizing: border-box;
}
.est-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.est-card-head .est-card-title-text {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}
.est-card-ico {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.est-ci-blue {
    background: #eff6ff;
}
.est-ci-green {
    background: #f0fdf4;
}
.est-ci-purple {
    background: #faf5ff;
}
.est-ci-amber {
    background: #fffbeb;
}
.est-card-sub {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}
.est-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}
.est-field:last-child {
    margin-bottom: 0;
}
.est-field-label {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}
.est-req {
    color: #dc2626;
    font-size: 10px;
}
.est-field-input {
    height: 40px !important;
    border-radius: 9px !important;
    border: 0.5px solid #e5e7eb !important;
    font-size: 13px !important;
    padding: 0 12px !important;
    color: #111827 !important;
    background: #fafafa !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    line-height: normal !important;
}
.est-field-input:focus {
    border-color: #1a56db !important;
    background: #fff !important;
    outline: none !important;
}
.est-field-input.est-readonly-no {
    color: #9ca3af !important;
    background: #f3f4f6 !important;
}
.est-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.est-field-textarea {
    border-radius: 9px !important;
    border: 0.5px solid #e5e7eb !important;
    font-size: 13px !important;
    padding: 10px 12px !important;
    color: #111827 !important;
    background: #fafafa !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 72px !important;
    line-height: 1.5 !important;
    resize: vertical !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}
.est-fixed-field {
    background: #f3f4f6;
    border-radius: 9px;
    border: 0.5px solid #e5e7eb;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.est-fixed-badge {
    font-size: 10px;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}
.est-fixed-input {
    border: none !important;
    background: transparent !important;
    flex: 1;
    min-width: 0;
    font-size: 13px !important;
    color: #374151 !important;
    padding: 0 !important;
    height: auto !important;
    max-width: none !important;
}
.est-fixed-input:focus {
    outline: none !important;
}
.est-items-card {
    padding: 14px 14px 0;
}
.est-lines-wrap {
    overflow-x: auto;
    overflow-y: auto;
    margin: 0 -14px;
    padding: 0 14px;
    /* 헤더 + 품목 약 3행만 보이고 나머지는 세로 스크롤 */
    max-height: 158px;
}
.estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container {
    max-height: 158px;
    overflow-y: auto !important;
}
.estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container .dash-spreadsheet-inner table {
    border-collapse: collapse;
    font-size: 11px;
}
.estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container .dash-spreadsheet-inner th {
    padding: 7px 6px;
    text-align: left;
    color: #9ca3af;
    font-weight: 500;
    border-bottom: 0.5px solid #f0f0f0;
    white-space: nowrap;
    background: #fff !important;
}
.estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container .dash-spreadsheet-inner td {
    padding: 2px 4px;
    border-bottom: 0.5px solid #f8f8f8;
    vertical-align: middle;
}
.estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container .dash-spreadsheet-inner td input {
    width: 100%;
    height: 34px;
    border: none;
    font-size: 11px;
    padding: 0 6px;
    outline: none;
    background: transparent;
    color: #111827;
    box-sizing: border-box;
}
.estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container .dash-spreadsheet-inner td input:focus {
    background: #f0f7ff;
}
.est-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 14px;
    border-top: 0.5px solid #f0f0f0;
    margin-top: 4px;
}
.est-total-label {
    font-size: 12px;
    color: #6b7280;
}
.est-total-num {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
}
.est-foot {
    padding: 12px 0 0;
    display: flex;
    gap: 8px;
    background: transparent;
}
.est-btn {
    flex: 1;
    height: 46px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    font-family: inherit;
    box-sizing: border-box;
}
.est-btn-preview {
    flex: 0.85;
    background: #fff;
    color: #374151;
    border: 0.5px solid #d1d5db;
}
.est-btn-primary {
    background: #1a2744;
    color: #fff;
}
.est-build-msg {
    min-height: 20px;
    font-size: 12px;
    margin: 4px 0 8px;
}
.estimate-quotation-page .SingleDatePickerInput,
.estimate-quotation-page .DateInput {
    width: 100% !important;
    max-width: none !important;
}
.estimate-quotation-page .SingleDatePickerInput .DateInput_input {
    height: 40px !important;
    border-radius: 9px !important;
    border: 0.5px solid #e5e7eb !important;
    font-size: 13px !important;
    padding: 0 12px !important;
    background: #fafafa !important;
    color: #111827 !important;
    font-weight: 400 !important;
}

/* 견적서 작성 v2 PC 리디자인 */
@media screen and (min-width: 801px) {
    body:has(#estimate-route-panel.estimate-route-visible) .app-top-header { display: none !important; }
    body:has(#estimate-route-panel.estimate-route-visible) .metric-header-fixed { display: none !important; }
    body:has(#estimate-route-panel.estimate-route-visible) #dashboard-stack.content-area {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body:has(#estimate-route-panel.estimate-route-visible) #dashboard-content { padding: 0 !important; }
    #estimate-route-panel.estimate-route-visible {
        left: 180px;
        top: 0;
        bottom: 88px;
        padding: 0 !important;
        overflow: hidden;
        background: #f0f2f5;
    }
    /* /work/estimate PC topbar == calendar topbar */
    .est-v2-topbar {
        padding: 8px 12px !important;
    }
    .est-v2-topbar-row {
        min-height: 28px;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
    }
    .est-v2-back-link,
    .est-v2-sep,
    .est-v2-doc-no,
    .est-v2-topbar .technote-hamburger {
        display: none !important;
    }
    .est-v2-title {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
        color: #fff;
    }
}

.estimate-v2 {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}
.est-v2-topbar {
    background: #1a2744;
    padding: 12px 24px 14px;
    flex-shrink: 0;
}
.est-v2-topbar-row { display: flex; align-items: center; gap: 10px; }
.est-v2-back-link { text-decoration: none; }
.est-v2-back { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: rgba(255,255,255,.4); }
.est-v2-sep { width: 4px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.2); }
.est-v2-title { font-size: 15px; font-weight: 500; color: #fff; }
.est-v2-spacer { flex: 1; }
.est-v2-doc-no { font-size: 11px; color: rgba(255,255,255,.42); }

.estimate-v2 .est-step-row {
    background: #fff;
    border-bottom: 0.5px solid #e8eaed;
    padding: 12px 24px;
    display: flex;
    align-items: center;
}
.est-v2-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
}
.est-v2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}
.est-v2-col { min-width: 0; }
.estimate-v2 .est-card { margin-bottom: 14px; padding: 14px 16px; }
.estimate-v2 .est-card:last-child { margin-bottom: 0; }
.estimate-v2 .est-items-card { padding-bottom: 0; }
.estimate-v2 .est-lines-wrap {
    max-height: none;
    margin: 0 -16px;
    padding: 0 16px;
}
.estimate-v2 .estimate-quotation-page #estimate-lines-table .dash-spreadsheet-container,
.estimate-v2 #estimate-lines-table .dash-spreadsheet-container {
    max-height: 360px;
}
.est-v2-add-row-btn {
    width: 100%;
    padding: 8px;
    border: none;
    background: #f9fafb;
    font-size: 11px;
    color: #9ca3af;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-top: 1px dashed #e5e7eb;
    font-family: inherit;
}
.est-v2-preview-empty {
    padding: 20px 4px 8px;
    text-align: center;
}
.est-v2-preview-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}
.est-v2-preview-empty-title { font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.est-v2-preview-empty-sub { font-size: 11px; color: #9ca3af; }

.est-v2-footer {
    background: #fff;
    border-top: 0.5px solid #e8eaed;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.est-v2-footer-spacer { flex: 1; }
.est-v2-btn {
    height: 38px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 18px;
    cursor: pointer;
}
.est-v2-btn-prev { background: #f3f4f6; color: #374151; border: 0.5px solid #e5e7eb; }
.est-v2-btn-preview { background: #fff7ed; color: #9a3412; border: 0.5px solid #fed7aa; }
.est-v2-btn-next { background: #1a2744; color: #fff; }

@media screen and (max-width: 800px) {
    .est-v2-topbar { padding: 12px 12px 10px; }
    .estimate-v2 .est-step-row { padding: 12px 12px; }
    .est-v2-content { padding: 12px; }
    .est-v2-grid { grid-template-columns: 1fr; gap: 10px; }
    .est-v2-footer { padding: 10px 12px; }
    .est-v2-btn { height: 42px; padding: 0 12px; font-size: 12px; }
}

/* 견적 미리보기: PNG 이미지(img) — 모바일·PC 공통 */
#estimate-pdf-preview-img {
    display: block;
    width: 100%;
    max-height: min(78vh, 720px);
    height: auto;
    object-fit: contain;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}
