@charset "UTF-8";
.estimate-body,
.estimate-body * {
  box-sizing: border-box;
}

.estimate-body {
  margin: 0;
  padding: 32px;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.estimate-input,
.estimate-note__textarea {
  width: 100%;
  border: 0;
  outline: 0;
  font-family: inherit;
  background: transparent;
  color: #111827;
}

.estimate-note__textarea {
  resize: none;
  overflow: hidden;
}

.estimate-toolbar {
  width: 794px;
  margin: 0 auto 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.estimate-kakao-notice {
  width: 794px;
  margin: 0 auto 14px;
  padding: 13px 16px;
  border: 1px solid #f2c98b;
  border-radius: 8px;
  background: #fff8eb;
  color: #73511f;
  text-align: center;
}
.estimate-kakao-notice[hidden] {
  display: none;
}
.estimate-kakao-notice strong {
  display: block;
  font-size: 12px;
}
.estimate-kakao-notice p {
  margin: 4px 0 0;
  font-size: 11px;
}

.estimate-template-picker {
  display: inline-flex;
  align-items: center;
}

.estimate-template-picker__options {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
}

.estimate-template-picker__select {
  display: none;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #4b5563 50%), linear-gradient(135deg, #4b5563 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 36px;
}

.estimate-template-picker__select:focus {
  border-color: #005bcc;
  box-shadow: 0 0 0 2px rgba(0, 91, 204, 0.12);
}

.estimate-template-picker__options button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.estimate-template-picker__options button:hover {
  color: #111827;
  background: #f3f4f6;
}

.estimate-template-picker__options button.is-active {
  color: #ffffff;
  background: #1f2937;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.18);
}

.estimate-toolbar__settings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.estimate-toolbar__button,
.estimate-items__add-button,
.estimate-items__delete-button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.estimate-toolbar__button,
.estimate-items__add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 8px;
  background: #005bcc;
  color: #ffffff;
  font-size: 12px;
}

.estimate-toolbar__button--dark {
  background: #374151;
  color: #ffffff;
}

.estimate-stamp-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.estimate-history[hidden] {
  display: none;
}

.estimate-history {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 24px;
  background: rgba(17, 24, 39, 0.38);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.estimate-history__dialog {
  width: min(560px, 100%);
  margin-top: 54px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.estimate-history__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.estimate-history__title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.estimate-history__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.estimate-history__notice {
  margin: 0;
  padding: 10px 18px 12px;
  border-top: 1px solid #f3f4f6;
  background: #ffffff;
  color: #6b7280;
  font-size: 10.5px;
  line-height: 1.55;
  word-break: keep-all;
}

.estimate-history__list {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 0;
}

.estimate-history__empty {
  margin: 0;
  padding: 28px 18px;
  color: #6b7280;
  font-size: 13px;
  text-align: center;
}

.estimate-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid #f3f4f6;
}

.estimate-history__item:last-child {
  border-bottom: 0;
}

.estimate-history__meta {
  min-width: 0;
}

.estimate-history__name,
.estimate-history__date {
  display: block;
}

.estimate-history__name {
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.estimate-history__date {
  margin-top: 3px;
  color: #6b7280;
  font-size: 11px;
}

.estimate-history__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.estimate-history__btn {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #005bcc;
  color: #ffffff;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.estimate-history__btn--danger {
  background: #ef4444;
}

.estimate-document {
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  padding: 38px 42px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.estimate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 3px solid #005bcc;
}

.estimate-title {
  width: 100%;
  text-align: center;
}

.estimate-title__text {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.estimate-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.estimate-info__box {
  border: 1px solid #d1d5db;
}

.estimate-info__title {
  margin: 0;
  padding: 8px 10px;
  background: #f9fafb;
  border-bottom: 1px solid #d1d5db;
  font-size: 12px;
}

.estimate-info__guide {
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid #dbeafe;
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  line-height: 1.4;
}

.estimate-info__row {
  display: grid;
  grid-template-columns: 82px 1fr;
  border-bottom: 1px solid #e5e7eb;
}

.estimate-info__row:last-child {
  border-bottom: 0;
}

.estimate-info__label {
  padding: 7px 9px;
  background: #fafafa;
  color: #4b5563;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  border-right: 1px solid #e5e7eb;
}

.estimate-info__value {
  min-width: 0;
}

.estimate-info__value--stamp {
  position: relative;
  z-index: 2;
  overflow: visible;
}

.estimate-info__ceo {
  min-width: 0;
}

.estimate-info__value--stamp .estimate-input {
  padding-right: 70px;
}

.estimate-info__value--stamp .estimate-stamp {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 3;
  width: 58px;
  height: 58px;
  margin: 0;
  border-radius: 50%;
  font-size: 9px;
  transform: translateY(-50%);
}

.estimate-info__value .estimate-input {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid transparent;
  background: #f8fbff;
  font-size: 11.5px;
  line-height: 1.35;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.estimate-info__value .estimate-input:hover {
  border-color: #93c5fd;
  background: #ffffff;
}

.estimate-info__value .estimate-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.estimate-info__value .estimate-input::placeholder {
  color: #94a3b8;
}

.estimate-summary {
  margin-top: 24px;
  padding: 14px 17px;
  background: #f8fafc;
  border-left: 4px solid #005bcc;
}

.estimate-summary__text {
  margin: 0;
  font-size: 12.5px;
  color: #374151;
}

.estimate-summary__text strong {
  color: #005bcc;
}

.estimate-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 10px;
}

.estimate-section-head__title {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.03em;
}

/* 상세 내역 */
.estimate-items {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11.5px;
}

.estimate-items__col--item {
  width: 48%;
}

.estimate-items__col--qty {
  width: 9%;
}

.estimate-items__col--price {
  width: 17%;
}

.estimate-items__col--amount {
  width: 17%;
}

.estimate-items__col--delete {
  width: 9%;
}

.estimate-items__th {
  padding: 11px 8px;
  background: #f8f9fb;
  color: #111827;
  font-weight: 700;
  text-align: left;
  border-top: 2px solid #222;
  border-bottom: 1px solid #dcdfe5;
  white-space: nowrap;
}

.estimate-items__td {
  padding: 12px 8px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  vertical-align: middle;
}

.estimate-items__tr:last-child .estimate-items__td {
  border-bottom: 2px solid #111827;
}

.estimate-items__th--qty,
.estimate-items__td--qty,
.estimate-items__th--delete,
.estimate-items__td--delete {
  text-align: center;
}

.estimate-items__td--price,
.estimate-items__td--amount {
  text-align: right;
}

.estimate-items__th--price,
.estimate-items__th--amount {
  text-align: center;
}

.estimate-items__input--name {
  font-size: 11.5px;
  font-weight: 700;
  color: #111827;
  line-height: 1.45;
}

.estimate-items__input--desc {
  margin-top: 4px;
  font-size: 10.5px;
  color: #6b7280;
  line-height: 1.5;
}

.estimate-items__input--qty {
  text-align: center;
  font-size: 11.5px;
}

.estimate-items__input--price {
  text-align: right;
  font-size: 11.5px;
}

@media (min-width: 861px) {
  .estimate-document:not(.estimate-capturing) .estimate-items__input {
    min-height: 32px;
    padding: 6px 7px;
    border: 1px solid #dbeafe;
    border-radius: 4px;
    background: #f8fbff;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  }
  .estimate-document:not(.estimate-capturing) .estimate-items__input:hover {
    border-color: #93c5fd;
    background: #ffffff;
  }
  .estimate-document:not(.estimate-capturing) .estimate-items__input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
  }
}
.estimate-items__amount {
  display: block;
  text-align: right;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

.estimate-items__delete-button {
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 합계 */
.estimate-total {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.estimate-total__box {
  width: 250px;
}

.estimate-total__row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.estimate-total__row--final {
  margin-top: 4px;
  padding: 10px 0;
  border-bottom: 0;
  color: #005bcc;
  font-size: 18px;
  font-weight: 800;
}

/* 비고 */
.estimate-note {
  margin-top: 26px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

.estimate-note__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.estimate-note__title {
  margin: 0;
  font-size: 13px;
}

.estimate-note__hint {
  color: #6b7280;
  font-size: 10px;
}

.estimate-note__textarea {
  min-height: 70px;
  padding: 8px 10px;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #4b5563;
  font-size: 11.5px;
  line-height: 1.65;
}

.estimate-note__textarea:hover {
  border-color: #94a3b8;
}

.estimate-note__textarea:focus {
  border-style: solid;
  border-color: #005bcc;
  box-shadow: 0 0 0 2px rgba(0, 91, 204, 0.1);
}

.estimate-legal-notice {
  padding: 13px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #4b5563;
}
.estimate-legal-notice strong {
  display: block;
  margin-bottom: 5px;
  color: #1f2937;
  font-size: 11px;
}
.estimate-legal-notice p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.6;
  word-break: keep-all;
}

.estimate-legal-notice {
  margin-top: 12px;
}

.estimate-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 10.5px;
}

.estimate-stamp {
  position: relative;
  width: 68px;
  height: 68px;
  border: 1px dashed #ef4444;
  border-radius: 10px;
  background: #fffafa;
  color: #ef4444;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.estimate-stamp--has-image {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.estimate-stamp__image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.estimate-stamp__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

.estimate-stamp__placeholder small {
  color: #6b7280;
  font-size: 9px;
  font-weight: 700;
}

.estimate-info__value--stamp .estimate-stamp__placeholder small {
  font-size: 8px;
}

.estimate-stamp--has-image .estimate-stamp__image {
  display: block;
}

.estimate-stamp--has-image .estimate-stamp__placeholder {
  display: none;
}

.estimate-stamp__clear {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 4;
  display: none;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d92d20;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  cursor: pointer;
  pointer-events: auto;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(217, 45, 32, 0.22);
}

.estimate-stamp--has-image .estimate-stamp__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.estimate-print-text,
.estimate-print-note {
  display: none;
}

.estimate-capturing .estimate-screen-only,
.estimate-capturing .estimate-items__add-button,
.estimate-capturing .estimate-items__delete-button,
.estimate-capturing .estimate-stamp-input,
.estimate-capturing .estimate-stamp__clear,
.estimate-capturing .estimate-items__th--delete,
.estimate-capturing .estimate-items__td--delete,
.estimate-capturing .estimate-items__col--delete {
  display: none !important;
}

.estimate-capturing .estimate-input,
.estimate-capturing .estimate-note__textarea {
  display: none !important;
}

.estimate-capturing .estimate-print-text,
.estimate-capturing .estimate-print-note {
  display: block !important;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.estimate-capturing .estimate-info__value .estimate-print-text {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 11.5px;
  line-height: 1.35;
}

.estimate-capturing .estimate-summary__text {
  font-size: 11.5px;
  line-height: 1.5;
}

.estimate-capturing .estimate-print-note {
  min-height: 70px;
  color: #4b5563;
  font-size: 11.5px;
  line-height: 1.65;
}

.estimate-capturing .estimate-items__col--item {
  width: 52%;
}

.estimate-capturing .estimate-items__col--qty {
  width: 10%;
}

.estimate-capturing .estimate-items__col--price,
.estimate-capturing .estimate-items__col--amount {
  width: 19%;
}

.estimate-ad-banner {
  width: 794px;
  min-height: 82px;
  margin: 18px auto 0;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "eyebrow copy cta" "title copy cta";
  align-items: center;
  column-gap: 24px;
  border-radius: 14px;
  background: linear-gradient(120deg, #0b1f3a 0%, #123f73 58%, #005bcc 100%);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(15, 35, 65, 0.18);
}

.estimate-ad-banner__eyebrow {
  grid-area: eyebrow;
  color: #fe7201;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.estimate-ad-banner__title {
  grid-area: title;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.estimate-ad-banner__copy {
  grid-area: copy;
  font-size: 13px;
  line-height: 1.5;
}

.estimate-ad-banner__cta {
  grid-area: cta;
  padding: 9px 12px;
  border: 1px solid #fe7201;
  border-radius: 999px;
  background: transparent;
  color: #ff9b4d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* 모바일 편집 화면 */
@media (max-width: 860px) {
  .estimate-document:not(.estimate-capturing) input.estimate-input,
  .estimate-document:not(.estimate-capturing) .estimate-note__textarea,
  .estimate-template-picker__select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .estimate-document:not(.estimate-capturing) input.estimate-input,
  .estimate-template-picker__select {
    min-height: 44px;
  }
  .estimate-document:not(.estimate-capturing) .estimate-items__amount,
  .estimate-document:not(.estimate-capturing) .estimate-total__value {
    font-size: 16px !important;
    font-variant-numeric: tabular-nums;
  }
  .estimate-document:not(.estimate-capturing) .estimate-total__row--final .estimate-total__value {
    font-size: 18px !important;
  }
  .estimate-body {
    padding: 12px;
  }
  .estimate-ad-banner {
    width: 100%;
  }
  .estimate-kakao-notice {
    width: 100%;
  }
  .estimate-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: auto;
    margin: -12px -12px 12px;
    padding: 10px 12px;
    background: rgba(243, 244, 246, 0.96);
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .estimate-toolbar__button {
    min-height: 38px;
    padding: 9px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .estimate-toolbar > .estimate-toolbar__button:nth-of-type(1),
  .estimate-toolbar > .estimate-toolbar__button:nth-of-type(2) {
    grid-column: span 3;
  }
  .estimate-toolbar > .estimate-toolbar__button:nth-of-type(3) {
    grid-column: span 2;
  }
  .estimate-toolbar__settings {
    display: contents;
  }
  .estimate-toolbar__settings .estimate-template-picker,
  .estimate-toolbar__settings .estimate-toolbar__button {
    grid-column: span 2;
    min-width: 0;
  }
  .estimate-toolbar__settings .estimate-template-picker__options {
    display: none;
  }
  .estimate-toolbar__settings .estimate-template-picker__select {
    display: block;
  }
  .estimate-document {
    width: 100%;
    min-height: auto;
    padding: 22px 16px 28px;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    overflow: visible;
  }
  .estimate-header {
    gap: 16px;
  }
  .estimate-title__text {
    font-size: 24px;
  }
  .estimate-info {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 20px;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__box {
    overflow: hidden;
    border-color: #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__title {
    padding: 10px 12px;
    font-size: 13px;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__guide {
    padding: 8px 12px;
    font-size: 11px;
  }
  .estimate-info__row {
    grid-template-columns: 68px 1fr;
    min-height: 44px;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__label {
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__label--business-number {
    padding-right: 4px;
    padding-left: 6px;
    font-size: 9.5px;
    letter-spacing: -0.5px;
    white-space: nowrap;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__value .estimate-input {
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 0;
    background: #ffffff;
    line-height: 1.35;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__value--stamp .estimate-input {
    padding-right: 62px;
  }
  .estimate-document:not(.estimate-capturing) .estimate-info__value--stamp .estimate-stamp {
    right: 8px;
    width: 48px;
    height: 48px;
  }
  .estimate-summary {
    margin-top: 18px;
    padding: 12px 14px;
  }
  .estimate-summary__text {
    font-size: 12px;
    line-height: 1.55;
    word-break: keep-all;
  }
  .estimate-section-head {
    align-items: center;
    gap: 10px;
    margin: 24px 0 10px;
  }
  .estimate-items__add-button {
    flex: 0 0 auto;
    min-height: 36px;
  }
  .estimate-items {
    display: block;
    min-width: 0;
    border-top: 0;
  }
  .estimate-items__colgroup,
  .estimate-items__head {
    display: none;
  }
  .estimate-items__body,
  .estimate-items__tr,
  .estimate-items__td {
    display: block;
    width: 100%;
  }
  .estimate-document:not(.estimate-capturing) .estimate-items__tr {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
  }
  .estimate-document:not(.estimate-capturing) .estimate-items__tr:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
  }
  .estimate-items__td {
    padding: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .estimate-items__tr:last-child .estimate-items__td {
    border-bottom: 0;
  }
  .estimate-items__td--item {
    margin-bottom: 10px;
  }
  .estimate-items__td--qty,
  .estimate-items__td--price,
  .estimate-items__td--amount,
  .estimate-items__td--delete {
    display: grid;
    grid-template-columns: 58px 1fr;
    column-gap: 10px;
    align-items: center;
    min-height: 34px;
    text-align: left;
  }
  .estimate-items__td--qty::before,
  .estimate-items__td--price::before,
  .estimate-items__td--amount::before {
    color: #6b7280;
    font-size: 10.5px;
    font-weight: 700;
    text-align: left;
  }
  .estimate-items__td--qty::before {
    content: "수량";
  }
  .estimate-items__td--price,
  .estimate-items__td--amount {
    margin-top: 8px;
  }
  .estimate-items__td--price::before {
    content: "단가";
  }
  .estimate-items__td--amount::before {
    content: "금액";
  }
  .estimate-items__td--delete {
    display: flex;
    justify-content: flex-end;
    min-height: 34px;
    margin-top: 8px;
  }
  .estimate-items__input--name,
  .estimate-items__input--desc,
  .estimate-items__input--qty,
  .estimate-items__input--price {
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
  }
  .estimate-items__input--desc {
    margin-top: 6px;
  }
  .estimate-items__input--qty {
    text-align: center;
  }
  .estimate-items__input--price {
    text-align: right;
  }
  .estimate-document:not(.estimate-capturing) .estimate-items__amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  .estimate-items__delete-button {
    min-width: 52px;
    height: 32px;
    border: 1px solid #fecaca;
    background: #fff7f7;
    color: #ef4444;
  }
  .estimate-total {
    justify-content: stretch;
  }
  .estimate-document:not(.estimate-capturing) .estimate-total__box {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
  }
  .estimate-document:not(.estimate-capturing) .estimate-note {
    margin-top: 22px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
  }
  .estimate-document:not(.estimate-capturing) .estimate-note__textarea {
    min-height: 118px;
    border-style: solid;
    background: #ffffff;
  }
  .estimate-footer {
    gap: 16px;
    align-items: center;
  }
  .estimate-history {
    padding: 14px;
  }
  .estimate-history__dialog {
    margin-top: 46px;
  }
  .estimate-history__item {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .estimate-history__actions {
    width: 100%;
  }
  .estimate-history__btn {
    flex: 1;
  }
}
@media (max-width: 420px) {
  .estimate-ad-banner {
    min-height: 0;
    padding: 17px 18px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "eyebrow cta" "title cta" "copy copy";
    gap: 3px 12px;
  }
  .estimate-ad-banner__copy {
    margin-top: 7px;
    font-size: 12px;
  }
  .estimate-document {
    padding: 20px 14px 24px;
  }
  .estimate-header {
    flex-direction: column;
    padding-bottom: 12px;
  }
  .estimate-title {
    text-align: left;
  }
  .estimate-footer {
    align-items: flex-start;
  }
}
/* 기본형·모던형: 숫자 열의 시각 중심 통일 */
.estimate-document:not(.estimate-document--simple) .estimate-items__th--qty,
.estimate-document:not(.estimate-document--simple) .estimate-items__td--qty,
.estimate-document:not(.estimate-document--simple) .estimate-items__input--qty {
  text-align: center;
}
.estimate-document:not(.estimate-document--simple) .estimate-items__td--price,
.estimate-document:not(.estimate-document--simple) .estimate-items__td--amount,
.estimate-document:not(.estimate-document--simple) .estimate-items__input--price,
.estimate-document:not(.estimate-document--simple) .estimate-items__amount {
  text-align: right;
}
.estimate-document:not(.estimate-document--simple) .estimate-items__th--price,
.estimate-document:not(.estimate-document--simple) .estimate-items__th--amount {
  text-align: center;
}

/* 모던형: 강한 헤더와 합계 강조 */
.estimate-document--modern {
  padding-top: 0;
  overflow: hidden;
  border-top: 0;
}
.estimate-document--modern .estimate-header {
  margin: 0 -36px;
  padding: 30px 36px 24px;
  border-bottom: 0;
  background: linear-gradient(120deg, #0b1f3a, #123f73);
}
.estimate-document--modern .estimate-title__text {
  color: #ffffff;
  letter-spacing: 0.08em;
}
.estimate-document--modern .estimate-info__box {
  border: 0;
  border-radius: 12px;
  background: #f7faff;
  box-shadow: inset 0 0 0 1px #dbe7f5;
}
.estimate-document--modern .estimate-info__title {
  border-bottom-color: #bfd5ef;
  background: transparent;
  color: #123f73;
}
.estimate-document--modern .estimate-items__th {
  border-color: #123f73;
  background: #123f73;
  color: #ffffff;
}
.estimate-document--modern .estimate-total__row--final {
  border-radius: 8px;
  background: #eaf3ff;
  color: #0b4f9c;
}

/* 클래식형: 전통적인 표 형식의 실무 견적서 */
.estimate-document--simple {
  padding: 32px 28px;
  border: 1px solid #d6d3d1;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
}
.estimate-document--simple .estimate-header {
  min-height: 82px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid #111;
}
.estimate-document--simple .estimate-title__text {
  font-family: serif;
  font-size: 25px;
  letter-spacing: 0.42em;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.estimate-document--simple .estimate-title__text,
.estimate-document--simple .estimate-info__title,
.estimate-document--simple .estimate-summary__text strong,
.estimate-document--simple .estimate-section-head__title,
.estimate-document--simple .estimate-total__row--final {
  color: #111827;
}
.estimate-document--simple .estimate-info__box {
  border: 1px solid #222;
}
.estimate-document--simple .estimate-info {
  gap: 76px;
  margin-top: 18px;
}
.estimate-document--simple .estimate-info__title {
  padding: 6px 8px;
  border-bottom-color: #222;
  background: #f7f7f5;
  text-align: center;
}
.estimate-document--simple .estimate-info__guide {
  background: #ffffff;
  border-bottom-color: #aaa;
  color: #6b7280;
}
.estimate-document--simple .estimate-info__row {
  border-bottom-color: #555;
}
.estimate-document--simple .estimate-info__label {
  border-right-color: #555;
  background: #f7f7f5;
  color: #111;
}
.estimate-document--simple .estimate-info__value .estimate-input {
  background: #ffffff;
}
.estimate-document--simple .estimate-summary {
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px solid #111;
  background: #f5f5f4;
  text-align: center;
}
.estimate-document--simple .estimate-section-head {
  margin-top: 20px;
}
.estimate-document--simple .estimate-items {
  border: 1px solid #111;
}
.estimate-document--simple .estimate-items__th {
  padding: 7px 6px;
  border: 1px solid #111;
  background: #f5f5f4;
  color: #111827;
  text-align: center;
}
.estimate-document--simple .estimate-items__td {
  padding: 8px 6px;
  border-right: 1px solid #999;
  border-bottom-color: #999;
}
.estimate-document--simple .estimate-items__tr:last-child .estimate-items__td {
  border-bottom: 1px solid #111;
}
.estimate-document--simple .estimate-total__box {
  border: 1px solid #111;
}
.estimate-document--simple .estimate-total__row {
  padding: 6px 9px;
  border-bottom-color: #555;
}
.estimate-document--simple .estimate-total__row--final {
  margin-top: 0;
  border-bottom: 0;
  background: #f5f5f4;
  font-size: 14px;
}
.estimate-document--simple .estimate-note {
  padding: 12px;
  border: 0;
  background: #ffffff;
}
.estimate-document--simple .estimate-footer {
  margin-top: 22px;
  border-top-color: #555;
}

@media (max-width: 860px) {
  .estimate-document--modern .estimate-header {
    margin: 0 -16px;
    padding: 24px 16px 20px;
  }
  .estimate-document--simple {
    padding: 22px 16px 26px;
    /* 모바일 편집 화면은 카드형 행 구분선으로 단순화 */
  }
  .estimate-document--simple .estimate-info {
    gap: 12px;
  }
  .estimate-document--simple .estimate-title__text {
    font-size: 22px;
  }
  .estimate-document--simple .estimate-items {
    border: 0;
  }
  .estimate-document--simple .estimate-items__td {
    padding: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .estimate-document--simple .estimate-items__tr {
    border: 1px solid #d6d3d1;
  }
  .estimate-document--simple .estimate-items__tr:last-child {
    border-bottom: 1px solid #d6d3d1;
  }
  .estimate-document--simple .estimate-items__tr:last-child .estimate-items__td {
    border-bottom: 0;
  }
}
@media print {
  .estimate-document--modern .estimate-header {
    margin: 0 0 8mm;
    padding: 8mm 10mm;
    border-radius: 10px;
  }
  .estimate-document--simple .estimate-items__th,
  .estimate-document--simple .estimate-items__td {
    border: 0;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
  }
  .estimate-document--simple .estimate-items__th {
    border-right-color: #111;
    border-bottom-color: #111;
  }
  .estimate-document--simple .estimate-items__th:last-child,
  .estimate-document--simple .estimate-items__td:last-child {
    border-right: 0;
  }
  .estimate-document--simple .estimate-items__tr:last-child .estimate-items__td {
    border-bottom: 0;
  }
}
/* 인쇄 */
/* 화면 크기와 무관하게 공유용 PDF는 PC 인쇄 레이아웃으로 캡처 */
.estimate-document.estimate-capturing {
  width: 794px !important;
  min-height: 1046.4094488189px !important;
  padding: 0 42px !important;
  border: 0;
  box-shadow: none;
  overflow: visible !important;
}

.estimate-capturing .estimate-items {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
}
.estimate-capturing .estimate-items__colgroup {
  display: table-column-group !important;
}
.estimate-capturing .estimate-items__head {
  display: table-header-group !important;
}
.estimate-capturing .estimate-items__body {
  display: table-row-group !important;
}
.estimate-capturing .estimate-items__tr {
  display: table-row !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}
.estimate-capturing .estimate-items__th,
.estimate-capturing .estimate-items__td {
  display: table-cell !important;
  width: auto !important;
}
.estimate-capturing .estimate-items__col--delete,
.estimate-capturing .estimate-items__th--delete,
.estimate-capturing .estimate-items__td--delete {
  display: none !important;
}
.estimate-capturing .estimate-items__td--item {
  margin-bottom: 0 !important;
}
.estimate-capturing .estimate-items__td--qty,
.estimate-capturing .estimate-items__td--price,
.estimate-capturing .estimate-items__td--amount {
  min-height: 0 !important;
}
.estimate-capturing .estimate-items__td--qty::before,
.estimate-capturing .estimate-items__td--price::before,
.estimate-capturing .estimate-items__td--amount::before,
.estimate-capturing .estimate-items__td--delete::before {
  content: none !important;
}

.estimate-capturing .estimate-info {
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
}

.estimate-capturing .estimate-info__row {
  grid-template-columns: 82px 1fr !important;
}

.estimate-document--modern.estimate-capturing .estimate-info__box {
  overflow: hidden;
  border: 1px solid #cbdcf0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.estimate-document--modern.estimate-capturing .estimate-info__title {
  padding: 9px 11px;
  border-bottom: 1px solid #cbdcf0;
  background: #edf5ff;
  color: #123f73;
}

.estimate-document--modern.estimate-capturing .estimate-info__row {
  border-bottom-color: #dbe7f5;
}

.estimate-document--modern.estimate-capturing .estimate-info__label {
  border-right-color: #dbe7f5;
  background: #f7faff;
  color: #43566f;
}

.estimate-document--modern.estimate-capturing .estimate-info__value .estimate-print-text {
  background: #ffffff;
}

.estimate-capturing .estimate-note {
  display: block !important;
}

.estimate-capturing .estimate-items__th {
  padding: 11px 8px !important;
}

.estimate-capturing .estimate-items__td {
  padding: 12px 8px !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.estimate-capturing .estimate-items__tr:last-child .estimate-items__td {
  border-bottom: 2px solid #111827 !important;
}

/* 클래식형 공유 PDF: 외곽선과 셀 선이 겹치지 않는 단일 표 테두리 */
.estimate-document--simple.estimate-capturing .estimate-items__th,
.estimate-document--simple.estimate-capturing .estimate-items__td {
  border: 0 !important;
  border-right: 1px solid #999 !important;
  border-bottom: 1px solid #999 !important;
}

.estimate-document--simple.estimate-capturing .estimate-items__th {
  border-right-color: #111 !important;
  border-bottom-color: #111 !important;
}

.estimate-document--simple.estimate-capturing .estimate-items__th:last-child,
.estimate-document--simple.estimate-capturing .estimate-items__td:last-child {
  border-right: 0 !important;
}

.estimate-document--simple.estimate-capturing .estimate-items__tr:last-child .estimate-items__td {
  border-bottom: 0 !important;
}

@page {
  size: A4;
  margin: 0;
}
@media print {
  .estimate-items {
    display: table;
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .estimate-items__colgroup {
    display: table-column-group;
  }
  .estimate-items__head {
    display: table-header-group;
  }
  .estimate-items__body {
    display: table-row-group;
  }
  .estimate-items__tr {
    display: table-row;
    padding: 0;
    border-bottom: 0;
  }
  .estimate-items__th,
  .estimate-items__td {
    display: table-cell;
    width: auto;
  }
  .estimate-items__col--delete,
  .estimate-items__th--delete,
  .estimate-items__td--delete {
    display: none !important;
  }
  .estimate-items__td--item {
    margin-bottom: 0;
  }
  .estimate-items__td--qty,
  .estimate-items__td--price,
  .estimate-items__td--amount {
    min-height: 0;
  }
  .estimate-items__td--qty::before,
  .estimate-items__td--price::before,
  .estimate-items__td--amount::before,
  .estimate-items__td--delete::before {
    content: none !important;
  }
  .estimate-body {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .estimate-toolbar,
  .estimate-history,
  .estimate-screen-only,
  .estimate-items__add-button,
  .estimate-items__delete-button,
  .estimate-stamp-input,
  .estimate-stamp__clear {
    display: none !important;
  }
  .estimate-footer {
    display: none !important;
  }
  .estimate-document {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 11mm 12mm;
    border: 0;
    overflow: visible;
  }
  .estimate-header {
    padding-bottom: 12px;
  }
  .estimate-info {
    grid-template-columns: 1fr 1fr;
    margin-top: 20px;
    gap: 12px;
  }
  .estimate-info__row {
    grid-template-columns: 82px 1fr;
  }
  .estimate-summary {
    margin-top: 20px;
    padding: 12px 15px;
  }
  .estimate-section-head {
    margin: 24px 0 8px;
  }
  .estimate-items {
    border-top: 0;
  }
  .estimate-items__head::before {
    display: table-row;
    height: 6mm;
    content: "";
  }
  .estimate-items__tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .estimate-items__tr:last-child {
    break-after: avoid;
    page-break-after: avoid;
  }
  .estimate-items__th {
    padding: 10px 6px;
  }
  .estimate-items__td {
    padding: 10px 6px;
    border-bottom: 1px solid #e5e7eb;
  }
  .estimate-items__tr:last-child .estimate-items__td {
    border-bottom: 2px solid #111827;
  }
  .estimate-items__input--name,
  .estimate-items__input--desc,
  .estimate-items__input--qty,
  .estimate-items__input--price {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .estimate-items__input--desc {
    margin-top: 4px;
  }
  .estimate-items__input--qty {
    text-align: center;
  }
  .estimate-items__input--price,
  .estimate-items__amount {
    text-align: right;
    padding: 0;
  }
  .estimate-total {
    margin-top: 12px;
    break-inside: avoid;
  }
  .estimate-note {
    margin-top: 22px;
    padding: 14px;
    break-inside: avoid;
  }
  .estimate-input,
  .estimate-note__textarea {
    display: none !important;
  }
  .estimate-print-text,
  .estimate-print-note {
    display: block !important;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  .estimate-info__value .estimate-print-text {
    padding: 7px 9px;
    font-size: 11.5px;
    line-height: 1.35;
  }
  .estimate-info__value--stamp {
    position: relative;
    overflow: visible;
  }
  .estimate-info__value--stamp .estimate-print-text {
    padding-right: 66px;
  }
  .estimate-items__print--name {
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 700;
    color: #111827;
  }
  .estimate-items__print--desc {
    margin-top: 3px;
    font-size: 10.5px;
    line-height: 1.45;
    color: #6b7280;
  }
  .estimate-print-note {
    min-height: 64px;
    color: #4b5563;
    font-size: 11.5px;
    line-height: 1.65;
  }
  .estimate-stamp {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
    overflow: visible;
  }
  .estimate-stamp__placeholder {
    display: none;
  }
}
